[gnome-games/wip/exalm/actions: 4/11] application: Move loading to startup()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/actions: 4/11] application: Move loading to startup()
- Date: Sun, 26 Jan 2020 17:11:03 +0000 (UTC)
commit 3d708094d9e82eadc53510677c0faf0691015091
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sun Jan 26 16:25:18 2020 +0500
application: Move loading to startup()
src/ui/application.vala | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/ui/application.vala b/src/ui/application.vala
index a343e428..cebc4882 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -12,6 +12,7 @@ public class Games.Application : Gtk.Application {
private bool game_list_loaded;
private GameCollection game_collection;
+ private ListStore list_store;
private CoverLoader cover_loader;
private Manette.Monitor manette_monitor;
@@ -197,22 +198,28 @@ public class Games.Application : Gtk.Application {
window.run_game (game);
}
- protected override void activate () {
- var icon_theme = Gtk.IconTheme.get_default ();
- icon_theme.add_resource_path ("/org/gnome/Games/gesture");
-
- Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
+ protected override void startup () {
+ base.startup ();
var screen = Gdk.Screen.get_default ();
var provider = load_css ("gtk-style.css");
Gtk.StyleContext.add_provider_for_screen (screen, provider, 600);
+ Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
+
+ var icon_theme = Gtk.IconTheme.get_default ();
+ icon_theme.add_resource_path ("/org/gnome/Games/gesture");
+
init_game_sources ();
load_game_list.begin ();
- cover_loader = new CoverLoader ();
- ListStore list_store = new ListStore (typeof (Game));
+
+ list_store = new ListStore (typeof (Game));
game_collection.game_added.connect (game => list_store.append (game));
+ cover_loader = new CoverLoader ();
+ }
+
+ protected override void activate () {
if (window != null) {
window.present_with_time (Gtk.get_current_event_time ());
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]