-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Application: modernize and set up locale
- Loading branch information
1 parent
c5b041d
commit 42ebe83
Showing
4 changed files
with
30 additions
and
32 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
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,19 +1,6 @@ | ||
// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- | ||
/*- | ||
* Copyright (c) 2016–2018 elementary LLC. (https://elementary.io) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
* SPDX-FileCopyrightText: 2016-2024 elementary, Inc. (https://elementary.io) | ||
* | ||
* Authored by: Corentin Noël <[email protected]> | ||
*/ | ||
|
@@ -26,10 +13,19 @@ public class Installer.App : Gtk.Application { | |
|
||
public static bool test_mode; | ||
|
||
public App () { | ||
Object ( | ||
application_id: "io.elementary.installer", | ||
flags: ApplicationFlags.FLAGS_NONE | ||
); | ||
} | ||
|
||
construct { | ||
application_id = "io.elementary.installer"; | ||
flags = ApplicationFlags.FLAGS_NONE; | ||
Intl.setlocale (LocaleCategory.ALL, ""); | ||
GLib.Intl.setlocale (LocaleCategory.ALL, ""); | ||
GLib.Intl.bindtextdomain (application_id, Build.LOCALEDIR); | ||
GLib.Intl.bind_textdomain_codeset (application_id, "UTF-8"); | ||
GLib.Intl.textdomain (application_id); | ||
|
||
add_main_option_entries (INSTALLER_OPTIONS); | ||
} | ||
|
||
|
@@ -44,6 +40,14 @@ public class Installer.App : Gtk.Application { | |
css_provider, | ||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION | ||
); | ||
|
||
var css_fallback = new Gtk.CssProvider (); | ||
css_fallback.load_from_resource ("io/elementary/installer/disk-bar-fallback.css"); | ||
Gtk.StyleContext.add_provider_for_screen ( | ||
Gdk.Screen.get_default (), | ||
css_fallback, | ||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION | ||
); | ||
} | ||
|
||
public override void activate () { | ||
|
@@ -57,17 +61,6 @@ public class Installer.App : Gtk.Application { | |
window.show_all (); | ||
add_window (window); | ||
|
||
weak Gtk.IconTheme default_theme = Gtk.IconTheme.get_default (); | ||
default_theme.add_resource_path ("/io/elementary/installer"); | ||
|
||
var css_fallback = new Gtk.CssProvider (); | ||
css_fallback.load_from_resource ("io/elementary/installer/disk-bar-fallback.css"); | ||
Gtk.StyleContext.add_provider_for_screen ( | ||
Gdk.Screen.get_default (), | ||
css_fallback, | ||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION | ||
); | ||
|
||
inhibit ( | ||
get_active_window (), | ||
Gtk.ApplicationInhibitFlags.IDLE | Gtk.ApplicationInhibitFlags.SUSPEND, | ||
|
@@ -77,6 +70,5 @@ public class Installer.App : Gtk.Application { | |
} | ||
|
||
public static int main (string[] args) { | ||
var application = new Installer.App (); | ||
return application.run (args); | ||
return new Installer.App ().run (args); | ||
} |
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
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