39 lines
1.2 KiB
Vala
39 lines
1.2 KiB
Vala
public class Streamdeck.App : Gtk.Application {
|
|
public static GLib.Settings obs_settings { get; private set; }
|
|
public static GLib.Settings saved_state { get; private set; }
|
|
public static MainWindow main_window { get; private set; }
|
|
|
|
static construct {
|
|
obs_settings = new GLib.Settings ("dog.asonix.git.asonix.owo.obs");
|
|
saved_state = new GLib.Settings ("dog.asonix.git.asonix.owo.saved-state");
|
|
}
|
|
|
|
construct {
|
|
flags = ApplicationFlags.FLAGS_NONE;
|
|
application_id = "dog.asonix.git.asonix.owo";
|
|
|
|
var present_action = new SimpleAction ("app.present", null);
|
|
present_action.activate.connect (() => {
|
|
if (main_window != null) {
|
|
main_window.present_with_time ((uint32) GLib.get_monotonic_time ());
|
|
}
|
|
});
|
|
|
|
add_action (present_action);
|
|
}
|
|
|
|
protected override void activate () {
|
|
if (main_window == null) {
|
|
main_window = new MainWindow (this);
|
|
main_window.build_ui ();
|
|
add_window (main_window);
|
|
}
|
|
|
|
main_window.present ();
|
|
}
|
|
|
|
public static int main (string[] args) {
|
|
return new Streamdeck.App ().run (args);
|
|
}
|
|
}
|