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

@@ -69,6 +69,7 @@ class DupeGuru(QObject):
self.directories_dialog = self.main_window.createPage("DirectoriesDialog", app=self)
self.main_window.addTab(
self.directories_dialog, "Directories", switch=False)
self.actionDirectoriesWindow.setEnabled(False)
else: # floating windows only
self.main_window = None
self.directories_dialog = DirectoriesDialog(self)
@@ -121,6 +122,7 @@ class DupeGuru(QObject):
self.preferencesTriggered,
),
("actionIgnoreList", "", "", tr("Ignore List"), self.ignoreListTriggered),
("actionDirectoriesWindow", "", "", tr("Directories"), self.showDirectoriesWindow),
(
"actionClearPictureCache",
"Ctrl+Shift+P",
@@ -220,6 +222,16 @@ class DupeGuru(QObject):
else:
self.resultWindow.show()
def showDirectoriesWindow(self):
if self.directories_dialog is not None:
if self.main_window:
index = self.main_window.indexOfWidget(self.directories_dialog)
# if not self.main_window.tabWidget.isTabVisible(index):
self.main_window.setTabVisible(index, True)
self.main_window.setCurrentIndex(index)
else:
self.directories_dialog.show()
def shutdown(self):
self.willSavePrefs.emit()
self.prefs.save()