[chronojump/FS-TFT-Menu] gui improvement on encoderConfiguration: edit, duplicate, ...



commit 6a90f98f9cd60e43ac2eca348ffb34a8bcf60569
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Apr 26 13:04:49 2022 +0200

    gui improvement on encoderConfiguration: edit,duplicate, ...

 glade/encoder_configuration.glade | 630 ++++++++++++++++++++++++++++----------
 src/gui/encoderConfiguration.cs   | 128 +++++++-
 2 files changed, 582 insertions(+), 176 deletions(-)
---
diff --git a/glade/encoder_configuration.glade b/glade/encoder_configuration.glade
index 222a69502..76ee4a5fe 100644
--- a/glade/encoder_configuration.glade
+++ b/glade/encoder_configuration.glade
@@ -1365,20 +1365,7 @@ Eg. value = 2, means person does twice force at half speed.</property>
                           <widget class="GtkVBox" id="vbox11">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="spacing">2</property>
-                            <child>
-                              <widget class="GtkLabel" id="label33">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="xalign">0</property>
-                                <property name="label" translatable="yes">Select</property>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
+                            <property name="spacing">6</property>
                             <child>
                               <widget class="GtkScrolledWindow" id="scr_treeview_select">
                                 <property name="visible">True</property>
@@ -1394,215 +1381,528 @@ Eg. value = 2, means person does twice force at half speed.</property>
                               <packing>
                                 <property name="expand">True</property>
                                 <property name="fill">True</property>
-                                <property name="position">1</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <widget class="GtkHBox" id="hbox13">
+                              <widget class="GtkNotebook" id="notebook_actions">
                                 <property name="visible">True</property>
-                                <property name="can_focus">False</property>
+                                <property name="can_focus">True</property>
+                                <property name="show_tabs">False</property>
+                                <property name="show_border">False</property>
                                 <child>
-                                  <widget class="GtkButton" id="button_delete">
+                                  <widget class="GtkVBox" id="vbox10">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="tooltip" translatable="yes">Delete</property>
-                                    <signal name="clicked" handler="on_button_delete_clicked" swapped="no"/>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">6</property>
                                     <child>
-                                      <widget class="GtkImage" id="image_delete">
+                                      <widget class="GtkVBox" id="vbox16">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="stock">gtk-missing-image</property>
-                                        <property name="icon-size">2</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <widget class="GtkLabel" id="label33">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">Selected:</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label_side_selected">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
                                       </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
                                     </child>
-                                  </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="GtkButton" id="button_new">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="tooltip" translatable="yes">New</property>
-                                    <signal name="clicked" handler="on_button_new_clicked" swapped="no"/>
                                     <child>
-                                      <widget class="GtkImage" id="image_new">
+                                      <widget class="GtkVButtonBox" id="vbuttonbox1">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="stock">gtk-new</property>
+                                        <property name="border_width">2</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <widget class="GtkButton" id="button_edit">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="tooltip" translatable="yes">Edit</property>
+                                            <signal name="clicked" handler="on_button_side_action_clicked" 
swapped="no"/>
+                                            <child>
+                                              <widget class="GtkHBox" id="hbox16">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="spacing">4</property>
+                                                <child>
+                                                  <widget class="GtkImage" id="image_edit">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="stock">gtk-new</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label1">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="label" translatable="yes">Edit</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">True</property>
+                                                    <property name="fill">True</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </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_add">
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="tooltip" translatable="yes">Add</property>
+                                            <signal name="clicked" handler="on_button_side_action_clicked" 
swapped="no"/>
+                                            <child>
+                                              <widget class="GtkHBox" id="hbox17">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="spacing">4</property>
+                                                <child>
+                                                  <widget class="GtkImage" id="image_add">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="stock">gtk-new</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label41">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="label" translatable="yes">Add 
new</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">True</property>
+                                                    <property name="fill">True</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkButton" id="button_duplicate">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="tooltip" translatable="yes">Duplicate</property>
+                                            <signal name="clicked" handler="on_button_side_action_clicked" 
swapped="no"/>
+                                            <child>
+                                              <widget class="GtkHBox" id="hbox18">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="spacing">4</property>
+                                                <child>
+                                                  <widget class="GtkImage" id="image_duplicate">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="stock">gtk-new</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label42">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="label" 
translatable="yes">Duplicate</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">True</property>
+                                                    <property name="fill">True</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkButton" id="button_delete">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="tooltip" translatable="yes">Delete</property>
+                                            <signal name="clicked" handler="on_button_side_action_clicked" 
swapped="no"/>
+                                            <child>
+                                              <widget class="GtkHBox" id="hbox19">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="spacing">4</property>
+                                                <child>
+                                                  <widget class="GtkImage" id="image_delete">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="stock">gtk-missing-image</property>
+                                                    <property name="icon-size">2</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label43">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="label" 
translatable="yes">Delete</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="expand">True</property>
+                                                    <property name="fill">True</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="pack_type">end</property>
+                                            <property name="position">3</property>
+                                          </packing>
+                                        </child>
                                       </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">1</property>
+                                      </packing>
                                     </child>
                                   </widget>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">1</property>
-                                  </packing>
                                 </child>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">2</property>
-                              </packing>
-                            </child>
-                          </widget>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkFrame" id="frame5">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label_xalign">0</property>
-                        <property name="label_yalign">0.69999998807907104</property>
-                        <property name="shadow_type">out</property>
-                        <child>
-                          <widget class="GtkVBox" id="vbox13">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="border_width">8</property>
-                            <property name="spacing">8</property>
-                            <child>
-                              <widget class="GtkVBox" id="vbox14">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">2</property>
                                 <child>
-                                  <widget class="GtkLabel" id="label35">
+                                  <widget class="GtkLabel" id="label21">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Name</property>
+                                    <property name="label">buttons</property>
                                   </widget>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
+                                    <property name="tab_fill">False</property>
+                                    <property name="type">tab</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkEntry" id="entry_save_name">
+                                  <widget class="GtkFrame" id="frame5">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">●</property>
-                                    <property name="primary_icon_activatable">False</property>
-                                    <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
-                                    <signal name="changed" handler="on_entry_save_name_changed" 
swapped="no"/>
+                                    <property name="can_focus">False</property>
+                                    <property name="label_xalign">0</property>
+                                    <property name="label_yalign">0.69999998807907104</property>
+                                    <property name="shadow_type">out</property>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox13">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="border_width">8</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <widget class="GtkVBox" id="vbox14">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">2</property>
+                                            <child>
+                                              <widget class="GtkLabel" id="label35">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="label" translatable="yes">Name</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">True</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkEntry" id="entry_save_name">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="invisible_char">●</property>
+                                                <property name="invisible_char_set">True</property>
+                                                <property name="primary_icon_activatable">False</property>
+                                                <property name="secondary_icon_activatable">False</property>
+                                                <property name="primary_icon_sensitive">True</property>
+                                                <property name="secondary_icon_sensitive">True</property>
+                                                <signal name="changed" handler="on_entry_save_name_changed" 
swapped="no"/>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">True</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkVBox" id="vbox15">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">2</property>
+                                            <child>
+                                              <widget class="GtkLabel" id="label36">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="xalign">0</property>
+                                                <property name="label" 
translatable="yes">Description</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">True</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkEntry" id="entry_save_description">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="invisible_char">●</property>
+                                                <property name="invisible_char_set">True</property>
+                                                <property name="primary_icon_activatable">False</property>
+                                                <property name="secondary_icon_activatable">False</property>
+                                                <property name="primary_icon_sensitive">True</property>
+                                                <property name="secondary_icon_sensitive">True</property>
+                                                <signal name="changed" 
handler="on_entry_save_description_changed" swapped="no"/>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">True</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkHButtonBox" id="hbuttonbox2">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">16</property>
+                                            <child>
+                                              <widget class="GtkButton" id="button_cancel">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <signal name="clicked" handler="on_button_cancel_clicked" 
swapped="no"/>
+                                                <child>
+                                                  <widget class="GtkHBox" id="hbox13">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="spacing">4</property>
+                                                    <child>
+                                                      <widget class="GtkImage" id="image_cancel">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="stock">gtk-missing-image</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">True</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label47">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="label" 
translatable="yes">Cancel</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">True</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="position">1</property>
+                                                      </packing>
+                                                    </child>
+                                                  </widget>
+                                                </child>
+                                              </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="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <signal name="clicked" handler="on_button_accept_clicked" 
swapped="no"/>
+                                                <child>
+                                                  <widget class="GtkHBox" id="hbox20">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="spacing">4</property>
+                                                    <child>
+                                                      <widget class="GtkImage" id="image_accept">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="stock">gtk-missing-image</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">True</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label48">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="label" 
translatable="yes">Accept</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">True</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="position">1</property>
+                                                      </packing>
+                                                    </child>
+                                                  </widget>
+                                                </child>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label_side_action">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="use_markup">True</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="type">label_item</property>
+                                      </packing>
+                                    </child>
                                   </widget>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
-                              </widget>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkVBox" id="vbox15">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">2</property>
                                 <child>
-                                  <widget class="GtkLabel" id="label36">
+                                  <widget class="GtkLabel" id="label44">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Description</property>
+                                    <property name="label">edit,add,duplicate</property>
                                   </widget>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
+                                    <property name="position">1</property>
+                                    <property name="tab_fill">False</property>
+                                    <property name="type">tab</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkEntry" id="entry_save_description">
+                                  <widget class="GtkLabel" id="label46">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">●</property>
-                                    <property name="invisible_char_set">True</property>
-                                    <property name="primary_icon_activatable">False</property>
-                                    <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
-                                    <signal name="changed" handler="on_entry_save_description_changed" 
swapped="no"/>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">TODO</property>
                                   </widget>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
+                                    <property name="position">2</property>
                                   </packing>
                                 </child>
-                              </widget>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkHButtonBox" id="hbuttonbox2">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">20</property>
                                 <child>
-                                  <widget class="GtkButton" id="button_apply">
-                                    <property name="label" translatable="yes">Apply</property>
+                                  <widget class="GtkLabel" id="label45">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <signal name="clicked" handler="on_button_apply_clicked" swapped="no"/>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">delete</property>
                                   </widget>
                                   <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
+                                    <property name="position">2</property>
+                                    <property name="tab_fill">False</property>
+                                    <property name="type">tab</property>
                                   </packing>
                                 </child>
                               </widget>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                           </widget>
                         </child>
-                        <child>
-                          <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>
-                        </child>
                       </widget>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                   </widget>
@@ -1886,7 +2186,7 @@ Eg. value = 2, means person does twice force at half speed.</property>
                             <property name="has_tooltip">True</property>
                             <signal name="clicked" 
handler="on_button_encoder_capture_inertial_cancel_clicked" swapped="no"/>
                             <child>
-                              <widget class="GtkImage" id="image_cancel">
+                              <widget class="GtkImage" id="image_capture_cancel">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="stock">gtk-missing-image</property>
diff --git a/src/gui/encoderConfiguration.cs b/src/gui/encoderConfiguration.cs
index d54f20f53..4000eab0d 100644
--- a/src/gui/encoderConfiguration.cs
+++ b/src/gui/encoderConfiguration.cs
@@ -97,14 +97,29 @@ public class EncoderConfigurationWindow
        [Widget] Gtk.Frame frame_notebook_side;
        [Widget] Gtk.Notebook notebook_side;
        [Widget] Gtk.TreeView treeview_select;
+       [Widget] Gtk.Button button_import;
+       [Widget] Gtk.Button button_export;
+       [Widget] Gtk.Button button_edit;
+       [Widget] Gtk.Button button_add;
+       [Widget] Gtk.Button button_duplicate;
+       [Widget] Gtk.Button button_delete;
        [Widget] Gtk.Image image_import;
        [Widget] Gtk.Image image_export;
-       [Widget] Gtk.Image image_delete;
+       [Widget] Gtk.Image image_capture_cancel;
        [Widget] Gtk.Image image_cancel;
+       [Widget] Gtk.Image image_accept;
+       [Widget] Gtk.Image image_edit;
+       [Widget] Gtk.Image image_add;
+       [Widget] Gtk.Image image_duplicate;
+       [Widget] Gtk.Image image_delete;
+       [Widget] Gtk.Label label_side_action;
+       [Widget] Gtk.Label label_side_selected;
 
+       [Widget] Gtk.Notebook notebook_actions;
        [Widget] Gtk.Entry entry_save_name;
        [Widget] Gtk.Entry entry_save_description;
-       [Widget] Gtk.Button button_apply;
+       //[Widget] Gtk.Button button_cancel;
+       [Widget] Gtk.Button button_accept;
 
        [Widget] Gtk.SpinButton spin_im_weight_calcule;
        [Widget] Gtk.SpinButton spin_im_length_calcule;
@@ -130,6 +145,8 @@ public class EncoderConfigurationWindow
 
        Constants.EncoderGI encoderGI;
 
+       private enum notebookPages { BUTTONS, EDIT_ADD_DUPLICATE, DELETE  };
+
        /*
         * this params are used on inertial
         * and must be retrieved when this window is closed
@@ -158,7 +175,21 @@ public class EncoderConfigurationWindow
                image_encoder_calcule_im.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_cancel.png");
+               image_capture_cancel.Pixbuf = pixbuf;
                image_cancel.Pixbuf = pixbuf;
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_done_blue.png");
+               image_accept.Pixbuf = pixbuf;
+
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_edit.png");
+               image_edit.Pixbuf = pixbuf;
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_add.png");
+               image_add.Pixbuf = pixbuf;
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_duplicate.png");
+               image_duplicate.Pixbuf = pixbuf;
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_delete.png");
+               image_delete.Pixbuf = pixbuf;
+
+               label_side_action.Text = "";
 
                //put an icon to window
                UtilGtk.IconWindow(encoder_configuration);
@@ -212,6 +243,7 @@ public class EncoderConfigurationWindow
 
                //C) side is shown now, after showing the window in order to be displayed correctly (see A)
                EncoderConfigurationWindowBox.frame_notebook_side.Visible = 
(EncoderConfigurationWindowBox.sideMode != sideModes.HIDDEN);
+               EncoderConfigurationWindowBox.notebook_actions.Page = Convert.ToInt32(notebookPages.BUTTONS);
 
                return EncoderConfigurationWindowBox;
        }
@@ -615,8 +647,6 @@ public class EncoderConfigurationWindow
                image_import.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameExport);
                image_export.Pixbuf = pixbuf;
-               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_delete.png");
-               image_delete.Pixbuf = pixbuf;
        }
 
        private void fillTreeView(List<EncoderConfigurationSQLObject> list, EncoderConfigurationSQLObject 
currentSO)
@@ -632,7 +662,7 @@ public class EncoderConfigurationWindow
                return new TreeStore(typeof (string), typeof (string));
        }
 
-       private string getSelectedName()
+       private string getSelectedName ()
        {
                TreeModel model;
                TreeIter iter;
@@ -643,12 +673,26 @@ public class EncoderConfigurationWindow
                return "";
        }
 
+       private string getSelectedDescription ()
+       {
+               TreeModel model;
+               TreeIter iter;
+
+               if (treeview_select.Selection.GetSelected(out model, out iter))
+                       return (string) model.GetValue (iter, colDescription);
+
+               return "";
+       }
+
        private void onTVSelectionChanged (object o, EventArgs args)
        {
                string selectedName = getSelectedName();
                if(selectedName == "")
                        return;
 
+               label_side_selected.Text = "<b>" + selectedName + "</b>";
+               label_side_selected.UseMarkup = true;
+
                List<EncoderConfigurationSQLObject> list = SqliteEncoderConfiguration.Select(false, 
encoderGI, selectedName);
                if(list != null && list.Count == 1)
                {
@@ -670,7 +714,7 @@ public class EncoderConfigurationWindow
        {
                entry_save_name.Text = Util.MakeValidSQL(entry_save_name.Text);
 
-               button_apply.Sensitive = (entry_save_name.Text.ToString().Length > 0);
+               button_accept.Sensitive = (entry_save_name.Text.ToString().Length > 0);
 
                //TODO: button delete sensitivity depends on being on the treeview
        }
@@ -813,13 +857,13 @@ public class EncoderConfigurationWindow
                ((IDisposable)writer).Dispose();
        }
 
-       //TODO: button_apply sensitive only when name != "" && != of the others
-       void on_button_apply_clicked (object o, EventArgs args)
+       //TODO: button_accept sensitive only when name != "" && != of the others
+       void on_button_accept_clicked (object o, EventArgs args)
        {
-               apply(true);
+               apply (true);
        }
 
-       private void apply(bool updateGUI)
+       private void apply (bool updateGUI)
        {
                //useful fo update SQL
                string selectedOldName = getSelectedName();
@@ -855,14 +899,66 @@ public class EncoderConfigurationWindow
                        store.SetValue (iter, colName, newName);
                        store.SetValue (iter, colDescription, entry_save_description.Text);
                }
+
+               notebook_actions.Page = Convert.ToInt32(notebookPages.BUTTONS);
+               sideActionGuiUnsensitive (false);
        }
 
-       void on_button_new_clicked (object o, EventArgs args)
+       private void sideActionGuiUnsensitive (bool unsensitivize)
+       {
+               button_import.Sensitive = ! unsensitivize;
+               button_export.Sensitive = ! unsensitivize;
+               treeview_select.Sensitive = ! unsensitivize;
+       }
+
+       /* right actions */
+
+       private void on_button_side_action_clicked (object o, EventArgs args)
+       {
+               sideActionGuiUnsensitive (true);
+
+               if(o == (object) button_edit)
+                       on_button_edit_clicked (o, args);
+               else if(o == (object) button_add)
+                       on_button_add_clicked (o, args);
+               else if(o == (object) button_duplicate)
+                       on_button_duplicate_clicked (o, args);
+               else if(o == (object) button_delete)
+                       on_button_delete_clicked (o, args);
+       }
+
+       private void on_button_edit_clicked (object o, EventArgs args)
+       {
+               notebook_actions.Page = Convert.ToInt32(notebookPages.EDIT_ADD_DUPLICATE);
+               label_side_action.Text = Catalog.GetString("Edit selected");
+
+               entry_save_name.Text = getSelectedName ();
+               entry_save_description.Text = getSelectedDescription ();
+       }
+
+       private void on_button_add_clicked (object o, EventArgs args)
+       {
+               /*
+               TODO: implement on the future
+               need to put default config for linear or inertial,
+               and change the gui, but if person cancels, then gui has to change again to new object
+
+               notebook_actions.Page = Convert.ToInt32(notebookPages.EDIT_ADD_DUPLICATE);
+               label_side_action.Text = Catalog.GetString("Add new");
+
+               entry_save_name.Text = "";
+               entry_save_description.Text = "";
+               */
+       }
+
+       private void on_button_duplicate_clicked (object o, EventArgs args)
        {
                string selectedName = getSelectedName();
                if(selectedName == "")
                        return;
 
+               notebook_actions.Page = Convert.ToInt32(notebookPages.EDIT_ADD_DUPLICATE);
+               label_side_action.Text = Catalog.GetString("Duplicate");
                List<EncoderConfigurationSQLObject> list = SqliteEncoderConfiguration.Select(false, 
encoderGI, selectedName);
                if(list != null && list.Count == 1)
                {
@@ -885,10 +981,14 @@ public class EncoderConfigurationWindow
 
        void on_button_delete_clicked (object o, EventArgs args)
        {
+               sideActionGuiUnsensitive (false);
+
                string selectedName = getSelectedName();
                if(selectedName == "")
                        return;
 
+               //notebook_actions.Page = Convert.ToInt32(notebookPages.DELETE);
+               //label_side_action.Text = Catalog.GetString("Delete");
                if(UtilGtk.CountRows(store) <= 1) {
                        new DialogMessage(Constants.MessageTypes.WARNING,
                                        Catalog.GetString("Sorry, cannot delete all rows.") + "\n");
@@ -903,6 +1003,12 @@ public class EncoderConfigurationWindow
                Sqlite.DeleteFromName(false, Constants.EncoderConfigurationTable, "name", selectedName);
        }
 
+       private void on_button_cancel_clicked (object o, EventArgs args)
+       {
+               notebook_actions.Page = Convert.ToInt32(notebookPages.BUTTONS);
+               sideActionGuiUnsensitive (false);
+       }
+
        /*
         * <--------------- end of side content area / load-save ----
         */


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