[bijiben] Rough spinner



commit 74a255e8541a2f83aea5a4c2729fc667c1f00974
Author: Pierre-Yves Luyten <py luyten fr>
Date:   Mon Apr 15 09:46:03 2013 +0200

    Rough spinner
    
    Main view shows a spinner before loading all notes. Spinner is not that cool but should not appear for a 
long time.

 src/bjb-app-menu.c    | 5 ++++-
 src/bjb-window-base.c | 8 ++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/bjb-app-menu.c b/src/bjb-app-menu.c
index 4f410c6..2faf4dc 100644
--- a/src/bjb-app-menu.c
+++ b/src/bjb-app-menu.c
@@ -46,7 +46,10 @@ new_activated (GSimpleAction *action,
                GVariant      *parameter,
                gpointer       user_data)
 {
-  bjb_window_base_new();
+  BjbWindowBase *win;
+
+  win = BJB_WINDOW_BASE (bjb_window_base_new());
+  bjb_window_base_switch_to (win, BJB_MAIN_VIEW);
 }
 
 /* Import external data - TODO : BJB_TYPE_IMPORT_DIALOG.c */
diff --git a/src/bjb-window-base.c b/src/bjb-window-base.c
index 55ed946..da81126 100644
--- a/src/bjb-window-base.c
+++ b/src/bjb-window-base.c
@@ -28,6 +28,8 @@ struct _BjbWindowBasePriv
    * The Notebook always has a main view.
    * When editing a note, it _also_ has a note view */
   GdStack              *stack;
+  GtkWidget            *spinner; // this spinner takes the whole place
+                                 // and only shows on startup
   BjbWindowViewType     current_view;
   BjbMainView          *view;
   gchar                *entry;
@@ -128,6 +130,12 @@ bjb_window_base_constructed (GObject *obj)
   priv->stack = GD_STACK (gd_stack_new ());
   gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (priv->stack));
 
+  priv->spinner = gtk_spinner_new ();
+  gd_stack_add_named (priv->stack, priv->spinner, "spinner");
+  gd_stack_set_visible_child_name (priv->stack, "spinner");
+  gtk_widget_show (priv->spinner);
+  gtk_spinner_start (GTK_SPINNER (priv->spinner));
+
   /* Signals */
   g_signal_connect(GTK_WIDGET(self),"destroy",
                    G_CALLBACK(bjb_window_base_destroy),self);


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