[chronojump] encoderConfigurationWin button_close (removed cancel, accept)



commit 8287bed0684d29a506cc5882eb3462b69f41b1f0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Jan 8 12:52:30 2017 +0100

    encoderConfigurationWin button_close (removed cancel, accept)

 glade/app1.glade                  |    3 ++
 glade/encoder_configuration.glade |   48 ++++++++----------------------------
 src/gui/encoder.cs                |    6 ++--
 src/gui/encoderConfiguration.cs   |   33 ++++++++-----------------
 4 files changed, 28 insertions(+), 62 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index d87f4cc..6f54126 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -18374,6 +18374,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/glade/encoder_configuration.glade b/glade/encoder_configuration.glade
index 9531520..c0184b7 100644
--- a/glade/encoder_configuration.glade
+++ b/glade/encoder_configuration.glade
@@ -1113,40 +1113,9 @@ Eg. value = 2, means person does twice force at half speed.</property>
                 <property name="can_focus">False</property>
                 <property name="layout_style">spread</property>
                 <child>
-                  <widget class="GtkButton" id="button_cancel">
-                    <property name="label">gtk-cancel</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="use_stock">True</property>
-                    <signal name="clicked" handler="on_button_cancel_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="button_accept">
-                    <property name="label">gtk-ok</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_stock">True</property>
-                    <signal name="clicked" handler="on_button_accept_clicked" swapped="no"/>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="pack_type">end</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
                   <widget class="GtkButton" id="button_close">
                     <property name="label">gtk-close</property>
+                    <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
                     <property name="use_stock">True</property>
@@ -1156,7 +1125,7 @@ Eg. value = 2, means person does twice force at half speed.</property>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">2</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
               </widget>
@@ -1429,12 +1398,12 @@ Eg. value = 2, means person does twice force at half speed.</property>
                             <property name="can_focus">False</property>
                             <property name="spacing">20</property>
                             <child>
-                              <widget class="GtkButton" id="button_save">
-                                <property name="label" translatable="yes">Save</property>
+                              <widget class="GtkButton" id="button_apply">
+                                <property name="label" translatable="yes">Apply</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">True</property>
-                                <signal name="clicked" handler="on_button_save_clicked" swapped="no"/>
+                                <signal name="clicked" handler="on_button_apply_clicked" swapped="no"/>
                               </widget>
                               <packing>
                                 <property name="expand">True</property>
@@ -1452,7 +1421,12 @@ Eg. value = 2, means person does twice force at half speed.</property>
                       </widget>
                     </child>
                     <child>
-                      <placeholder/>
+                      <widget class="GtkLabel" id="label21">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Edit</property>
+                        <property name="use_markup">True</property>
+                      </widget>
                       <packing>
                         <property name="type">label_item</property>
                       </packing>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index ffc30c7..ee8ddb2 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -431,7 +431,7 @@ public partial class ChronoJumpWindow
                                currentEncoderGI, SqliteEncoderConfiguration.SelectActive(currentEncoderGI),
                                UtilGtk.ComboGetActive(combo_encoder_anchorage), (int) 
spin_encoder_im_weights_n.Value); //used on inertial
 
-               encoder_configuration_win.Button_accept.Clicked += new 
EventHandler(on_encoder_configuration_win_accepted);
+               encoder_configuration_win.Button_close.Clicked += new 
EventHandler(on_encoder_configuration_win_closed);
 
                //unregister eventHandler first, then register. This avoids to have registered twice
                try {
@@ -445,9 +445,9 @@ public partial class ChronoJumpWindow
                        new EventHandler(on_button_encoder_cancel_clicked);
        }
 
-       void on_encoder_configuration_win_accepted (object o, EventArgs args) 
+       void on_encoder_configuration_win_closed (object o, EventArgs args)
        {
-               encoder_configuration_win.Button_accept.Clicked -= new 
EventHandler(on_encoder_configuration_win_accepted);
+               encoder_configuration_win.Button_close.Clicked -= new 
EventHandler(on_encoder_configuration_win_closed);
                
                EncoderConfiguration eConfNew = encoder_configuration_win.GetAcceptedValues();
 
diff --git a/src/gui/encoderConfiguration.cs b/src/gui/encoderConfiguration.cs
index 2486040..8c3e9ec 100644
--- a/src/gui/encoderConfiguration.cs
+++ b/src/gui/encoderConfiguration.cs
@@ -94,7 +94,7 @@ public class EncoderConfigurationWindow
 
        [Widget] Gtk.Entry entry_save_name;
        [Widget] Gtk.Entry entry_save_description;
-       [Widget] Gtk.Button button_save;
+       [Widget] Gtk.Button button_apply;
        [Widget] Gtk.Button button_delete;
 
        [Widget] Gtk.SpinButton spin_im_weight_calcule;
@@ -106,7 +106,7 @@ public class EncoderConfigurationWindow
        [Widget] Gtk.Button button_encoder_capture_inertial_cancel;
        //[Widget] Gtk.Button button_encoder_capture_inertial_finish;
 
-       [Widget] Gtk.Button button_accept;
+       [Widget] Gtk.Button button_close;
 
        static EncoderConfigurationWindow EncoderConfigurationWindowBox;
        
@@ -604,7 +604,7 @@ public class EncoderConfigurationWindow
 
        void on_entry_save_name_changed (object o, EventArgs args)
        {
-               button_save.Sensitive = (entry_save_name.Text.ToString().Length > 0);
+               button_apply.Sensitive = (entry_save_name.Text.ToString().Length > 0);
 
                //TODO: button delete sensitivity depends on being on the treeview
        }
@@ -656,8 +656,8 @@ public class EncoderConfigurationWindow
                fc.Destroy();
        }
 
-       //TODO: button_save sensitive only when name != "" && != of the others
-       void on_button_save_clicked (object o, EventArgs args)
+       //TODO: button_apply sensitive only when name != "" && != of the others
+       void on_button_apply_clicked (object o, EventArgs args)
        {
                string selectedName = getSelectedName();
                if(selectedName == "")
@@ -792,23 +792,16 @@ public class EncoderConfigurationWindow
         * <--------------- end of side content area / capture inertial ----
         */
 
-       private void on_button_close_clicked (object o, EventArgs args)
-       {
-               //TODO:
-               //if changed:
-               //confirmwindow to save or cancel
-       }
-
+       /*
        private void on_button_cancel_clicked (object o, EventArgs args)
        {
-               //TODO: remove button_cancel
                EncoderConfigurationWindowBox.encoder_configuration.Hide();
                EncoderConfigurationWindowBox = null;
        }
+       */
        
-       private void on_button_accept_clicked (object o, EventArgs args)
+       private void on_button_close_clicked (object o, EventArgs args)
        {
-               //TODO: remove button_accept (but continue managing call on gui/encoder.cs)
                //managed on gui/encoder.cs
                EncoderConfigurationWindowBox.encoder_configuration.Hide();
        }
@@ -820,15 +813,11 @@ public class EncoderConfigurationWindow
                if(capturing)
                        button_encoder_capture_inertial_cancel.Click();
 
-               //TODO:
-               //call on_button_close_clicked
-
-               EncoderConfigurationWindowBox.encoder_configuration.Hide();
-               EncoderConfigurationWindowBox = null;
+               on_button_close_clicked(new object(), new EventArgs());
        }
 
-       public Button Button_accept {
-               get { return button_accept; }
+       public Button Button_close {
+               get { return button_close; }
        }
        
        public Button Button_encoder_capture_inertial_do {


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