<?xml version="1.0"?>
<interface>
<object class="GtkUIManager" id="uimanager1">
+ <child>
+ <object class="GtkActionGroup" id="actiongroup2">
+ <child>
+ <object class="GtkAction" id="sort-up">
+ <property name="stock-id">gtk-sort-ascending</property>
+ <property name="label" translatable="yes">Sort Ascending</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="sort-down">
+ <property name="stock-id">gtk-sort-descending</property>
+ <property name="label" translatable="yes">Sort Descending</property>
+ </object>
+ </child>
+ </object>
+ </child>
+
<child>
<object class="GtkActionGroup" id="actiongroup1">
<child>
<toolitem name="toolbar_select-cases" action="view_value-labels"/>
</placeholder>
</toolbar>
+ <popup name="datasheet-variable-popup">
+ <menuitem action="action_insert-variable"/>
+ <separator/>
+ <menuitem action="edit_clear-variables"/>
+ <separator/>
+ <menuitem action="sort-up"/>
+ <menuitem action="sort-down"/>
+ </popup>
</ui>
</object>
<!-- interface-requires gtk+ 2.6 -->
<object class="GtkMenuBar" constructor="uimanager1" id="menubar">
<property name="visible">True</property>
</object>
+ <object class="GtkMenu" constructor="uimanager1" id="datasheet-variable-popup">
+ <property name="visible">True</property>
+ </object>
<object class="GtkHandleBox" id="handlebox1">
<property name="visible">True</property>
<child>
}
-
-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)
{
}
{
- 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));