[chronojump] On multissesion only show graphs: barplot and lines. On singlesession Evolution always lines



commit bce932f7ffb23c80f233fd74ebacb51d9906e08f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Sep 8 18:50:33 2014 +0200

    On multissesion only show graphs: barplot and lines. On singlesession Evolution always lines

 src/constants.cs |    1 +
 src/gui/stats.cs |   20 +++++++++++++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index b746f03..f9e2878 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -362,6 +362,7 @@ public class Constants
        public static string GraphTypeStripchart = "Stripchart";
        public static string [] GraphTypes = { GraphTypeBoxplot, GraphTypeHistogram, GraphTypeBarplot, 
GraphTypeLines, 
                GraphTypeXY, GraphTypeDotchart, GraphTypeStripchart };
+       public static string [] GraphTypesMultisession = { GraphTypeBarplot, GraphTypeLines };
        public static string GraphPaletteGray = "gray.colors";
        public static string GraphPaletteBlack = Catalog.GetString("black only");
        public static string [] GraphPalettes = { GraphPaletteBlack, GraphPaletteGray, "rainbow", 
diff --git a/src/gui/stats.cs b/src/gui/stats.cs
index 2cbf0b1..b17cc86 100644
--- a/src/gui/stats.cs
+++ b/src/gui/stats.cs
@@ -730,6 +730,9 @@ public partial class ChronoJumpWindow {
                        checkbutton_transposed.Sensitive = false;
                        UtilGtk.ComboUpdate(combo_graph_type, 
Util.StringToStringArray(Constants.GraphTypeLines), "");
                        combo_graph_type.Active=0;
+               } else if (radiobutton_selected_sessions.Active) {
+                       //on multi session use only barplot and lines
+                       combo_graph_type.Active = UtilGtk.ComboUpdate(combo_graph_type, 
Constants.GraphTypesMultisession, Constants.GraphTypeLines);
                } else {
                        //hbox_mark_consecutives.Hide();
                        checkbutton_transposed.Active = false;
@@ -1167,17 +1170,24 @@ public partial class ChronoJumpWindow {
                        //single session can have all graph types
                        combo_graph_type.Active = UtilGtk.ComboUpdate(
                                        combo_graph_type, Constants.GraphTypes, 
UtilGtk.ComboGetActive(combo_graph_type));
+                       //except
+                       if ( UtilGtk.ComboGetActive(combo_stats_stat_subtype) == 
Catalog.GetString("Evolution") ||
+                                       UtilGtk.ComboGetActive(combo_stats_stat_type) == 
Constants.TypeRunsIntervallic ) {
+                               notebook_stats_win_options.Show();
+                               checkbutton_transposed.Active = true;
+                               checkbutton_transposed.Sensitive = false;
+                               UtilGtk.ComboUpdate(combo_graph_type, 
Util.StringToStringArray(Constants.GraphTypeLines), "");
+                               combo_graph_type.Active=0;
+                       } else
+                               notebook_stats_win_options.Hide();
                } 
                else if (o == (object) radiobutton_selected_sessions ) 
                {
                        Log.WriteLine("selected");
                        button_stats_select_sessions.Sensitive = true;
                        
-                       //multi session cannot have XY and dotchart
-                       string [] types = Util.DeleteString(Constants.GraphTypes, Constants.GraphTypeXY);
-                       types = Util.DeleteString(types, Constants.GraphTypeDotchart);
-                       combo_graph_type.Active = UtilGtk.ComboUpdate(
-                                       combo_graph_type, types, UtilGtk.ComboGetActive(combo_graph_type));
+                       //multi session use only barplot and lines
+                       combo_graph_type.Active = UtilGtk.ComboUpdate(combo_graph_type, 
Constants.GraphTypesMultisession, Constants.GraphTypeLines);
                }
                update_stats_widgets_sensitiveness();
                showUpdateStatsAndHideData(true);


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