diff --git a/src/calibre/gui2/convert/page_setup.ui b/src/calibre/gui2/convert/page_setup.ui index 0aa2a97e70..0ea2093697 100644 --- a/src/calibre/gui2/convert/page_setup.ui +++ b/src/calibre/gui2/convert/page_setup.ui @@ -115,6 +115,9 @@ 1 + + 200.000000000000000 + @@ -135,6 +138,9 @@ 1 + + 200.000000000000000 + @@ -155,6 +161,9 @@ 1 + + 200.000000000000000 + @@ -175,6 +184,9 @@ 1 + + 200.000000000000000 + diff --git a/src/calibre/gui2/dialogs/choose_format.py b/src/calibre/gui2/dialogs/choose_format.py index e0fcb0868b..e1f32e3d26 100644 --- a/src/calibre/gui2/dialogs/choose_format.py +++ b/src/calibre/gui2/dialogs/choose_format.py @@ -12,7 +12,8 @@ class ChooseFormatDialog(QDialog, Ui_ChooseFormatDialog): QDialog.__init__(self, window) Ui_ChooseFormatDialog.__init__(self) self.setupUi(self) - self.connect(self.formats, SIGNAL('activated(QModelIndex)'), lambda i: self.accept()) + self.connect(self.formats, SIGNAL('activated(QModelIndex)'), + self.activated_slot) self.msg.setText(msg) for format in formats: @@ -20,6 +21,15 @@ class ChooseFormatDialog(QDialog, Ui_ChooseFormatDialog): format.upper())) self._formats = formats self.formats.setCurrentRow(0) + self._format = None + + def activated_slot(self, *args): + self.accept() def format(self): - return self._formats[self.formats.currentRow()] + return self._format + + def accept(self): + self._format = self._formats[self.formats.currentRow()] + return QDialog.accept(self) + diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 6a3c637340..2a43f39f43 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -337,7 +337,8 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): QObject.connect(self.view_menu.actions()[0], SIGNAL("triggered(bool)"), self.view_book) QObject.connect(self.view_menu.actions()[1], - SIGNAL("triggered(bool)"), self.view_specific_format) + SIGNAL("triggered(bool)"), self.view_specific_format, + Qt.QueuedConnection) self.connect(self.action_open_containing_folder, SIGNAL('triggered(bool)'), self.view_folder) self.delete_menu.actions()[0].triggered.connect(self.delete_books) @@ -1642,12 +1643,9 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): row = rows[0].row() formats = self.library_view.model().db.formats(row).upper().split(',') d = ChooseFormatDialog(self, _('Choose the format to view'), formats) - d.exec_() - if d.result() == QDialog.Accepted: + if d.exec_() == QDialog.Accepted: format = d.format() self.view_format(row, format) - else: - return def view_folder(self, *args): rows = self.current_view().selectionModel().selectedRows()