Skip to content

Commit

Permalink
Application: subclass Gtk.Application (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Oct 5, 2024
1 parent 0ce8fce commit c09e7f9
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions src/Application.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 elementary, Inc. (https://elementary.io)
* Copyright 2018-2024 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
Expand All @@ -19,18 +19,27 @@
* Authors: Corentin Noël <[email protected]>
*/

public int main (string[] args) {
Intl.setlocale (LocaleCategory.ALL, "");
Intl.bind_textdomain_codeset (Constants.GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (Constants.GETTEXT_PACKAGE);
Intl.bindtextdomain (Constants.GETTEXT_PACKAGE, Constants.LOCALE_DIR);
public class Greeter.Application : Gtk.Application {
public Application () {
Object (
application_id: "io.elementary.greeter",
flags: ApplicationFlags.FLAGS_NONE
);
}

Gtk.init (ref args);
construct {
Intl.setlocale (LocaleCategory.ALL, "");
Intl.bind_textdomain_codeset (Constants.GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (Constants.GETTEXT_PACKAGE);
Intl.bindtextdomain (Constants.GETTEXT_PACKAGE, Constants.LOCALE_DIR);
}

var window = new Greeter.MainWindow ();
window.show_all ();
public override void activate () {
add_window (new Greeter.MainWindow ());
active_window.show_all ();
}

Gtk.main ();

return 0;
public static int main (string[] args) {
return new Greeter.Application ().run (args);
}
}

0 comments on commit c09e7f9

Please sign in to comment.