From: John Darrington Date: Mon, 27 Jul 2015 15:14:54 +0000 (+0200) Subject: PsppireDataWindow (on_switch_page): Add comment and reformat X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40ed0fae9e8d01019be469fb6133c26cd2b5a0f4;p=pspp PsppireDataWindow (on_switch_page): Add comment and reformat --- diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 5c1b48dc83..a301dda27d 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -840,15 +840,16 @@ static void on_switch_page (PsppireDataEditor *de, gpointer p, gint pagenum, PsppireDataWindow *dw) { - GtkWidget *page_menu_item; - gboolean is_ds; - const char *path; + /* Set the appropriate ui_manager according to the selected page. + This is necessary, because the menus for the variable view and + the data view are different (slightly). */ - is_ds = pagenum == PSPPIRE_DATA_EDITOR_DATA_VIEW; - path = (is_ds + gboolean is_ds = pagenum == PSPPIRE_DATA_EDITOR_DATA_VIEW; + const char *path = (is_ds ? "/ui/menubar/view/view_data" : "/ui/menubar/view/view_variables"); - page_menu_item = gtk_ui_manager_get_widget (dw->ui_manager, path); + + GtkWidget *page_menu_item = gtk_ui_manager_get_widget (dw->ui_manager, path); gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (page_menu_item), TRUE); }