Add minor change to variable names

This commit is contained in:
glubsy 2020-07-31 22:27:18 +02:00
parent 87f9317805
commit 63a9f00552
2 changed files with 7 additions and 8 deletions

View File

@ -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

View File

@ -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))