[chronojump] At session load an animation "Loading" is shown



commit 7972f52f3139e38eede40dded620df8978134936
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Apr 1 10:31:48 2020 +0200

    At session load an animation "Loading" is shown

 glade/app1.glade                     | 125 ++++++++++++++++++++++++-----------
 src/gui/app1/sessionLoadAndImport.cs |  24 +++++--
 2 files changed, 103 insertions(+), 46 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 756739a0..d863dc39 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -2125,7 +2125,7 @@
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="label_xalign">0</property>
-                                                            <property name="shadow_type">none</property>
+                                                            <property name="shadow_type">in</property>
                                                             <child>
                                                             <widget class="GtkAlignment" id="alignment52">
                                                             <property name="visible">True</property>
@@ -24759,6 +24759,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27080,6 +27083,18 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
+                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_capturing">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -27116,18 +27131,6 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_no_capturing">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -34660,6 +34663,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -35960,7 +35966,7 @@ then click this button.</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkHBox" id="hbox386">
+                                                  <widget class="GtkHBox" id="app1s_hbox_load_controls">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                     <property name="spacing">10</property>
@@ -36080,48 +36086,89 @@ then click this button.</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkHButtonBox" 
id="app1s_hbuttonbox_page2_load">
+                                                  <widget class="GtkNotebook" 
id="app1s_notebook_load_button_animation">
                                                     <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="layout_style">spread</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="show_tabs">False</property>
+                                                    <property name="show_border">False</property>
                                                     <child>
-                                                      <widget class="GtkButton" id="app1s_button_cancel">
-                                                        <property name="label">gtk-cancel</property>
+                                                      <widget class="GtkHButtonBox" 
id="app1s_hbuttonbox_page2_load">
                                                         <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="can_default">True</property>
-                                                        <property name="receives_default">False</property>
-                                                        <property name="use_stock">True</property>
-                                                        <signal name="clicked" 
handler="app1s_on_button_cancel2_clicked" swapped="no"/>
-                                                        <accelerator key="Escape" signal="clicked"/>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="layout_style">spread</property>
+                                                        <child>
+                                                          <widget class="GtkButton" id="app1s_button_cancel">
+                                                            <property name="label">gtk-cancel</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="can_default">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="use_stock">True</property>
+                                                            <signal name="clicked" 
handler="app1s_on_button_cancel2_clicked" swapped="no"/>
+                                                            <accelerator key="Escape" signal="clicked"/>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkButton" id="app1s_button_accept">
+                                                            <property name="label">gtk-ok</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="can_default">True</property>
+                                                            <property name="has_default">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="use_stock">True</property>
+                                                            <signal name="clicked" 
handler="app1s_on_button_accept_clicked" swapped="no"/>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
+                                                        </child>
+                                                      </widget>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label468">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="label" translatable="yes">page 
1</property>
                                                       </widget>
                                                       <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">0</property>
+                                                        <property name="tab_fill">False</property>
+                                                        <property name="type">tab</property>
                                                       </packing>
                                                     </child>
                                                     <child>
-                                                      <widget class="GtkButton" id="app1s_button_accept">
-                                                        <property name="label">gtk-ok</property>
+                                                      <widget class="GtkLabel" id="label470">
                                                         <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="can_default">True</property>
-                                                        <property name="has_default">True</property>
-                                                        <property name="receives_default">False</property>
-                                                        <property name="use_stock">True</property>
-                                                        <signal name="clicked" 
handler="app1s_on_button_accept_clicked" swapped="no"/>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="label" 
translatable="yes">Loading</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="position">1</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label469">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="label" translatable="yes">page 
2</property>
                                                       </widget>
                                                       <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
                                                         <property name="position">1</property>
+                                                        <property name="tab_fill">False</property>
+                                                        <property name="type">tab</property>
                                                       </packing>
                                                     </child>
                                                   </widget>
                                                   <packing>
                                                     <property name="expand">False</property>
-                                                    <property name="fill">True</property>
+                                                    <property name="fill">False</property>
                                                     <property name="position">4</property>
                                                   </packing>
                                                 </child>
diff --git a/src/gui/app1/sessionLoadAndImport.cs b/src/gui/app1/sessionLoadAndImport.cs
index 09a76832..ab3a838f 100644
--- a/src/gui/app1/sessionLoadAndImport.cs
+++ b/src/gui/app1/sessionLoadAndImport.cs
@@ -79,8 +79,9 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.CheckButton app1s_checkbutton_show_data_jump_run;
        [Widget] Gtk.CheckButton app1s_checkbutton_show_data_other_tests;
        [Widget] Gtk.Label app1s_file_path_import;
-       [Widget] Gtk.HButtonBox app1s_hbuttonbox_page2_load;
+       [Widget] Gtk.Notebook app1s_notebook_load_button_animation;
        [Widget] Gtk.HButtonBox app1s_hbuttonbox_page2_import;
+       [Widget] Gtk.HBox app1s_hbox_load_controls;
 
        //notebook tab 3
        [Widget] Gtk.Label app1s_label_import_session_name;
@@ -108,14 +109,15 @@ public partial class ChronoJumpWindow
        {
                if (app1s_type == app1s_windowType.LOAD_SESSION) {
                        app1s_file_path_import.Visible = false;
-                       app1s_hbuttonbox_page2_load.Visible = true;
+                       app1s_notebook_load_button_animation.Visible = true;
                        app1s_hbuttonbox_page2_import.Visible = false;
                        app1s_label_select.Text = "<b>" + Catalog.GetString ("Load session") + "</b>";
                        app1s_label_select.UseMarkup = true;
                        app1s_notebook.CurrentPage = app1s_PAGE_SELECT_SESSION;
+                       app1s_notebook_load_button_animation.CurrentPage = 0;
                } else {
                        app1s_file_path_import.Visible = true;
-                       app1s_hbuttonbox_page2_load.Visible = false;
+                       app1s_notebook_load_button_animation.Visible = false;
                        app1s_hbuttonbox_page2_import.Visible = true;
                        //session_load.Title = Catalog.GetString ("Import session");
                        app1s_button_select_file_import_same_database.Visible = false; //is shown when user 
want to import a second session
@@ -602,15 +604,23 @@ public partial class ChronoJumpWindow
                }
        }
        
-       void app1s_on_button_accept_clicked (object o, EventArgs args)
+       private void app1s_on_button_accept_clicked (object o, EventArgs args)
        {
                if(app1s_selected != "-1")
                {
-                       currentSession = SqliteSession.Select (app1s_selected);
-                       on_load_session_accepted();
-                       notebook_supSetOldPage();
+                       app1s_notebook_load_button_animation.CurrentPage = 1;
+                       GLib.Timeout.Add(1000, new GLib.TimeoutHandler(app1s_on_button_accept_clicked_do));
                }
        }
+       private bool app1s_on_button_accept_clicked_do ()
+       {
+               currentSession = SqliteSession.Select (app1s_selected);
+               on_load_session_accepted();
+               notebook_supSetOldPage();
+               app1s_notebook_load_button_animation.CurrentPage = 0;
+
+               return false; //do not call this again
+       }
 
        // ---- notebook page 3 (import) buttons ----
        void app1s_on_button_back_clicked (object o, EventArgs args)


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