IGN:Add donate button to main GUI

This commit is contained in:
Kovid Goyal 2009-01-26 17:17:53 -08:00
parent cb2a875125
commit 8987fc9e01
3 changed files with 28 additions and 2 deletions

View File

@ -100,7 +100,8 @@ class Main(MainWindow, Ui_MainWindow):
self.system_tray_icon.show() self.system_tray_icon.show()
self.system_tray_menu = QMenu() self.system_tray_menu = QMenu()
self.restore_action = self.system_tray_menu.addAction(QIcon(':/images/page.svg'), _('&Restore')) self.restore_action = self.system_tray_menu.addAction(QIcon(':/images/page.svg'), _('&Restore'))
self.donate_action = self.system_tray_menu.addAction(QIcon(':/images/donate.svg'), _('&Donate')) self.donate_action = self.system_tray_menu.addAction(QIcon(':/images/donate.svg'), _('&Donate to support calibre'))
self.donate_button.setDefaultAction(self.donate_action)
self.addAction(self.quit_action) self.addAction(self.quit_action)
self.action_restart = QAction(_('&Restart'), self) self.action_restart = QAction(_('&Restart'), self)
self.addAction(self.action_restart) self.addAction(self.action_restart)
@ -1422,7 +1423,7 @@ class Main(MainWindow, Ui_MainWindow):
self.restart_after_quit = restart self.restart_after_quit = restart
QApplication.instance().quit() QApplication.instance().quit()
def donate(self): def donate(self, *args):
BUTTON = ''' BUTTON = '''
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="cmd" value="_s-xclick">

View File

@ -82,6 +82,29 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="donate_button" >
<property name="cursor" >
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text" >
<string>...</string>
</property>
<property name="icon" >
<iconset resource="images.qrc" >
<normaloff>:/images/donate.svg</normaloff>:/images/donate.svg</iconset>
</property>
<property name="iconSize" >
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="autoRaise" >
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_3" > <layout class="QVBoxLayout" name="verticalLayout_3" >
<item> <item>

View File

@ -148,6 +148,7 @@ class CoverFlowButton(QToolButton):
self.setSizePolicy(QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)) self.setSizePolicy(QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding))
self.connect(self, SIGNAL('toggled(bool)'), self.adjust_tooltip) self.connect(self, SIGNAL('toggled(bool)'), self.adjust_tooltip)
self.adjust_tooltip(False) self.adjust_tooltip(False)
self.setCursor(Qt.PointingHandCursor)
def adjust_tooltip(self, on): def adjust_tooltip(self, on):
tt = _('Click to turn off Cover Browsing') if on else _('Click to browse books by their covers') tt = _('Click to turn off Cover Browsing') if on else _('Click to browse books by their covers')
@ -165,6 +166,7 @@ class TagViewButton(QToolButton):
self.setIcon(QIcon(':/images/tags.svg')) self.setIcon(QIcon(':/images/tags.svg'))
self.setToolTip(_('Click to browse books by tags')) self.setToolTip(_('Click to browse books by tags'))
self.setSizePolicy(QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)) self.setSizePolicy(QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding))
self.setCursor(Qt.PointingHandCursor)
self.setCheckable(True) self.setCheckable(True)
self.setChecked(False) self.setChecked(False)
self.setAutoRaise(True) self.setAutoRaise(True)