mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 00:58:32 -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();
|
||||
setUpShortcutsManagement();
|
||||
disableActions();
|
||||
disablePreviousNextComicActions();
|
||||
|
||||
createToolBars();
|
||||
|
||||
@ -957,9 +958,12 @@ void MainWindowViewer::enableActions()
|
||||
void MainWindowViewer::disableActions()
|
||||
{
|
||||
setActionsEnabled(false);
|
||||
for (auto *a : { setBookmarkAction,
|
||||
openComicOnTheLeftAction,
|
||||
openComicOnTheRightAction })
|
||||
setBookmarkAction->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindowViewer::disablePreviousNextComicActions()
|
||||
{
|
||||
for (auto *a : { openComicOnTheLeftAction, openComicOnTheRightAction })
|
||||
a->setEnabled(false);
|
||||
}
|
||||
|
||||
@ -1125,17 +1129,9 @@ void MainWindowViewer::checkNewVersion()
|
||||
|
||||
void MainWindowViewer::processReset()
|
||||
{
|
||||
if (isClient) {
|
||||
if (siblingComics.count() > 1) {
|
||||
bool openNextB = openComicOnTheRightAction->isEnabled();
|
||||
bool openPrevB = openComicOnTheLeftAction->isEnabled();
|
||||
disableActions();
|
||||
openComicOnTheRightAction->setEnabled(openNextB);
|
||||
openComicOnTheLeftAction->setEnabled(openPrevB);
|
||||
} else
|
||||
disableActions();
|
||||
} else
|
||||
disableActions();
|
||||
disableActions();
|
||||
if (!isClient || siblingComics.size() <= 1)
|
||||
disablePreviousNextComicActions();
|
||||
}
|
||||
|
||||
void MainWindowViewer::setUpShortcutsManagement()
|
||||
|
@ -45,6 +45,7 @@ public slots:
|
||||
void showToolBars();
|
||||
void enableActions();
|
||||
void disableActions();
|
||||
void disablePreviousNextComicActions();
|
||||
void toggleFullScreen();
|
||||
void toFullScreen();
|
||||
void toNormal();
|
||||
|
Loading…
x
Reference in New Issue
Block a user