Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
6b0ddf4c
Commit
6b0ddf4c
authored
Nov 10, 2020
by
Alexander A. Maly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Astyled DocBookViewer
parent
51f174af
Pipeline
#2579
failed with stages
in 2 minutes and 4 seconds
Changes
24
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1951 additions
and
2059 deletions
+1951
-2059
src/kumir2-libs/docbookviewer/contentview.cpp
src/kumir2-libs/docbookviewer/contentview.cpp
+0
-1
src/kumir2-libs/docbookviewer/contentview.h
src/kumir2-libs/docbookviewer/contentview.h
+0
-1
src/kumir2-libs/docbookviewer/docbookfactory.cpp
src/kumir2-libs/docbookviewer/docbookfactory.cpp
+589
-668
src/kumir2-libs/docbookviewer/docbookfactory.h
src/kumir2-libs/docbookviewer/docbookfactory.h
+57
-61
src/kumir2-libs/docbookviewer/docbookmodel.cpp
src/kumir2-libs/docbookviewer/docbookmodel.cpp
+103
-103
src/kumir2-libs/docbookviewer/docbookmodel.h
src/kumir2-libs/docbookviewer/docbookmodel.h
+0
-3
src/kumir2-libs/docbookviewer/docbookview.cpp
src/kumir2-libs/docbookviewer/docbookview.cpp
+53
-52
src/kumir2-libs/docbookviewer/docbookview.h
src/kumir2-libs/docbookviewer/docbookview.h
+34
-35
src/kumir2-libs/docbookviewer/docbookview_impl.cpp
src/kumir2-libs/docbookviewer/docbookview_impl.cpp
+227
-230
src/kumir2-libs/docbookviewer/docbookview_impl.h
src/kumir2-libs/docbookviewer/docbookview_impl.h
+55
-62
src/kumir2-libs/docbookviewer/document.cpp
src/kumir2-libs/docbookviewer/document.cpp
+7
-7
src/kumir2-libs/docbookviewer/document.h
src/kumir2-libs/docbookviewer/document.h
+12
-11
src/kumir2-libs/docbookviewer/main.cpp
src/kumir2-libs/docbookviewer/main.cpp
+10
-14
src/kumir2-libs/docbookviewer/mainwindow.cpp
src/kumir2-libs/docbookviewer/mainwindow.cpp
+34
-36
src/kumir2-libs/docbookviewer/mainwindow.h
src/kumir2-libs/docbookviewer/mainwindow.h
+11
-9
src/kumir2-libs/docbookviewer/mathmlrenderer.cpp
src/kumir2-libs/docbookviewer/mathmlrenderer.cpp
+214
-217
src/kumir2-libs/docbookviewer/mathmlrenderer.h
src/kumir2-libs/docbookviewer/mathmlrenderer.h
+20
-20
src/kumir2-libs/docbookviewer/modeltype.h
src/kumir2-libs/docbookviewer/modeltype.h
+67
-66
src/kumir2-libs/docbookviewer/printdialog.cpp
src/kumir2-libs/docbookviewer/printdialog.cpp
+41
-40
src/kumir2-libs/docbookviewer/printdialog.h
src/kumir2-libs/docbookviewer/printdialog.h
+20
-16
src/kumir2-libs/docbookviewer/printrenderer.cpp
src/kumir2-libs/docbookviewer/printrenderer.cpp
+1
-0
src/kumir2-libs/docbookviewer/printrenderer.h
src/kumir2-libs/docbookviewer/printrenderer.h
+1
-3
src/kumir2-libs/docbookviewer/sidepanel.cpp
src/kumir2-libs/docbookviewer/sidepanel.cpp
+343
-355
src/kumir2-libs/docbookviewer/sidepanel.h
src/kumir2-libs/docbookviewer/sidepanel.h
+52
-49
No files found.
src/kumir2-libs/docbookviewer/contentview.cpp
View file @
6b0ddf4c
...
...
@@ -6,7 +6,6 @@
#include <kumir2/editorinterface.h>
#include <kumir2-libs/widgets/iconprovider.h>
#include <QUrl>
#include <QMenu>
#include <QScrollBar>
#include <QApplication>
...
...
src/kumir2-libs/docbookviewer/contentview.h
View file @
6b0ddf4c
...
...
@@ -3,7 +3,6 @@
#include "contentrenderer.h"
#include <QtGlobal>
#include <QTextBrowser>
class
QMenu
;
...
...
src/kumir2-libs/docbookviewer/docbookfactory.cpp
View file @
6b0ddf4c
This diff is collapsed.
Click to expand it.
src/kumir2-libs/docbookviewer/docbookfactory.h
View file @
6b0ddf4c
#ifndef DOCBOOKFACTORY_H
#define DOCBOOKFACTORY_H
#include "docbookview.h"
#include "document.h"
#include "docbookmodel.h"
// Qt includes
#include <QXmlDefaultHandler>
#include <QXmlSimpleReader>
#include <QUrl>
#ifdef DOCBOOKVIEWER_LIBRARY
...
...
@@ -17,36 +13,36 @@
#define EXTERN Q_DECL_IMPORT
#endif
namespace
DocBookViewer
{
namespace
DocBookViewer
{
class
EXTERN
DocBookFactory
:
public
QXmlDefaultHandler
class
EXTERN
DocBookFactory
:
public
QXmlDefaultHandler
{
public:
static
DocBookFactory
*
self
();
Document
parseDocument
(
const
QMap
<
ModelType
,
QString
>
roleValues
,
const
QUrl
&
url
,
QString
*
error
=
0
)
const
;
static
DocBookFactory
*
self
();
Document
parseDocument
(
const
QMap
<
ModelType
,
QString
>
roleValues
,
const
QUrl
&
url
,
QString
*
error
=
0
)
const
;
static
ModelPtr
createListOfEntries
(
ModelPtr
root
,
ModelType
resType
,
ModelType
findType
);
static
QMap
<
QString
,
ModelPtr
>
&
updateListOfAlgorithms
(
ModelPtr
root
,
QMap
<
QString
,
ModelPtr
>
&
result
);
static
QMap
<
QString
,
ModelPtr
>
&
updateListOfAlgorithms
(
ModelPtr
root
,
QMap
<
QString
,
ModelPtr
>
&
result
);
static
QMap
<
QString
,
ModelPtr
>
&
updateListOfKeywords
(
ModelPtr
root
,
QMap
<
QString
,
ModelPtr
>
&
result
);
static
QMap
<
QString
,
ModelPtr
>
&
updateListOfKeywords
(
ModelPtr
root
,
QMap
<
QString
,
ModelPtr
>
&
result
);
Document
createNamedSet
(
const
QString
&
name
,
const
QList
<
Document
>
documents
)
const
;
void
setConfigurationName
(
const
QString
&
configurationName
);
void
setConfigurationName
(
const
QString
&
configurationName
);
private
/*methods*/
:
ModelPtr
parseDocument
(
const
QMap
<
ModelType
,
QString
>
&
roles
,
QIODevice
*
stream
,
const
QUrl
&
url
,
QString
*
error
=
0
)
const
;
const
QMap
<
ModelType
,
QString
>
&
roles
,
QIODevice
*
stream
,
const
QUrl
&
url
,
QString
*
error
=
0
)
const
;
explicit
DocBookFactory
();
...
...
@@ -66,7 +62,7 @@ private /*methods*/:
bool
warning
(
const
QXmlParseException
&
exception
);
void
filterByOs
(
ModelPtr
root
)
const
;
void
filterByRoles
(
const
QMap
<
ModelType
,
QString
>
&
roles
,
void
filterByRoles
(
const
QMap
<
ModelType
,
QString
>
&
roles
,
ModelPtr
root
)
const
;
void
filterByConfiguration
(
ModelPtr
root
)
const
;
...
...
@@ -74,15 +70,15 @@ private /*methods*/:
ModelType
findType
);
static
QByteArray
loadAndPreprocessSvg
(
const
QString
&
fileName
);
static
QImage
loadAndPreprocessPng
(
const
QString
&
fileName
);
static
QByteArray
loadAndPreprocessSvg
(
const
QString
&
fileName
);
static
QImage
loadAndPreprocessPng
(
const
QString
&
fileName
);
private
/*fields*/
:
mutable
QXmlSimpleReader
*
reader_
;
mutable
QXmlSimpleReader
*
reader_
;
mutable
ModelPtr
doc_
;
mutable
QUrl
url_
;
mutable
QMap
<
ModelType
,
QString
>
roles_
;
mutable
QMap
<
ModelType
,
QString
>
roles_
;
ModelPtr
root_
;
QString
buffer_
;
...
...
src/kumir2-libs/docbookviewer/docbookmodel.cpp
View file @
6b0ddf4c
#include "docbookmodel.h"
#include "contentrenderer.h"
#include <QImage>
#include <QPainter>
namespace
DocBookViewer
{
namespace
DocBookViewer
{
DocBookModel
::
DocBookModel
(
ModelPtr
parent
,
const
ModelType
modelType
)
:
parent_
(
parent
)
...
...
@@ -25,45 +24,46 @@ ModelType DocBookModel::modelType() const
return
modelType_
;
}
const
QString
&
DocBookModel
::
id
()
const
const
QString
&
DocBookModel
::
id
()
const
{
return
id_
;
}
const
QString
&
DocBookModel
::
title
()
const
const
QString
&
DocBookModel
::
title
()
const
{
return
title_
;
}
QString
DocBookModel
::
titleAbbrev
()
const
{
if
(
titleAbbrev_
.
isEmpty
())
if
(
titleAbbrev_
.
isEmpty
())
{
return
title_
;
else
}
else
{
return
titleAbbrev_
;
}
}
const
QString
&
DocBookModel
::
subtitle
()
const
const
QString
&
DocBookModel
::
subtitle
()
const
{
return
subtitle_
;
}
const
QString
&
DocBookModel
::
text
()
const
const
QString
&
DocBookModel
::
text
()
const
{
return
text_
;
}
const
QString
&
DocBookModel
::
role
()
const
const
QString
&
DocBookModel
::
role
()
const
{
return
role_
;
}
const
QString
&
DocBookModel
::
xrefLinkEnd
()
const
const
QString
&
DocBookModel
::
xrefLinkEnd
()
const
{
return
xrefLinkEnd_
;
}
const
QString
&
DocBookModel
::
xrefEndTerm
()
const
const
QString
&
DocBookModel
::
xrefEndTerm
()
const
{
return
xrefEndTerm_
;
}
...
...
@@ -73,7 +73,7 @@ const QString DocBookModel::format() const
return
format_
.
toLower
().
trimmed
();
}
const
QUrl
&
DocBookModel
::
href
()
const
const
QUrl
&
DocBookModel
::
href
()
const
{
return
href_
;
}
...
...
@@ -94,16 +94,17 @@ ModelPtr DocBookModel::findChildrenOfType(const ModelType modelType) const
foreach
(
ModelPtr
child
,
children_
)
{
if
(
modelType
==
child
->
modelType
())
{
result
=
child
;
}
else
{
}
else
{
result
=
child
->
findChildrenOfType
(
modelType
);
}
if
(
result
)
break
;
if
(
result
)
{
break
;
}
}
return
result
;
}
const
QList
<
ModelPtr
>
&
DocBookModel
::
children
()
const
const
QList
<
ModelPtr
>
&
DocBookModel
::
children
()
const
{
return
children_
;
}
...
...
@@ -119,7 +120,8 @@ ModelPtr DocBookModel::self() const
}
}
}
if
(
!
result
)
foreach
(
ModelPtr
child
,
children
())
{
if
(
!
result
)
foreach
(
ModelPtr
child
,
children
())
{
if
(
child
->
parent
().
data
()
==
this
)
{
result
=
child
->
parent
();
break
;
...
...
@@ -132,12 +134,11 @@ bool DocBookModel::isSectioningNode() const
{
if
(
title_
.
length
()
==
0
)
{
return
false
;
}
else
if
(
modelType_
==
Section
)
{
}
else
if
(
modelType_
==
Section
)
{
return
sectionLevel_
<=
MAX_SECTION_LEVEL_IN_TOC
;
}
else
{
return
modelType_
==
Book
||
}
else
{
return
modelType_
==
Book
||
modelType_
==
Article
||
modelType_
==
Set
||
modelType_
==
Chapter
||
...
...
@@ -151,8 +152,7 @@ void DocBookModel::updateSectionLevel()
{
if
(
modelType_
!=
Section
)
{
sectionLevel_
=
0u
;
}
else
{
}
else
{
ModelPtr
p
=
parent_
;
sectionLevel_
=
1u
;
while
(
p
&&
p
->
modelType_
==
Section
)
{
...
...
@@ -165,7 +165,7 @@ void DocBookModel::updateSectionLevel()
}
}
const
QImage
&
DocBookModel
::
imageData
()
const
const
QImage
&
DocBookModel
::
imageData
()
const
{
if
(
svgRenderer_
&&
cachedImage_
.
isNull
())
{
const
QSize
size
=
svgRenderer_
->
defaultSize
();
...
...
src/kumir2-libs/docbookviewer/docbookmodel.h
View file @
6b0ddf4c
...
...
@@ -5,10 +5,7 @@
#include "modeltype.h"
// Qt includes
#include <QtGlobal>
#include <QString>
#include <QUrl>
#include <QObject>
#include <QSharedPointer>
#include <QSvgRenderer>
#include <QImage>
...
...
src/kumir2-libs/docbookviewer/docbookview.cpp
View file @
6b0ddf4c
...
...
@@ -4,7 +4,8 @@
#include <QResizeEvent>
#include <QDebug>
namespace
DocBookViewer
{
namespace
DocBookViewer
{
DocBookView
::
DocBookView
(
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -18,7 +19,7 @@ void DocBookView::updateSettings(ExtensionSystem::SettingsPtr settings, const QS
pImpl_
->
updateSettings
(
settings
,
prefix
);
}
void
DocBookView
::
closeEvent
(
QCloseEvent
*
event
)
void
DocBookView
::
closeEvent
(
QCloseEvent
*
event
)
{
if
(
pImpl_
->
settings_
)
{
pImpl_
->
saveState
(
pImpl_
->
settings_
,
pImpl_
->
settingsPrefix_
);
...
...
@@ -26,7 +27,7 @@ void DocBookView::closeEvent(QCloseEvent * event)
QWidget
::
closeEvent
(
event
);
}
void
DocBookView
::
hideEvent
(
QHideEvent
*
event
)
void
DocBookView
::
hideEvent
(
QHideEvent
*
event
)
{
if
(
pImpl_
->
settings_
)
{
pImpl_
->
saveState
(
pImpl_
->
settings_
,
pImpl_
->
settingsPrefix_
);
...
...
@@ -34,7 +35,7 @@ void DocBookView::hideEvent(QHideEvent * event)
QWidget
::
hideEvent
(
event
);
}
void
DocBookView
::
showEvent
(
QShowEvent
*
event
)
void
DocBookView
::
showEvent
(
QShowEvent
*
event
)
{
if
(
pImpl_
->
settings_
)
{
pImpl_
->
restoreState
(
pImpl_
->
settings_
,
pImpl_
->
settingsPrefix_
);
...
...
@@ -42,13 +43,12 @@ void DocBookView::showEvent(QShowEvent * event)
QWidget
::
showEvent
(
event
);
}
void
DocBookView
::
resizeEvent
(
QResizeEvent
*
event
)
void
DocBookView
::
resizeEvent
(
QResizeEvent
*
event
)
{
if
(
event
->
size
().
width
()
<
minimumWidth
()
||
event
->
size
().
height
()
<
minimumHeight
())
{
event
->
ignore
();
}
else
{
}
else
{
event
->
accept
();
pImpl_
->
setSize
(
event
->
size
());
}
...
...
@@ -60,7 +60,7 @@ DocBookView::~DocBookView()
delete
pImpl_
;
}
QAction
*
DocBookView
::
viewerAction
(
const
DocBookViewAction
type
)
const
QAction
*
DocBookView
::
viewerAction
(
const
DocBookViewAction
type
)
const
{
return
pImpl_
->
viewerAction
(
type
);
}
...
...
@@ -75,7 +75,7 @@ Document DocBookView::addDocuments(const QString &groupName, const QList<QUrl> &
return
pImpl_
->
addDocuments
(
groupName
,
urls
,
error
);
}
void
DocBookView
::
removeDocument
(
const
Document
&
existingDocument
)
void
DocBookView
::
removeDocument
(
const
Document
&
existingDocument
)
{
pImpl_
->
removeDocument
(
existingDocument
);
}
...
...
@@ -95,7 +95,7 @@ bool DocBookView::hasAlgorithm(const QString &name) const
return
pImpl_
->
hasAlgorithm
(
name
);
}
void
DocBookView
::
navigateToApiFunction
(
const
QString
&
package
,
const
QString
&
function
)
void
DocBookView
::
navigateToApiFunction
(
const
QString
&
package
,
const
QString
&
function
)
{
pImpl_
->
navigateToApiFunction
(
package
,
function
);
}
...
...
@@ -108,10 +108,11 @@ void DocBookView::navigateToIndex(const QString &index)
void
DocBookView
::
navigateFromQuickReference
(
const
int
topicType
,
const
QString
&
name
)
{
qDebug
()
<<
"navigateFromQuickReference("
<<
topicType
<<
", "
<<
name
<<
")"
;
if
(
2
==
topicType
)
if
(
2
==
topicType
)
{
navigateToApiFunction
(
""
,
name
);
else
}
else
{
navigateToIndex
(
name
);
}
}
void
DocBookView
::
clearNavigationFilters
()
...
...
src/kumir2-libs/docbookviewer/docbookview.h
View file @
6b0ddf4c
...
...
@@ -12,7 +12,6 @@
#include <QString>
#include <QWidget>
#include <QUrl>
#include <QSettings>
#ifdef DOCBOOKVIEWER_LIBRARY
#define EXTERN_LIB Q_DECL_EXPORT
...
...
@@ -20,10 +19,10 @@
#define EXTERN_LIB Q_DECL_IMPORT
#endif
namespace
DocBookViewer
{
namespace
DocBookViewer
{
class
EXTERN_LIB
DocBookView
:
public
QWidget
class
EXTERN_LIB
DocBookView
:
public
QWidget
{
Q_OBJECT
public:
...
...
@@ -33,21 +32,21 @@ public:
ShowPrintDialog
};
explicit
DocBookView
(
QWidget
*
parent
=
0
);
QAction
*
viewerAction
(
const
DocBookViewAction
type
)
const
;
explicit
DocBookView
(
QWidget
*
parent
=
0
);
QAction
*
viewerAction
(
const
DocBookViewAction
type
)
const
;
QStringList
booksList
()
const
;
void
activateBookIndex
(
int
index
);
void
updateSettings
(
ExtensionSystem
::
SettingsPtr
settings
,
const
QString
&
prefix
);
bool
hasAlgorithm
(
const
QString
&
name
)
const
;
void
navigateToApiFunction
(
const
QString
&
package
,
const
QString
&
function
);
void
navigateToIndex
(
const
QString
&
index
);
void
updateSettings
(
ExtensionSystem
::
SettingsPtr
settings
,
const
QString
&
prefix
);
bool
hasAlgorithm
(
const
QString
&
name
)
const
;
void
navigateToApiFunction
(
const
QString
&
package
,
const
QString
&
function
);
void
navigateToIndex
(
const
QString
&
index
);
void
navigateFromQuickReference
(
const
int
topicType
,
const
QString
&
name
);
void
clearNavigationFilters
();
void
setInitialView
();
void
setRole
(
ModelType
category
,
const
QString
&
value
);
void
setRole
(
ModelType
category
,
const
QString
&
value
);
QString
role
(
ModelType
category
)
const
;
QSize
minimumSizeHint
()
const
;
...
...
@@ -55,10 +54,10 @@ public:
~
DocBookView
();
Document
addDocument
(
const
QUrl
&
url
,
QString
*
error
=
0
);
Document
addDocuments
(
const
QString
&
groupName
,
const
QList
<
QUrl
>
&
urls
,
QString
*
error
=
0
);
Document
addDocument
(
const
QUrl
&
url
,
QString
*
error
=
0
);
Document
addDocuments
(
const
QString
&
groupName
,
const
QList
<
QUrl
>
&
urls
,
QString
*
error
=
0
);
void
removeDocument
(
const
Document
&
existingDocument
);
void
removeDocument
(
const
Document
&
existingDocument
);
protected:
void
showEvent
(
QShowEvent
*
);
...
...
@@ -67,7 +66,7 @@ protected:
void
resizeEvent
(
QResizeEvent
*
);
private:
class
DocBookViewImpl
*
pImpl_
;
class
DocBookViewImpl
*
pImpl_
;
};
}
...
...
src/kumir2-libs/docbookviewer/docbookview_impl.cpp
View file @
6b0ddf4c
// Self includes
#include "docbookview_impl.h"
#include "contentview.h"
#include "document.h"
#include "docbookfactory.h"
#include "docbookmodel.h"
#include "printdialog.h"
...
...
@@ -9,14 +8,14 @@
#include "sidepanel.h"
// Qt includes
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QSplitter>
#include <QLabel>
#include <QStackedWidget>
#include <QLayout>
#include <QAction>
namespace
DocBookViewer
{
namespace
DocBookViewer
{
DocBookViewImpl
::
DocBookViewImpl
(
DocBookView
*
pClass
)
:
QObject
(
pClass
)
...
...
@@ -86,7 +85,7 @@ void DocBookViewImpl::updateToggleSideBarButton()
static
const
QString
Hide
=
tr
(
"Hide side bar"
);
static
const
QString
Show
=
tr
(
"Show side bar"
);
const
QString
&
text
=
isSideBarVisible
()
?
Hide
:
Show
;
const
QString
&
text
=
isSideBarVisible
()
?
Hide
:
Show
;
const
QString
action
=
isSideBarVisible
()
?
"#hide"
:
"#show"
;
const
QString
html
=
QString
(
"<a href=
\"
%1
\"
>%2</a>"
).
arg
(
action
).
arg
(
text
);
...
...
@@ -104,10 +103,9 @@ bool DocBookViewImpl::isSideBarVisible() const
void
DocBookViewImpl
::
handleShowSideBarButton
(
const
QString
&
action
)
{
if
(
action
==
"#show"
)
{
if
(
action
==
"#show"
)
{
showSidePanel
();
}
else
if
(
action
==
"#hide"
)
{
}
else
if
(
action
==
"#hide"
)
{
hideSidePanel
();
}
}
...
...
@@ -124,8 +122,7 @@ void DocBookViewImpl::setSize(const QSize &size)
background_
->
resize
(
size
);
if
(
size
.
width
()
<
minWidth
)
{
// switchToCompactMode();
}
else
{
}
else
{
switchToEnoughtSizeMode
();
}
updateToggleSideBarButton
();
...
...
@@ -133,8 +130,9 @@ void DocBookViewImpl::setSize(const QSize &size)
void
DocBookViewImpl
::
switchToCompactMode
(
bool
force
)
{
if
(
compactModeFlag_
&&
!
force
)
if
(
compactModeFlag_
&&
!
force
)
{
return
;
}
compactModeFlag_
=
true
;
splitterRightWidget_
->
setCurrentIndex
(
0
);
smallSizeContainer_
->
layout
()
->
addWidget
(
content_
);
...
...
@@ -145,8 +143,9 @@ void DocBookViewImpl::switchToCompactMode(bool force)
void
DocBookViewImpl
::
switchToEnoughtSizeMode
(
bool
force
)
{
if
(
!
compactModeFlag_
&&
!
force
)
if
(
!
compactModeFlag_
&&
!
force
)
{
return
;
}
compactModeFlag_
=
false
;
splitterRightWidget_
->
setCurrentIndex
(
1
);
enoughtSizeContainer_
->
layout
()
->
addWidget
(
content_
);
...
...
@@ -157,10 +156,11 @@ void DocBookViewImpl::switchToEnoughtSizeMode(bool force)
void
DocBookViewImpl
::
hideSidePanel
()
{
if
(
compactModeFlag_
)
if
(
compactModeFlag_
)
{
splitter_
->
setVisible
(
false
);
else
}
else
{
sidePanel_
->
setVisible
(
false
);
}
updateToggleSideBarButton
();
background_
->
setVisible
(
false
);
enoughtSizeContainer_
->
layout
()
->
setContentsMargins
(
0
,
24
,
0
,
0
);
...
...
@@ -226,10 +226,11 @@ void DocBookViewImpl::restoreState(ExtensionSystem::SettingsPtr settings, const
.
toByteArray
());
sidePanel_
->
restoreState
(
settings
,
prefix
+
"/SideBar"
);
setSize
(
pClass_
->
size
());
if
(
settings
->
value
(
prefix
+
"/CompactMode"
).
toBool
())
if
(
settings
->
value
(
prefix
+
"/CompactMode"
).
toBool
())
{
switchToCompactMode
(
true
);
else
}
else
{
switchToEnoughtSizeMode
(
true
);
}
}
...
...
@@ -243,12 +244,11 @@ void DocBookViewImpl::createActions()
this
,
SLOT
(
showPrintDialog
()));
}
QAction
*
DocBookViewImpl
::
viewerAction
(
const
DocBookView
::
DocBookViewAction
type
)
const
QAction
*
DocBookViewImpl
::
viewerAction
(
const
DocBookView
::
DocBookViewAction
type
)
const
{
if
(
type
==
DocBookView
::
ToggleNavigationPane
)
{
if
(
type
==
DocBookView
::
ToggleNavigationPane
)
{
return
actionToggleNavigationBar_
;
}
else
if
(
type
==
DocBookView
::
ShowPrintDialog
)
{
}
else
if
(
type
==
DocBookView
::
ShowPrintDialog
)
{
return
actionShowPrintDialog_
;
}
return
0
;
...
...
@@ -256,7 +256,7 @@ QAction * DocBookViewImpl::viewerAction(const DocBookView::DocBookViewAction typ
Document
DocBookViewImpl
::
addDocument
(
const
QUrl
&
url
,
QString
*
error
)
{
DocBookFactory
*
factory
=
DocBookFactory
::
self
();
DocBookFactory
*
factory
=
DocBookFactory
::
self
();
Document
doc
=
factory
->
parseDocument
(
roleValues_
,
url
,
error
);
sidePanel_
->
addDocument
(
doc
,
true
);
if
(
content_
->
isEmpty
())
{
...
...
@@ -267,17 +267,16 @@ Document DocBookViewImpl::addDocument(const QUrl &url, QString *error)
Document
DocBookViewImpl
::
addDocuments
(
const
QString
&
groupName
,
const
QList
<
QUrl
>
&
urls
,
QString
*
error
)
{
DocBookFactory
*
factory
=
DocBookFactory
::
self
();
DocBookFactory
*
factory
=
DocBookFactory
::
self
();
QList
<
Document
>
docs
;
Q_FOREACH
(
const
QUrl
&
url
,
urls
)
{
Q_FOREACH
(
const
QUrl
&
url
,
urls
)
{
Document
doc
=
factory
->
parseDocument
(
roleValues_
,
url
,
error
);
if
(
doc
.
root_
.
isNull
())
{
if
(
error
)
{
error
->
prepend
(
QString
(
"In %1: "
).
arg
(
url
.
toString
()));
}
}
else
{
}
else
{
docs
.
append
(
doc
);
}
}
...
...
@@ -292,7 +291,7 @@ bool DocBookViewImpl::hasAlgorithm(const QString &name) const
return
!
algorithm
.
isNull
();
}
void
DocBookViewImpl
::
navigateToApiFunction
(
const
QString
&
package
,
const
QString
&
function
)
void
DocBookViewImpl
::
navigateToApiFunction
(
const
QString
&
package
,
const
QString
&
function
)
{
const
ModelPtr
algorithm
=
sidePanel_
->
findApiFunction
(
package
,
function
);
if
(
algorithm
)
{
...
...
@@ -317,7 +316,7 @@ void DocBookViewImpl::clearNavigationFilters()
sidePanel_
->
focusToSearchLine
();