From dac9fb44dddd39306cda002c7380d4fd58f6ab3f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Nov 2008 09:57:54 -0800 Subject: [PATCH 1/2] Fix #1321 (Right-click on button bar gives empty option that removed button bar) --- src/calibre/gui2/dialogs/scheduler.py | 6 +++--- src/calibre/gui2/dialogs/user_profiles.ui | 2 +- src/calibre/gui2/main.py | 3 +++ src/calibre/gui2/main.ui | 6 ++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/dialogs/scheduler.py b/src/calibre/gui2/dialogs/scheduler.py index b99407a404..410b81c714 100644 --- a/src/calibre/gui2/dialogs/scheduler.py +++ b/src/calibre/gui2/dialogs/scheduler.py @@ -334,9 +334,9 @@ class Scheduler(QObject): def customize_feeds(self, *args): main = self.main d = UserProfiles(main, main.library_view.model().db.get_feeds()) - if d.exec_() == QDialog.Accepted: - feeds = tuple(d.profiles()) - main.library_view.model().db.set_feeds(feeds) + d.exec_() + feeds = tuple(d.profiles()) + main.library_view.model().db.set_feeds(feeds) def debug(self, *args): diff --git a/src/calibre/gui2/dialogs/user_profiles.ui b/src/calibre/gui2/dialogs/user_profiles.ui index 74a9891caf..44662e75a2 100644 --- a/src/calibre/gui2/dialogs/user_profiles.ui +++ b/src/calibre/gui2/dialogs/user_profiles.ui @@ -23,7 +23,7 @@ Qt::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Close diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 44c8b91a32..d820c7bff3 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -110,6 +110,9 @@ class Main(MainWindow, Ui_MainWindow): if r == QSystemTrayIcon.Trigger: self.hide() if self.isVisible() else self.show() self.connect(self.system_tray_icon, SIGNAL('activated(QSystemTrayIcon::ActivationReason)'), sta) + def tcme(self, *args): + print args + self.tool_bar.contextMenuEvent = tcme ####################### Location View ######################## QObject.connect(self.location_view, SIGNAL('location_selected(PyQt_PyObject)'), self.location_selected) diff --git a/src/calibre/gui2/main.ui b/src/calibre/gui2/main.ui index ff2177b149..46f7c08bbd 100644 --- a/src/calibre/gui2/main.ui +++ b/src/calibre/gui2/main.ui @@ -16,6 +16,9 @@ 0 + + Qt::NoContextMenu + __appname__ @@ -412,6 +415,9 @@ 0 + + Qt::PreventContextMenu + false From 70c1443b96f474125aa1cd809d81977f5d96842c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Nov 2008 10:07:58 -0800 Subject: [PATCH 2/2] Fix #1324 (Donate - error) --- src/calibre/gui2/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index d820c7bff3..770d2c35fe 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -1250,9 +1250,10 @@ in which you want to store your books files. Any existing books will be automati ''' MSG = _('is the result of the efforts of many volunteers from all over the world. If you find it useful, please consider donating to support its development.') - HTML = ''' + HTML = u''' + Donate to support calibre @@ -1263,7 +1264,7 @@ in which you want to store your books files. Any existing books will be automati '''%(MSG, BUTTON) pt = PersistentTemporaryFile('_donate.htm') - pt.write(HTML) + pt.write(HTML.encode('utf-8')) pt.close() QDesktopServices.openUrl(QUrl.fromLocalFile(pt.name))