[chronojump] Chronopic window only shows 4 chronopics if opened from "other" (not, jump, run or encoder)



commit 72eee8407038ff2ba4d8e3a0794f65400042dd52
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sat Nov 1 22:03:21 2014 +0100

    Chronopic window only shows 4 chronopics if opened from "other" (not, jump, run or encoder)

 glade/chronojump.glade |   78 +++++++++++++++++++++++++++++++++++++++++++-----
 src/gui/chronojump.cs  |    8 ++++-
 src/gui/chronopic.cs   |   15 ++++++---
 3 files changed, 86 insertions(+), 15 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index ab5ef02..5a2c0bb 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6321,6 +6321,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -7033,6 +7036,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -7879,6 +7885,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -8484,6 +8493,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -15536,7 +15548,7 @@ Evaluator can use real name or nickname.</property>
 </property>
                                       </widget>
                                       <packing>
-                                        <property name="expand">True</property>
+                                        <property name="expand">False</property>
                                         <property name="fill">True</property>
                                         <property name="position">0</property>
                                       </packing>
@@ -15548,7 +15560,7 @@ Evaluator can use real name or nickname.</property>
                                         <property name="items">COM?</property>
                                       </widget>
                                       <packing>
-                                        <property name="expand">True</property>
+                                        <property name="expand">False</property>
                                         <property name="fill">True</property>
                                         <property name="position">1</property>
                                       </packing>
@@ -15557,6 +15569,7 @@ Evaluator can use real name or nickname.</property>
                                   <packing>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
+                                    <property name="y_options">GTK_FILL</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -15570,7 +15583,7 @@ Evaluator can use real name or nickname.</property>
                                         <property name="stock">gtk-no</property>
                                       </widget>
                                       <packing>
-                                        <property name="expand">True</property>
+                                        <property name="expand">False</property>
                                         <property name="fill">True</property>
                                         <property name="position">0</property>
                                       </packing>
@@ -15583,7 +15596,7 @@ Evaluator can use real name or nickname.</property>
                                         <property name="icon-size">5</property>
                                       </widget>
                                       <packing>
-                                        <property name="expand">True</property>
+                                        <property name="expand">False</property>
                                         <property name="fill">True</property>
                                         <property name="position">1</property>
                                       </packing>
@@ -15592,6 +15605,7 @@ Evaluator can use real name or nickname.</property>
                                   <packing>
                                     <property name="left_attach">3</property>
                                     <property name="right_attach">4</property>
+                                    <property name="y_options">GTK_FILL</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -15600,6 +15614,9 @@ Evaluator can use real name or nickname.</property>
                                     <property name="can_focus">False</property>
                                     <property name="label">Chronopic 1</property>
                                   </widget>
+                                  <packing>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
                                 </child>
                                 <child>
                                   <widget class="GtkButton" id="button_connect_cp1">
@@ -15612,6 +15629,7 @@ Evaluator can use real name or nickname.</property>
                                   <packing>
                                     <property name="left_attach">2</property>
                                     <property name="right_attach">3</property>
+                                    <property name="y_options">GTK_FILL</property>
                                   </packing>
                                 </child>
                               </widget>
@@ -15631,14 +15649,13 @@ Evaluator can use real name or nickname.</property>
                         </child>
                       </widget>
                       <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkFrame" id="frame2">
-                        <property name="visible">True</property>
+                      <widget class="GtkFrame" id="frame_supplementary">
                         <property name="can_focus">False</property>
                         <property name="label_xalign">0</property>
                         <property name="label_yalign">0.69999998807907104</property>
@@ -18216,6 +18233,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -18729,6 +18749,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -19734,6 +19757,9 @@ by you</property>
               <placeholder/>
             </child>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkButton" id="button_video_url">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -19796,6 +19822,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -28539,6 +28568,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>
@@ -30432,6 +30479,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>
@@ -30983,6 +31033,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>
@@ -33528,6 +33581,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -33705,6 +33761,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -33897,6 +33956,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 99106a6..183dc7b 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4390,13 +4390,17 @@ Log.WriteLine("DDD 2");
        }
 
        private void on_chronopic_contacts_clicked (object o, EventArgs args) {
-               chronopicWin = ChronopicWindow.View("contacts", preferences.volumeOn);
+               ChronopicWindow.ChronojumpMode cmode = ChronopicWindow.ChronojumpMode.JUMPORRUN;
+               if(radio_menuitem_mode_other.Active)
+                       cmode = ChronopicWindow.ChronojumpMode.OTHER;
+
+               chronopicWin = ChronopicWindow.View(cmode, preferences.volumeOn);
                //chronopicWin.FakeWindowReload.Clicked += new EventHandler(chronopicWindowReload);
                chronopicWin.FakeWindowDone.Clicked += new 
EventHandler(on_chronopic_window_contacts_connected_or_done);
        }
 
        private void on_chronopic_encoder_clicked (object o, EventArgs args) {
-               chronopicWin = ChronopicWindow.View("encoder", preferences.volumeOn);
+               chronopicWin = ChronopicWindow.View(ChronopicWindow.ChronojumpMode.ENCODER, 
preferences.volumeOn);
                //chronopicWin.FakeWindowReload.Clicked += new EventHandler(chronopicWindowReload);
                chronopicWin.FakeWindowDone.Clicked += new 
EventHandler(on_chronopic_window_encoder_connected_or_done);
        }
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index 52b9e47..632cd32 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -55,6 +55,8 @@ public class ChronopicWindow
        [Widget] Gtk.Label label_connect_contacts;
        [Widget] Gtk.Label label_connect_encoder;
 
+       [Widget] Gtk.Frame frame_supplementary;
+
        [Widget] Gtk.Image image_cp1_yes;
        [Widget] Gtk.Image image_cp1_no;
        [Widget] Gtk.Image image_cp2_yes;
@@ -127,7 +129,6 @@ public class ChronopicWindow
                OFF
        }
        bool connected;
-       string type;    //"contacts" or "encoder"
        bool volumeOn;
        int currentCp; //1 to 4
        bool cancelledByUser;
@@ -154,6 +155,8 @@ public class ChronopicWindow
 
        States loggedState;             //log of last state
        
+       public enum ChronojumpMode { JUMPORRUN, ENCODER, OTHER };
+       
 
        public ChronopicWindow(ArrayList myCpd)
        {
@@ -215,20 +218,22 @@ public class ChronopicWindow
                return ChronopicWindowBox;
        }
 
-       static public ChronopicWindow View (string type, bool volumeOn)
+       static public ChronopicWindow View (ChronojumpMode cmode, bool volumeOn)
        {
                if (ChronopicWindowBox == null) {
                        ChronopicWindowBox = new ChronopicWindow (cpd);
                } 
                
-               ChronopicWindowBox.type = type;
                ChronopicWindowBox.volumeOn = volumeOn;
                
-               if(type == "contacts") {
+               if(cmode == ChronojumpMode.JUMPORRUN || cmode == ChronojumpMode.OTHER) {
                        ChronopicWindowBox.notebook_main.CurrentPage = 0;
                        ChronopicWindowBox.checkChronopicDisconnected(); //encoder does not need this because 
there's no connection
+               
+                       ChronopicWindowBox.frame_supplementary.Visible = 
+                               (cmode == ChronojumpMode.OTHER); //can have multichronopic
                }
-               else
+               else    //cmode == ChronojumpMode.ENCODER)
                        ChronopicWindowBox.notebook_main.CurrentPage = 1;
                
                ChronopicWindowBox.createCombos();


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