From: Ben Pfaff Date: Sun, 1 May 2011 05:30:28 +0000 (-0700) Subject: gui: Change View|Data and View|Variables to radio button menu items. X-Git-Tag: v0.7.8~3 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e4c36d1b7cc62f4f2108fbfb0c412e2cafe91ef;p=pspp-builds.git gui: Change View|Data and View|Variables to radio button menu items. 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. --- diff --git a/src/ui/gui/data-editor.ui b/src/ui/gui/data-editor.ui index e64334a6..012605e5 100644 --- a/src/ui/gui/data-editor.ui +++ b/src/ui/gui/data-editor.ui @@ -219,15 +219,16 @@ - + view_data _Data - + view_variables _Variables + view_data diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index ef06d83a..c3886e1d 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;