From: John Darrington Date: Sun, 9 May 2010 18:12:14 +0000 (+0200) Subject: Move implementation of the datasheet variable popup menu to the GtkBuilder file X-Git-Tag: v0.7.5~25^2~24 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bfe6b7a62becebdd5a8b37badec3f0508a99aad;p=pspp-builds.git Move implementation of the datasheet variable popup menu to the GtkBuilder file --- diff --git a/src/ui/gui/data-editor.ui b/src/ui/gui/data-editor.ui index 9ba68677..9e1fa74e 100644 --- a/src/ui/gui/data-editor.ui +++ b/src/ui/gui/data-editor.ui @@ -1,6 +1,23 @@ + + + + + gtk-sort-ascending + Sort Ascending + + + + + gtk-sort-descending + Sort Descending + + + + + @@ -568,6 +585,14 @@ + + + + + + + + @@ -575,6 +600,9 @@ True + + True + True diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 55e206e1..aedfe4f0 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -843,73 +843,6 @@ file_quit (GtkCheckMenuItem *menuitem, gpointer data) } - -static GtkWidget * -create_data_sheet_variable_popup_menu (PsppireDataWindow *de) -{ - GtkWidget *menu = gtk_menu_new (); - - GtkWidget *sort_ascending = - gtk_action_create_menu_item (gtk_action_new ("sort-up", - _("Sort Ascending"), - NULL, - "gtk-sort-ascending")); - - GtkWidget *sort_descending = - gtk_action_create_menu_item (gtk_action_new ("sort-down", - _("Sort Descending"), - NULL, - "gtk-sort-descending")); - - GtkWidget *insert_variable = - gtk_menu_item_new_with_label (_("Insert Variable")); - - GtkWidget *clear_variable = - gtk_menu_item_new_with_label (_("Clear")); - - - gtk_action_connect_proxy (de->delete_variables, - clear_variable ); - - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), insert_variable); - - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), - gtk_separator_menu_item_new ()); - - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), clear_variable); - - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), - gtk_separator_menu_item_new ()); - - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), sort_ascending); - - - g_signal_connect_swapped (sort_ascending, "activate", - G_CALLBACK (psppire_data_editor_sort_ascending), - de->data_editor); - - g_signal_connect_swapped (sort_descending, "activate", - G_CALLBACK (psppire_data_editor_sort_descending), - de->data_editor); - - g_signal_connect_swapped (insert_variable, "activate", - G_CALLBACK (gtk_action_activate), - de->insert_variable); - - - gtk_menu_shell_append (GTK_MENU_SHELL (menu), sort_descending); - - gtk_widget_show_all (menu); - - return menu; -} - - static GtkWidget * create_data_sheet_cases_popup_menu (PsppireDataWindow *de) { @@ -1817,8 +1750,16 @@ psppire_data_window_init (PsppireDataWindow *de) } { - GtkMenu *data_sheet_variable_popup_menu = - GTK_MENU (create_data_sheet_variable_popup_menu (de)); + GtkMenu *data_sheet_variable_popup_menu = get_widget_assert (de->builder, + "datasheet-variable-popup"); + + g_signal_connect_swapped (get_action_assert (de->builder, "sort-up"), "activate", + G_CALLBACK (psppire_data_editor_sort_ascending), + de->data_editor); + + g_signal_connect_swapped (get_action_assert (de->builder, "sort-down"), "activate", + G_CALLBACK (psppire_data_editor_sort_descending), + de->data_editor); GtkMenu *var_sheet_variable_popup_menu = GTK_MENU (create_var_sheet_variable_popup_menu (de));