Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
Improved the whats new dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
haecker-felix committed Sep 23, 2016
1 parent 6bbfb3b commit b548c3b
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ set (ICON_NAME ${CMAKE_PROJECT_NAME})
set (APP_NAME "Gradio")
set (GENERIC_NAME "Internet Radio")
set (COMMENT "Listen to radio stations worldwide")
set (VERSION "5.0 Beta 1")
set (VERSION_INFO "Stable")
set (VERSION "5_0_0_Beta_1")
set (VERSION_INFO "5.0.0 Beta 1")

# where we install data directory (if we have any)
include (GNUInstallDirs)
Expand Down
6 changes: 0 additions & 6 deletions data/ui/discover-box.ui
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@
</packing>
</child>
</object>
<packing>
<property name="index">-1</property>
</packing>
</child>
<child type="overlay">
<object class="GtkBox" id="SidebarBox">
Expand All @@ -175,9 +172,6 @@
<placeholder/>
</child>
</object>
<packing>
<property name="pass_through">True</property>
</packing>
</child>
</object>
<packing>
Expand Down
4 changes: 2 additions & 2 deletions data/ui/release-notes.ui
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="VersionLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
Expand Down Expand Up @@ -158,7 +158,7 @@
<object class="GtkHeaderBar" id="Header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title">Release Notes</property>
<property name="title">What's New?</property>
</object>
</child>
</template>
Expand Down
165 changes: 165 additions & 0 deletions data/ui/release-notes.ui~
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.14"/>
<template class="GradioReleaseNotes" parent="GtkWindow">
<property name="width_request">500</property>
<property name="height_request">400</property>
<property name="can_focus">False</property>
<property name="modal">True</property>
<property name="window_position">center-always</property>
<property name="skip_taskbar_hint">True</property>
<property name="skip_pager_hint">True</property>
<property name="urgency_hint">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<child>
<object class="GtkButton" id="MoreInformationButton">
<property name="label">gtk-info</property>
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="MoreInformationButton_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="CloseButton">
<property name="label">gtk-close</property>
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="margin_left">5</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="CloseButton_clicked" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="icon_name">gradio</property>
<property name="icon_size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="VersionLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Gradio 5.0.1 Beta 1</property>
<attributes>
<attribute name="font-desc" value="&lt;Geben Sie den Wert ein&gt; 20"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<child>
<object class="GtkBox" id="Placeholder">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="Header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title">Release Notes</property>
</object>
</child>
</template>
</interface>
2 changes: 1 addition & 1 deletion po/gradio.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-23 18:27+0200\n"
"POT-Creation-Date: 2016-09-23 20:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
4 changes: 2 additions & 2 deletions src/Config.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace Constants {
public const string PKG_DATADIR = "/usr/share/gradio";
public const string GETTEXT_PACKAGE = "gradio";
public const string RELEASE_NAME = "";
public const string VERSION = "5.0 Beta 1";
public const string VERSION_INFO = "Stable";
public const string VERSION = "5_0_0_Beta_1";
public const string VERSION_INFO = "5.0.0 Beta 1";
public const string INSTALL_PREFIX = "/usr";
public const string APP_NAME = "Gradio";
public const string EXEC_NAME = "gradio";
Expand Down
8 changes: 6 additions & 2 deletions src/Gradio.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace Gradio {
private Gtk.Menu menuSystem;

public App () {
settings = new GLib.Settings ("de.haecker-felix.gradio");
Object(application_id: "de.haeckerfelix.gradio", flags: ApplicationFlags.FLAGS_NONE);
}

Expand All @@ -40,7 +41,6 @@ namespace Gradio {
create_app_menu();

player = new AudioPlayer();
settings = new GLib.Settings ("de.haecker-felix.gradio");

mpris = new MPRIS();
mpris.initialize();
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace Gradio {
"title", _("About Gradio"),
"license-type", Gtk.License.GPL_3_0,
"logo-icon-name", "gradio",
"version", Constants.VERSION,
"version", Constants.VERSION_INFO,
"comments", "Database: www.radio-browser.info",
"website", "https://github.com/haecker-felix/gradio",
"wrap-license", true);
Expand Down Expand Up @@ -170,6 +170,10 @@ namespace Gradio {
trayicon.popup_menu.connect(app.menuSystem_popup);

// Show release notes if neccesary
if(settings != null)
message("Release notes: " + settings.get_string("release-notes"));

message("Current: " + Constants.VERSION);
if(!(settings.get_string("release-notes") == Constants.VERSION)){
ReleaseNotes rn = new ReleaseNotes();
rn.show();
Expand Down
8 changes: 7 additions & 1 deletion src/Widgets/ReleaseNotes.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace Gradio{
[GtkChild]
private Box Placeholder;

[GtkChild]
private Label VersionLabel;

private WebView notes;

public ReleaseNotes(){
Expand All @@ -33,14 +36,17 @@ namespace Gradio{
notes = new WebView();
Placeholder.add(notes);

VersionLabel.set_text(Constants.VERSION_INFO);

notes.show();
notes.set_vexpand(true);

notes.load_uri("https://gradio.haecker-felix.de/release_notes.html");
notes.load_uri("https://gradio.haecker-felix.de/release_notes/"+Constants.VERSION+".html");
}

[GtkCallback]
private void CloseButton_clicked (Button button){
App.settings.set_string("release-notes", Constants.VERSION);
this.close();
}

Expand Down

0 comments on commit b548c3b

Please sign in to comment.