Skip to content

Commit

Permalink
System tray menu: Add action to restart calibre. Fixes #2087754 [[Enh…
Browse files Browse the repository at this point in the history
…ancement] Add 'Restart' to tray menu](https://bugs.launchpad.net/calibre/+bug/2087754)
  • Loading branch information
kovidgoyal committed Nov 24, 2024
1 parent 2dacaf7 commit c96a330
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/calibre/gui2/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def initialize(self, library_path, db, actions, show_gui=True):
QIcon.ic('eject.png'), _('&Eject connected device'))
self.eject_action.setEnabled(False)
self.addAction(self.quit_action)
self.system_tray_menu.addAction(self.iactions['Restart'].menuless_qaction)
self.system_tray_menu.addAction(self.quit_action)
self.keyboard.register_shortcut('quit calibre', _('Quit calibre'),
default_keys=('Ctrl+Q',), action=self.quit_action)
Expand Down Expand Up @@ -1177,6 +1178,9 @@ def write_settings(self):
self.save_layout_state()
self.tb_widget.save_state()

def restart(self):
self.quit(restart=True)

def quit(self, checked=True, restart=False, debug_on_restart=False,
confirm_quit=True, no_plugins_on_restart=False):
if self.shutting_down:
Expand Down

0 comments on commit c96a330

Please sign in to comment.