1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Fix menu items being wrongly disabled

* Add Directories to the View menu.
* View menu items should be disabled properly depending on whether they point to the current page/tab.
* Keep "Load scan results" actions active while viewing pages other than the Directories tab.
This commit is contained in:
glubsy
2020-07-31 05:08:08 +02:00
parent 1b3b40543b
commit 86e1b55b02
3 changed files with 33 additions and 26 deletions

View File

@@ -88,17 +88,17 @@ class DirectoriesDialog(QMainWindow):
"actionShowResultsWindow",
"",
"",
tr("Results Window"),
tr("Scan Results"),
self.app.showResultsWindow,
),
("actionAddFolder", "", "", tr("Add Folder..."), self.addFolderTriggered),
]
createActions(ACTIONS, self)
if self.app.main_window: # We use tab widgets in this case
# Keep track of actions which should only be accessible from this class
for action, _, _, _, _ in ACTIONS:
self.specific_actions.add(getattr(self, action))
# if self.app.main_window: # We use tab widgets in this case
# # Keep track of actions which should only be accessible from this class
# for action, _, _, _, _ in ACTIONS:
# self.specific_actions.add(getattr(self, action))
def _setupMenu(self):
if not self.app.main_window:
@@ -124,7 +124,6 @@ class DirectoriesDialog(QMainWindow):
self.menuLoadRecent.setTitle(tr("Load Recent Results"))
self.menuFile.addAction(self.actionLoadResults)
self.menuFile.addAction(self.menuLoadRecent.menuAction())
self.specific_actions.add(self.menuLoadRecent.menuAction())
self.menuFile.addSeparator()
self.menuFile.addAction(self.app.actionClearPictureCache)
self.menuFile.addSeparator()
@@ -132,6 +131,7 @@ class DirectoriesDialog(QMainWindow):
self.menuView.addAction(self.app.actionPreferences)
self.menuView.addAction(self.actionShowResultsWindow)
self.menuView.addAction(self.app.actionIgnoreList)
self.menuView.addAction(self.app.actionDirectoriesWindow)
self.menuHelp.addAction(self.app.actionShowHelp)
self.menuHelp.addAction(self.app.actionOpenDebugLog)
self.menuHelp.addAction(self.app.actionAbout)