[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[datasets 18/18] gui: Change View|Data and View|Variables to radio butto
From: |
Ben Pfaff |
Subject: |
[datasets 18/18] gui: Change View|Data and View|Variables to radio button menu items. |
Date: |
Sat, 30 Apr 2011 22:36:46 -0700 |
I didn't know what View|Variables did until I tried it, at which
point I was surprised that it changed into View|Data. I think that
a pair of radio button menu items better communicates the intent.
Also, this situation seems to fit well what the GNOME Human Interface
Guidelines say about radio button menu items:
Radio button menu items show which of two or more
mutually-exclusive settings are currently selected, and allow
the user to choose a different setting by selecting its menu
item.
* If you need to offer a choice of two mutually-exclusive
settings to the user, use a group of two radio button items
instead of a single check box menu item if the settings are
not clearly opposites. For example, represent View as Icons
and View as List as two radio button items.
---
src/ui/gui/data-editor.ui | 5 +++--
src/ui/gui/psppire-data-window.c | 7 +++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/ui/gui/data-editor.ui b/src/ui/gui/data-editor.ui
index e64334a..012605e 100644
--- a/src/ui/gui/data-editor.ui
+++ b/src/ui/gui/data-editor.ui
@@ -219,15 +219,16 @@
</object>
</child>
<child>
- <object class="GtkAction" id="view_data">
+ <object class="GtkRadioAction" id="view_data">
<property name="name">view_data</property>
<property name="label" translatable="yes">_Data</property>
</object>
</child>
<child>
- <object class="GtkAction" id="view_variables">
+ <object class="GtkRadioAction" id="view_variables">
<property name="name">view_variables</property>
<property name="label" translatable="yes">_Variables</property>
+ <property name="group">view_data</property>
</object>
</child>
<child>
diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c
index ef06d83..c3886e1 100644
--- a/src/ui/gui/psppire-data-window.c
+++ b/src/ui/gui/psppire-data-window.c
@@ -815,15 +815,14 @@ on_switch_sheet (GtkNotebook *notebook,
switch (page_num)
{
case PSPPIRE_DATA_EDITOR_VARIABLE_VIEW:
- gtk_widget_hide (view_variables);
- gtk_widget_show (view_data);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (view_variables),
+ TRUE);
gtk_action_set_sensitive (de->insert_variable, TRUE);
gtk_action_set_sensitive (de->insert_case, FALSE);
gtk_action_set_sensitive (de->invoke_goto_dialog, FALSE);
break;
case PSPPIRE_DATA_EDITOR_DATA_VIEW:
- gtk_widget_show (view_variables);
- gtk_widget_hide (view_data);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (view_data), TRUE);
gtk_action_set_sensitive (de->invoke_goto_dialog, TRUE);
gtk_action_set_sensitive (de->insert_case, TRUE);
break;
--
1.7.2.5
- [datasets 07/18] psppire-window: Use g_string_append_unichar() instead of global var., (continued)
- [datasets 07/18] psppire-window: Use g_string_append_unichar() instead of global var., Ben Pfaff, 2011/05/01
- [datasets 08/18] gui: Include only <gtk/gtk.h> to use GTK+., Ben Pfaff, 2011/05/01
- [datasets 01/18] gui: Always convert file names to UTF-8 for use in syntax., Ben Pfaff, 2011/05/01
- [datasets 14/18] gui: Fix g_object_get() memory leaks for PsppireWindow's filename., Ben Pfaff, 2011/05/01
- [datasets 03/18] gui: Fix const-ness warning for measure_to_string() return type., Ben Pfaff, 2011/05/01
- [datasets 16/18] Implement DATASET commands., Ben Pfaff, 2011/05/01
- [datasets 10/18] gui: Prefer NULL to 0 for initializing pointers., Ben Pfaff, 2011/05/01
- [datasets 18/18] gui: Change View|Data and View|Variables to radio button menu items.,
Ben Pfaff <=
- [datasets 15/18] gui: New "entry-dialog" module for prompting for a text string., Ben Pfaff, 2011/05/01
- [datasets 12/18] gui: Eliminate dataset-related global variables., Ben Pfaff, 2011/05/01
- [datasets 11/18] gui: Make syntax execution functions take a PsppireDataWindow argument., Ben Pfaff, 2011/05/01
- [datasets 04/18] gui: Fix const-ness warning in create_lines_tree_view()., Ben Pfaff, 2011/05/01
- [datasets 05/18] gui: Drop null base_finalize function from PsppireDataWindow., Ben Pfaff, 2011/05/01