Move var sheet variables popup menu to GtkBuilder file
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 9 May 2010 18:47:55 +0000 (20:47 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 9 May 2010 18:47:55 +0000 (20:47 +0200)
src/ui/gui/data-editor.ui
src/ui/gui/psppire-data-window.c

index 659e2fd5592d6069c893386d651ea9a9739744a0..93bd84cd7fe4e866c7b15db9c5c95647c1ce8d40 100644 (file)
           <menuitem action="sort-up"/>
           <menuitem action="sort-down"/>
       </popup>
+      <popup name="varsheet-variable-popup">
+         <menuitem action="action_insert-variable"/>
+         <separator/>
+         <menuitem action="edit_clear-variables"/>
+      </popup>
 </ui>
   </object>
   <!-- interface-requires gtk+ 2.6 -->
   <object class="GtkMenu" constructor="uimanager1" id="datasheet-variable-popup">
     <property name="visible">True</property>
   </object>
+  <object class="GtkMenu" constructor="uimanager1" id="varsheet-variable-popup">
+    <property name="visible">True</property>
+  </object>
   <object class="GtkHandleBox" id="handlebox1">
     <property name="visible">True</property>
     <child>
index d11dc3fa867777d056e04305fb213fea857eab56..757d20e98fae44f89af04fd7800b32246206f107 100644 (file)
@@ -879,41 +879,6 @@ create_data_sheet_cases_popup_menu (PsppireDataWindow *de)
 }
 
 
-static GtkWidget *
-create_var_sheet_variable_popup_menu (PsppireDataWindow *de)
-{
-  GtkWidget *menu = gtk_menu_new ();
-
-  GtkWidget *insert_variable =
-    gtk_menu_item_new_with_label (_("Insert Variable"));
-
-  GtkWidget *delete_variable =
-    gtk_menu_item_new_with_label (_("Clear"));
-
-
-  gtk_action_connect_proxy (de->delete_variables,
-                           delete_variable);
-
-
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), insert_variable);
-
-  g_signal_connect_swapped (insert_variable, "activate",
-                           G_CALLBACK (gtk_action_activate),
-                           de->insert_variable);
-
-
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu),
-                        gtk_separator_menu_item_new ());
-
-
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), delete_variable);
-
-
-  gtk_widget_show_all (menu);
-
-  return menu;
-}
-
 
 static void
 on_recent_data_select (GtkMenuShell *menushell,
@@ -1628,8 +1593,8 @@ psppire_data_window_init (PsppireDataWindow *de)
                            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));
+    GtkMenu *var_sheet_variable_popup_menu = get_widget_assert (de->builder,
+                                                               "varsheet-variable-popup");
 
     GtkMenu *data_sheet_cases_popup_menu =
       GTK_MENU (create_data_sheet_cases_popup_menu (de));