From 4a77d32a0ec155688182ee5cd7580a4073081418 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 May 2018 07:44:57 +0530 Subject: [PATCH] Update notification: When both calibre and plugin updates are available and the user updates only the plugins, fix the restart calibre button not working. Fixes #1774059 [restart after updating plugins does't work. Selecting "automatically restart" leaves the menu to update plugins or calibre.](https://bugs.launchpad.net/calibre/+bug/1774059) --- src/calibre/gui2/update.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/update.py b/src/calibre/gui2/update.py index 9ea0993273..6b8f9aa7b7 100644 --- a/src/calibre/gui2/update.py +++ b/src/calibre/gui2/update.py @@ -151,6 +151,12 @@ class UpdateNotification(QDialog): d = PluginUpdaterDialog(self.parent(), initial_filter=FILTER_UPDATE_AVAILABLE) d.exec_() + if d.do_restart: + QDialog.accept(self) + from calibre.gui2.ui import get_gui + gui = get_gui() + if gui is not None: + gui.quit(restart=True) def show_future(self, *args): config.set('new_version_notification', bool(self.cb.isChecked())) @@ -202,8 +208,8 @@ class UpdateMixin(object): self.status_bar.update_label.setVisible(True) if has_calibre_update: - if (force or (config.get('new_version_notification') and - dynamic.get('update to version %s'%calibre_version, True))): + if (force or (config.get('new_version_notification') and dynamic.get( + 'update to version %s'%calibre_version, True))): if not no_show_popup: self._update_notification__ = UpdateNotification(calibre_version, number_of_plugin_updates, parent=self)