-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Application: subclass Gtk.Application (#728)
- Loading branch information
1 parent
0ce8fce
commit c09e7f9
Showing
1 changed file
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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); | ||
} | ||
} |