Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Removed redundant "Exclude" and "Copy" menu options in LogViewDialog #1672

Closed
wants to merge 43 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
30e7c5c
LogViewDialog: Remove redundant "Exclude" and "Copy" menu options
vozellad Mar 26, 2024
c96e776
Merge branch 'bit-team:dev' into dev
T1petitti Mar 29, 2024
fbee763
(In Progress) Add to ShutDown class ability to either shutdown, hiber…
vozellad Apr 10, 2024
313acc8
(In Progress) Add to ShutDown class a function to get the user-distro…
vozellad Apr 10, 2024
cb1b3ab
added button for sleep/hibernate
c18walsh Apr 10, 2024
f632409
Implemented suspend functionality when activate_suspend is enabled, a…
T1petitti Apr 11, 2024
9a20db3
added button for sleep/hibernate
c18walsh Apr 12, 2024
4a7b4f9
(In Progress) Remove hibernate. Add setting computer to suspend in ne…
vozellad Apr 13, 2024
fb7246d
Take from suspend_implementation branch
vozellad Apr 13, 2024
9bb9695
Add code to suspend, except it still doesn't do it
vozellad Apr 13, 2024
069dbcd
Add Preferences menubar item
vozellad Apr 16, 2024
bf26b6b
Make new menubar item checkable
vozellad Apr 16, 2024
0d377a2
Rename show_icon_text to show_toolbar_text. Un-nest nested if statement.
vozellad Apr 17, 2024
f7a5130
(In progress) Add option to use text instead of icon
vozellad Apr 18, 2024
4f21dd9
Merge remote-tracking branch 'refs/remotes/origin/suspend_implementat…
T1petitti Apr 18, 2024
1360df6
Merge remote-tracking branch 'refs/remotes/origin/Adding-choices-for-…
T1petitti Apr 18, 2024
2d2dfa0
Merging icon work / method option work / suspend feature work
T1petitti Apr 18, 2024
1ea7246
When saving snapshot, will suspend or shutdown if manually changing D…
T1petitti Apr 18, 2024
6ae2456
Add member variable list of actions to use in rest of class
vozellad Apr 19, 2024
0239779
Add icon-text switch functionality
vozellad Apr 19, 2024
006c769
Both Shutdown and Suspend Trigger first DBUS method
T1petitti Apr 19, 2024
a95605a
Changed proxy method to Suspend when suspend triggered, Shutdown prox…
T1petitti Apr 19, 2024
b67f3b5
Disables shutdown when suspend is enabled and vice versa
T1petitti Apr 19, 2024
84927cb
Remember "show toolbar text" toggle with stored file
vozellad Apr 19, 2024
ef4836e
Access widgets in toolbar's actions to set their icons
vozellad Apr 20, 2024
d39bf3c
Viewing snapshots does not change text back to icon
vozellad Apr 20, 2024
58116eb
Add comments
vozellad Apr 20, 2024
c0bd8b8
Add unit-testing (in-progress)
vozellad Apr 23, 2024
a283405
Resourced free_space from snapshots class to create gui indicator of …
T1petitti Apr 25, 2024
8ab4ce5
Merge pull request #1 from T1petitti/master
vozellad Apr 26, 2024
70f3b68
Change suspend action tooltip text to be more accurate and match the …
vozellad Apr 26, 2024
d1cad3b
Add suspend QAction to menubar
vozellad Apr 26, 2024
365c1b3
Remove outdated commented code
vozellad Apr 26, 2024
344a37d
Horizontally align line of code with surrounding lines
vozellad Apr 26, 2024
56c7ef6
Only show suspend button when user's desktop environment can suspend
vozellad Apr 26, 2024
5cf00f9
Add available suspend keyword for e17 desktop environment
vozellad Apr 27, 2024
a782ee8
Gnome doesn't use any 'Suspend' keyword, so accommodate for that
vozellad Apr 27, 2024
4a96d13
Gnome doesn't support suspending in this way, so remove the ability f…
vozellad Apr 27, 2024
97d8475
Remove redundant comment
vozellad Apr 27, 2024
765dd6f
Make variable name more descriptive
vozellad Apr 27, 2024
796b749
Merge branch 'dev' into Give-option-to-display-text-in-toolbar-items
vozellad Apr 27, 2024
0dbb000
Merge pull request #2 from T1petitti/Give-option-to-display-text-in-t…
vozellad Apr 27, 2024
82f5ddf
'toolbar' is a class variable now. Correct code that doesn't use it t…
vozellad Apr 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions qt/logviewdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,49 +178,15 @@ def comboFilterChanged(self, index):

def contextMenuClicked(self, point):
menu = QMenu()
clipboard = qttools.createQApplication().clipboard()
cursor = self.txtLogView.textCursor()

btnCopy = menu.addAction(_('Copy'))
btnCopy.triggered.connect(lambda: clipboard.setText(cursor.selectedText()))
btnCopy.setEnabled(cursor.hasSelection())

btnAddExclude = menu.addAction(_('Add to Exclude'))
btnAddExclude.triggered.connect(self.btnAddExcludeClicked)
btnAddExclude.setEnabled(cursor.hasSelection())

btnDecode = menu.addAction(_('Decode'))
btnDecode.triggered.connect(self.btnDecodeClicked)
btnDecode.setEnabled(cursor.hasSelection())
btnDecode.setVisible(self.config.snapshotsMode() == 'ssh_encfs')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that only the entry "Decode" is left in this context menu. This is visible only when the current snapshot profile use encryption (EncFS).

So I propose to add the check self.config.snapshotsMode() == 'ssh_encfs' to line 147 where the context menu trigger is installed. It should be installed only when there is a encrypted (encfs) snapshot profile.

Side note: What confuses me is that the check is only for ssh_encfs and not also local_encfs. Maybe you can check this out if there is a good reason for this? But be aware that we plan to remove (replace) encfs in the long run (#1549). So don't invest to much resources into this encfs-thing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. I worked with T1petitti in a group of 3. The Decode option does not come up graphically because the context menu does not appear either, which is why we didn't think we needed to change anything involving the Decode feature, but moving the condition to before the context menu is created instead of after is something we can do.

3bc25fa
This commit by @Germar is where it got added. It does not say why it got added.
Is it possible 'local_encfs' does not have a decode option because local file-paths, not through ssh, do not need to be decoded?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! 🚀 A team of three. 🤟

I don't use EncFS and so I don't know the details. Might it be possible that you can give it a short test: Create one "locale (encrypted)" and "SSH (encrypted)" profile and then check this feature?


menu.exec(self.txtLogView.mapToGlobal(point))

def btnAddExcludeClicked(self):
exclude = self.config.exclude()
path = self.txtLogView.textCursor().selectedText().strip()
if not path or path in exclude:
return
edit = QLineEdit(self)
edit.setText(path)
edit.setMinimumWidth(600)
options = {
'widget': edit,
'retFunc': edit.text,
'id': 'path'
}
confirm, opt = messagebox.warningYesNoOptions(
self,
_('Do you want to exclude this?'),
(options, )
)

if not confirm:
return

exclude.append(opt['path'])
self.config.setExclude(exclude)

def btnDecodeClicked(self):
if not self.decode:
self.decode = encfstools.Decode(self.config)
Expand Down