mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Simplify code that disables previous/next comic actions
This commit is contained in:
parent
f030a7fb0c
commit
0fad89dc03
@ -179,6 +179,7 @@ void MainWindowViewer::setupUI()
|
|||||||
createActions();
|
createActions();
|
||||||
setUpShortcutsManagement();
|
setUpShortcutsManagement();
|
||||||
disableActions();
|
disableActions();
|
||||||
|
disablePreviousNextComicActions();
|
||||||
|
|
||||||
createToolBars();
|
createToolBars();
|
||||||
|
|
||||||
@ -957,9 +958,12 @@ void MainWindowViewer::enableActions()
|
|||||||
void MainWindowViewer::disableActions()
|
void MainWindowViewer::disableActions()
|
||||||
{
|
{
|
||||||
setActionsEnabled(false);
|
setActionsEnabled(false);
|
||||||
for (auto *a : { setBookmarkAction,
|
setBookmarkAction->setEnabled(false);
|
||||||
openComicOnTheLeftAction,
|
}
|
||||||
openComicOnTheRightAction })
|
|
||||||
|
void MainWindowViewer::disablePreviousNextComicActions()
|
||||||
|
{
|
||||||
|
for (auto *a : { openComicOnTheLeftAction, openComicOnTheRightAction })
|
||||||
a->setEnabled(false);
|
a->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,17 +1129,9 @@ void MainWindowViewer::checkNewVersion()
|
|||||||
|
|
||||||
void MainWindowViewer::processReset()
|
void MainWindowViewer::processReset()
|
||||||
{
|
{
|
||||||
if (isClient) {
|
disableActions();
|
||||||
if (siblingComics.count() > 1) {
|
if (!isClient || siblingComics.size() <= 1)
|
||||||
bool openNextB = openComicOnTheRightAction->isEnabled();
|
disablePreviousNextComicActions();
|
||||||
bool openPrevB = openComicOnTheLeftAction->isEnabled();
|
|
||||||
disableActions();
|
|
||||||
openComicOnTheRightAction->setEnabled(openNextB);
|
|
||||||
openComicOnTheLeftAction->setEnabled(openPrevB);
|
|
||||||
} else
|
|
||||||
disableActions();
|
|
||||||
} else
|
|
||||||
disableActions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowViewer::setUpShortcutsManagement()
|
void MainWindowViewer::setUpShortcutsManagement()
|
||||||
|
@ -45,6 +45,7 @@ public slots:
|
|||||||
void showToolBars();
|
void showToolBars();
|
||||||
void enableActions();
|
void enableActions();
|
||||||
void disableActions();
|
void disableActions();
|
||||||
|
void disablePreviousNextComicActions();
|
||||||
void toggleFullScreen();
|
void toggleFullScreen();
|
||||||
void toFullScreen();
|
void toFullScreen();
|
||||||
void toNormal();
|
void toNormal();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user