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
PIM
Akregator
Commits
af5420b6
Commit
af5420b6
authored
Oct 11, 2021
by
Laurent Montel
😁
Browse files
Add dialog box if necessary + fix checkbox status
parent
60cb9b23
Pipeline
#87749
passed with stage
in 9 minutes and 8 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
interfaces/akregator.kcfg
View file @
af5420b6
...
...
@@ -10,6 +10,13 @@
<whatsthis>
Hides feeds with no unread articles
</whatsthis>
<default>
false
</default>
</entry>
<entry
key=
"ShowMenuBar"
type=
"Bool"
>
<default>
true
</default>
<!-- label and whatsthis are already provided by KStandardAction::showMenubar -->
<label></label>
<whatsthis></whatsthis>
</entry>
<entry
key=
"Lock Feeds In Place"
type=
"Bool"
>
<label>
Prevent feeds from being moved in the list
</label>
<whatsthis>
Locks feeds where they are
</whatsthis>
...
...
src/mainwindow.cpp
View file @
af5420b6
...
...
@@ -58,7 +58,9 @@ MainWindow::MainWindow(QWidget *parent)
statusBar
()
->
addWidget
(
m_statusLabel
,
1
);
KStandardAction
::
quit
(
qApp
,
&
QApplication
::
quit
,
actionCollection
());
mShowMenuBarAction
=
KStandardAction
::
showMenubar
(
menuBar
(),
&
QMenuBar
::
setVisible
,
actionCollection
());
mShowMenuBarAction
=
KStandardAction
::
showMenubar
(
this
,
&
MainWindow
::
slotToggleMenubar
,
actionCollection
());
mShowMenuBarAction
->
setChecked
(
Settings
::
showMenuBar
());
slotToggleMenubar
(
true
);
if
(
menuBar
())
{
mHamburgerMenu
=
KStandardAction
::
hamburgerMenu
(
nullptr
,
nullptr
,
actionCollection
());
...
...
@@ -81,6 +83,27 @@ MainWindow::MainWindow(QWidget *parent)
connect
(
qApp
,
&
QCoreApplication
::
aboutToQuit
,
this
,
&
MainWindow
::
slotOnShutdown
);
}
void
MainWindow
::
slotToggleMenubar
(
bool
dontShowWarning
)
{
if
(
menuBar
())
{
if
(
mShowMenuBarAction
->
isChecked
())
{
menuBar
()
->
show
();
}
else
{
if
(
!
dontShowWarning
&&
(
!
toolBar
()
->
isVisible
()
||
!
toolBar
()
->
actions
().
contains
(
mHamburgerMenu
)))
{
const
QString
accel
=
mShowMenuBarAction
->
shortcut
().
toString
();
KMessageBox
::
information
(
this
,
i18n
(
"<qt>This will hide the menu bar completely."
" You can show it again by typing %1.</qt>"
,
accel
),
i18n
(
"Hide menu bar"
),
QStringLiteral
(
"HideMenuBarWarning"
));
}
menuBar
()
->
hide
();
}
Settings
::
setShowMenuBar
(
mShowMenuBarAction
->
isChecked
());
}
}
void
MainWindow
::
updateHamburgerMenu
()
{
QMenu
*
menu
=
new
QMenu
(
this
);
...
...
src/mainwindow.h
View file @
af5420b6
...
...
@@ -81,6 +81,7 @@ private Q_SLOTS:
private:
void
updateHamburgerMenu
();
void
slotToggleMenubar
(
bool
dontShowWarning
);
QPointer
<
Akregator
::
Part
>
m_part
;
KSqueezedTextLabel
*
const
m_statusLabel
;
KHamburgerMenu
*
mHamburgerMenu
=
nullptr
;
...
...
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