2024-10-11 09:09:47 +00:00
|
|
|
Wavelet.Subsonic public_api;
|
2024-10-06 11:21:53 +00:00
|
|
|
|
|
|
|
public class Wavelet.Application : Adw.Application {
|
|
|
|
public Application () {
|
|
|
|
Object (
|
|
|
|
application_id: "eu.callcc.Wavelet",
|
|
|
|
flags: ApplicationFlags.DEFAULT_FLAGS
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
construct {
|
|
|
|
ActionEntry[] action_entries = {
|
|
|
|
{ "about", this.on_about_action },
|
|
|
|
{ "preferences", this.on_preferences_action },
|
|
|
|
{ "quit", this.quit }
|
|
|
|
};
|
|
|
|
this.add_action_entries (action_entries, this);
|
|
|
|
this.set_accels_for_action ("app.quit", {"<primary>q"});
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void activate () {
|
|
|
|
base.activate ();
|
2024-10-12 12:28:05 +00:00
|
|
|
// if this.active_window not null, this isnt the primary instance
|
|
|
|
var win = this.active_window ?? new Wavelet.Window (this);
|
2024-10-06 11:21:53 +00:00
|
|
|
win.present ();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void on_about_action () {
|
|
|
|
string[] developers = { "Erica Z" };
|
|
|
|
var about = new Adw.AboutDialog () {
|
|
|
|
application_name = "wavelet",
|
|
|
|
application_icon = "eu.callcc.Wavelet",
|
|
|
|
developer_name = "Erica Z",
|
|
|
|
translator_credits = _("translator-credits"),
|
2024-10-12 12:28:05 +00:00
|
|
|
version = "0.1.0", // WAVELET_VERSION
|
2024-10-06 11:21:53 +00:00
|
|
|
developers = developers,
|
|
|
|
copyright = "© 2024 Erica Z",
|
|
|
|
};
|
|
|
|
|
|
|
|
about.present (this.active_window);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void on_preferences_action () {
|
|
|
|
message ("app.preferences action activated");
|
|
|
|
}
|
|
|
|
}
|