Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
e13172b4
Commit
e13172b4
authored
May 13, 2021
by
Alexander Semke
Browse files
Fixed the switch between the web-view and the content widget for the
documentation.
parent
06b88d84
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/backends/octave/CMakeLists.txt
View file @
e13172b4
...
...
@@ -24,7 +24,7 @@ endif (WITH_EPS)
configure_file
(
octavebackend.kcfg.in
${
CMAKE_CURRENT_BINARY_DIR
}
/octavebackend.kcfg
)
kconfig_add_kcfg_files
(
OctaveBackend_SRCS settings.kcfgc
)
install
(
FILES octavebackend.kcfg DESTINATION
${
KDE_INSTALL_KCFGDIR
}
)
install
(
FILES octavebackend.kcfg
.in
DESTINATION
${
KDE_INSTALL_KCFGDIR
}
)
ki18n_wrap_ui
(
OctaveBackend_SRCS settings.ui
)
...
...
src/panelplugins/documentationpanel/documentationpanelplugin.json
View file @
e13172b4
{
"KPlugin"
:
{
"Dependencies"
:
[],
"Description"
:
"A panel to display the official documentation of various backends"
,
"Icon"
:
""
,
"Id"
:
"DocumentationPanel"
,
...
...
src/panelplugins/documentationpanel/documentationpanelwidget.cpp
View file @
e13172b4
...
...
@@ -175,25 +175,20 @@ DocumentationPanelWidget::DocumentationPanelWidget(QWidget* parent) : QWidget(pa
vlayout
->
addWidget
(
m_stackedWidget
);
vlayout
->
addWidget
(
findPageWidgetContainer
);
connect
(
m_documentationSelector
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
DocumentationPanelWidget
::
updateDocumentation
);
connect
(
m_documentationSelector
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
[
=
]
{
updateDocumentation
();
m_stackedWidget
->
setCurrentIndex
(
1
);
});
connect
(
m_stackedWidget
,
&
QStackedWidget
::
currentChanged
,
[
=
]{
//disable Home and Search in Page buttons when stackwidget shows contents widget, enable when shows web browser
if
(
m_stackedWidget
->
currentIndex
()
!=
1
)
//0->contents 1->browser
{
findPage
->
setEnabled
(
false
);
home
->
setEnabled
(
false
);
}
else
{
findPage
->
setEnabled
(
true
);
home
->
setEnabled
(
true
);
}
bool
enabled
=
(
m_stackedWidget
->
currentIndex
()
==
0
);
//0 = web view, 1 = content widget
findPage
->
setEnabled
(
enabled
);
home
->
setEnabled
(
enabled
);
});
connect
(
home
,
&
QPushButton
::
clicked
,
[
=
]{
m_stackedWidget
->
setCurrentIndex
(
0
);
m_stackedWidget
->
setCurrentIndex
(
1
);
//navigate to the content widget
findPageWidgetContainer
->
hide
();
});
...
...
@@ -256,7 +251,7 @@ void DocumentationPanelWidget::updateBackend(const QString& newBackend)
// show all available documentation files for the new backend
m_documentationSelector
->
clear
();
const
KConfigGroup
group
=
KSharedConfig
::
openConfig
()
->
group
(
m_backend
.
toLower
());
const
KConfigGroup
&
group
=
KSharedConfig
::
openConfig
()
->
group
(
m_backend
.
toLower
());
m_docNames
=
group
.
readEntry
(
QLatin1String
(
"Names"
),
QStringList
());
m_docPaths
=
group
.
readEntry
(
QLatin1String
(
"Paths"
),
QStringList
());
const
QStringList
&
iconNames
=
group
.
readEntry
(
QLatin1String
(
"Icons"
),
QStringList
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment