Commit 0527eced authored by Dan Pascu's avatar Dan Pascu

Added donate menu entry and implemented opening of external URLs from menu

parent 8ce39db4
...@@ -8,8 +8,9 @@ __all__ = ['MainWindow'] ...@@ -8,8 +8,9 @@ __all__ = ['MainWindow']
from functools import partial from functools import partial
from PyQt4 import uic from PyQt4 import uic
from PyQt4.QtCore import Qt, QVariant from PyQt4.QtCore import Qt, QUrl, QVariant
from PyQt4.QtGui import QAction, QActionGroup, QBrush, QColor, QFontMetrics, QPainter, QPen, QPixmap, QShortcut, QStyle, QStyleOptionComboBox, QStyleOptionFrameV2 from PyQt4.QtGui import QAction, QActionGroup, QDesktopServices, QShortcut
from PyQt4.QtGui import QBrush, QColor, QFontMetrics, QPainter, QPen, QPixmap, QStyle, QStyleOptionComboBox, QStyleOptionFrameV2
from application.notification import IObserver, NotificationCenter from application.notification import IObserver, NotificationCenter
from application.python.util import Null from application.python.util import Null
...@@ -112,6 +113,7 @@ class MainWindow(base_class, ui_class): ...@@ -112,6 +113,7 @@ class MainWindow(base_class, ui_class):
self.search_box.shortcut.setKey('CTRL+F') self.search_box.shortcut.setKey('CTRL+F')
self.search_box.shortcut.activated.connect(self.search_box.setFocus) self.search_box.shortcut.activated.connect(self.search_box.setFocus)
# menu actions
self.about_action.triggered.connect(self.about_panel.show) self.about_action.triggered.connect(self.about_panel.show)
self.add_account_action.triggered.connect(self.add_account_dialog.open_for_add) self.add_account_action.triggered.connect(self.add_account_dialog.open_for_add)
self.mute_action.triggered.connect(self._SH_MuteButtonClicked) self.mute_action.triggered.connect(self._SH_MuteButtonClicked)
...@@ -119,6 +121,11 @@ class MainWindow(base_class, ui_class): ...@@ -119,6 +121,11 @@ class MainWindow(base_class, ui_class):
self.silent_action.triggered.connect(self._SH_SilentButtonClicked) self.silent_action.triggered.connect(self._SH_SilentButtonClicked)
self.quit_action.triggered.connect(self.close) self.quit_action.triggered.connect(self.close)
# menu actions that link to external web pages
self.donate_action.triggered.connect(partial(QDesktopServices.openUrl, QUrl(u'http://icanblink.com/payments.phtml')))
self.help_action.triggered.connect(partial(QDesktopServices.openUrl, QUrl(u'http://icanblink.com/help.phtml')))
self.release_notes_action.triggered.connect(partial(QDesktopServices.openUrl, QUrl(u'http://icanblink.com/changelog.phtml')))
self.idle_status_index = 0 self.idle_status_index = 0
self.output_devices_group = QActionGroup(self) self.output_devices_group = QActionGroup(self)
......
...@@ -921,6 +921,7 @@ padding: 2px;</string> ...@@ -921,6 +921,7 @@ padding: 2px;</string>
</widget> </widget>
<addaction name="about_action"/> <addaction name="about_action"/>
<addaction name="check_for_updates_action"/> <addaction name="check_for_updates_action"/>
<addaction name="donate_action"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="preferences_action"/> <addaction name="preferences_action"/>
<addaction name="quick_settings_menu"/> <addaction name="quick_settings_menu"/>
...@@ -1212,6 +1213,11 @@ padding: 2px;</string> ...@@ -1212,6 +1213,11 @@ padding: 2px;</string>
<string>&amp;Manage accounts...</string> <string>&amp;Manage accounts...</string>
</property> </property>
</action> </action>
<action name="donate_action">
<property name="text">
<string>Donate if you like Blink</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment