From 63a9f00552d5d474d8094c31e5c5b240d023b184 Mon Sep 17 00:00:00 2001 From: glubsy Date: Fri, 31 Jul 2020 22:27:18 +0200 Subject: [PATCH] Add minor change to variable names --- qt/app.py | 11 +++++------ qt/directories_dialog.py | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/qt/app.py b/qt/app.py index 5cbdf43e..43e9e8db 100644 --- a/qt/app.py +++ b/qt/app.py @@ -81,7 +81,7 @@ class DupeGuru(QObject): self.problemDialog = ProblemDialog( parent=parent_window, model=self.model.problem_dialog ) - if self.main_window: # we use tab widget + if self.use_tabs: self.ignoreListDialog = self.main_window.createPage( "IgnoreListDialog", parent=self.main_window, @@ -216,7 +216,7 @@ class DupeGuru(QObject): def showResultsWindow(self): if self.resultWindow is not None: - if self.main_window: + if self.use_tabs: self.main_window.addTab( self.resultWindow, "Results", switch=True) else: @@ -224,9 +224,8 @@ class DupeGuru(QObject): def showDirectoriesWindow(self): if self.directories_dialog is not None: - if self.main_window: + if self.use_tabs: 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: @@ -264,7 +263,7 @@ class DupeGuru(QObject): QMessageBox.information(active, title, tr("Picture cache cleared.")) def ignoreListTriggered(self): - if self.main_window: + if self.use_tabs: # Fetch the index in the TabWidget or the StackWidget (depends on class): index = self.main_window.indexOfWidget(self.ignoreListDialog) if index < 0: @@ -339,7 +338,7 @@ class DupeGuru(QObject): if self.resultWindow is not None: self.resultWindow.close() self.resultWindow.setParent(None) - if self.main_window: + if self.use_tabs: self.resultWindow = self.main_window.createPage( "ResultWindow", parent=self.main_window, app=self) else: # We don't use a tab widget, regular floating QMainWindow diff --git a/qt/directories_dialog.py b/qt/directories_dialog.py index 283731e9..45e53be6 100644 --- a/qt/directories_dialog.py +++ b/qt/directories_dialog.py @@ -94,13 +94,13 @@ class DirectoriesDialog(QMainWindow): ("actionAddFolder", "", "", tr("Add Folder..."), self.addFolderTriggered), ] createActions(ACTIONS, self) - # if self.app.main_window: # We use tab widgets in this case + # if self.app.use_tabs: # # 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: + if not self.app.use_tabs: # we are our own QMainWindow, we need our own menu bar self.menubar = QMenuBar(self) self.menubar.setGeometry(QRect(0, 0, 42, 22))