From b5d167512a8ee6851a1bd589e7a0474d507b6ce5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Dec 2008 11:19:01 -0800 Subject: [PATCH] Add entry to context (right-click) menu to show book details --- src/calibre/gui2/dialogs/comicconf.py | 5 ++++- src/calibre/gui2/library.py | 5 ++++- src/calibre/gui2/main.py | 10 +++++++--- src/calibre/gui2/main.ui | 9 +++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/dialogs/comicconf.py b/src/calibre/gui2/dialogs/comicconf.py index 50f4254be2..a53865627f 100644 --- a/src/calibre/gui2/dialogs/comicconf.py +++ b/src/calibre/gui2/dialogs/comicconf.py @@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en' from PyQt4.QtGui import QDialog from calibre.gui2.dialogs.comicconf_ui import Ui_Dialog from calibre.gui2 import qstring_to_unicode -from calibre.ebooks.lrf.comic.convert_from import config +from calibre.ebooks.lrf.comic.convert_from import config, PROFILES def set_conversion_defaults(window): d = ComicConf(window) @@ -52,6 +52,9 @@ class ComicConf(QDialog, Ui_Dialog): self.opt_author.setText(author) self.opt_colors.setValue(opts.colors) self.opt_profile.addItem(opts.profile) + for x in PROFILES.keys(): + if x != opts.profile: + self.opt_profile.addItem(x) self.opt_dont_normalize.setChecked(opts.dont_normalize) self.opt_keep_aspect_ratio.setChecked(opts.keep_aspect_ratio) self.opt_dont_sharpen.setChecked(opts.dont_sharpen) diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index 664d3980cb..c529b55879 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -563,7 +563,8 @@ class BooksView(TableView): if col > -1: self.setItemDelegateForColumn(col, self.rating_delegate) - def set_context_menu(self, edit_metadata, send_to_device, convert, view, save, open_folder): + def set_context_menu(self, edit_metadata, send_to_device, convert, view, + save, open_folder, book_details): self.setContextMenuPolicy(Qt.DefaultContextMenu) self.context_menu = QMenu(self) if edit_metadata is not None: @@ -576,6 +577,8 @@ class BooksView(TableView): self.context_menu.addAction(save) if open_folder is not None: self.context_menu.addAction(open_folder) + if book_details is not None: + self.context_menu.addAction(book_details) def contextMenuEvent(self, event): self.context_menu.popup(event.globalPos()) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 6c04126939..f2fb35b681 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -104,10 +104,13 @@ class Main(MainWindow, Ui_MainWindow): self.system_tray_menu.addAction(self.quit_action) self.quit_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_Q)) self.action_restart.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_R)) + self.action_show_book_details.setShortcut(QKeySequence(Qt.Key_I)) + self.addAction(self.action_show_book_details) self.system_tray_icon.setContextMenu(self.system_tray_menu) self.connect(self.quit_action, SIGNAL('triggered(bool)'), self.quit) self.connect(self.donate_action, SIGNAL('triggered(bool)'), self.donate) self.connect(self.restore_action, SIGNAL('triggered(bool)'), lambda c : self.show()) + self.connect(self.action_show_book_details, SIGNAL('triggered(bool)'), self.show_book_info) def restart_app(c): self.quit(None, restart=True) self.connect(self.action_restart, SIGNAL('triggered(bool)'), restart_app) @@ -233,9 +236,10 @@ class Main(MainWindow, Ui_MainWindow): ####################### Library view ######################## self.library_view.set_context_menu(self.action_edit, self.action_sync, self.action_convert, self.action_view, - self.action_save, self.action_open_containing_folder) - self.memory_view.set_context_menu(None, None, None, self.action_view, self.action_save, None) - self.card_view.set_context_menu(None, None, None, self.action_view, self.action_save, None) + self.action_save, self.action_open_containing_folder, + self.action_show_book_details) + self.memory_view.set_context_menu(None, None, None, self.action_view, self.action_save, None, None) + self.card_view.set_context_menu(None, None, None, self.action_view, self.action_save, None, None) QObject.connect(self.library_view, SIGNAL('files_dropped(PyQt_PyObject)'), self.files_dropped) for func, target in [ diff --git a/src/calibre/gui2/main.ui b/src/calibre/gui2/main.ui index 200e54c38f..a4541f0a1d 100644 --- a/src/calibre/gui2/main.ui +++ b/src/calibre/gui2/main.ui @@ -569,6 +569,15 @@ Open containing folder + + + + :/images/dialog_information.svg:/images/dialog_information.svg + + + Show book details + +