[chronojump] Better management of disconnected chronopics



commit 5855440305840d4871b043b9e8e9c8a94649f83c
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 25 17:11:52 2014 +0200

    Better management of disconnected chronopics

 src/gui/chronojump.cs   |   12 +++++++++---
 src/gui/chronopic.cs    |    5 ++++-
 src/gui/encoder.cs      |    3 +++
 src/gui/eventExecute.cs |    2 +-
 4 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 94538f9..3a8dc01 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4354,7 +4354,11 @@ Log.WriteLine("DDD 2");
 
                chronopicWin = ChronopicWindow.Create(cpd, Util.GetDefaultPort(), recreate, volumeOn);
                //chronopicWin.FakeButtonCancelled.Clicked += new EventHandler(on_chronopic_window_cancelled);
-               chronopicContactsLabels(0, recreate);
+               
+               if(notebook_sup.CurrentPage == 0)
+                       chronopicContactsLabels(0, recreate);
+               else //(notebook_sup.CurrentPage == 1)
+                       chronopicEncoderLabels(recreate);
        }
 
        private void on_chronopic_contacts_clicked (object o, EventArgs args) {
@@ -4393,7 +4397,7 @@ Log.WriteLine("DDD 2");
        */
        
        private void on_chronopic_window_contacts_connected_or_done (object o, EventArgs args) {
-               //chronopicWin.FakeWindowDone.Clicked -= new 
EventHandler(on_chronopic_window_connected_or_done);
+               chronopicWin.FakeWindowDone.Clicked -= new 
EventHandler(on_chronopic_window_contacts_connected_or_done);
                int cps = chronopicWin.NumConnected();
 
                if(radio_mode_multi_chronopic_small.Active)     
@@ -4403,7 +4407,7 @@ Log.WriteLine("DDD 2");
        }
        
        private void on_chronopic_window_encoder_connected_or_done (object o, EventArgs args) {
-               //chronopicWin.FakeWindowDone.Clicked -= new 
EventHandler(on_chronopic_window_connected_or_done);
+               chronopicWin.FakeWindowDone.Clicked -= new 
EventHandler(on_chronopic_window_encoder_connected_or_done);
 
                chronopicEncoderLabels(true);
        }
@@ -4423,6 +4427,8 @@ Log.WriteLine("DDD 2");
        }
 
        private void chronopicEncoderLabels(bool colorize) {
+               Log.WriteLine("here");
+               Log.WriteLine(chronopicWin.GetEncoderPort());
                if(chronopicWin.GetEncoderPort() != Util.GetDefaultPort())
                        label_chronopic_encoder.Text = Catalog.GetString("Encoder connected");
                else
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index f149dd9..14a8744 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -870,7 +870,10 @@ Log.WriteLine("bbb");
        }
 
        public string GetEncoderPort() {
-               return encoderPort;
+               if(isWindows)
+                       return UtilGtk.ComboGetActive(combo_windows_encoder);
+               else
+                       return UtilGtk.ComboGetActive(combo_linux_encoder);
        }
 
 
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index a1118fa..f1760cc 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -345,9 +345,12 @@ public partial class ChronoJumpWindow
                if(chronopicWin.GetEncoderPort() == Util.GetDefaultPort()) {
                        new DialogMessage(Constants.MessageTypes.WARNING, 
                                        Catalog.GetString("Chronopic port is not configured."));
+                       /*
                        UtilGtk.ChronopicColors(viewport_chronopic_encoder, 
                                        label_chronopic_encoder, new Gtk.Label(),
                                        false);
+                                       */
+                       createChronopicWindow(true);
                        return false;
                }
                return true;
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index d28ee06..850494f 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -1824,7 +1824,7 @@ Log.WriteLine("Preparing reactive A");
                                if(thisRunIsSimple)
                                        
PrepareRunSimpleGraph(currentEventExecute.PrepareEventGraphRunSimpleObject);
                                else {
-                                       bool volumeOnHere = true;
+                                       bool volumeOnHere = volumeOn;
                                        //do not play good or bad sounds at RSA because we need to hear the 
GO sound
                                        if(currentRunIntervalType.IsRSA)
                                                volumeOnHere = false;


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