mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add donate entry to Help menu
This commit is contained in:
parent
5a113f3c04
commit
2d9bba1e59
@ -27,6 +27,9 @@ from calibre.gui2.tweak_book.search import SearchPanel
|
|||||||
from calibre.gui2.tweak_book.check import Check
|
from calibre.gui2.tweak_book.check import Check
|
||||||
from calibre.gui2.tweak_book.toc import TOCViewer
|
from calibre.gui2.tweak_book.toc import TOCViewer
|
||||||
|
|
||||||
|
def open_donate():
|
||||||
|
open_url(QUrl('http://calibre-ebook.com/donate'))
|
||||||
|
|
||||||
class Central(QStackedWidget):
|
class Central(QStackedWidget):
|
||||||
|
|
||||||
' The central widget, hosts the editors '
|
' The central widget, hosts the editors '
|
||||||
@ -429,6 +432,7 @@ class Main(MainWindow):
|
|||||||
e = b.addMenu(_('&Help'))
|
e = b.addMenu(_('&Help'))
|
||||||
a = e.addAction
|
a = e.addAction
|
||||||
a(self.action_help)
|
a(self.action_help)
|
||||||
|
a(QIcon(I('donate.png')), _('Donate to support calibre development'), open_donate)
|
||||||
|
|
||||||
def update_recent_books(self):
|
def update_recent_books(self):
|
||||||
m = self.recent_books_menu
|
m = self.recent_books_menu
|
||||||
@ -453,7 +457,7 @@ class Main(MainWindow):
|
|||||||
continue
|
continue
|
||||||
a(getattr(self, 'action_' + x))
|
a(getattr(self, 'action_' + x))
|
||||||
self.donate_button = b = ThrobbingButton(self)
|
self.donate_button = b = ThrobbingButton(self)
|
||||||
b.clicked.connect(lambda : open_url(QUrl('http://calibre-ebook.com/donate')))
|
b.clicked.connect(open_donate)
|
||||||
b.setAutoRaise(True)
|
b.setAutoRaise(True)
|
||||||
self.donate_widget = w = create_donate_widget(b)
|
self.donate_widget = w = create_donate_widget(b)
|
||||||
if hasattr(w, 'filler'):
|
if hasattr(w, 'filler'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user