This commit is contained in:
Matthias Clasen 2007-11-19 02:51:17 +00:00
parent 40275feb7f
commit 139998e8a2
6 changed files with 5 additions and 8179 deletions

View File

@ -1,176 +0,0 @@
--- gedit-2.13.1/data/gedit.schemas.in.filesel 2006-01-08 21:06:29.000000000 -0500
+++ gedit-2.13.1/data/gedit.schemas.in 2006-01-08 21:19:10.000000000 -0500
@@ -604,5 +604,29 @@
is writable by default.</long>
</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.1/gedit/gedit-prefs-manager.h.filesel 2006-01-08 21:10:21.000000000 -0500
+++ gedit-2.13.1/gedit/gedit-prefs-manager.h 2006-01-08 21:22:10.000000000 -0500
@@ -101,6 +101,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"
@@ -184,6 +188,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
@@ -377,6 +384,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.1/gedit/gedit-commands-file.c.filesel 2006-01-08 21:22:53.000000000 -0500
+++ gedit-2.13.1/gedit/gedit-commands-file.c 2006-01-08 21:29:17.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,10 @@
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 +598,8 @@
GeditTab *tab;
gpointer data;
GSList *tabs_to_save_as;
+ gint selector_width;
+ gint selector_height;
gedit_debug (DEBUG_COMMANDS);
@@ -603,6 +618,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 +720,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 +799,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);
}
--- gedit-2.13.1/gedit/gedit-prefs-manager.c.filesel 2006-01-08 21:10:08.000000000 -0500
+++ gedit-2.13.1/gedit/gedit-prefs-manager.c 2006-01-08 21:20:17.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,

View File

@ -1,77 +0,0 @@
--- gedit-2.15.1/gedit/gedit-commands-file.c.bgo-341055-workaround 2006-05-13 13:46:43.000000000 -0400
+++ gedit-2.15.1/gedit/gedit-commands-file.c 2006-05-13 13:48:12.000000000 -0400
@@ -336,12 +336,6 @@
if (default_path == NULL)
default_path = g_strdup (_gedit_window_get_default_path (window));
- if (default_path != NULL)
- gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (open_dialog),
- default_path);
-
- 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);
@@ -351,6 +345,11 @@
window);
gtk_widget_show (open_dialog);
+
+ if (default_path != NULL)
+ gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (open_dialog),
+ default_path);
+ g_free (default_path);
}
static void
@@ -767,24 +766,6 @@
g_free (uri);
- if (!uri_set)
- {
- const gchar *default_path;
- gchar *docname;
-
- default_path = _gedit_window_get_default_path (window);
- docname = gedit_document_get_short_name_for_display (doc);
-
- if (default_path != NULL)
- gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (save_dialog),
- default_path);
-
- gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (save_dialog),
- docname);
-
- g_free (docname);
- }
-
/* Set suggested encoding */
encoding = gedit_document_get_encoding (doc);
g_return_if_fail (encoding != NULL);
@@ -807,6 +788,24 @@
gtk_window_resize (GTK_WINDOW (save_dialog), selector_width, selector_height);
gtk_widget_show (save_dialog);
+
+ if (!uri_set)
+ {
+ const gchar *default_path;
+ gchar *docname;
+
+ default_path = _gedit_window_get_default_path (window);
+ docname = gedit_document_get_short_name_for_display (doc);
+
+ if (default_path != NULL)
+ gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (save_dialog),
+ default_path);
+
+ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (save_dialog),
+ docname);
+
+ g_free (docname);
+ }
}
static void

View File

@ -1,92 +0,0 @@
diff -rup gedit-2.15.5-orig/configure.ac gedit-2.15.5/configure.ac
--- gedit-2.15.5-orig/configure.ac 2006-08-10 12:25:58.000000000 -0400
+++ gedit-2.15.5/configure.ac 2006-08-10 15:16:02.000000000 -0400
@@ -87,6 +87,12 @@ AC_SUBST(PSPELL_LIBS)
dnl ================================================================
+dnl libattr checks
+dnl ================================================================
+
+AC_CHECK_LIB(attr, attr_copy_fd)
+
+dnl ================================================================
dnl Start of pkg-config checks
dnl ================================================================
Only in gedit-2.15.5: configure.ac.xattrs
diff -rup gedit-2.15.5-orig/gedit/gedit-document-saver.c gedit-2.15.5/gedit/gedit-document-saver.c
--- gedit-2.15.5-orig/gedit/gedit-document-saver.c 2006-05-18 18:55:16.000000000 -0400
+++ gedit-2.15.5/gedit/gedit-document-saver.c 2006-08-10 15:16:08.000000000 -0400
@@ -42,6 +42,12 @@
#include <glib/gfileutils.h>
#include <libgnomevfs/gnome-vfs.h>
+#ifdef HAVE_LIBATTR
+# include <attr/libattr.h>
+#else
+# define attr_copy_fd(x1, x2, x3, x4, x5, x6) (errno = ENOSYS, -1)
+#endif
+
#include "gedit-document-saver.h"
#include "gedit-debug.h"
#include "gedit-convert.h"
@@ -457,6 +463,15 @@ get_slow_mime_type (const char *text_uri
/* ----------- local files ----------- */
+#ifdef HAVE_LIBATTR
+static int all_xattrs(const char *xattr, struct error_context *err)
+{ /* Save everything: user/root xattrs, SELinux, ACLs. */
+ (void)xattr;
+ (void)err;
+ return 1;
+}
+#endif
+
static gboolean
save_existing_local_file (GeditDocumentSaver *saver)
{
@@ -597,6 +612,22 @@ save_existing_local_file (GeditDocumentS
goto fallback_strategy;
}
+ /* copy the xattrs, like user.mime_type, over. Also ACLs and
+ SELinux context. */
+ if ((attr_copy_fd (saver->priv->local_path, saver->priv->fd,
+ tmp_filename, tmpfd,
+ all_xattrs, NULL) == -1) &&
+ (errno != EOPNOTSUPP) && (errno != ENOSYS))
+ {
+ gedit_debug_message (DEBUG_SAVER, "could not set xattrs");
+
+ close (tmpfd);
+ unlink (tmp_filename);
+ g_free (tmp_filename);
+
+ goto fallback_strategy;
+ }
+
if (!write_document_contents (tmpfd,
GTK_TEXT_BUFFER (saver->priv->document),
saver->priv->encoding,
@@ -751,6 +782,18 @@ save_existing_local_file (GeditDocumentS
}
}
+ /* copy the xattrs, like user.mime_type, over. Also ACLs and
+ SELinux context. */
+ if ((attr_copy_fd (saver->priv->local_path, saver->priv->fd,
+ backup_filename, bfd,
+ all_xattrs, NULL) == -1) &&
+ (errno != EOPNOTSUPP) && (errno != ENOSYS))
+ {
+ gedit_debug_message (DEBUG_SAVER, "could not set xattrs");
+
+ goto out; /* is it better to save or not save? */
+ }
+
if (!copy_file_data (saver->priv->fd, bfd, NULL))
{
gedit_debug_message (DEBUG_SAVER, "could not copy data into the backup");
Only in gedit-2.15.5/gedit: gedit-document-saver.c.xattrs

View File

@ -1,53 +0,0 @@
--- gedit-2.16.0/gedit/gedit-commands-file.c.a11y 2006-11-29 15:34:43.000000000 -0500
+++ gedit-2.16.0/gedit/gedit-commands-file.c 2006-11-29 15:39:53.000000000 -0500
@@ -1151,6 +1151,7 @@
gchar *primary_msg;
gchar *secondary_msg;
glong seconds;
+ AtkObject *atk_obj, *win_atk_obj;
gedit_debug (DEBUG_COMMANDS);
@@ -1258,6 +1259,15 @@
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_CANCEL);
+ atk_obj = gtk_widget_get_accessible (dialog);
+ win_atk_obj = gtk_widget_get_accessible (GTK_WIDGET (window));
+ if (GTK_IS_ACCESSIBLE (atk_obj))
+ {
+ atk_object_set_name (atk_obj, "Question");
+ atk_object_set_role (atk_obj, ATK_ROLE_ALERT);
+ atk_object_add_relationship (atk_obj, ATK_RELATION_POPUP_FOR, win_atk_obj);
+ }
+
return dialog;
}
--- gedit-2.16.0/gedit/gedit-view.c.a11y 2006-11-29 15:06:30.000000000 -0500
+++ gedit-2.16.0/gedit/gedit-view.c 2006-11-29 15:12:29.000000000 -0500
@@ -1468,7 +1468,7 @@
GtkWidget *vbox;
GtkWidget *toplevel;
GtkEntryCompletion *completion;
-
+ AtkObject *atk_obj, *win_atk_obj;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view));
@@ -1507,6 +1507,15 @@
G_CALLBACK (search_window_scroll_event),
view);
+ atk_obj = gtk_widget_get_accessible (view->priv->search_window);
+ win_atk_obj = gtk_widget_get_accessible (toplevel);
+ if (GTK_IS_ACCESSIBLE (atk_obj))
+ {
+ atk_object_set_name (atk_obj, "Line number popup");
+ atk_object_set_role (atk_obj, ATK_ROLE_ALERT);
+ atk_object_add_relationship (atk_obj, ATK_RELATION_POPUP_FOR, win_atk_obj);
+ }
+
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_widget_show (frame);

File diff suppressed because it is too large Load Diff

View File

@ -20,9 +20,9 @@
Summary: gEdit is a small but powerful text editor for GNOME
Name: gedit
Version: 2.20.2
Release: 2%{?dist}
Release: 3%{?dist}
Epoch: 1
License: GPLv2+ and GFDL+
License: GPLv2+ and GFDL
Group: Applications/Editors
Source0: http://download.gnome.org/sources/gedit/2.20/gedit-%{version}.tar.bz2
@ -196,6 +196,9 @@ fi
%changelog
* Sun Nov 18 2007 Matthias Clasen <mclasen@redhat.com> - 1:2.20.2-3
- Fix the license field
* Tue Nov 13 2007 Florian La Roche <laroche@redhat.com> - 1:2.20.2-2
- define pango_version