[chronojump] On report, buttons unsensitive if no row selected



commit f87903785e65d1d2fbfa839f766013b74c2cc4fa
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jul 15 16:47:49 2014 +0200

    On report, buttons unsensitive if no row selected

 glade/chronojump.glade |   60 +++++++++++++++++++++++++++++++++++++++++++++++-
 src/gui/report.cs      |    7 ++++-
 2 files changed, 65 insertions(+), 2 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 291f8c7..3854381 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6188,6 +6188,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -6792,6 +6795,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -7530,6 +7536,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -8027,6 +8036,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -17293,6 +17305,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -17698,6 +17713,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -18522,6 +18540,12 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -26012,6 +26036,24 @@ options</property>
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -27807,6 +27849,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                 <child>
                                   <placeholder/>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </widget>
                             </child>
                           </widget>
@@ -28271,6 +28316,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -30530,6 +30578,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -30599,6 +30650,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -30683,6 +30737,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -34179,8 +34236,9 @@ show elevation as:</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
-                          <widget class="GtkVButtonBox" id="vbuttonbox3">
+                          <widget class="GtkVButtonBox" id="right_buttons">
                             <property name="visible">True</property>
+                            <property name="sensitive">False</property>
                             <property name="can_focus">False</property>
                             <property name="spacing">4</property>
                             <property name="layout_style">start</property>
diff --git a/src/gui/report.cs b/src/gui/report.cs
index b545e91..696e9c4 100644
--- a/src/gui/report.cs
+++ b/src/gui/report.cs
@@ -50,6 +50,8 @@ public class ReportWindow {
        [Widget] Gtk.Image image_report_win_report;
        [Widget] Gtk.Image image_report_delete;
        
+       [Widget] Gtk.VButtonBox right_buttons;
+       
        GenericWindow genericWin;
        
        static ReportWindow ReportWindowBox;
@@ -177,7 +179,8 @@ public class ReportWindow {
                                        myStringFull[8]         //comment
                                        );
                }
-
+                       
+               right_buttons.Sensitive = false;
        }
 
        string arrayToString(ArrayList myArrayList) {
@@ -241,6 +244,7 @@ public class ReportWindow {
                // you get the iter and the model if something is selected
                if (((TreeSelection)o).GetSelected(out model, out iter)) {
                        selected = true;
+                       right_buttons.Sensitive = true;
                }
        }
        
@@ -381,6 +385,7 @@ public class ReportWindow {
 
                        if (treeview1.Selection.GetSelected (out model, out iter1)) {
                                store.Remove(ref iter1);
+                               right_buttons.Sensitive = false;
                        }
                }
        }


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