[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/ui/gui data-editor.c data-editor.glade...
From: |
John Darrington |
Subject: |
[Pspp-cvs] pspp/src/ui/gui data-editor.c data-editor.glade... |
Date: |
Tue, 24 Jul 2007 06:24:01 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: John Darrington <jmd> 07/07/24 06:24:01
Modified files:
src/ui/gui : data-editor.c data-editor.glade data-editor.h
Log message:
Tidied up the way that value-labels button and menu item interact.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.glade?cvsroot=pspp&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.h?cvsroot=pspp&r1=1.17&r2=1.18
Patches:
Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- data-editor.c 18 Jul 2007 05:32:22 -0000 1.40
+++ data-editor.c 24 Jul 2007 06:24:01 -0000 1.41
@@ -71,6 +71,7 @@
static void delete_cases (GtkAction *a, gpointer data);
static void delete_variables (GtkAction *a, gpointer data);
+static void toggle_value_labels (GtkToggleAction *a, gpointer data);
/* Switch between the VAR SHEET and the DATA SHEET */
@@ -102,10 +103,6 @@
static void fonts_activate (GtkMenuItem *, gpointer);
-static void value_labels_activate (GtkCheckMenuItem *, gpointer);
-static void value_labels_toggled (GtkToggleToolButton *, gpointer);
-
-
static void file_quit (GtkCheckMenuItem *, gpointer );
static void
@@ -244,6 +241,24 @@
register_data_editor_actions (de);
+ de->toggle_value_labels =
+ gtk_toggle_action_new ("toggle-value-labels",
+ _("Labels"),
+ _("Show (hide) value labels"),
+ "pspp-value-labels");
+
+ g_signal_connect (de->toggle_value_labels, "activate",
+ G_CALLBACK (toggle_value_labels), de);
+
+
+ gtk_action_connect_proxy (GTK_ACTION (de->toggle_value_labels),
+ get_widget_assert (de->xml,
+ "togglebutton-value-labels"));
+
+
+ gtk_action_connect_proxy (GTK_ACTION (de->toggle_value_labels),
+ get_widget_assert (de->xml,
+ "view_value-labels"));
de->delete_cases =
gtk_action_new ("clear-cases",
@@ -579,14 +594,6 @@
- g_signal_connect (get_widget_assert (de->xml, "view_valuelabels"),
- "activate",
- G_CALLBACK (value_labels_activate), de);
-
-
- g_signal_connect (get_widget_assert (de->xml, "togglebutton-value-labels"),
- "toggled",
- G_CALLBACK (value_labels_toggled), de);
gtk_action_connect_proxy (de->action_data_open,
get_widget_assert (de->xml, "button-open")
@@ -828,50 +835,20 @@
}
-/* The next two callbacks are mutually co-operative */
-
-/* Callback for the value labels menu item */
-static void
-value_labels_activate (GtkCheckMenuItem *menuitem, gpointer data)
-{
- struct data_editor *de = data;
-
- GtkSheet *data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
-
- GtkToggleToolButton *tb =
- GTK_TOGGLE_TOOL_BUTTON (get_widget_assert (de->xml,
- "togglebutton-value-labels"));
-
- PsppireDataStore *ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet));
-
- gboolean show_value_labels = gtk_check_menu_item_get_active (menuitem);
-
- gtk_toggle_tool_button_set_active (tb, show_value_labels);
- psppire_data_store_show_labels (ds, show_value_labels);
-}
-
-
-/* Callback for the value labels tooglebutton */
+/* Callback for the value labels action */
static void
-value_labels_toggled (GtkToggleToolButton *toggle_tool_button,
- gpointer data)
+toggle_value_labels (GtkToggleAction *ta, gpointer data)
{
struct data_editor *de = data;
GtkSheet *data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
- GtkCheckMenuItem *item =
- GTK_CHECK_MENU_ITEM (get_widget_assert (de->xml, "view_valuelabels"));
-
PsppireDataStore *ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet));
- gboolean show_value_labels =
- gtk_toggle_tool_button_get_active (toggle_tool_button);
- gtk_check_menu_item_set_active (item, show_value_labels);
-
- psppire_data_store_show_labels (ds, show_value_labels);
+ psppire_data_store_show_labels (ds,
+ gtk_toggle_action_get_active (ta));
}
@@ -1684,3 +1661,5 @@
event->button, event->time);
}
}
+
+
Index: data-editor.glade
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.glade,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- data-editor.glade 19 Jul 2007 00:36:00 -0000 1.26
+++ data-editor.glade 24 Jul 2007 06:24:01 -0000 1.27
@@ -243,7 +243,7 @@
</widget>
</child>
<child>
- <widget class="GtkCheckMenuItem" id="view_valuelabels">
+ <widget class="GtkCheckMenuItem" id="view_value-labels">
<property name="visible">True</property>
<property name="label" translatable="yes">Value
Labels</property>
<property name="use_underline">True</property>
Index: data-editor.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- data-editor.h 18 Jul 2007 05:32:22 -0000 1.17
+++ data-editor.h 24 Jul 2007 06:24:01 -0000 1.18
@@ -47,6 +47,8 @@
GtkAction *delete_variables;
GtkAction *delete_cases;
+ GtkToggleAction *toggle_value_labels;
+
GladeXML *xml;
GtkMenu *data_sheet_variable_popup_menu;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src/ui/gui data-editor.c data-editor.glade...,
John Darrington <=