Blob Blame Raw
--- gedit-2.13.2/data/gedit.schemas.in.filesel	2006-01-13 13:27:15.000000000 -0500
+++ gedit-2.13.2/data/gedit.schemas.in	2006-01-13 13:29:14.000000000 -0500
@@ -629,5 +629,26 @@
       </locale>
     </schema>
     
+    <schema>
+      <key>/schemas/apps/gedit-2/preferences/ui/open_save/selector_width</key>
+      <applyto>/apps/gedit-2/preferences/ui/open_save/selector_width</applyto>
+      <owner>gedit</owner>
+      <type>int</type> +      <default>400</default>
+      <locale name="C"> +       <short>Open/Save Dialog Width</short>
+       <long>Persistent Open/Save dialog width.</long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/gedit-2/preferences/ui/open_save/selector_height</key>
+      <applyto>/apps/gedit-2/preferences/ui/open_save/selector_height</applyto>
+      <owner>gedit</owner>
+      <type>int</type>
+      <default>400</default>
+      <locale name="C">
+       <short>Open/Save Dialog Height</short>
+       <long>Persistent Open/Save dialog height.</long>
+      </locale>
+    </schema>
   </schemalist>
 </gconfschemafile>
--- gedit-2.13.2/gedit/gedit-prefs-manager.h.filesel	2006-01-13 13:29:39.000000000 -0500
+++ gedit-2.13.2/gedit/gedit-prefs-manager.h	2006-01-13 13:36:05.000000000 -0500
@@ -106,6 +106,10 @@
 #define GPM_RECENTS_DIR			GPM_PREFS_DIR "/ui/recents"
 #define GPM_MAX_RECENTS			GPM_RECENTS_DIR "/max_recents"
 
+#define GPM_OPENSAVE_DIR                GPM_PREFS_DIR "/ui/open_save"
+#define GPM_OPENSAVE_WIDTH              GPM_OPENSAVE_DIR "/selector_width"
+#define GPM_OPENSAVE_HEIGHT             GPM_OPENSAVE_DIR "/selector_height"
+
 /* Print */
 #define GPM_PRINT_PAGE_DIR		GPM_PREFS_DIR "/print/page"
 #define GPM_PRINT_SYNTAX		GPM_PRINT_PAGE_DIR "/print_syntax_highlighting"
@@ -189,6 +193,9 @@
 
 #define GPM_DEFAULT_MAX_RECENTS		5
 
+#define GPM_DEFAULT_OPENSAVE_WIDTH      400
+#define GPM_DEFAULT_OPENSAVE_HEIGHT     400
+
 #define GPM_DEFAULT_WINDOW_STATE	0
 #define GPM_DEFAULT_WINDOW_WIDTH	650
 #define GPM_DEFAULT_WINDOW_HEIGHT	500
@@ -386,6 +393,15 @@
  */
 gint		 	 gedit_prefs_manager_get_max_recents		(void);
 
+/* Persistent size of open/save dialogs */
+gint                     gedit_prefs_manager_get_opensave_dialog_width      (void);
+void                     gedit_prefs_manager_set_opensave_dialog_width      (gint width);
+gboolean                 gedit_prefs_manager_opensave_dialog_width_can_set  (void);
+
+gint                     gedit_prefs_manager_get_opensave_dialog_height     (void);
+void                     gedit_prefs_manager_set_opensave_dialog_height     (gint height);
+gboolean                 gedit_prefs_manager_opensave_dialog_height_can_set (void);
+
 /* Encodings */
 GSList 			*gedit_prefs_manager_get_auto_detected_encodings (void);
 
--- gedit-2.13.2/gedit/gedit-prefs-manager.c.filesel	2006-01-13 13:42:22.000000000 -0500
+++ gedit-2.13.2/gedit/gedit-prefs-manager.c	2006-01-13 13:42:56.000000000 -0500
@@ -721,6 +721,16 @@
 
 }
 
+/* Open/Save dialog width */
+DEFINE_INT_PREF (opensave_dialog_width,
+                GPM_OPENSAVE_WIDTH,
+                GPM_DEFAULT_OPENSAVE_WIDTH)
+
+/* Open/Save dialog height */
+DEFINE_INT_PREF (opensave_dialog_height,
+                GPM_OPENSAVE_HEIGHT,
+                GPM_DEFAULT_OPENSAVE_HEIGHT)
+
 /* Statusbar visiblity */
 DEFINE_BOOL_PREF (statusbar_visible,
 		  GPM_STATUSBAR_VISIBLE,
--- gedit-2.13.2/gedit/gedit-commands-file.c.filesel	2006-01-13 13:36:19.000000000 -0500
+++ gedit-2.13.2/gedit/gedit-commands-file.c	2006-01-13 13:42:11.000000000 -0500
@@ -50,6 +50,7 @@
 #include "dialogs/gedit-close-confirmation-dialog.h"
 #include "dialogs/gedit-open-location-dialog.h"
 #include "gedit-file-chooser-dialog.h"
+#include "gedit-prefs-manager.h"
 
 
 /* Defined constants */
@@ -239,9 +240,15 @@
 {
 	GSList              *uris;
 	const GeditEncoding *encoding;
+        gint                 selector_width;
+        gint                 selector_height;
 
 	gedit_debug (DEBUG_COMMANDS);
 
+        gtk_window_get_size (GTK_WINDOW (dialog), &selector_width, &selector_height);
+        gedit_prefs_manager_set_opensave_dialog_width (selector_width);
+        gedit_prefs_manager_set_opensave_dialog_height (selector_height);
+
 	if (response_id != GTK_RESPONSE_OK)
 	{
 		gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -272,6 +279,8 @@
 	gpointer       data;
 	GeditDocument *doc;
 	gchar         *default_path = NULL;
+        gint           selector_width;
+        gint           selector_height;
 
 	gedit_debug (DEBUG_COMMANDS);
 
@@ -336,6 +345,9 @@
 
 	g_free (default_path);
 
+        selector_width = gedit_prefs_manager_get_opensave_dialog_width ();
+        selector_height = gedit_prefs_manager_get_opensave_dialog_height ();
+        gtk_window_resize (GTK_WINDOW (open_dialog), selector_width, selector_height);
 	g_signal_connect (open_dialog,
 			  "response",
 			  G_CALLBACK (open_dialog_response_cb),
@@ -585,6 +597,8 @@
 	GeditTab            *tab;
 	gpointer	     data;
 	GSList		    *tabs_to_save_as;
+        gint                 selector_width;
+        gint                 selector_height;
 
 	gedit_debug (DEBUG_COMMANDS);
 
@@ -603,6 +617,10 @@
 
 	encoding = gedit_file_chooser_dialog_get_encoding (dialog);
 
+        gtk_window_get_size (GTK_WINDOW (dialog), &selector_width, &selector_height);
+        gedit_prefs_manager_set_opensave_dialog_width (selector_width);
+        gedit_prefs_manager_set_opensave_dialog_height (selector_height);
+
 	gtk_widget_destroy (GTK_WIDGET (dialog));
 
 	if (tab != NULL)
@@ -701,6 +719,8 @@
 	gchar *uri;
 	gboolean uri_set = FALSE;
 	const GeditEncoding *encoding;
+        gint selector_width;
+        gint selector_height;
 
 	g_return_if_fail (GEDIT_IS_TAB (tab));
 	g_return_if_fail (GEDIT_IS_WINDOW (window));
@@ -778,6 +798,10 @@
 			  G_CALLBACK (save_dialog_response_cb),
 			  window);
 
+        selector_width = gedit_prefs_manager_get_opensave_dialog_width();
+        selector_height = gedit_prefs_manager_get_opensave_dialog_height();
+        gtk_window_resize (GTK_WINDOW (save_dialog), selector_width, selector_height);
+
 	gtk_widget_show (save_dialog);
 }