Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application: subclass Gtk.Application #728

Merged
merged 11 commits into from
Oct 5, 2024
35 changes: 23 additions & 12 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,32 @@
* 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
);
}

var settings_daemon = new Greeter.SettingsDaemon ();
settings_daemon.start ();
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);
}

Gtk.init (ref args);
public static int main (string[] args) {
var settings_daemon = new Greeter.SettingsDaemon ();
settings_daemon.start ();

var window = new Greeter.MainWindow ();
window.show_all ();
Gtk.init (ref args);

Gtk.main ();
var window = new Greeter.MainWindow ();
window.show_all ();

return 0;
Gtk.main ();

return new Greeter.Application ().run (args);
}
}