Skip to content

Commit

Permalink
Followed [buhtz's refactoring suggestions](bit-team#1662 (comment)).
Browse files Browse the repository at this point in the history
  • Loading branch information
stcksmsh committed Apr 8, 2024
1 parent d7f0ec0 commit e66feba
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions qt/snapshotsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@

if tools.checkCommand('meld'):
DIFF_CMD = 'meld'
DIFF_PARAMS = '%1 %2'
elif tools.checkCommand('kompare'):
DIFF_CMD = 'kompare'
DIFF_PARAMS = '%1 %2'
else:
DIFF_CMD = 'false'
DIFF_PARAMS = '%1 %2'
DIFF_CMD = ''

if DIFF_CMD is None:
DIFF_PARAMS = ''
else:
DIFF_PARAMS = '%1 %2'

class DiffOptionsDialog(QDialog):
def __init__(self, parent):
super(DiffOptionsDialog, self).__init__(parent)
Expand Down Expand Up @@ -333,10 +335,9 @@ def btnDiffClicked(self):
diffCmd = self.config.strValue('qt.diff.cmd', DIFF_CMD)
diffParams = self.config.strValue('qt.diff.params', DIFF_PARAMS)

if not tools.checkCommand(diffCmd):
if diffCmd is None:
messagebox.critical(
self, '{}: {}'.format(_('Command not found'), diffCmd)
)
self, ('No tool found to compare snapshots. It is suggested to install "meld", "kompare", or a similar tool.'))
return

# prevent backup data from being accidentally overwritten
Expand Down

0 comments on commit e66feba

Please sign in to comment.