1
[CCode(cname="GETTEXT_PACKAGE")] extern const string GETTEXT_PACKAGE;
5
const string[] authors = {
6
"Gustav \"Gego/XAREN\" Hartvigsson (+GustavHartvigsson)",
9
int main (string[] args) {
10
Intl.setlocale(LocaleCategory.MESSAGES, "");
11
Intl.textdomain(GETTEXT_PACKAGE);
12
Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "utf-8");
13
Intl.bindtextdomain(GETTEXT_PACKAGE, "./locale");
15
GLib.Environment.set_prgname (_("SAPG"));
17
var app = new SAPG.App ();
23
class App : Gtk.Application {
25
Object (application_id: "org.gego.sapg",
26
flags: GLib.ApplicationFlags.FLAGS_NONE);
30
SAPG.AppWinodw window;
47
this.window = new SAPG.AppWinodw (this);
48
this.window.resizable = false;
49
this.window.set_size_request (0,0);
50
this.window.destroy.connect (() => {
54
window.revealer.set_reveal_child (false);
56
this.window.tgl_btn_show_volume.toggled.connect (() => {
57
this.window.revealer.set_reveal_child (this.window.tgl_btn_show_volume.active);
63
var about_action = new GLib.SimpleAction ("about", null);
64
about_action.activate.connect (() => {
65
var about_dialogue = new SAPG.About (this.window);
66
about_dialogue.run ();
67
about_dialogue.destroy ();
70
var quit_action = new GLib.SimpleAction ("quit", null);
71
quit_action.activate.connect (() => {
72
this.window.destroy ();
76
this.add_action (about_action);
77
this.add_action (quit_action);
79
var app_menu = new GLib.Menu ();
80
app_menu.append ("About", "app.about");
81
app_menu.append ("Quit", "app.quit");
83
this.set_app_menu (app_menu);
87
this.window.show_all ();
95
[GtkTemplate(ui = "/org/gego/sapg/window.glade")]
96
public class AppWinodw : Gtk.ApplicationWindow {
99
public Gtk.Revealer revealer;
102
public Gtk.ToggleButton tgl_btn_show_volume;
104
public AppWinodw (Gtk.Application application) {
105
Object (application: application);
106
var icon_image = new Gtk.Image.from_resource ("/org/gego/sapg/icon.png");
107
Gtk.Window.set_default_icon (icon_image.get_pixbuf ());
112
public class About : Gtk.AboutDialog {
113
public About (Gtk.Window? window) {
114
this.program_name = GLib.Environment.get_prgname ();
115
this.logo = (new Gtk.Image.from_resource ("/org/gego/sapg/icon.png")).get_pixbuf ();
116
this.authors = SAPG.authors;
118
this.set_modal (true);
119
this.set_transient_for (window);