Added changelog link to app menu

parent f74db020
Version 0.12.0
==============
Released: 2019-02-16
Released: 2019-02-17
* Using NV-CONTROL instead of NVML, when possible, to provide better
compatibility with older cards
* Fix #11: Power limit Apply should check exit code
* Added changelog link to app menu
* Fix #9: The Close button in the About dialog box does not work on KDE
* Fix #11: Power limit Apply should check exit code
* Fix #34: Graph max sample based on refresh interval
Version 0.11.0
==============
......
......@@ -27,14 +27,16 @@
<url type="bugtracker">https://gitlab.com/leinardi/gwe/issues</url>
<update_contact>roberto@leinardi.com</update_contact>
<releases>
<release date="2019-02-16" version="0.12.0">
<release date="2019-02-17" version="0.12.0">
<description>
<ul>
<li>Using NV-CONTROL instead of NVML, when possible, to provide better compatibility with older
cards
</li>
<li>Fix #11: Power limit Apply should check exit code</li>
<li>Added changelog link to app menu</li>
<li>Fix #9: The Close button in the About dialog box does not work on KDE</li>
<li>Fix #11: Power limit Apply should check exit code</li>
<li>Fix #34: Graph max sample based on refresh interval</li>
</ul>
</description>
</release>
......
......@@ -57,6 +57,15 @@ along with gwe. If not, see <http://www.gnu.org/licenses/>.
<signal name="activate" handler="on_menu_settings_clicked" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Changelog</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu_changelog_clicked" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
......
......@@ -26,7 +26,7 @@ from rx.concurrency import GtkScheduler, ThreadPoolScheduler
from rx.concurrency.schedulerbase import SchedulerBase
from rx.disposables import CompositeDisposable
from gwe.conf import APP_NAME, APP_SOURCE_URL
from gwe.conf import APP_NAME, APP_SOURCE_URL, APP_VERSION
from gwe.di import FanProfileChangedSubject, SpeedStepChangedSubject, OverclockProfileChangedSubject
from gwe.interactor import GetStatusInteractor, SettingsInteractor, \
CheckNewVersionInteractor, SetOverclockInteractor, SetPowerLimitInteractor, SetFanSpeedInteractor
......@@ -36,7 +36,7 @@ from gwe.presenter.edit_fan_profile import EditFanProfilePresenter
from gwe.presenter.edit_overclock_profile import EditOverclockProfilePresenter
from gwe.presenter.historical_data import HistoricalDataPresenter
from gwe.presenter.preferences import PreferencesPresenter
from gwe.util.view import show_notification
from gwe.util.view import show_notification, open_uri
LOG = logging.getLogger(__name__)
_ADD_NEW_PROFILE_INDEX = -10
......@@ -187,6 +187,9 @@ class MainPresenter:
def on_menu_settings_clicked(self, *_: Any) -> None:
self._preferences_presenter.show()
def on_menu_changelog_clicked(self, *_: Any) -> None:
open_uri(self._get_changelog_uri())
def on_menu_about_clicked(self, *_: Any) -> None:
self.main_view.show_about_dialog()
......@@ -444,9 +447,13 @@ class MainPresenter:
def _handle_new_version_response(self, version: Optional[str]) -> None:
if version is not None:
message = "%s version <b>%s</b> is available! Click <a href=\"%s/blob/%s/CHANGELOG.md\"><b>here</b></a> " \
"to see what's new." % (APP_NAME, version, APP_SOURCE_URL, version)
message = "%s version <b>%s</b> is available! Click <a href=\"%s\"><b>here</b></a> " \
"to see what's new." % (APP_NAME, version, self._get_changelog_uri(version))
self.main_view.show_main_infobar_message(message, True)
message = "%s version <b>%s</b> is available! Click here to see what's new: %s/blob/%s/CHANGELOG.md" \
% (APP_NAME, version, APP_SOURCE_URL, version)
message = "%s version <b>%s</b> is available! Click here to see what's new: %s" \
% (APP_NAME, version, self._get_changelog_uri(version))
show_notification("GWE update available!", message, "dialog-information")
@staticmethod
def _get_changelog_uri(version: str = APP_VERSION) -> str:
return "{}/blob/{}/CHANGELOG.md".format(APP_SOURCE_URL, version)
......@@ -116,3 +116,7 @@ def show_notification(summary: str, body: str, icon: str) -> None:
if Notify.init(APP_NAME):
hello = Notify.Notification.new(summary=summary, body=body, icon=icon)
hello.show()
def open_uri(uri: str, parent: Gtk.Window = None, timestamp: int = Gdk.CURRENT_TIME) -> None:
Gtk.show_uri_on_window(parent, uri, timestamp)
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