本文整理汇总了Python中calibre.gui2.dialogs.plugin_updater.PluginUpdaterDialog类的典型用法代码示例。如果您正苦于以下问题:Python PluginUpdaterDialog类的具体用法?Python PluginUpdaterDialog怎么用?Python PluginUpdaterDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginUpdaterDialog类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_plugins
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)
示例2: check_for_plugin_updates
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_()
示例3: update_plugins
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()
示例4: get_plugins
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)
示例5: update_found
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)
示例6: update_found
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)
示例7: get_plugins
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_()