Пример #1
0
 def save_catalog_settings(self):
     self.catalog_format = unicode_type(self.format.currentText())
     dynamic.set('catalog_preferred_format', self.catalog_format)
     self.catalog_title = unicode_type(self.title.text())
     dynamic.set('catalog_last_used_title', self.catalog_title)
     self.catalog_sync = bool(self.sync.isChecked())
     dynamic.set('catalog_sync_to_device', self.catalog_sync)
     dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
     dynamic.set('catalog_add_to_library', self.add_to_library.isChecked())
Пример #2
0
 def save_catalog_settings(self):
     self.catalog_format = unicode(self.format.currentText())
     dynamic.set('catalog_preferred_format', self.catalog_format)
     self.catalog_title = unicode(self.title.text())
     dynamic.set('catalog_last_used_title', self.catalog_title)
     self.catalog_sync = bool(self.sync.isChecked())
     dynamic.set('catalog_sync_to_device', self.catalog_sync)
     dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
     dynamic.set('catalog_add_to_library', self.add_to_library.isChecked())
Пример #3
0
 def save_catalog_settings(self):
     self.catalog_format = unicode(self.format.currentText())
     dynamic.set("catalog_preferred_format", self.catalog_format)
     self.catalog_title = unicode(self.title.text())
     dynamic.set("catalog_last_used_title", self.catalog_title)
     self.catalog_sync = bool(self.sync.isChecked())
     dynamic.set("catalog_sync_to_device", self.catalog_sync)
     dynamic.set("catalog_window_geom", bytearray(self.saveGeometry()))
Пример #4
0
 def __init__(self, calibre_version, plugin_updates, parent=None):
     QDialog.__init__(self, parent)
     self.setAttribute(Qt.WA_QuitOnClose, False)
     self.resize(400, 250)
     self.l = QGridLayout()
     self.setLayout(self.l)
     self.logo = QLabel()
     self.logo.setMaximumWidth(110)
     self.logo.setPixmap(QIcon(I('lt.png')).pixmap(100, 100))
     ver = calibre_version
     if ver.endswith('.0'):
         ver = ver[:-2]
     self.label = QLabel(
         ('<p>' +
          _('New version <b>{ver}</b> of {app} is available for download. '
            'See the <a href="{url}">new features</a>.').format(
                url=localize_website_link(
                    'https://calibre-ebook.com/whats-new'),
                app=__appname__,
                ver=ver)))
     self.label.setOpenExternalLinks(True)
     self.label.setWordWrap(True)
     self.setWindowTitle(_('Update available!'))
     self.setWindowIcon(QIcon(I('lt.png')))
     self.l.addWidget(self.logo, 0, 0)
     self.l.addWidget(self.label, 0, 1)
     self.cb = QCheckBox(_('Show this notification for future updates'),
                         self)
     self.l.addWidget(self.cb, 1, 0, 1, -1)
     self.cb.setChecked(config.get('new_version_notification'))
     self.cb.stateChanged.connect(self.show_future)
     self.bb = QDialogButtonBox(self)
     b = self.bb.addButton(_('&Get update'), self.bb.AcceptRole)
     b.setDefault(True)
     b.setIcon(QIcon(I('arrow-down.png')))
     if plugin_updates > 0:
         b = self.bb.addButton(_('Update &plugins'), self.bb.ActionRole)
         b.setIcon(QIcon(I('plugins/plugin_updater.png')))
         b.clicked.connect(self.get_plugins, type=Qt.QueuedConnection)
     self.bb.addButton(self.bb.Cancel)
     self.l.addWidget(self.bb, 2, 0, 1, -1)
     self.bb.accepted.connect(self.accept)
     self.bb.rejected.connect(self.reject)
     dynamic.set('update to version %s' % calibre_version, False)
Пример #5
0
 def __init__(self, calibre_version, plugin_updates, parent=None):
     QDialog.__init__(self, parent)
     self.setAttribute(Qt.WA_QuitOnClose, False)
     self.resize(400, 250)
     self.l = QGridLayout()
     self.setLayout(self.l)
     self.logo = QLabel()
     self.logo.setMaximumWidth(110)
     self.logo.setPixmap(QPixmap(I('lt.png')).scaled(100, 100,
         Qt.IgnoreAspectRatio, Qt.SmoothTransformation))
     ver = calibre_version
     if ver.endswith('.0'):
         ver = ver[:-2]
     self.label = QLabel(('<p>'+
         _('New version <b>%(ver)s</b> of %(app)s is available for download. '
         'See the <a href="http://calibre-ebook.com/whats-new'
         '">new features</a>.'))%dict(
             app=__appname__, ver=ver))
     self.label.setOpenExternalLinks(True)
     self.label.setWordWrap(True)
     self.setWindowTitle(_('Update available!'))
     self.setWindowIcon(QIcon(I('lt.png')))
     self.l.addWidget(self.logo, 0, 0)
     self.l.addWidget(self.label, 0, 1)
     self.cb = QCheckBox(
         _('Show this notification for future updates'), self)
     self.l.addWidget(self.cb, 1, 0, 1, -1)
     self.cb.setChecked(config.get('new_version_notification'))
     self.cb.stateChanged.connect(self.show_future)
     self.bb = QDialogButtonBox(self)
     b = self.bb.addButton(_('&Get update'), self.bb.AcceptRole)
     b.setDefault(True)
     b.setIcon(QIcon(I('arrow-down.png')))
     if plugin_updates > 0:
         b = self.bb.addButton(_('Update &plugins'), self.bb.ActionRole)
         b.setIcon(QIcon(I('plugins/plugin_updater.png')))
         b.clicked.connect(self.get_plugins, type=Qt.QueuedConnection)
     self.bb.addButton(self.bb.Cancel)
     self.l.addWidget(self.bb, 2, 0, 1, -1)
     self.bb.accepted.connect(self.accept)
     self.bb.rejected.connect(self.reject)
     dynamic.set('update to version %s'%calibre_version, False)
Пример #6
0
 def __init__(self, calibre_version, plugin_updates, parent=None):
     QDialog.__init__(self, parent)
     self.resize(400, 250)
     self.l = QGridLayout()
     self.setLayout(self.l)
     self.logo = QLabel()
     self.logo.setMaximumWidth(110)
     self.logo.setPixmap(
         QPixmap(I('lt.png')).scaled(100, 100, Qt.IgnoreAspectRatio,
                                     Qt.SmoothTransformation))
     self.label = QLabel(
         ('<p>' + _('%(app)s has been updated to version <b>%(ver)s</b>. '
                    'See the <a href="http://calibre-ebook.com/whats-new'
                    '">new features</a>.')) %
         dict(app=__appname__, ver=calibre_version))
     self.label.setOpenExternalLinks(True)
     self.label.setWordWrap(True)
     self.setWindowTitle(_('Update available!'))
     self.setWindowIcon(QIcon(I('lt.png')))
     self.l.addWidget(self.logo, 0, 0)
     self.l.addWidget(self.label, 0, 1)
     self.cb = QCheckBox(_('Show this notification for future updates'),
                         self)
     self.l.addWidget(self.cb, 1, 0, 1, -1)
     self.cb.setChecked(config.get('new_version_notification'))
     self.cb.stateChanged.connect(self.show_future)
     self.bb = QDialogButtonBox(self)
     b = self.bb.addButton(_('&Get update'), self.bb.AcceptRole)
     b.setDefault(True)
     b.setIcon(QIcon(I('arrow-down.png')))
     if plugin_updates > 0:
         b = self.bb.addButton(_('Update &plugins'), self.bb.ActionRole)
         b.setIcon(QIcon(I('plugins/plugin_updater.png')))
         b.clicked.connect(self.get_plugins, type=Qt.QueuedConnection)
     self.bb.addButton(self.bb.Cancel)
     self.l.addWidget(self.bb, 2, 0, 1, -1)
     self.bb.accepted.connect(self.accept)
     self.bb.rejected.connect(self.reject)
     dynamic.set('update to version %s' % calibre_version, False)
Пример #7
0
 def accept(self):
     dynamic.set(self.cfg_key + '__un',
                 unicode_type(self.gui_username.text()))
     dynamic.set(self.cfg_key + '__pw',
                 unicode_type(self.gui_password.text()))
     QDialog.accept(self)
Пример #8
0
 def accept(self):
     dynamic.set(self.cfg_key + "__un", unicode(self.gui_username.text()))
     dynamic.set(self.cfg_key + "__pw", unicode(self.gui_password.text()))
     QDialog.accept(self)
Пример #9
0
 def reject(self):
     dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
     QDialog.reject(self)
Пример #10
0
 def reject(self):
     dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
     QDialog.reject(self)
Пример #11
0
def save_version_notified(calibre_version):
    done = dynamic.get('notified-version-updates') or set()
    done.add(version_key(calibre_version))
    dynamic.set('notified-version-updates', done)
Пример #12
0
 def toggle_cover_fit(self, state):
     dynamic.set('book_info_dialog_fit_cover', self.fit_cover.isChecked())
     self.resize_cover()
Пример #13
0
 def reject(self):
     dynamic.set("catalog_window_geom", bytearray(self.saveGeometry()))
     ResizableDialog.reject(self)
Пример #14
0
 def toggle_cover_fit(self, state):
     dynamic.set('book_info_dialog_fit_cover', self.fit_cover.isChecked())
     self.resize_cover()
Пример #15
0
 def accept(self):
     dynamic.set(self.cfg_key+'__un', unicode_type(self.gui_username.text()))
     dynamic.set(self.cfg_key+'__pw', unicode_type(self.gui_password.text()))
     QDialog.accept(self)