Skip to content

Commit

Permalink
fix: Empty EncFS snapshotpath field in Manage profiles dialog (#1808)
Browse files Browse the repository at this point in the history
For EncFS profiles the snapshotpath field in Manage profile dialog was empty.

Beside of that the profile specific encfs-deprecation-warning dialog now is shown not only in Manage profiles dialog but also in MainWindow when an EncFS profile is selected. But it is shown only once.

Fix #1808
Related to #1806 
Related to #1734
  • Loading branch information
buhtz committed Jul 25, 2024
1 parent 677b423 commit ab6cb6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
9 changes: 9 additions & 0 deletions qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,15 @@ def updateProfile(self):
self.updatePlaces()
self.updateFilesView(0)

# EncFS deprecation warning (see #1734)
current_mode = self.config.snapshotsMode(self.config.currentProfile())
if current_mode in ('local_encfs', 'ssh_encfs'):
# Show the profile specific warning dialog only once per profile.
if self.config.profileBoolValue('msg_shown_encfs') is False:
self.config.setProfileBoolValue('msg_shown_encfs', True)
dlg = encfsmsgbox.EncfsCreateWarning(self)
dlg.exec()

def comboProfileChanged(self, index):
if self.disableProfileChanged:
return
Expand Down
16 changes: 10 additions & 6 deletions qt/settingsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ def __init__(self, parent):
self.keyringSupported = tools.keyringSupported()
self.cbPasswordSave.setEnabled(self.keyringSupported)

# mode change
self.comboModes.currentIndexChanged.connect(self.comboModesChanged)

# host, user, profile id
groupBox = QGroupBox(self)
self.frameAdvanced = groupBox
Expand Down Expand Up @@ -1246,9 +1249,6 @@ def __init__(self, parent):
self.updateProfiles()
self.comboModesChanged()

# mode change
self.comboModes.currentIndexChanged.connect(self.comboModesChanged)

# enable tabs scroll buttons again but keep dialog size
size = self.sizeHint()
self.tabs.setUsesScrollButtons(scrollButtonDefault)
Expand Down Expand Up @@ -2262,15 +2262,19 @@ def comboModesChanged(self, *params):
self.cbSshCheckPing.setHidden(not enabled)
self.cbSshCheckCommands.setHidden(not enabled)

# EncFS deprecation warnings
# EncFS deprecation warnings (see #1734)
if active_mode in ('local_encfs', 'ssh_encfs'):
self.encfsWarning.setHidden(False)

# Workaround to avoid showing the warning messagebox just when
# opening the manage profiles dialog.
if self.isVisible():
dlg = encfsmsgbox.EncfsCreateWarning(self)
dlg.exec()
# Show the profile specific warning dialog only once per
# profile.
if self.config.profileBoolValue('msg_shown_encfs') is False:
self.config.setProfileBoolValue('msg_shown_encfs', True)
dlg = encfsmsgbox.EncfsCreateWarning(self)
dlg.exec()
else:
self.encfsWarning.setHidden(True)

Expand Down

0 comments on commit ab6cb6c

Please sign in to comment.