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)
def __init__(self, parent, db, preferred_output_format=None, has_saved_settings=True, book_ids=()): QDialog.__init__(self, parent) self.widgets = [] self.setupUi() try: self.num_of_books = len(book_ids) except Exception: self.num_of_books = 1 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[native_string_type].connect( self.setup_pipeline) self.groups.setSpacing(5) 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( QDialogButtonBox.StandardButton.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: QApplication.instance().safe_restore_geometry(self, geom) else: self.resize(self.sizeHint())
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.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) 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)