def get_plugins(self): from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog, FILTER_NOT_INSTALLED) d = PluginUpdaterDialog(self.gui, initial_filter=FILTER_NOT_INSTALLED) d.exec_() if d.do_restart: self.gui.quit(restart=True)
def check_for_plugin_updates(self): # Get the user to choose a plugin to install initial_filter = FILTER_UPDATE_AVAILABLE mods = QApplication.keyboardModifiers() if mods & Qt.ControlModifier or mods & Qt.ShiftModifier: initial_filter = FILTER_ALL d = PluginUpdaterDialog(self.gui, initial_filter=initial_filter) d.exec_()
def update_plugins(self, not_installed=False): from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE, FILTER_NOT_INSTALLED) mode = FILTER_NOT_INSTALLED if not_installed else FILTER_UPDATE_AVAILABLE d = PluginUpdaterDialog(self.gui, initial_filter=mode) d.exec_() self._plugin_model.populate() self._plugin_model.reset() self.changed_signal.emit()
def update_plugins(self, not_installed=False): from calibre.gui2.dialogs.plugin_updater import ( PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE, FILTER_NOT_INSTALLED) mode = FILTER_NOT_INSTALLED if not_installed else FILTER_UPDATE_AVAILABLE d = PluginUpdaterDialog(self.gui, initial_filter=mode) d.exec_() self._plugin_model.populate() self._plugin_model.reset() self.changed_signal.emit()
def check_for_plugin_updates(self): # Get the user to choose a plugin to install initial_filter = FILTER_UPDATE_AVAILABLE mods = QApplication.keyboardModifiers() if mods & Qt.ControlModifier or mods & Qt.ShiftModifier: initial_filter = FILTER_ALL d = PluginUpdaterDialog(self.gui, initial_filter=initial_filter) d.exec_() if d.do_restart: self.gui.quit(restart=True)
def get_plugins(self): from calibre.gui2.dialogs.plugin_updater import ( PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) 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 get_plugins(self): from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) 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 update_found(self, calibre_version, number_of_plugin_updates, force=False, no_show_popup=False): self.last_newest_calibre_version = calibre_version has_calibre_update = calibre_version != NO_CALIBRE_UPDATE and calibre_version[ 0] > 0 has_plugin_updates = number_of_plugin_updates > 0 self.plugin_update_found(number_of_plugin_updates) version_url = as_hex_unicode( msgpack_dumps((calibre_version, number_of_plugin_updates))) calibre_version = '.'.join(map(str, calibre_version)) if not has_calibre_update and not has_plugin_updates: self.status_bar.update_label.setVisible(False) return if has_calibre_update: plt = '' if has_plugin_updates: plt = ngettext( ' and one plugin update', ' and {} plugin updates', number_of_plugin_updates).format(number_of_plugin_updates) msg = ('<span style="color:green; font-weight: bold">%s: ' '<a href="update:%s">%s%s</a></span>') % ( _('Update found'), version_url, calibre_version, plt) else: plt = ngettext('plugin update available', 'plugin updates available', number_of_plugin_updates) msg = ('<a href="update:%s">%d %s</a>') % ( version_url, number_of_plugin_updates, plt) self.status_bar.update_label.setText(msg) self.status_bar.update_label.setVisible(True) if has_calibre_update: if (force or (config.get('new_version_notification') and not is_version_notified(calibre_version))): if not no_show_popup: self._update_notification__ = UpdateNotification( calibre_version, number_of_plugin_updates, parent=self) self._update_notification__.show() elif has_plugin_updates: if force: from calibre.gui2.dialogs.plugin_updater import ( PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) d = PluginUpdaterDialog(self, initial_filter=FILTER_UPDATE_AVAILABLE) d.exec() if d.do_restart: self.quit(restart=True)
def update_found(self, calibre_version, number_of_plugin_updates, force=False, no_show_popup=False): self.last_newest_calibre_version = calibre_version has_calibre_update = calibre_version != NO_CALIBRE_UPDATE has_plugin_updates = number_of_plugin_updates > 0 self.plugin_update_found(number_of_plugin_updates) version_url = binascii.hexlify( cPickle.dumps((calibre_version, number_of_plugin_updates), -1)) calibre_version = u'.'.join(map(unicode, calibre_version)) if not has_calibre_update and not has_plugin_updates: self.status_bar.update_label.setVisible(False) return if has_calibre_update: plt = u'' if has_plugin_updates: plt = ngettext( ' (one plugin update)', ' ({} plugin updates)', number_of_plugin_updates).format(number_of_plugin_updates) msg = (u'<span style="color:green; font-weight: bold">%s: ' u'<a href="update:%s">%s%s</a></span>') % ( _('Update found'), version_url, calibre_version, plt) else: plt = ngettext('updated plugin', 'updated plugins', number_of_plugin_updates) msg = (u'<a href="update:%s">%d %s</a>') % ( version_url, number_of_plugin_updates, plt) self.status_bar.update_label.setText(msg) 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 not no_show_popup: self._update_notification__ = UpdateNotification( calibre_version, number_of_plugin_updates, parent=self) self._update_notification__.show() elif has_plugin_updates: if force: from calibre.gui2.dialogs.plugin_updater import ( PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) d = PluginUpdaterDialog(self, initial_filter=FILTER_UPDATE_AVAILABLE) d.exec_() if d.do_restart: self.quit(restart=True)
def update_found(self, version, force=False, no_show_popup=False): try: calibre_version, plugin_updates = version.split(VSEP) plugin_updates = int(plugin_updates) except: traceback.print_exc() return self.last_newest_calibre_version = calibre_version has_calibre_update = calibre_version and calibre_version != NO_CALIBRE_UPDATE has_plugin_updates = plugin_updates > 0 self.plugin_update_found(plugin_updates) if not has_calibre_update and not has_plugin_updates: self.status_bar.update_label.setVisible(False) return if has_calibre_update: plt = u'' if has_plugin_updates: plt = _(' (%d plugin updates)')%plugin_updates msg = (u'<span style="color:green; font-weight: bold">%s: ' u'<a href="update:%s">%s%s</a></span>') % ( _('Update found'), version, calibre_version, plt) else: msg = (u'<a href="update:%s">%d %s</a>')%(version, plugin_updates, _('updated plugins')) self.status_bar.update_label.setText(msg) 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 not no_show_popup: self._update_notification__ = UpdateNotification(calibre_version, plugin_updates, parent=self) self._update_notification__.show() elif has_plugin_updates: if force: from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) d = PluginUpdaterDialog(self, initial_filter=FILTER_UPDATE_AVAILABLE) d.exec_() if d.do_restart: self.quit(restart=True)
def update_found(self, version, force=False, no_show_popup=False): try: calibre_version, plugin_updates = version.split(VSEP) plugin_updates = int(plugin_updates) except: traceback.print_exc() return self.last_newest_calibre_version = calibre_version has_calibre_update = calibre_version and calibre_version != NO_CALIBRE_UPDATE has_plugin_updates = plugin_updates > 0 self.plugin_update_found(plugin_updates) if not has_calibre_update and not has_plugin_updates: self.status_bar.update_label.setVisible(False) return if has_calibre_update: plt = u'' if has_plugin_updates: plt = _(' (%d plugin updates)') % plugin_updates msg = (u'<span style="color:green; font-weight: bold">%s: ' u'<a href="update:%s">%s%s</a></span>') % ( _('Update found'), version, calibre_version, plt) else: msg = (u'<a href="update:%s">%d %s</a>') % ( version, plugin_updates, _('updated plugins')) self.status_bar.update_label.setText(msg) 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 not no_show_popup: self._update_notification__ = UpdateNotification( calibre_version, plugin_updates, parent=self) self._update_notification__.show() elif has_plugin_updates: if force: from calibre.gui2.dialogs.plugin_updater import ( PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) d = PluginUpdaterDialog(self, initial_filter=FILTER_UPDATE_AVAILABLE) d.exec_() if d.do_restart: self.quit(restart=True)
def update_found(self, calibre_version, number_of_plugin_updates, force=False, no_show_popup=False): self.last_newest_calibre_version = calibre_version has_calibre_update = calibre_version != NO_CALIBRE_UPDATE has_plugin_updates = number_of_plugin_updates > 0 self.plugin_update_found(number_of_plugin_updates) version_url = binascii.hexlify(cPickle.dumps((calibre_version, number_of_plugin_updates), -1)) calibre_version = u'.'.join(map(unicode, calibre_version)) if not has_calibre_update and not has_plugin_updates: self.status_bar.update_label.setVisible(False) return if has_calibre_update: plt = u'' if has_plugin_updates: plt = _(' (%d plugin updates)')%number_of_plugin_updates msg = (u'<span style="color:green; font-weight: bold">%s: ' u'<a href="update:%s">%s%s</a></span>') % ( _('Update found'), version_url, calibre_version, plt) else: msg = (u'<a href="update:%s">%d %s</a>')%(version_url, number_of_plugin_updates, _('updated plugins')) self.status_bar.update_label.setText(msg) 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 not no_show_popup: self._update_notification__ = UpdateNotification(calibre_version, number_of_plugin_updates, parent=self) self._update_notification__.show() elif has_plugin_updates: if force: from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) d = PluginUpdaterDialog(self, initial_filter=FILTER_UPDATE_AVAILABLE) d.exec_() if d.do_restart: self.quit(restart=True)
def get_plugins(self): from calibre.gui2.dialogs.plugin_updater import ( PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) d = PluginUpdaterDialog(self.parent(), initial_filter=FILTER_UPDATE_AVAILABLE) d.exec_()
def get_plugins(self): from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog, FILTER_UPDATE_AVAILABLE) d = PluginUpdaterDialog(self.parent(), initial_filter=FILTER_UPDATE_AVAILABLE) d.exec_()