pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/ui/gui ChangeLog data-editor.c data-ed...


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui ChangeLog data-editor.c data-ed...
Date: Tue, 03 Apr 2007 10:08:59 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   07/04/03 10:08:59

Modified files:
        src/ui/gui     : ChangeLog data-editor.c data-editor.glade 
                         helper.h syntax-editor.c syntax-editor.h 

Log message:
        Implemented the recently used files menus.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/ChangeLog?cvsroot=pspp&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.glade?cvsroot=pspp&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/helper.h?cvsroot=pspp&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/syntax-editor.c?cvsroot=pspp&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/syntax-editor.h?cvsroot=pspp&r1=1.3&r2=1.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/ChangeLog,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- ChangeLog   31 Mar 2007 11:44:45 -0000      1.47
+++ ChangeLog   3 Apr 2007 10:08:59 -0000       1.48
@@ -1,3 +1,9 @@
+2007-04-03   John Darrington <address@hidden>
+       
+       * data-editor.c data-editor.glade helper.h syntax-editor.c
+       syntax-editor.h : Implemented the File->Recently_Used_ menus.
+
+
 2007-03-31   John Darrington <address@hidden>
         
        * data-editor.c data-editor.glade data-editor.h dialog-common.c

Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- data-editor.c       2 Apr 2007 08:55:52 -0000       1.22
+++ data-editor.c       3 Apr 2007 10:08:59 -0000       1.23
@@ -54,6 +54,7 @@
 static void insert_variable (GtkCheckMenuItem *m, gpointer data);
 
 
+
 /* Switch between the VAR SHEET and the DATA SHEET */
 enum {PAGE_DATA_SHEET = 0, PAGE_VAR_SHEET};
 
@@ -115,6 +116,56 @@
   return FALSE;
 }
 
+static void open_data_file (const gchar *, struct data_editor *);
+
+
+
+#if RECENT_LISTS_AVAILABLE
+
+static void
+on_recent_data_select (GtkMenuShell *menushell,   gpointer user_data)
+{
+  gchar *file;
+
+  struct data_editor *de = user_data;
+
+  gchar *uri =
+    gtk_recent_chooser_get_current_uri (GTK_RECENT_CHOOSER (menushell));
+
+  file = g_filename_from_uri (uri, NULL, NULL);
+
+  g_free (uri);
+
+  open_data_file (file, de);
+
+  g_free (file);
+}
+
+static void
+on_recent_files_select (GtkMenuShell *menushell,   gpointer user_data)
+{
+  gchar *file;
+
+  struct syntax_editor *se ;
+
+  gchar *uri =
+    gtk_recent_chooser_get_current_uri (GTK_RECENT_CHOOSER (menushell));
+
+  file = g_filename_from_uri (uri, NULL, NULL);
+
+  g_free (uri);
+
+  se = (struct syntax_editor *)
+    window_create (WINDOW_SYNTAX, file);
+
+  load_editor_from_file (se, file, NULL);
+
+  g_free (file);
+}
+
+#endif
+
+
 
 /*
   Create a new data editor.
@@ -211,6 +262,45 @@
                            G_CALLBACK (gtk_action_activate),
                            de->action_data_open);
 
+
+#if RECENT_LISTS_AVAILABLE
+  {
+    GtkRecentManager *rm = gtk_recent_manager_get_default ();
+    GtkWidget *recent_data = get_widget_assert (de->xml, "file_recent-data");
+    GtkWidget *recent_files = get_widget_assert (de->xml, "file_recent-files");
+
+    GtkWidget *menu = gtk_recent_chooser_menu_new_for_manager (rm);
+
+    GtkRecentFilter *filter = gtk_recent_filter_new ();
+
+    gtk_recent_filter_add_pattern (filter, "*.sav");
+    gtk_recent_filter_add_pattern (filter, "*.SAV");
+
+    gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu), filter);
+
+    gtk_widget_set_sensitive (recent_data, TRUE);
+    g_signal_connect (menu, "selection-done",
+                     G_CALLBACK (on_recent_data_select), de);
+
+    gtk_menu_item_set_submenu (GTK_MENU_ITEM (recent_data), menu);
+
+
+    filter = gtk_recent_filter_new ();
+    menu = gtk_recent_chooser_menu_new_for_manager (rm);
+
+    gtk_recent_filter_add_pattern (filter, "*.sps");
+    gtk_recent_filter_add_pattern (filter, "*.SPS");
+
+    gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu), filter);
+
+    gtk_widget_set_sensitive (recent_files, TRUE);
+    g_signal_connect (menu, "selection-done",
+                     G_CALLBACK (on_recent_files_select), de);
+
+    gtk_menu_item_set_submenu (GTK_MENU_ITEM (recent_files), menu);
+  }
+#endif
+
   g_signal_connect (get_widget_assert (de->xml,"file_new_syntax"),
                    "activate",
                    G_CALLBACK (new_syntax_window),
@@ -1009,6 +1099,26 @@
 }
 
 
+static void
+open_data_file (const gchar *file_name, struct data_editor *de)
+{
+  struct getl_interface *sss;
+  struct string filename;
+
+  ds_init_cstr (&filename, file_name);
+
+  gen_quoted_string (&filename);
+
+  sss = create_syntax_string_source ("GET FILE=%s.",
+                                    ds_cstr (&filename));
+
+  execute_syntax (sss);
+  ds_destroy (&filename);
+
+  window_set_name_from_filename ((struct editor_window *) de, file_name);
+}
+
+
 /* Callback for the data_open action.
    Prompts for a filename and opens it */
 static void
@@ -1045,23 +1155,24 @@
     {
     case GTK_RESPONSE_ACCEPT:
       {
-       struct getl_interface *sss;
-       struct string filename;
        g_free (de->file_name);
        de->file_name =
          gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
 
-       ds_init_cstr (&filename, de->file_name);
+       open_data_file (de->file_name, de);
 
-       gen_quoted_string (&filename);
+#if RECENT_LISTS_AVAILABLE
+       {
+         GtkRecentManager *manager = gtk_recent_manager_get_default();
+         gchar *uri = g_filename_to_uri (de->file_name, NULL, NULL);
 
-       sss = create_syntax_string_source ("GET FILE=%s.",
-                                          ds_cstr (&filename));
+         if ( ! gtk_recent_manager_add_item (manager, uri))
+           g_warning ("Could not add item %s to recent list\n",uri);
 
-       execute_syntax (sss);
-       ds_destroy (&filename);
+         g_free (uri);
+       }
+#endif
 
-       window_set_name_from_filename (e, de->file_name);
       }
       break;
     default:
@@ -1070,7 +1181,3 @@
 
   gtk_widget_destroy (dialog);
 }
-
-
-
-

Index: data-editor.glade
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.glade,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- data-editor.glade   31 Mar 2007 11:44:45 -0000      1.15
+++ data-editor.glade   3 Apr 2007 10:08:59 -0000       1.16
@@ -88,6 +88,28 @@
                       </widget>
                     </child>
                     <child>
+                      <widget class="GtkSeparatorMenuItem" 
id="separatormenuitem2">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkMenuItem" id="file_recent-data">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="label" translatable="yes">Recently 
Used Da_ta</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkMenuItem" id="file_recent-files">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="label" translatable="yes">Recently 
Used _Files</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                    </child>
+                    <child>
                       <widget class="GtkSeparatorMenuItem" 
id="separatormenuitem1">
                         <property name="visible">True</property>
                       </widget>
@@ -442,13 +464,12 @@
                     <property name="visible">True</property>
                     <property name="sensitive">False</property>
                     <property name="tooltip" 
translatable="yes">Recall</property>
-                    <property name="stock_id">pspp-recent-dialogs</property>
+                    <property name="stock_id">gtk-missing-image</property>
                   </widget>
                   <packing>
                     <property name="expand">False</property>
                   </packing>
                 </child>
-
                 <child>
                   <widget class="GtkSeparatorToolItem" id="separatortoolitem1">
                     <property name="visible">True</property>
@@ -664,25 +685,25 @@
                     <property name="n_rows">1</property>
                     <property name="n_columns">2</property>
                     <child>
-                      <widget class="GtkEntry" id="entry4">
+                      <widget class="GtkEntry" id="cell_ref_entry">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
+                        <property name="sensitive">False</property>
+                        <property name="editable">False</property>
+                        <property name="width_chars">25</property>
                       </widget>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkEntry" id="cell_ref_entry">
+                      <widget class="GtkEntry" id="entry4">
                         <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="editable">False</property>
-                        <property name="width_chars">25</property>
+                        <property name="can_focus">True</property>
                       </widget>
                       <packing>
-                        <property name="x_options">GTK_FILL</property>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
@@ -1213,63 +1234,63 @@
                 <property name="column_spacing">2</property>
                 <property name="row_spacing">1</property>
                 <child>
-                  <widget class="GtkHBox" id="hbox2">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkLabel" id="width_label">
+                  <widget class="GtkLabel" id="decimals_label">
                         <property name="visible">True</property>
-                        <property name="label" 
translatable="yes">Width:</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Decimal 
Places:</property>
                         <property name="justify">GTK_JUSTIFY_RIGHT</property>
                       </widget>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="pack_type">GTK_PACK_END</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
+                    <property name="y_options"></property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="decimals_entry">
+                  <widget class="GtkEntry" id="width_entry">
                     <property name="width_request">25</property>
-                    <property name="visible">True</property>
                     <property name="can_focus">True</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
                     <property name="y_options"></property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="width_entry">
+                  <widget class="GtkEntry" id="decimals_entry">
                     <property name="width_request">25</property>
+                    <property name="visible">True</property>
                     <property name="can_focus">True</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
                     <property name="y_options"></property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="decimals_label">
+                  <widget class="GtkHBox" id="hbox2">
                     <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Decimal 
Places:</property>
+                    <child>
+                      <widget class="GtkLabel" id="width_label">
+                        <property name="visible">True</property>
+                        <property name="label" 
translatable="yes">Width:</property>
                     <property name="justify">GTK_JUSTIFY_RIGHT</property>
                   </widget>
                   <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">GTK_PACK_END</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options">GTK_FILL</property>
                   </packing>
                 </child>
               </widget>
@@ -1356,28 +1377,50 @@
                     <property name="n_columns">2</property>
                     <property name="row_spacing">5</property>
                     <child>
-                      <widget class="GtkScrolledWindow" id="scrolledwindow3">
+                      <widget class="GtkVButtonBox" id="vbuttonbox2">
                         <property name="visible">True</property>
+                        <property name="border_width">5</property>
+                        <child>
+                          <widget class="GtkButton" id="val_labs_add">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
                         <property name="can_focus">True</property>
-                        <property 
name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-                        <property 
name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                        <property 
name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                            <property name="can_default">True</property>
+                            <property name="label">gtk-add</property>
+                            <property name="use_stock">True</property>
+                          </widget>
+                        </child>
                         <child>
-                          <widget class="GtkTreeView" id="treeview1">
+                          <widget class="GtkButton" id="val_labs_change">
                             <property name="visible">True</property>
+                            <property name="sensitive">False</property>
                             <property name="can_focus">True</property>
-                            <property name="headers_visible">False</property>
-                            <property name="enable_search">False</property>
+                            <property name="can_default">True</property>
+                            <property name="label">gtk-apply</property>
+                            <property name="use_stock">True</property>
                           </widget>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkButton" id="val_labs_remove">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="can_default">True</property>
+                            <property name="label">gtk-remove</property>
+                            <property name="use_stock">True</property>
+                          </widget>
+                          <packing>
+                            <property name="position">2</property>
+                          </packing>
                         </child>
                       </widget>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
                         <property name="top_attach">1</property>
                         <property name="bottom_attach">2</property>
                         <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
                       </packing>
                     </child>
                     <child>
@@ -1389,26 +1432,27 @@
                         <property name="column_spacing">5</property>
                         <property name="row_spacing">4</property>
                         <child>
-                          <widget class="GtkHBox" id="hbox4">
-                            <property name="visible">True</property>
-                            <child>
-                              <widget class="GtkEntry" id="value_entry">
-                                <property name="width_request">85</property>
+                          <widget class="GtkLabel" id="label5">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" 
translatable="yes">Value:</property>
                               </widget>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="padding">1</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
                               </packing>
                             </child>
+                        <child>
+                          <widget class="GtkLabel" id="label6">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Value 
Label:</property>
                           </widget>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options">GTK_FILL</property>
+                            <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
@@ -1425,27 +1469,26 @@
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="label6">
+                          <widget class="GtkHBox" id="hbox4">
                             <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Value 
Label:</property>
+                            <child>
+                              <widget class="GtkEntry" id="value_entry">
+                                <property name="width_request">85</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
                           </widget>
                           <packing>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">1</property>
                           </packing>
                         </child>
-                        <child>
-                          <widget class="GtkLabel" id="label5">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="label" 
translatable="yes">Value:</property>
                           </widget>
                           <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                       </widget>
@@ -1455,50 +1498,28 @@
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkVButtonBox" id="vbuttonbox2">
-                        <property name="visible">True</property>
-                        <property name="border_width">5</property>
-                        <child>
-                          <widget class="GtkButton" id="val_labs_add">
-                            <property name="visible">True</property>
-                            <property name="sensitive">False</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="label">gtk-add</property>
-                            <property name="use_stock">True</property>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkButton" id="val_labs_change">
+                      <widget class="GtkScrolledWindow" id="scrolledwindow3">
                             <property name="visible">True</property>
-                            <property name="sensitive">False</property>
                             <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="label">gtk-apply</property>
-                            <property name="use_stock">True</property>
-                          </widget>
-                          <packing>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property 
name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                        <property 
name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                        <property 
name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
                         <child>
-                          <widget class="GtkButton" id="val_labs_remove">
+                          <widget class="GtkTreeView" id="treeview1">
                             <property name="visible">True</property>
-                            <property name="sensitive">False</property>
                             <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="label">gtk-remove</property>
-                            <property name="use_stock">True</property>
+                            <property name="headers_visible">False</property>
+                            <property name="enable_search">False</property>
                           </widget>
-                          <packing>
-                            <property name="position">2</property>
-                          </packing>
                         </child>
                       </widget>
                       <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
                         <property name="top_attach">1</property>
                         <property name="bottom_attach">2</property>
                         <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
                       </packing>
                     </child>
                   </widget>
@@ -1584,68 +1605,62 @@
         <property name="n_rows">2</property>
         <property name="n_columns">2</property>
         <child>
-          <widget class="GtkVBox" id="vbox7">
+          <widget class="GtkVButtonBox" id="vbuttonbox5">
             <property name="visible">True</property>
+            <property name="border_width">5</property>
+            <property name="spacing">5</property>
+            <property name="layout_style">GTK_BUTTONBOX_START</property>
             <child>
-              <widget class="GtkRadioButton" id="range_missing">
+              <widget class="GtkButton" id="missing_val_ok">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="label" translatable="yes">_Range plus one 
optional discrete missing value</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <property name="draw_indicator">True</property>
-                <property name="group">no_missing</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-ok</property>
+                <property name="use_stock">True</property>
               </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-              </packing>
             </child>
             <child>
-              <widget class="GtkVBox" id="vbox8">
-                <property name="visible">True</property>
-                <property name="spacing">5</property>
-                <child>
-                  <widget class="GtkHBox" id="hbox7">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkHBox" id="hbox8">
-                        <property name="visible">True</property>
-                        <child>
-                          <widget class="GtkLabel" id="label11">
+              <widget class="GtkButton" id="missing_val_cancel">
                             <property name="visible">True</property>
-                            <property name="label" 
translatable="yes">_Low:</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">mv-low</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-cancel</property>
+                <property name="use_stock">True</property>
                           </widget>
                           <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="padding">20</property>
+                <property name="position">1</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="mv-low">
-                            <property name="width_request">75</property>
+              <widget class="GtkButton" id="help_button_missing_values">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-help</property>
+                <property name="use_stock">True</property>
                           </widget>
                           <packing>
-                            <property name="expand">False</property>
-                            <property name="position">1</property>
+                <property name="position">2</property>
                           </packing>
                         </child>
                       </widget>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+          </packing>
                     </child>
                     <child>
-                      <widget class="GtkHBox" id="hbox9">
+          <widget class="GtkVBox" id="vbox5">
                         <property name="visible">True</property>
+            <property name="spacing">12</property>
                         <child>
-                          <widget class="GtkLabel" id="label12">
+              <widget class="GtkRadioButton" id="no_missing">
                             <property name="visible">True</property>
-                            <property name="label" 
translatable="yes">_High:</property>
+                <property name="can_focus">True</property>
+                <property name="label" translatable="yes">_No missing 
values</property>
                             <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">mv-high</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
                             <property name="expand">False</property>
@@ -1653,102 +1668,97 @@
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="mv-high">
-                            <property name="width_request">75</property>
+              <widget class="GtkVBox" id="vbox6">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkRadioButton" id="discrete_missing">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                    <property name="label" translatable="yes">_Discrete 
missing values</property>
+                    <property name="use_underline">True</property>
+                    <property name="focus_on_click">False</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">no_missing</property>
                           </widget>
                           <packing>
-                            <property name="padding">5</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
+                    <property name="expand">False</property>
                         <property name="fill">False</property>
-                        <property name="padding">20</property>
-                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </widget>
-                </child>
+                  <widget class="GtkHBox" id="hbox10">
+                    <property name="visible">True</property>
                 <child>
-                  <widget class="GtkHBox" id="hbox6">
+                      <widget class="GtkHBox" id="hbox5">
                     <property name="visible">True</property>
+                        <property name="border_width">5</property>
+                        <property name="spacing">5</property>
+                        <property name="homogeneous">True</property>
                     <child>
-                      <widget class="GtkLabel" id="label10">
+                          <widget class="GtkEntry" id="mv0">
+                            <property name="width_request">75</property>
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">Di_screte 
value:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">mv-discrete</property>
+                            <property name="can_focus">True</property>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
-                        <property name="padding">20</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkEntry" id="mv-discrete">
+                          <widget class="GtkEntry" id="mv1">
                         <property name="width_request">75</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
+                            <property name="fill">False</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
+                        <child>
+                          <widget class="GtkEntry" id="mv2">
+                            <property name="width_request">75</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
                   </widget>
                   <packing>
-                    <property name="position">1</property>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
                   </packing>
                 </child>
               </widget>
               <packing>
-                <property name="position">1</property>
+                        <property name="padding">20</property>
               </packing>
             </child>
           </widget>
           <packing>
-            <property name="right_attach">2</property>
-            <property name="top_attach">1</property>
-            <property name="bottom_attach">2</property>
-            <property name="x_options">GTK_FILL</property>
+                    <property name="position">1</property>
           </packing>
         </child>
-        <child>
-          <widget class="GtkVBox" id="vbox5">
-            <property name="visible">True</property>
-            <property name="spacing">12</property>
-            <child>
-              <widget class="GtkRadioButton" id="no_missing">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="label" translatable="yes">_No missing 
values</property>
-                <property name="use_underline">True</property>
-                <property name="active">True</property>
-                <property name="draw_indicator">True</property>
               </widget>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="y_options">GTK_FILL</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkVBox" id="vbox6">
+          <widget class="GtkVBox" id="vbox7">
                 <property name="visible">True</property>
                 <child>
-                  <widget class="GtkRadioButton" id="discrete_missing">
+              <widget class="GtkRadioButton" id="range_missing">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="label" translatable="yes">_Discrete 
missing values</property>
+                <property name="label" translatable="yes">_Range plus one 
optional discrete missing value</property>
                     <property name="use_underline">True</property>
                     <property name="focus_on_click">False</property>
                     <property name="draw_indicator">True</property>
@@ -1760,114 +1770,125 @@
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkHBox" id="hbox10">
+              <widget class="GtkVBox" id="vbox8">
                     <property name="visible">True</property>
+                <property name="spacing">5</property>
                     <child>
-                      <widget class="GtkHBox" id="hbox5">
+                  <widget class="GtkHBox" id="hbox7">
                         <property name="visible">True</property>
-                        <property name="border_width">5</property>
-                        <property name="spacing">5</property>
-                        <property name="homogeneous">True</property>
                         <child>
-                          <widget class="GtkEntry" id="mv0">
-                            <property name="width_request">75</property>
+                      <widget class="GtkHBox" id="hbox8">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
+                        <child>
+                          <widget class="GtkLabel" id="label11">
+                            <property name="visible">True</property>
+                            <property name="label" 
translatable="yes">_Low:</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">mv-low</property>
                           </widget>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="padding">20</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="mv1">
+                          <widget class="GtkEntry" id="mv-low">
                             <property name="width_request">75</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                           </widget>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="fill">False</property>
                             <property name="position">1</property>
                           </packing>
                         </child>
+                      </widget>
+                    </child>
                         <child>
-                          <widget class="GtkEntry" id="mv2">
-                            <property name="width_request">75</property>
+                      <widget class="GtkHBox" id="hbox9">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
+                        <child>
+                          <widget class="GtkLabel" id="label12">
+                            <property name="visible">True</property>
+                            <property name="label" 
translatable="yes">_High:</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">mv-high</property>
                           </widget>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="padding">20</property>
                       </packing>
                     </child>
+                        <child>
+                          <widget class="GtkEntry" id="mv-high">
+                            <property name="width_request">75</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
                   </widget>
                   <packing>
+                            <property name="padding">5</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
               </widget>
               <packing>
-                <property name="expand">False</property>
                 <property name="fill">False</property>
+                        <property name="padding">20</property>
                 <property name="position">1</property>
               </packing>
             </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
           </widget>
-          <packing>
-            <property name="y_options">GTK_FILL</property>
-          </packing>
         </child>
         <child>
-          <widget class="GtkVButtonBox" id="vbuttonbox5">
+                  <widget class="GtkHBox" id="hbox6">
             <property name="visible">True</property>
-            <property name="border_width">5</property>
-            <property name="spacing">5</property>
-            <property name="layout_style">GTK_BUTTONBOX_START</property>
             <child>
-              <widget class="GtkButton" id="missing_val_ok">
+                      <widget class="GtkLabel" id="label10">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-ok</property>
-                <property name="use_stock">True</property>
+                        <property name="label" translatable="yes">Di_screte 
value:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">mv-discrete</property>
               </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="padding">20</property>
+                      </packing>
             </child>
             <child>
-              <widget class="GtkButton" id="missing_val_cancel">
+                      <widget class="GtkEntry" id="mv-discrete">
+                        <property name="width_request">75</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-cancel</property>
-                <property name="use_stock">True</property>
               </widget>
               <packing>
+                        <property name="expand">False</property>
                 <property name="position">1</property>
               </packing>
             </child>
-            <child>
-              <widget class="GtkButton" id="help_button_missing_values">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-help</property>
-                <property name="use_stock">True</property>
               </widget>
               <packing>
-                <property name="position">2</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
               </packing>
             </child>
           </widget>
           <packing>
-            <property name="left_attach">1</property>
             <property name="right_attach">2</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_FILL</property>
           </packing>
         </child>
       </widget>

Index: helper.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/helper.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- helper.h    26 Mar 2007 10:11:01 -0000      1.12
+++ helper.h    3 Apr 2007 10:08:59 -0000       1.13
@@ -29,6 +29,15 @@
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 
+
+/*
+   GtkRecentChooserMenu was added in 2.10.0
+   but it didn't support GtkRecentFilters until
+   2.10.2
+*/
+#define RECENT_LISTS_AVAILABLE GTK_CHECK_VERSION (2, 10, 2)
+
+
 /* Formats a value according to FORMAT
    The returned string must be freed when no longer required */
 gchar * value_to_text (union value v, struct fmt_spec format);

Index: syntax-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/syntax-editor.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- syntax-editor.c     26 Mar 2007 10:11:01 -0000      1.16
+++ syntax-editor.c     3 Apr 2007 10:08:59 -0000       1.17
@@ -466,7 +466,7 @@
 /*
   Loads the buffer from the file called FILENAME
 */
-static gboolean
+gboolean
 load_editor_from_file (struct syntax_editor *se,
                       const gchar *filename,
                       GError **err)
@@ -492,6 +492,9 @@
 
   gtk_text_buffer_insert (buffer, &iter, text, -1);
 
+
+
+
   window_set_name_from_filename ((struct editor_window *)se, filename);
   gtk_text_buffer_set_modified (buffer, FALSE);
 
@@ -536,6 +539,19 @@
        window_create (WINDOW_SYNTAX, file_name);
 
       load_editor_from_file (se, file_name, NULL);
+
+#if RECENT_LISTS_AVAILABLE
+      {
+       GtkRecentManager *manager = gtk_recent_manager_get_default();
+       gchar *uri = g_filename_to_uri (file_name, NULL, NULL);
+
+       if ( ! gtk_recent_manager_add_item (manager, uri))
+         g_warning ("Could not add item %s to recent list\n",uri);
+
+       g_free (uri);
+      }
+#endif
+
     }
 
   gtk_widget_destroy (dialog);

Index: syntax-editor.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/syntax-editor.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- syntax-editor.h     23 Dec 2006 23:05:59 -0000      1.3
+++ syntax-editor.h     3 Apr 2007 10:08:59 -0000       1.4
@@ -41,5 +41,7 @@
 
 void open_syntax_window (GtkMenuItem *, gpointer);
 
-
+gboolean load_editor_from_file (struct syntax_editor *se,
+                               const gchar *filename,
+                               GError **err);
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]