Skip to content

Commit

Permalink
Add a title to debug options and display it in corresponding menu
Browse files Browse the repository at this point in the history
Suggested by @rdswift
  • Loading branch information
zas committed Apr 7, 2024
1 parent 5dcf46d commit 6d15126
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions picard/debug_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ class DebugOpt(IntEnum):
WS_REPLIES = 1


DebugOptDesc = namedtuple('DebugOptDesc', ('name', 'description'))
DebugOptDesc = namedtuple('DebugOptDesc', ('name', 'title', 'description'))

debug_opts_descriptions = {
DebugOpt.WS_REPLIES: DebugOptDesc(name='ws_replies', description=N_('Log web service replies'))
DebugOpt.WS_REPLIES: DebugOptDesc(
name='ws_replies',
title=N_('WS Replies'),
description=N_('Log web service replies'),
),
}


Expand Down
2 changes: 1 addition & 1 deletion picard/ui/logview.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def __init__(self, parent=None):

self.actions = {}
for debug_opt, desc in debug_opts_descriptions.items():
action = QtGui.QAction(desc.name, self, checkable=True, checked=debug_opt in debug_opts)
action = QtGui.QAction(_(desc.title), self, checkable=True, checked=debug_opt in debug_opts)
action.setToolTip(_(desc.description))
action.triggered.connect(partial(self.debug_opt_changed, debug_opt))
self.addAction(action)
Expand Down

0 comments on commit 6d15126

Please sign in to comment.