[goffice] Add a user interface for radar and polar plots axis selection. [#692803]



commit cc747beb5b0552f642589b4ee9d30b77c097906a
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Jan 29 17:20:24 2013 +0100

    Add a user interface for radar and polar plots axis selection. [#692803]

 ChangeLog                       |    8 ++++++++
 NEWS                            |    1 +
 goffice/graph/gog-axis-prefs.ui |   12 ++++++------
 goffice/graph/gog-axis.c        |   20 +++++++++++---------
 goffice/graph/gog-plot.c        |    4 +++-
 5 files changed, 29 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 70e8759..3da9ee3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-01-29  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/graph/gog-axis-prefs.ui: add a user interface for discrete
+	circular axis rotation.
+	* goffice/graph/gog-axis.c (gog_axis_populate_editor): ditto.
+	* goffice/graph/gog-plot.c (gog_plot_populate_editor): add a user interface
+	for radar and polar plots axis selection. [#692803]
+
 2013-01-24  Morten Welinder  <terra gnome org>
 
 	* goffice/math/go-regression.c (go_linear_regression_leverage):
diff --git a/NEWS b/NEWS
index 34f81d1..e16bf05 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Jean:
 	* Don't add an extra separator at start of data labels. [#691704]
 	* Don't crash after deleting a named smoothed curve. [#691796]
 	* Fix data label offset serialization. [#692305]
+	* Add a user interface for radar and polar plots axis selection. [#692803]
 
 Morten:
 	* Cleanup linear algebra.  [#691630]
diff --git a/goffice/graph/gog-axis-prefs.ui b/goffice/graph/gog-axis-prefs.ui
index 84e45fe..5b74c56 100644
--- a/goffice/graph/gog-axis-prefs.ui
+++ b/goffice/graph/gog-axis-prefs.ui
@@ -114,7 +114,7 @@
         <property name="xalign">0</property>
         <property name="label" translatable="yes">Major ticks</property>
         <attributes>
-         <attribute name="weight" value="bold"/>
+          <attribute name="weight" value="bold"/>
         </attributes>
       </object>
       <packing>
@@ -198,7 +198,7 @@
             <property name="xalign">0</property>
             <property name="label" translatable="yes">Position</property>
             <attributes>
-             <attribute name="weight" value="bold"/>
+              <attribute name="weight" value="bold"/>
             </attributes>
           </object>
           <packing>
@@ -392,7 +392,7 @@
             <property name="xalign">0</property>
             <property name="label" translatable="yes">Minor ticks</property>
             <attributes>
-             <attribute name="weight" value="bold"/>
+              <attribute name="weight" value="bold"/>
             </attributes>
           </object>
           <packing>
@@ -467,7 +467,7 @@
         <property name="xalign">0</property>
         <property name="label" translatable="yes">Bounds</property>
         <attributes>
-         <attribute name="weight" value="bold"/>
+          <attribute name="weight" value="bold"/>
         </attributes>
       </object>
       <packing>
@@ -568,7 +568,7 @@
             <property name="row_spacing">6</property>
             <property name="column_spacing">12</property>
             <child>
-              <object class="GtkLabel" id="label8">
+              <object class="GtkLabel" id="unit-lbl">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="xalign">0</property>
@@ -663,7 +663,7 @@
         <property name="xalign">0</property>
         <property name="label" translatable="yes">Mapping</property>
         <attributes>
-         <attribute name="weight" value="bold"/>
+          <attribute name="weight" value="bold"/>
         </attributes>
       </object>
       <packing>
diff --git a/goffice/graph/gog-axis.c b/goffice/graph/gog-axis.c
index 04d5f53..f50c304 100644
--- a/goffice/graph/gog-axis.c
+++ b/goffice/graph/gog-axis.c
@@ -2861,23 +2861,25 @@ gog_axis_populate_editor (GogObject *gobj,
 		gtk_widget_hide (w);
 	}
 
-	if (!axis->is_discrete && gog_axis_get_atype (axis) == GOG_AXIS_CIRCULAR) {
+	if (gog_axis_get_atype (axis) == GOG_AXIS_CIRCULAR) {
 		GtkWidget *w;
 		GtkComboBoxText *box = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (gui, "polar-unit-combo"));
-		gog_axis_populate_polar_unit_combo (axis, box);
-		g_signal_connect (G_OBJECT (box),
-				  "changed",
-				  G_CALLBACK (cb_polar_unit_changed),
-				  state);
+		if (!axis->is_discrete) {
+			gog_axis_populate_polar_unit_combo (axis, box);
+			g_signal_connect (G_OBJECT (box),
+					  "changed",
+					  G_CALLBACK (cb_polar_unit_changed),
+					  state);
+		} else {
+			gtk_widget_hide (GTK_WIDGET (box));
+			gtk_widget_hide (go_gtk_builder_get_widget (gui, "unit-lbl"));
+		}
 
 		w = go_gtk_builder_get_widget (gui, "circular-rotation-spinbutton");
 		gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), axis->circular_rotation);
 		g_signal_connect_object (G_OBJECT (w), "value-changed",
 					 G_CALLBACK (cb_rotation_changed),
 					 axis, 0);
-	} else {
-		GtkWidget *w = go_gtk_builder_get_widget (gui, "circular-grid");
-		gtk_widget_hide (w);
 	}
 
 	for (i = 0; i < G_N_ELEMENTS (toggle_props) ; i++) {
diff --git a/goffice/graph/gog-plot.c b/goffice/graph/gog-plot.c
index 5801dfa..a2f8e39 100644
--- a/goffice/graph/gog-plot.c
+++ b/goffice/graph/gog-plot.c
@@ -243,10 +243,12 @@ gog_plot_populate_editor (GogObject *obj,
 	GtkListStore *store;
 	GtkTreeIter iter;
 	GtkCellRenderer *cell;
+	unsigned axis_set;
 
 	g_return_if_fail (chart != NULL);
 
-	if ((gog_chart_get_axis_set (chart) & GOG_AXIS_SET_FUNDAMENTAL) == GOG_AXIS_SET_XY) {
+	axis_set = gog_chart_get_axis_set (chart) & GOG_AXIS_SET_FUNDAMENTAL;
+	if (axis_set == GOG_AXIS_SET_XY || axis_set == GOG_AXIS_SET_RADAR) {
 		GtkWidget *combo;
 		GtkWidget *table = gtk_table_new (0, 1, FALSE);
 



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