[gnome-games/wip/exalm/spinner: 43/45] ui: Use loading state instead of loading notification



commit 832ba664d945cda9fe8baf20cab11ff430490447
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Wed Sep 5 20:18:53 2018 +0500

    ui: Use loading state instead of loading notification

 src/ui/application-window.vala |  5 +++++
 src/ui/application.vala        | 11 +----------
 2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index c3e89698..238a2d49 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -714,4 +714,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                        critical (e.message);
                }
        }
+
+       public void on_collection_loaded () {
+               if (ui_state == UiState.LOADING)
+                       ui_state = UiState.COLLECTION;
+       }
 }
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 7d1797fe..80ac6158 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -233,15 +233,6 @@ public class Games.Application : Gtk.Application {
                        quit_application ();
                });
                window.show ();
-
-               GLib.Timeout.add (500, show_loading_notification);
-       }
-
-       private bool show_loading_notification () {
-               if (!game_list_loaded)
-                       window.loading_notification = true;
-
-               return false;
        }
 
        private void init_game_sources () {
@@ -339,7 +330,7 @@ public class Games.Application : Gtk.Application {
 
                game_list_loaded = true;
                if (window != null)
-                       window.loading_notification = false;
+                       window.on_collection_loaded ();
        }
 
        private void preferences () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]