[chronojump] Code reorg



commit 95f9407503064fbb3b7170fd0cf55c12ffe36f1c
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Apr 9 11:49:48 2020 +0200

    Code reorg

 po/POTFILES.in                                     |  2 +-
 src/Makefile.am                                    |  5 +-
 .../app1/{sessionDelete.cs => session/delete.cs}   |  0
 .../loadAndImport.cs}                              | 51 -------------
 src/gui/app1/session/main.cs                       | 83 ++++++++++++++++++++++
 5 files changed, 87 insertions(+), 54 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 19135b57..352bb6a1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -70,7 +70,7 @@ src/gui/app1/jumpsWeightFVProfile.cs
 src/gui/app1/pulse.cs
 src/gui/app1/reactionTime.cs
 src/gui/app1/run.cs
-src/gui/app1/sessionLoadAndImport.cs
+src/gui/app1/session/loadAndImport.cs
 src/gui/chronopic.cs
 src/gui/chronopicRegister.cs
 src/gui/confirm.cs
diff --git a/src/Makefile.am b/src/Makefile.am
index 1658825a..6b52eb3d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,8 +17,9 @@ SOURCES = \
        gui/app1/contactsExercise.cs\
        gui/app1/forceSensor.cs\
        gui/app1/forceSensorAnalyze.cs\
-       gui/app1/sessionLoadAndImport.cs\
-       gui/app1/sessionDelete.cs\
+       gui/app1/session/delete.cs\
+       gui/app1/session/loadAndImport.cs\
+       gui/app1/session/main.cs\
        gui/app1/jump.cs\
        gui/app1/menu.cs\
        gui/app1/menu_tiny.cs\
diff --git a/src/gui/app1/sessionDelete.cs b/src/gui/app1/session/delete.cs
similarity index 100%
rename from src/gui/app1/sessionDelete.cs
rename to src/gui/app1/session/delete.cs
diff --git a/src/gui/app1/sessionLoadAndImport.cs b/src/gui/app1/session/loadAndImport.cs
similarity index 92%
rename from src/gui/app1/sessionLoadAndImport.cs
rename to src/gui/app1/session/loadAndImport.cs
index 7d39375d..4bd775ae 100644
--- a/src/gui/app1/sessionLoadAndImport.cs
+++ b/src/gui/app1/session/loadAndImport.cs
@@ -43,7 +43,6 @@ public partial class ChronoJumpWindow
        private string app1s_import_file_path;
        private int app1s_notebook_sup_entered_from; //to store from which page we entered (to return at it)
 
-       [Widget] Gtk.Notebook app1s_notebook;
        [Widget] Gtk.Label app1s_label_select;
 
        /*
@@ -60,52 +59,8 @@ public partial class ChronoJumpWindow
         * fakeButton_cancel_maybeDatabaseSwitched.Click();
         */
 
-       //notebook tab 0
-       //notebook tab 1
-       [Widget] Gtk.HBox hbox_session_more;
-       [Widget] Gtk.VBox vbox_session_overview;
-       [Widget] Gtk.RadioButton app1s_radio_import_new_session;
-       [Widget] Gtk.RadioButton app1s_radio_import_current_session;
-       [Widget] Gtk.Image app1s_image_open_database;
-       [Widget] Gtk.Label app1s_label_open_database_file;
-       [Widget] Gtk.Button app1s_button_select_file_import_same_database;
-
-       //notebook tab 2
-       [Widget] Gtk.TreeView app1s_treeview_session_load;
-       [Widget] Gtk.Button app1s_button_accept;
-       [Widget] Gtk.Button app1s_button_import;
-       [Widget] Gtk.Image app1s_image_import;
-       [Widget] Gtk.Entry app1s_entry_search_filter;
-       [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.Notebook app1s_notebook_load_button_animation;
-       [Widget] Gtk.HButtonBox app1s_hbuttonbox_page2_import;
-       [Widget] Gtk.VBox app1s_vbox_notebook_load;
-
-       //notebook tab 3
-       [Widget] Gtk.Label app1s_label_import_session_name;
-       [Widget] Gtk.Label app1s_label_import_file;
-       [Widget] Gtk.Button app1s_button_import_confirm_accept;
-
-       //notebook tab 4
-       [Widget] Gtk.ProgressBar app1s_progressbarImport;
-       [Widget] Gtk.Label app1s_label_import_done_at_new_session;
-       [Widget] Gtk.Label app1s_label_import_done_at_current_session;
-       [Widget] Gtk.ScrolledWindow app1s_scrolledwindow_import_error;
-       [Widget] Gtk.TextView app1s_textview_import_error;
-       [Widget] Gtk.Image app1s_image_import1;
-       [Widget] Gtk.HButtonBox app1s_hbuttonbox_page4;
-
        private app1s_windowType app1s_type;
 
-       const int app1s_PAGE_MODES = 0;
-       const int app1s_PAGE_IMPORT_START = 1;
-       const int app1s_PAGE_SELECT_SESSION = 2; //for load session and for import
-       public const int app1s_PAGE_IMPORT_CONFIRM = 3;
-       public const int app1s_PAGE_IMPORT_RESULT = 4;
-       public const int app1s_PAGE_DELETE_CONFIRM = 5;
-
        private void app1s_initializeGui()
        {
                if (app1s_type == app1s_windowType.LOAD_SESSION) {
@@ -561,12 +516,6 @@ public partial class ChronoJumpWindow
                        notebook_start_selector.CurrentPage = 0;
        }
 
-       // ---- notebook page 0 buttons ----
-       void app1s_on_button_close0_clicked (object o, EventArgs args)
-       {
-               menus_sensitive_import_not_danger(true);
-               notebook_supSetOldPage();
-       }
 
        // ---- notebook page 1 buttons ----
        void app1s_on_button_cancel1_clicked (object o, EventArgs args)
diff --git a/src/gui/app1/session/main.cs b/src/gui/app1/session/main.cs
new file mode 100644
index 00000000..d8e17c95
--- /dev/null
+++ b/src/gui/app1/session/main.cs
@@ -0,0 +1,83 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * ChronoJump 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 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * ChronoJump 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, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Copyright (C) 2004-2019   Xavier de Blas <xaviblas gmail com> 
+ */
+
+using System;
+using Gtk;
+using Glade;
+
+//here using app1s_ , "s" means session
+//this file has been moved from his old window to be part of app1 on Chronojump 2.0
+
+public partial class ChronoJumpWindow
+{
+       [Widget] Gtk.Notebook app1s_notebook;
+
+       //notebook tab 0
+       //notebook tab 1
+       [Widget] Gtk.HBox hbox_session_more;
+       [Widget] Gtk.VBox vbox_session_overview;
+       [Widget] Gtk.RadioButton app1s_radio_import_new_session;
+       [Widget] Gtk.RadioButton app1s_radio_import_current_session;
+       [Widget] Gtk.Image app1s_image_open_database;
+       [Widget] Gtk.Label app1s_label_open_database_file;
+       [Widget] Gtk.Button app1s_button_select_file_import_same_database;
+
+       //notebook tab 2
+       [Widget] Gtk.TreeView app1s_treeview_session_load;
+       [Widget] Gtk.Button app1s_button_accept;
+       [Widget] Gtk.Button app1s_button_import;
+       [Widget] Gtk.Image app1s_image_import;
+       [Widget] Gtk.Entry app1s_entry_search_filter;
+       [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.Notebook app1s_notebook_load_button_animation;
+       [Widget] Gtk.HButtonBox app1s_hbuttonbox_page2_import;
+       [Widget] Gtk.VBox app1s_vbox_notebook_load;
+
+       //notebook tab 3
+       [Widget] Gtk.Label app1s_label_import_session_name;
+       [Widget] Gtk.Label app1s_label_import_file;
+       [Widget] Gtk.Button app1s_button_import_confirm_accept;
+
+       //notebook tab 4
+       [Widget] Gtk.ProgressBar app1s_progressbarImport;
+       [Widget] Gtk.Label app1s_label_import_done_at_new_session;
+       [Widget] Gtk.Label app1s_label_import_done_at_current_session;
+       [Widget] Gtk.ScrolledWindow app1s_scrolledwindow_import_error;
+       [Widget] Gtk.TextView app1s_textview_import_error;
+       [Widget] Gtk.Image app1s_image_import1;
+       [Widget] Gtk.HButtonBox app1s_hbuttonbox_page4;
+
+       const int app1s_PAGE_MODES = 0;
+       const int app1s_PAGE_IMPORT_START = 1;
+       const int app1s_PAGE_SELECT_SESSION = 2; //for load session and for import
+       public const int app1s_PAGE_IMPORT_CONFIRM = 3;
+       public const int app1s_PAGE_IMPORT_RESULT = 4;
+       public const int app1s_PAGE_DELETE_CONFIRM = 5;
+
+
+       // ---- notebook page 0 buttons ----
+       void app1s_on_button_close0_clicked (object o, EventArgs args)
+       {
+               menus_sensitive_import_not_danger(true);
+               notebook_supSetOldPage();
+       }
+}


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