本文整理汇总了Python中calibre.gui2.ResizableDialog类的典型用法代码示例。如果您正苦于以下问题:Python ResizableDialog类的具体用法?Python ResizableDialog怎么用?Python ResizableDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ResizableDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent, recipe_model):
ResizableDialog.__init__(self, parent)
self._model = self.model = CustomRecipeModel(recipe_model)
self.available_profiles.setModel(self._model)
self.available_profiles.currentChanged = self.current_changed
f = QFont()
f.setStyleHint(f.Monospace)
self.source_code.setFont(f)
self.remove_feed_button.clicked[(bool)].connect(self.added_feeds.remove_selected_items)
self.remove_profile_button.clicked[(bool)].connect(self.remove_selected_items)
self.add_feed_button.clicked[(bool)].connect(self.add_feed)
self.load_button.clicked.connect(self.load)
self.opml_button.clicked.connect(self.opml_import)
self.builtin_recipe_button.clicked.connect(self.add_builtin_recipe)
self.share_button.clicked.connect(self.share)
self.show_recipe_files_button.clicked.connect(self.show_recipe_files)
self.down_button.clicked.connect(self.down)
self.up_button.clicked.connect(self.up)
self.add_profile_button.clicked[(bool)].connect(self.add_profile)
self.feed_url.returnPressed[()].connect(self.add_feed)
self.feed_title.returnPressed[()].connect(self.add_feed)
self.toggle_mode_button.clicked[(bool)].connect(self.toggle_mode)
self.clear()
示例2: __init__
def __init__(self, db, parent=None):
self.db = db
self.changed = set()
self.books_to_refresh = set()
self.rows_to_refresh = set()
self.metadata_before_fetch = None
ResizableDialog.__init__(self, parent)
示例3: __init__
def __init__(self, parent, db, book_id,
preferred_input_format=None, preferred_output_format=None):
ResizableDialog.__init__(self, parent)
self.opt_individual_saved_settings.setVisible(False)
self.db, self.book_id = db, book_id
self.setup_input_output_formats(self.db, self.book_id, preferred_input_format,
preferred_output_format)
self.setup_pipeline()
self.connect(self.input_formats, SIGNAL('currentIndexChanged(QString)'),
self.setup_pipeline)
self.connect(self.output_formats, SIGNAL('currentIndexChanged(QString)'),
self.setup_pipeline)
self.connect(self.groups, SIGNAL('activated(QModelIndex)'),
self.show_pane)
self.connect(self.groups, SIGNAL('clicked(QModelIndex)'),
self.show_pane)
self.connect(self.groups, SIGNAL('entered(QModelIndex)'),
self.show_group_help)
rb = self.buttonBox.button(self.buttonBox.RestoreDefaults)
self.connect(rb, SIGNAL('clicked()'), self.restore_defaults)
self.groups.setMouseTracking(True)
geom = gprefs.get('convert_single_dialog_geom', None)
if geom:
self.restoreGeometry(geom)
示例4: __init__
def __init__(self, parent, db, preferred_output_format=None,
has_saved_settings=True):
ResizableDialog.__init__(self, parent)
self.setup_output_formats(db, preferred_output_format)
self.db = db
self.setup_pipeline()
self.input_label.hide()
self.input_formats.hide()
self.opt_individual_saved_settings.setVisible(True)
self.opt_individual_saved_settings.setChecked(True)
self.opt_individual_saved_settings.setToolTip(_('For '
'settings that cannot be specified in this dialog, use the '
'values saved in a previous conversion (if they exist) instead '
'of using the defaults specified in the Preferences'))
self.output_formats.currentIndexChanged[str].connect(self.setup_pipeline)
self.groups.activated[(QModelIndex)].connect(self.show_pane)
self.groups.clicked[(QModelIndex)].connect(self.show_pane)
self.groups.entered[(QModelIndex)].connect(self.show_group_help)
rb = self.buttonBox.button(self.buttonBox.RestoreDefaults)
rb.setVisible(False)
self.groups.setMouseTracking(True)
if not has_saved_settings:
o = self.opt_individual_saved_settings
o.setEnabled(False)
o.setToolTip(_('None of the selected books have saved conversion '
'settings.'))
o.setChecked(False)
geom = gprefs.get('convert_bulk_dialog_geom', None)
if geom:
self.restoreGeometry(geom)
示例5: __init__
def __init__(self, db, parent=None, editing_multiple=False):
self.db = db
self.changed = set()
self.books_to_refresh = set()
self.rows_to_refresh = set()
self.metadata_before_fetch = None
self.editing_multiple = editing_multiple
ResizableDialog.__init__(self, parent)
示例6: accept
def accept(self):
recs = GuiRecommendations()
for w in self._groups_model.widgets:
if not w.pre_commit_check():
return
x = w.commit(save_defaults=False)
recs.update(x)
self._recommendations = recs
ResizableDialog.accept(self)
示例7: reject
def reject(self):
if question_dialog(
self,
_("Are you sure?"),
_(
"You will lose any unsaved changes. To save your"
" changes, click the Add/Update recipe button."
" Continue?"
),
show_copy_button=False,
):
ResizableDialog.reject(self)
示例8: accept
def accept(self):
recs = GuiRecommendations()
for w in self._groups_model.widgets:
if not w.pre_commit_check():
return
x = w.commit(save_defaults=False)
recs.update(x)
self.opf_file, self.cover_file = self.mw.opf_file, self.mw.cover_file
self._recommendations = recs
if self.db is not None:
recs['gui_preferred_input_format'] = self.input_format
save_specifics(self.db, self.book_id, recs)
self.break_cycles()
ResizableDialog.accept(self)
示例9: accept
def accept(self):
self.save_state()
if not self.apply_changes():
return
if self.editing_multiple and self.current_row != len(self.row_list) - 1:
num = len(self.row_list) - 1 - self.current_row
from calibre.gui2 import question_dialog
if not question_dialog(
self, _('Are you sure?'),
_('There are still %d more books to edit in this set.'
' Are you sure you want to stop? Use the Next button'
' instead of the OK button to move through books in the set.') % num,
yes_text=_('&Stop editing'), no_text=_('&Continue editing'),
yes_icon='dot_red.png', no_icon='dot_green.png',
default_yes=False, skip_dialog_name='edit-metadata-single-confirm-ok-on-multiple'):
return self.do_one(delta=1, apply_changes=False)
ResizableDialog.accept(self)
示例10: reject
def reject(self):
self.save_state()
ResizableDialog.reject(self)
示例11: done
def done(self, r):
if self.isVisible():
gprefs['convert_bulk_dialog_geom'] = \
bytearray(self.saveGeometry())
return ResizableDialog.done(self, r)
示例12: reject
def reject(self):
self.break_cycles()
ResizableDialog.reject(self)
示例13: __init__
def __init__(self, window, rows, model, tab, refresh_books):
ResizableDialog.__init__(self, window)
Ui_MetadataBulkDialog.__init__(self)
self.model = model
self.db = model.db
self.refresh_book_list.setChecked(gprefs['refresh_book_list_on_bulk_edit'])
self.refresh_book_list.toggled.connect(self.save_refresh_booklist)
self.ids = [self.db.id(r) for r in rows]
self.first_title = self.db.title(self.ids[0], index_is_id=True)
self.cover_clone.setToolTip(unicode(self.cover_clone.toolTip()) + ' (%s)' % self.first_title)
self.box_title.setText('<p>' +
_('Editing meta information for <b>%d books</b>') %
len(rows))
self.write_series = False
self.changed = False
self.refresh_books = refresh_books
self.comments = null
self.comments_button.clicked.connect(self.set_comments)
all_tags = self.db.all_tags()
self.tags.update_items_cache(all_tags)
self.remove_tags.update_items_cache(all_tags)
self.initialize_combos()
for f in sorted(self.db.all_formats()):
self.remove_format.addItem(f)
self.remove_format.setCurrentIndex(-1)
self.series.currentIndexChanged[int].connect(self.series_changed)
self.series.editTextChanged.connect(self.series_changed)
self.tag_editor_button.clicked.connect(self.tag_editor)
self.autonumber_series.stateChanged[int].connect(self.auto_number_changed)
self.pubdate.setMinimumDateTime(UNDEFINED_QDATETIME)
self.pubdate_cw = CalendarWidget(self.pubdate)
self.pubdate.setCalendarWidget(self.pubdate_cw)
pubdate_format = tweaks['gui_pubdate_display_format']
if pubdate_format is not None:
self.pubdate.setDisplayFormat(pubdate_format)
self.pubdate.setSpecialValueText(_('Undefined'))
self.clear_pubdate_button.clicked.connect(self.clear_pubdate)
self.pubdate.dateTimeChanged.connect(self.do_apply_pubdate)
self.adddate.setDateTime(QDateTime.currentDateTime())
self.adddate.setMinimumDateTime(UNDEFINED_QDATETIME)
adddate_format = tweaks['gui_timestamp_display_format']
if adddate_format is not None:
self.adddate.setDisplayFormat(adddate_format)
self.adddate.setSpecialValueText(_('Undefined'))
self.clear_adddate_button.clicked.connect(self.clear_adddate)
self.adddate.dateTimeChanged.connect(self.do_apply_adddate)
if len(self.db.custom_field_keys(include_composites=False)) == 0:
self.central_widget.removeTab(1)
else:
self.create_custom_column_editors()
self.prepare_search_and_replace()
self.button_box.clicked.connect(self.button_clicked)
self.button_box.button(QDialogButtonBox.Apply).setToolTip(_(
'Immediately make all changes without closing the dialog. '
'This operation cannot be canceled or undone'))
self.do_again = False
self.central_widget.setCurrentIndex(tab)
geom = gprefs.get('bulk_metadata_window_geometry', None)
if geom is not None:
self.restoreGeometry(bytes(geom))
ct = gprefs.get('bulk_metadata_window_tab', 0)
self.central_widget.setCurrentIndex(ct)
self.languages.init_langs(self.db)
self.languages.setEditText('')
self.authors.setFocus(Qt.OtherFocusReason)
self.exec_()
示例14: __init__
def __init__(self, db, parent=None):
self.db = db
self.changed = set()
self.books_to_refresh = set()
self.rows_to_refresh = set()
ResizableDialog.__init__(self, parent)
示例15: reject
def reject(self):
dynamic.set("catalog_window_geom", bytearray(self.saveGeometry()))
ResizableDialog.reject(self)