[chronojump] Fixed not updating combo_select_contacts_top that mades crash after creation jump/run test on window



commit 8fd588ea35fa7e45760f1ca23b63af5851ef3174
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Feb 8 13:19:32 2022 +0100

    Fixed not updating combo_select_contacts_top that mades crash after creation jump/run test on windows

 src/gui/app1/chronojump.cs       | 13 ++++++++++---
 src/gui/app1/contactsExercise.cs | 13 +++++++++++++
 2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index b2db7aca8..17ddfb890 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -6900,7 +6900,8 @@ LogB.Debug("mc finished 5");
                jumpTypeAddWin.FakeButtonAccept.Clicked += new EventHandler(on_jump_type_add_accepted);
        }
        
-       private void on_jump_type_add_accepted (object o, EventArgs args) {
+       private void on_jump_type_add_accepted (object o, EventArgs args)
+       {
                LogB.Information("ACCEPTED Add new jump type");
                if(jumpTypeAddWin.InsertedSimple) {
                        createComboSelectJumps(false);
@@ -6910,6 +6911,7 @@ LogB.Debug("mc finished 5");
 
                        pre_fillTreeView_jumps(false);
                        combo_select_jumps.Active = UtilGtk.ComboMakeActive(combo_select_jumps, 
jumpTypeAddWin.Name);
+                       update_combo_select_contacts_top_using_combo (combo_select_jumps);
 
                        new DialogMessage(Constants.MessageTypes.INFO, Catalog.GetString("Added simple jump 
type."));
                } else {
@@ -6919,6 +6921,7 @@ LogB.Debug("mc finished 5");
                        
                        pre_fillTreeView_jumps_rj(false);
                        combo_select_jumps_rj.Active = UtilGtk.ComboMakeActive(combo_select_jumps_rj, 
jumpTypeAddWin.Name);
+                       update_combo_select_contacts_top_using_combo (combo_select_jumps_rj);
 
                        new DialogMessage(Constants.MessageTypes.INFO, Catalog.GetString("Added reactive jump 
type."));
                }
@@ -6938,8 +6941,9 @@ LogB.Debug("mc finished 5");
                runTypeAddWin = RunTypeAddWindow.Show(app1, false); //is intervallic
                runTypeAddWin.FakeButtonAccept.Clicked += new EventHandler(on_run_type_add_accepted);
        }
-       
-       private void on_run_type_add_accepted (object o, EventArgs args) {
+
+       private void on_run_type_add_accepted (object o, EventArgs args)
+       {
                LogB.Information("ACCEPTED Add new run type");
                if(runTypeAddWin.InsertedSimple) {
                        createComboSelectRuns(false);
@@ -6948,6 +6952,8 @@ LogB.Debug("mc finished 5");
                        pre_fillTreeView_runs(false);
                        combo_select_runs.Active = UtilGtk.ComboMakeActive(combo_select_runs, 
runTypeAddWin.Name);
 
+                       update_combo_select_contacts_top_using_combo (combo_select_runs);
+
                        new DialogMessage(Constants.MessageTypes.INFO, Catalog.GetString("Added simple race 
type."));
                } else {
                        createComboSelectRunsInterval(false);
@@ -6955,6 +6961,7 @@ LogB.Debug("mc finished 5");
                        pre_fillTreeView_runs_interval(false);
 
                        combo_select_runs_interval.Active = 
UtilGtk.ComboMakeActive(combo_select_runs_interval, runTypeAddWin.Name);
+                       update_combo_select_contacts_top_using_combo (combo_select_runs_interval);
 
                        new DialogMessage(Constants.MessageTypes.INFO, Catalog.GetString("Added intervallic 
race type."));
                }
diff --git a/src/gui/app1/contactsExercise.cs b/src/gui/app1/contactsExercise.cs
index 6b16af320..a72c1920f 100644
--- a/src/gui/app1/contactsExercise.cs
+++ b/src/gui/app1/contactsExercise.cs
@@ -39,6 +39,19 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_contacts_exercise_actions_add_do;
        [Widget] Gtk.Label label_contacts_exercise_error;
 
+       private void update_combo_select_contacts_top_using_combo (Gtk.ComboBox cb)
+       {
+               if(combo_select_contacts_top == null)
+                       return;
+
+               comboSelectContactsTopNoFollow = true;
+
+               UtilGtk.ComboUpdate(combo_select_contacts_top, UtilGtk.ComboGetValues (cb), "");
+               combo_select_contacts_top.Active = cb.Active;
+
+               comboSelectContactsTopNoFollow = false;
+       }
+
        private void on_button_contacts_exercise_clicked (object o, EventArgs args)
        {
                menus_and_mode_sensitive(false);


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