From 8f91edb8736f66d191886aedcc7550253674eab6 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:04:17 +0000 Subject: import gedit-3.14.3-18.el7 --- diff --git a/SOURCES/0001-gedit-document-fix-close-after-save-functionality.patch b/SOURCES/0001-gedit-document-fix-close-after-save-functionality.patch new file mode 100644 index 0000000..1506c72 --- /dev/null +++ b/SOURCES/0001-gedit-document-fix-close-after-save-functionality.patch @@ -0,0 +1,107 @@ +From b0e10edb322665f5a357d9264bfbc4d759b265ea Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 15 Apr 2016 13:08:54 -0400 +Subject: [PATCH] gedit-document: fix close after save functionality + +Right now if a document is modified when a user tries +to close the buffer, we pop up a dialog asking if they +would like to save before closing. If the user says +yes, we proceed to save the document but then fail to +close it. + +This is because we try to close the tab before marking +the now saved document as unmodified. The close operation +then fails. + +This commit changes the code to set the document unmodified, +earlier, in time for the close tab operation to succeed. +--- + gedit/gedit-document.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c +index cc59ea1..92c0393 100644 +--- a/gedit/gedit-document.c ++++ b/gedit/gedit-document.c +@@ -1187,76 +1187,76 @@ saved_query_info_cb (GFile *location, + if (info != NULL) + { + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE)) + { + content_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); + } + + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) + { + g_file_info_get_modification_time (info, &doc->priv->mtime); + doc->priv->mtime_set = TRUE; + } + } + + gedit_document_set_content_type (doc, content_type); + + if (info != NULL) + { + /* content_type (owned by info) is no longer needed. */ + g_object_unref (info); + } + + g_get_current_time (&doc->priv->time_of_last_save_or_load); + + doc->priv->externally_modified = FALSE; + doc->priv->deleted = FALSE; + doc->priv->create = FALSE; + + set_readonly (doc, FALSE); + +- gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (doc), FALSE); +- + save_encoding_metadata (doc); + + /* Async operation finished. */ + g_object_unref (doc); + } + + static void + gedit_document_saved_real (GeditDocument *doc) + { + GFile *location = gtk_source_file_get_location (doc->priv->file); + + /* Keep the doc alive during the async operation. */ + g_object_ref (doc); + ++ gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (doc), FALSE); ++ + g_file_query_info_async (location, + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," + G_FILE_ATTRIBUTE_TIME_MODIFIED, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT, + NULL, + (GAsyncReadyCallback) saved_query_info_cb, + doc); + } + + gboolean + gedit_document_is_untouched (GeditDocument *doc) + { + GFile *location; + + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), TRUE); + + location = gtk_source_file_get_location (doc->priv->file); + + return location == NULL && !gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc)); + } + + gboolean + gedit_document_is_untitled (GeditDocument *doc) + { + g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), TRUE); + + return gtk_source_file_get_location (doc->priv->file) == NULL; + } + +-- +2.8.1 + diff --git a/SOURCES/0001-po-es-use-single-quote-instead-of-chevrons.patch b/SOURCES/0001-po-es-use-single-quote-instead-of-chevrons.patch index b4e64ed..e8aed02 100644 --- a/SOURCES/0001-po-es-use-single-quote-instead-of-chevrons.patch +++ b/SOURCES/0001-po-es-use-single-quote-instead-of-chevrons.patch @@ -1,97 +1,39 @@ -From e0155f834f494fc3de374920589cba8b93ead96a Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Mon, 21 Sep 2015 16:21:45 -0400 -Subject: [PATCH] po: es: use single quote instead of chevrons - -Fixes weird debug spew ---- - po/es.po | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/po/es.po b/po/es.po -index 6c90959..a83af90 100644 ---- a/po/es.po -+++ b/po/es.po -@@ -444,78 +444,78 @@ msgstr "" - msgid "Print Line Numbers" - msgstr "Imprimir números de línea" - - #: ../data/org.gnome.gedit.gschema.xml.in.h:63 - msgid "" - "If this value is 0, then no line numbers will be inserted when printing a " - "document. Otherwise, gedit will print line numbers every such number of " - "lines." - msgstr "" - "Si este valor es cero entonces no se colocan números de líneas al imprimir " - "el documento. En otro caso, gedit imprime los números de línea cada dicha " - "cantidad de líneas." - +diff -up gedit-3.14.3/po/es.po.es-po-quotes gedit-3.14.3/po/es.po +--- gedit-3.14.3/po/es.po.es-po-quotes 2015-02-04 06:32:46.000000000 -0500 ++++ gedit-3.14.3/po/es.po 2016-04-06 15:31:23.979277863 -0400 +@@ -105,7 +105,7 @@ msgstr "" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:3 + msgid "'Monospace 12'" +-msgstr "«Monospace 12»" ++msgstr "'Monospace 12'" + + #: ../data/org.gnome.gedit.gschema.xml.in.h:4 + msgid "Editor Font" +@@ -456,7 +456,7 @@ msgstr "" + #: ../data/org.gnome.gedit.gschema.xml.in.h:64 msgid "'Monospace 9'" - msgstr "«Monospace 9»" - +-msgstr "«Monospace 9»" ++msgstr "'Monospace 9'" + #: ../data/org.gnome.gedit.gschema.xml.in.h:65 msgid "Body Font for Printing" - msgstr "Tipografía para impresión del cuerpo" - - #: ../data/org.gnome.gedit.gschema.xml.in.h:66 - msgid "" - "Specifies the font to use for a document's body when printing documents." - msgstr "" - "Especifica la tipografía que utilizar para el cuerpo del documento cuando se " - "imprimen archivos." - +@@ -471,7 +471,7 @@ msgstr "" + #: ../data/org.gnome.gedit.gschema.xml.in.h:67 msgid "'Sans 11'" -msgstr "«Sans 11»" +msgstr "'Sans 11'" - + #: ../data/org.gnome.gedit.gschema.xml.in.h:68 msgid "Header Font for Printing" - msgstr "Tipografía para impresión de la cabecera" - - #: ../data/org.gnome.gedit.gschema.xml.in.h:69 - msgid "" - "Specifies the font to use for page headers when printing a document. This " - "will only take effect if the \"Print Header\" option is turned on." - msgstr "" - "Especifica la tipografía que utilizar para la cabecera de las páginas cuando " - "se imprime un documento. Esto sólo tiene efecto cuando la opción «Imprimir " - "cabecera» se encuentre activada." - +@@ -488,7 +488,7 @@ msgstr "" + #: ../data/org.gnome.gedit.gschema.xml.in.h:70 msgid "'Sans 8'" -msgstr "«Sans 8»" +msgstr "'Sans 8'" - + #: ../data/org.gnome.gedit.gschema.xml.in.h:71 msgid "Line Number Font for Printing" - msgstr "Tipografía para impresión de los números de línea" - - #: ../data/org.gnome.gedit.gschema.xml.in.h:72 - msgid "" - "Specifies the font to use for line numbers when printing. This will only " - "take effect if the \"Print Line Numbers\" option is non-zero." - msgstr "" - "Especifica la tipografía que utilizar para los números de línea cuando se " - "imprimen. Esto sólo tiene efecto si la opción «Imprimir números de línea» es " - "distinta de cero." - - #. Translators: This is the sorted list of encodings used by gedit - #. for automatic detection of the file encoding. You may want to customize it adding - #. encodings that are common in your country, for instance the GB18030 encoding - #. for the Chinese translation. You may also want to remove the ISO-8859-15 encoding - #. (covering English and most Western European languages) if you think people - #. in your country will rarely use it. - #. "CURRENT" is a magic value used by gedit and it represents the encoding - #. for the current locale, so please don't translate the "CURRENT" term. - #. Only recognized encodings are used. - #. See http://git.gnome.org/browse/gedit/tree/gedit/gedit-encodings.c#n152 for - #. a list of supported encodings - #: ../data/org.gnome.gedit.gschema.xml.in.h:84 - msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" - msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" - - #: ../data/org.gnome.gedit.gschema.xml.in.h:85 --- -2.5.0 diff --git a/SOURCES/0005-Fix-desktop-actions.patch b/SOURCES/0005-Fix-desktop-actions.patch new file mode 100644 index 0000000..dd2a66f --- /dev/null +++ b/SOURCES/0005-Fix-desktop-actions.patch @@ -0,0 +1,455 @@ +From 8fa00d0a56f073e0ac44a7de33203d893af4a841 Mon Sep 17 00:00:00 2001 +From: Ignacio Casal Quinteiro +Date: Thu, 19 Mar 2015 15:46:48 +0100 +Subject: [PATCH 05/26] Fix desktop actions + +https://bugzilla.gnome.org/show_bug.cgi?id=744184 +--- + data/org.gnome.gedit.desktop.in.in | 6 +- + gedit/gedit-app.c | 394 +++++++++++++++++++------------------ + 2 files changed, 210 insertions(+), 190 deletions(-) + +--- a/data/org.gnome.gedit.desktop.in.in ++++ b/data/org.gnome.gedit.desktop.in.in +@@ -16,14 +16,14 @@ X-GNOME-Bugzilla-Product=gedit + X-GNOME-Bugzilla-Component=general + X-GNOME-Bugzilla-Version=@VERSION@ + X-GNOME-Bugzilla-ExtraInfoScript=@FULL_LIBEXECDIR@/gedit/gedit-bugreport.sh +-Actions=Window;Document; ++Actions=new-window;new-document; + _Keywords=Text;Editor; + DBusActivatable=true + +-[Desktop Action Window] ++[Desktop Action new-window] + _Name=Open a New Window + Exec=gedit --new-window + +-[Desktop Action Document] ++[Desktop Action new-document] + _Name=Open a New Document + Exec=gedit --new-document +--- a/gedit/gedit-app.c ++++ b/gedit/gedit-app.c +@@ -290,6 +290,193 @@ gedit_app_set_window_title_impl (GeditAp + gtk_window_set_title (GTK_WINDOW (window), title); + } + ++static gboolean ++is_in_viewport (GtkWindow *window, ++ GdkScreen *screen, ++ gint workspace, ++ gint viewport_x, ++ gint viewport_y) ++{ ++ GdkScreen *s; ++ GdkDisplay *display; ++ GdkWindow *gdkwindow; ++ const gchar *cur_name; ++ const gchar *name; ++ gint cur_n; ++ gint n; ++ gint ws; ++ gint sc_width, sc_height; ++ gint x, y, width, height; ++ gint vp_x, vp_y; ++ ++ /* Check for screen and display match */ ++ display = gdk_screen_get_display (screen); ++ cur_name = gdk_display_get_name (display); ++ cur_n = gdk_screen_get_number (screen); ++ ++ s = gtk_window_get_screen (window); ++ display = gdk_screen_get_display (s); ++ name = gdk_display_get_name (display); ++ n = gdk_screen_get_number (s); ++ ++ if (strcmp (cur_name, name) != 0 || cur_n != n) ++ { ++ return FALSE; ++ } ++ ++ /* Check for workspace match */ ++ ws = gedit_utils_get_window_workspace (window); ++ if (ws != workspace && ws != GEDIT_ALL_WORKSPACES) ++ { ++ return FALSE; ++ } ++ ++ /* Check for viewport match */ ++ gdkwindow = gtk_widget_get_window (GTK_WIDGET (window)); ++ gdk_window_get_position (gdkwindow, &x, &y); ++ width = gdk_window_get_width (gdkwindow); ++ height = gdk_window_get_height (gdkwindow); ++ gedit_utils_get_current_viewport (screen, &vp_x, &vp_y); ++ x += vp_x; ++ y += vp_y; ++ ++ sc_width = gdk_screen_get_width (screen); ++ sc_height = gdk_screen_get_height (screen); ++ ++ return x + width * .25 >= viewport_x && ++ x + width * .75 <= viewport_x + sc_width && ++ y >= viewport_y && ++ y + height <= viewport_y + sc_height; ++} ++ ++static GeditWindow * ++get_active_window (GtkApplication *app) ++{ ++ GdkScreen *screen; ++ guint workspace; ++ gint viewport_x, viewport_y; ++ GList *windows, *l; ++ ++ screen = gdk_screen_get_default (); ++ ++ workspace = gedit_utils_get_current_workspace (screen); ++ gedit_utils_get_current_viewport (screen, &viewport_x, &viewport_y); ++ ++ /* Gtk documentation says the window list is always in MRU order */ ++ windows = gtk_application_get_windows (app); ++ for (l = windows; l != NULL; l = l->next) ++ { ++ GtkWindow *window = l->data; ++ ++ if (GEDIT_IS_WINDOW (window) && is_in_viewport (window, screen, workspace, viewport_x, viewport_y)) ++ { ++ return GEDIT_WINDOW (window); ++ } ++ } ++ ++ return NULL; ++} ++ ++static void ++set_command_line_wait (GeditApp *app, ++ GeditTab *tab) ++{ ++ g_object_set_data_full (G_OBJECT (tab), ++ "GeditTabCommandLineWait", ++ g_object_ref (app->priv->command_line), ++ (GDestroyNotify)g_object_unref); ++} ++ ++static void ++open_files (GApplication *application, ++ gboolean new_window, ++ gboolean new_document, ++ gchar *geometry, ++ gint line_position, ++ gint column_position, ++ const GtkSourceEncoding *encoding, ++ GInputStream *stdin_stream, ++ GSList *file_list, ++ GApplicationCommandLine *command_line) ++{ ++ GeditWindow *window = NULL; ++ GeditTab *tab; ++ gboolean doc_created = FALSE; ++ ++ if (!new_window) ++ { ++ window = get_active_window (GTK_APPLICATION (application)); ++ } ++ ++ if (window == NULL) ++ { ++ gedit_debug_message (DEBUG_APP, "Create main window"); ++ window = gedit_app_create_window (GEDIT_APP (application), NULL); ++ ++ gedit_debug_message (DEBUG_APP, "Show window"); ++ gtk_widget_show (GTK_WIDGET (window)); ++ } ++ ++ if (geometry) ++ { ++ gtk_window_parse_geometry (GTK_WINDOW (window), geometry); ++ } ++ ++ if (stdin_stream) ++ { ++ gedit_debug_message (DEBUG_APP, "Load stdin"); ++ ++ tab = gedit_window_create_tab_from_stream (window, ++ stdin_stream, ++ encoding, ++ line_position, ++ column_position, ++ TRUE); ++ doc_created = tab != NULL; ++ ++ if (doc_created && command_line) ++ { ++ set_command_line_wait (GEDIT_APP (application), ++ tab); ++ } ++ g_input_stream_close (stdin_stream, NULL, NULL); ++ } ++ ++ if (file_list != NULL) ++ { ++ GSList *loaded; ++ ++ gedit_debug_message (DEBUG_APP, "Load files"); ++ loaded = _gedit_cmd_load_files_from_prompt (window, ++ file_list, ++ encoding, ++ line_position, ++ column_position); ++ ++ doc_created = doc_created || loaded != NULL; ++ ++ if (command_line) ++ { ++ g_slist_foreach (loaded, (GFunc)set_command_line_wait, NULL); ++ } ++ g_slist_free (loaded); ++ } ++ ++ if (!doc_created || new_document) ++ { ++ gedit_debug_message (DEBUG_APP, "Create tab"); ++ tab = gedit_window_create_tab (window, TRUE); ++ ++ if (command_line) ++ { ++ set_command_line_wait (GEDIT_APP (application), ++ tab); ++ } ++ } ++ ++ gtk_window_present (GTK_WINDOW (window)); ++} ++ + static void + new_window_activated (GSimpleAction *action, + GVariant *parameter, +@@ -311,6 +498,25 @@ new_window_activated (GSimpleAction *act + } + + static void ++new_document_activated (GSimpleAction *action, ++ GVariant *parameter, ++ gpointer user_data) ++{ ++ GApplication *application = G_APPLICATION (user_data); ++ ++ open_files (application, ++ FALSE, ++ TRUE, ++ NULL, ++ 0, ++ 0, ++ NULL, ++ NULL, ++ NULL, ++ NULL); ++} ++ ++static void + preferences_activated (GSimpleAction *action, + GVariant *parameter, + gpointer user_data) +@@ -362,6 +568,7 @@ quit_activated (GSimpleAction *action, + + static GActionEntry app_entries[] = { + { "new-window", new_window_activated, NULL, NULL, NULL }, ++ { "new-document", new_document_activated, NULL, NULL, NULL }, + { "preferences", preferences_activated, NULL, NULL, NULL }, + { "help", help_activated, NULL, NULL, NULL }, + { "about", about_activated, NULL, NULL, NULL }, +@@ -639,193 +846,6 @@ gedit_app_startup (GApplication *applica + app); + } + +-static gboolean +-is_in_viewport (GtkWindow *window, +- GdkScreen *screen, +- gint workspace, +- gint viewport_x, +- gint viewport_y) +-{ +- GdkScreen *s; +- GdkDisplay *display; +- GdkWindow *gdkwindow; +- const gchar *cur_name; +- const gchar *name; +- gint cur_n; +- gint n; +- gint ws; +- gint sc_width, sc_height; +- gint x, y, width, height; +- gint vp_x, vp_y; +- +- /* Check for screen and display match */ +- display = gdk_screen_get_display (screen); +- cur_name = gdk_display_get_name (display); +- cur_n = gdk_screen_get_number (screen); +- +- s = gtk_window_get_screen (window); +- display = gdk_screen_get_display (s); +- name = gdk_display_get_name (display); +- n = gdk_screen_get_number (s); +- +- if (strcmp (cur_name, name) != 0 || cur_n != n) +- { +- return FALSE; +- } +- +- /* Check for workspace match */ +- ws = gedit_utils_get_window_workspace (window); +- if (ws != workspace && ws != GEDIT_ALL_WORKSPACES) +- { +- return FALSE; +- } +- +- /* Check for viewport match */ +- gdkwindow = gtk_widget_get_window (GTK_WIDGET (window)); +- gdk_window_get_position (gdkwindow, &x, &y); +- width = gdk_window_get_width (gdkwindow); +- height = gdk_window_get_height (gdkwindow); +- gedit_utils_get_current_viewport (screen, &vp_x, &vp_y); +- x += vp_x; +- y += vp_y; +- +- sc_width = gdk_screen_get_width (screen); +- sc_height = gdk_screen_get_height (screen); +- +- return x + width * .25 >= viewport_x && +- x + width * .75 <= viewport_x + sc_width && +- y >= viewport_y && +- y + height <= viewport_y + sc_height; +-} +- +-static GeditWindow * +-get_active_window (GtkApplication *app) +-{ +- GdkScreen *screen; +- guint workspace; +- gint viewport_x, viewport_y; +- GList *windows, *l; +- +- screen = gdk_screen_get_default (); +- +- workspace = gedit_utils_get_current_workspace (screen); +- gedit_utils_get_current_viewport (screen, &viewport_x, &viewport_y); +- +- /* Gtk documentation says the window list is always in MRU order */ +- windows = gtk_application_get_windows (app); +- for (l = windows; l != NULL; l = l->next) +- { +- GtkWindow *window = l->data; +- +- if (GEDIT_IS_WINDOW (window) && is_in_viewport (window, screen, workspace, viewport_x, viewport_y)) +- { +- return GEDIT_WINDOW (window); +- } +- } +- +- return NULL; +-} +- +-static void +-set_command_line_wait (GeditApp *app, +- GeditTab *tab) +-{ +- g_object_set_data_full (G_OBJECT (tab), +- "GeditTabCommandLineWait", +- g_object_ref (app->priv->command_line), +- (GDestroyNotify)g_object_unref); +-} +- +-static void +-open_files (GApplication *application, +- gboolean new_window, +- gboolean new_document, +- gchar *geometry, +- gint line_position, +- gint column_position, +- const GtkSourceEncoding *encoding, +- GInputStream *stdin_stream, +- GSList *file_list, +- GApplicationCommandLine *command_line) +-{ +- GeditWindow *window = NULL; +- GeditTab *tab; +- gboolean doc_created = FALSE; +- +- if (!new_window) +- { +- window = get_active_window (GTK_APPLICATION (application)); +- } +- +- if (window == NULL) +- { +- gedit_debug_message (DEBUG_APP, "Create main window"); +- window = gedit_app_create_window (GEDIT_APP (application), NULL); +- +- gedit_debug_message (DEBUG_APP, "Show window"); +- gtk_widget_show (GTK_WIDGET (window)); +- } +- +- if (geometry) +- { +- gtk_window_parse_geometry (GTK_WINDOW (window), geometry); +- } +- +- if (stdin_stream) +- { +- gedit_debug_message (DEBUG_APP, "Load stdin"); +- +- tab = gedit_window_create_tab_from_stream (window, +- stdin_stream, +- encoding, +- line_position, +- column_position, +- TRUE); +- doc_created = tab != NULL; +- +- if (doc_created && command_line) +- { +- set_command_line_wait (GEDIT_APP (application), +- tab); +- } +- g_input_stream_close (stdin_stream, NULL, NULL); +- } +- +- if (file_list != NULL) +- { +- GSList *loaded; +- +- gedit_debug_message (DEBUG_APP, "Load files"); +- loaded = _gedit_cmd_load_files_from_prompt (window, +- file_list, +- encoding, +- line_position, +- column_position); +- +- doc_created = doc_created || loaded != NULL; +- +- if (command_line) +- { +- g_slist_foreach (loaded, (GFunc)set_command_line_wait, NULL); +- } +- g_slist_free (loaded); +- } +- +- if (!doc_created || new_document) +- { +- gedit_debug_message (DEBUG_APP, "Create tab"); +- tab = gedit_window_create_tab (window, TRUE); +- +- if (command_line) +- { +- set_command_line_wait (GEDIT_APP (application), +- tab); +- } +- } +- +- gtk_window_present (GTK_WINDOW (window)); +-} +- + static void + gedit_app_activate (GApplication *application) + { diff --git a/SOURCES/0008-spell-don-t-include-gedit-metadata-manager.h-private.patch b/SOURCES/0008-spell-don-t-include-gedit-metadata-manager.h-private.patch new file mode 100644 index 0000000..cef03c0 --- /dev/null +++ b/SOURCES/0008-spell-don-t-include-gedit-metadata-manager.h-private.patch @@ -0,0 +1,22 @@ +From 47766883e6366cce5684a36eb9975a91db8b157c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= +Date: Sun, 7 Jun 2015 13:42:26 +0200 +Subject: [PATCH 08/26] spell: don't #include gedit-metadata-manager.h (private + header) + +The gedit_metadata_manager_* functions are anyway not used in the spell +plugin. +--- + plugins/spell/gedit-spell-plugin.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/plugins/spell/gedit-spell-plugin.c ++++ b/plugins/spell/gedit-spell-plugin.c +@@ -42,7 +42,6 @@ + #include "gedit-automatic-spell-checker.h" + + #ifdef G_OS_WIN32 +-#include + #define GEDIT_METADATA_ATTRIBUTE_SPELL_LANGUAGE "spell-language" + #define GEDIT_METADATA_ATTRIBUTE_SPELL_ENABLED "spell-enabled" + #else diff --git a/SOURCES/0009-spell-fix-bug-with-document-metadata.patch b/SOURCES/0009-spell-fix-bug-with-document-metadata.patch new file mode 100644 index 0000000..d632490 --- /dev/null +++ b/SOURCES/0009-spell-fix-bug-with-document-metadata.patch @@ -0,0 +1,114 @@ +From 099aa09ff5eabf24005fcf94ca6a71a1a7138228 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= +Date: Sun, 7 Jun 2015 14:51:43 +0200 +Subject: [PATCH 09/26] spell: fix bug with document metadata + +See the comment in the code. + +With one document, the bug was easy to reproduce: +1. open document in gedit +2. activate the auto spell -> metadata set to 1 +3. close gedit +4. $ gedit -> spell checking disabled, but should be enabled + +https://bugzilla.gnome.org/show_bug.cgi?id=741853 +--- + plugins/spell/gedit-spell-plugin.c | 56 +++++++++++++++++++++++++++++++------- + 1 file changed, 46 insertions(+), 10 deletions(-) + +--- a/plugins/spell/gedit-spell-plugin.c ++++ b/plugins/spell/gedit-spell-plugin.c +@@ -89,15 +89,16 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditSpe + gedit_window_activatable_iface_init) + G_ADD_PRIVATE_DYNAMIC (GeditSpellPlugin)) + +-static void spell_cb (GSimpleAction *action, GVariant *parameter, gpointer data); +-static void set_language_cb (GSimpleAction *action, GVariant *parameter, gpointer data); +-static void auto_spell_cb (GSimpleAction *action, GVariant *state, gpointer data); ++static void spell_cb (GSimpleAction *action, GVariant *parameter, gpointer data); ++static void set_language_cb (GSimpleAction *action, GVariant *parameter, gpointer data); ++static void auto_spell_activate_cb (GSimpleAction *action, GVariant *parameter, gpointer data); ++static void auto_spell_change_state_cb (GSimpleAction *action, GVariant *state, gpointer data); + + static GActionEntry action_entries[] = + { + { "check-spell", spell_cb }, + { "config-spell", set_language_cb }, +- { "auto-spell", NULL, NULL, "false", auto_spell_cb } ++ { "auto-spell", auto_spell_activate_cb, NULL, "false", auto_spell_change_state_cb } + }; + + static GQuark spell_checker_id = 0; +@@ -874,20 +875,27 @@ set_auto_spell (GeditWindow *window, + } + + static void +-auto_spell_cb (GSimpleAction *action, +- GVariant *state, +- gpointer data) ++auto_spell_activate_cb (GSimpleAction *action, ++ GVariant *parameter, ++ gpointer data) + { + GeditSpellPlugin *plugin = GEDIT_SPELL_PLUGIN (data); + GeditSpellPluginPrivate *priv = plugin->priv; +- GeditView *view; ++ GVariant *state; + gboolean active; ++ GeditView *view; + + gedit_debug (DEBUG_PLUGINS); + ++ state = g_action_get_state (G_ACTION (action)); ++ g_return_if_fail (state != NULL); ++ + active = g_variant_get_boolean (state); ++ g_variant_unref (state); + +- gedit_debug_message (DEBUG_PLUGINS, active ? "Auto Spell activated" : "Auto Spell deactivated"); ++ /* We must toggle ourself the value. */ ++ active = !active; ++ g_action_change_state (G_ACTION (action), g_variant_new_boolean (active)); + + view = gedit_window_get_active_view (priv->window); + if (view != NULL) +@@ -896,10 +904,38 @@ auto_spell_cb (GSimpleAction *action, + + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); + ++ /* Set metadata in the "activate" handler, not in "change-state" ++ * because "change-state" is called every time the state ++ * changes, not specifically when the user has changed the state ++ * herself. For example "change-state" is called to initialize ++ * the sate to the default value specified in the GActionEntry. ++ */ + gedit_document_set_metadata (doc, + GEDIT_METADATA_ATTRIBUTE_SPELL_ENABLED, +- active ? "1" : NULL, NULL); ++ active ? "1" : NULL, ++ NULL); ++ } ++} ++ ++static void ++auto_spell_change_state_cb (GSimpleAction *action, ++ GVariant *state, ++ gpointer data) ++{ ++ GeditSpellPlugin *plugin = GEDIT_SPELL_PLUGIN (data); ++ GeditSpellPluginPrivate *priv = plugin->priv; ++ GeditView *view; ++ gboolean active; ++ ++ gedit_debug (DEBUG_PLUGINS); ++ ++ active = g_variant_get_boolean (state); + ++ gedit_debug_message (DEBUG_PLUGINS, active ? "Auto Spell activated" : "Auto Spell deactivated"); ++ ++ view = gedit_window_get_active_view (priv->window); ++ if (view != NULL) ++ { + set_auto_spell (priv->window, view, active); + g_simple_action_set_state (action, g_variant_new_boolean (active)); + } diff --git a/SOURCES/0010-Unset-correctly-GVFS-file-attributes.patch b/SOURCES/0010-Unset-correctly-GVFS-file-attributes.patch new file mode 100644 index 0000000..bcdf0e3 --- /dev/null +++ b/SOURCES/0010-Unset-correctly-GVFS-file-attributes.patch @@ -0,0 +1,44 @@ +From c1f59ef858a2b6b14f4c05f49cb8d5b4a1642451 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= +Date: Sun, 7 Jun 2015 18:23:14 +0200 +Subject: [PATCH 10/26] Unset correctly GVFS file attributes + +remove_attribute() removes the attribute from the FileInfo, so when +calling g_file_set_attributes_from_info(), the attribute value is kept +as-is, it was not unset. + +To unset the file attribute, we must set the attribute to an invalid +type (it seems there is no nicer way to do it). + +https://bugzilla.gnome.org/show_bug.cgi?id=741853 +--- + gedit/gedit-document.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c +index ab4fab6..cc59ea1 100644 +--- a/gedit/gedit-document.c ++++ b/gedit/gedit-document.c +@@ -1662,11 +1662,17 @@ gedit_document_set_metadata (GeditDocument *doc, + else + { + /* Unset the key */ +- g_file_info_remove_attribute (info, key); ++ g_file_info_set_attribute (info, ++ key, ++ G_FILE_ATTRIBUTE_TYPE_INVALID, ++ NULL); + + if (doc->priv->metadata_info != NULL) + { +- g_file_info_remove_attribute (doc->priv->metadata_info, key); ++ g_file_info_set_attribute (doc->priv->metadata_info, ++ key, ++ G_FILE_ATTRIBUTE_TYPE_INVALID, ++ NULL); + } + } + } +-- +1.8.3.1 + diff --git a/SOURCES/0011-Printing-fix-margins.patch b/SOURCES/0011-Printing-fix-margins.patch new file mode 100644 index 0000000..f74bbdf --- /dev/null +++ b/SOURCES/0011-Printing-fix-margins.patch @@ -0,0 +1,112 @@ +From 83edea9c0319d6e5f9c65338ddbc31c24ae736c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= +Date: Sat, 6 Jun 2015 20:36:36 +0200 +Subject: [PATCH 11/26] Printing: fix margins + +GTK+'s default margins are too small. It was not possible to use a hole +punch, and with some printers the text was truncated on the right. + +Add gsettings to configure margins, with better defaults (25mm on each +side). The unit chosen is the millimeter, because it's the international +standard. + +https://bugzilla.gnome.org/show_bug.cgi?id=572741 +--- + data/org.gnome.gedit.gschema.xml.in | 20 ++++++++++++++++++++ + gedit/gedit-print-job.c | 19 ++++++++++++++++--- + gedit/gedit-settings.h | 4 ++++ + 3 files changed, 40 insertions(+), 3 deletions(-) + +diff --git a/data/org.gnome.gedit.gschema.xml.in b/data/org.gnome.gedit.gschema.xml.in +index a01b3ec..c34e4db 100644 +--- a/data/org.gnome.gedit.gschema.xml.in ++++ b/data/org.gnome.gedit.gschema.xml.in +@@ -222,6 +222,26 @@ + Line Number Font for Printing + Specifies the font to use for line numbers when printing. This will only take effect if the "Print Line Numbers" option is non-zero. + ++ ++ 25 ++ Margin Left ++ The left margin, in millimeters. ++ ++ ++ 25 ++ Margin Top ++ The top margin, in millimeters. ++ ++ ++ 25 ++ Margin Right ++ The right margin, in millimeters. ++ ++ ++ 25 ++ Margin Bottom ++ The bottom margin, in millimeters. ++ + + + +diff --git a/gedit/gedit-print-job.c b/gedit/gedit-print-job.c +index a19ef65..34816da 100644 +--- a/gedit/gedit-print-job.c ++++ b/gedit/gedit-print-job.c +@@ -507,6 +507,7 @@ create_compositor (GeditPrintJob *job) + GtkWrapMode wrap_mode; + guint print_line_numbers; + gboolean print_header; ++ gdouble margin; + + /* Create and initialize print compositor */ + print_font_body = g_settings_get_string (job->priv->print_settings, +@@ -540,9 +541,17 @@ create_compositor (GeditPrintJob *job) + "header-font-name", print_font_header, + NULL)); + +- g_free (print_font_body); +- g_free (print_font_header); +- g_free (print_font_numbers); ++ margin = g_settings_get_double (job->priv->print_settings, GEDIT_SETTINGS_PRINT_MARGIN_LEFT); ++ gtk_source_print_compositor_set_left_margin (job->priv->compositor, margin, GTK_UNIT_MM); ++ ++ margin = g_settings_get_double (job->priv->print_settings, GEDIT_SETTINGS_PRINT_MARGIN_TOP); ++ gtk_source_print_compositor_set_top_margin (job->priv->compositor, margin, GTK_UNIT_MM); ++ ++ margin = g_settings_get_double (job->priv->print_settings, GEDIT_SETTINGS_PRINT_MARGIN_RIGHT); ++ gtk_source_print_compositor_set_right_margin (job->priv->compositor, margin, GTK_UNIT_MM); ++ ++ margin = g_settings_get_double (job->priv->print_settings, GEDIT_SETTINGS_PRINT_MARGIN_BOTTOM); ++ gtk_source_print_compositor_set_bottom_margin (job->priv->compositor, margin, GTK_UNIT_MM); + + if (print_header) + { +@@ -568,6 +577,10 @@ create_compositor (GeditPrintJob *job) + g_free (name_to_display); + g_free (left); + } ++ ++ g_free (print_font_body); ++ g_free (print_font_header); ++ g_free (print_font_numbers); + } + + static void +diff --git a/gedit/gedit-settings.h b/gedit/gedit-settings.h +index 39ee82e..85cdc94 100644 +--- a/gedit/gedit-settings.h ++++ b/gedit/gedit-settings.h +@@ -108,6 +108,10 @@ void gedit_settings_set_list (GSettings *settings, + #define GEDIT_SETTINGS_PRINT_FONT_NUMBERS_PANGO "print-font-numbers-pango" + #define GEDIT_SETTINGS_ENCODING_AUTO_DETECTED "auto-detected" + #define GEDIT_SETTINGS_ENCODING_SHOWN_IN_MENU "shown-in-menu" ++#define GEDIT_SETTINGS_PRINT_MARGIN_LEFT "margin-left" ++#define GEDIT_SETTINGS_PRINT_MARGIN_TOP "margin-top" ++#define GEDIT_SETTINGS_PRINT_MARGIN_RIGHT "margin-right" ++#define GEDIT_SETTINGS_PRINT_MARGIN_BOTTOM "margin-bottom" + #define GEDIT_SETTINGS_ACTIVE_PLUGINS "active-plugins" + #define GEDIT_SETTINGS_ENSURE_TRAILING_NEWLINE "ensure-trailing-newline" + +-- +1.8.3.1 + diff --git a/SOURCES/0012-Printing-set-default-margin-top-to-15mm.patch b/SOURCES/0012-Printing-set-default-margin-top-to-15mm.patch new file mode 100644 index 0000000..2972960 --- /dev/null +++ b/SOURCES/0012-Printing-set-default-margin-top-to-15mm.patch @@ -0,0 +1,26 @@ +From a08e7846a2693747aee2aeba9e44e79fed4bcfcf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= +Date: Thu, 11 Jun 2015 16:40:38 +0200 +Subject: [PATCH 12/26] Printing: set default margin-top to 15mm + +25mm is too much for the top margin. +--- + data/org.gnome.gedit.gschema.xml.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/org.gnome.gedit.gschema.xml.in b/data/org.gnome.gedit.gschema.xml.in +index c34e4db..a1fa8a3 100644 +--- a/data/org.gnome.gedit.gschema.xml.in ++++ b/data/org.gnome.gedit.gschema.xml.in +@@ -228,7 +228,7 @@ + The left margin, in millimeters. + + +- 25 ++ 15 + Margin Top + The top margin, in millimeters. + +-- +1.8.3.1 + diff --git a/SOURCES/0019-build-fix-generation-of-desktop-files-for-external-t.patch b/SOURCES/0019-build-fix-generation-of-desktop-files-for-external-t.patch new file mode 100644 index 0000000..e8c576e --- /dev/null +++ b/SOURCES/0019-build-fix-generation-of-desktop-files-for-external-t.patch @@ -0,0 +1,30 @@ +From cff568ca9ac94a0564f0751090fde3cde41a3f11 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= +Date: Sun, 12 Jul 2015 11:16:04 +0200 +Subject: [PATCH 19/26] build: fix generation of desktop files for external + tools + +The .desktop files were not generated since there were two rules for the +same targets. So the last rule was executed, which is the mkdir command. + +To be sure that the mkdir command is executed before any target is +built, we can use $(shell ...). See: +http://stackoverflow.com/questions/2122602/force-makefile-to-execute-script-before-building-targets +--- + plugins/externaltools/data/Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/plugins/externaltools/data/Makefile.am b/plugins/externaltools/data/Makefile.am +index e3a4707..23098be 100644 +--- a/plugins/externaltools/data/Makefile.am ++++ b/plugins/externaltools/data/Makefile.am +@@ -59,5 +59,4 @@ CLEANFILES += \ + # generating the .desktop files. + # If the following bug is fixed, this hack can normally be removed: + # https://bugs.launchpad.net/intltool/+bug/605826 +-$(externaltools_all_desktop_files): +- $(AM_V_GEN) $(MKDIR_P) $(top_builddir)/plugins/externaltools/data/ ++$(shell $(MKDIR_P) $(top_builddir)/plugins/externaltools/data/) +-- +1.8.3.1 + diff --git a/SOURCES/0024-Add-a-snippet-generating-RPM-SPEC-changelog-line.patch b/SOURCES/0024-Add-a-snippet-generating-RPM-SPEC-changelog-line.patch new file mode 100644 index 0000000..31dfa72 --- /dev/null +++ b/SOURCES/0024-Add-a-snippet-generating-RPM-SPEC-changelog-line.patch @@ -0,0 +1,55 @@ +From d1a0ec893fc609795c6553553dc274105bd0d389 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= +Date: Mon, 17 Aug 2015 14:04:08 +0200 +Subject: [PATCH 24/26] Add a snippet generating RPM SPEC %changelog line. + +https://bugzilla.gnome.org/show_bug.cgi?id=732813 +--- + plugins/snippets/Makefile.am | 1 + + plugins/snippets/data/rpmspec.xml | 22 ++++++++++++++++++++++ + 2 files changed, 23 insertions(+) + create mode 100644 plugins/snippets/data/rpmspec.xml + +diff --git a/plugins/snippets/Makefile.am b/plugins/snippets/Makefile.am +index f4f5d0c..20c8ccc 100644 +--- a/plugins/snippets/Makefile.am ++++ b/plugins/snippets/Makefile.am +@@ -44,6 +44,7 @@ dist_plugins_snippets_snippets_DATA = \ + plugins/snippets/data/perl.xml \ + plugins/snippets/data/php.xml \ + plugins/snippets/data/python.xml \ ++ plugins/snippets/data/rpmspec.xml \ + plugins/snippets/data/ruby.xml \ + plugins/snippets/data/sh.xml \ + plugins/snippets/data/snippets.xml \ +diff --git a/plugins/snippets/data/rpmspec.xml b/plugins/snippets/data/rpmspec.xml +new file mode 100644 +index 0000000..eb3396d +--- /dev/null ++++ b/plugins/snippets/data/rpmspec.xml +@@ -0,0 +1,22 @@ ++ ++ ++ ++ ++ ++]]> ++ ch ++ changelog entry ++ ++ +-- +1.8.3.1 + diff --git a/SOURCES/0025-Add-a-shortcut-for-the-open-button-for-german.patch b/SOURCES/0025-Add-a-shortcut-for-the-open-button-for-german.patch new file mode 100644 index 0000000..5601499 --- /dev/null +++ b/SOURCES/0025-Add-a-shortcut-for-the-open-button-for-german.patch @@ -0,0 +1,12 @@ +diff -ru gedit-3.14.3.orig/po/de.po gedit-3.14.3/po/de.po +--- gedit-3.14.3/po/de.po 2015-02-04 12:32:46.000000000 +0100 ++++ gedit-3.14.3/po/de.po 2016-04-15 09:05:33.002363506 +0200 +@@ -820,7 +820,7 @@ + #: ../plugins/quickopen/quickopen/popup.py:38 + #: ../plugins/snippets/snippets/manager.py:782 + msgid "_Open" +-msgstr "Öffnen" ++msgstr "Ö_ffnen" + + # CHECK + #: ../gedit/gedit-commands-file.c:577 diff --git a/SOURCES/gedit-disable-python3.patch b/SOURCES/gedit-disable-python3.patch index d526e56..177b581 100644 --- a/SOURCES/gedit-disable-python3.patch +++ b/SOURCES/gedit-disable-python3.patch @@ -1,5 +1,5 @@ -From 1cb46d3837804d69c2b2e12317d3c5a7e60a819a Mon Sep 17 00:00:00 2001 -From: Matěj Cepl +From 2315024697904bc00c01caa42e042983491f98f1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Fri, 15 May 2015 11:00:19 -0400 Subject: [PATCH] Switch from python3 to python2 @@ -8,14 +8,17 @@ Subject: [PATCH] Switch from python3 to python2 gedit/gedit-plugins-engine.c | 2 +- plugins/externaltools/data/send-to-fpaste.tool.in | 2 +- plugins/externaltools/externaltools.plugin.desktop.in | 2 +- - plugins/externaltools/tools/library.py | 15 ++++++++------- + plugins/externaltools/tools/capture.py | 8 ++++++- + plugins/externaltools/tools/library.py | 27 ++++++++++++++++------ plugins/pythonconsole/pythonconsole.plugin.desktop.in | 2 +- plugins/quickopen/quickopen.plugin.desktop.in | 2 +- + plugins/quickopen/quickopen/__init__.py | 5 ++-- plugins/snippets/snippets.plugin.desktop.in | 2 +- + plugins/snippets/snippets/helper.py | 5 +++- plugins/snippets/snippets/library.py | 3 ++- plugins/snippets/snippets/shareddata.py | 3 ++- plugins/snippets/snippets/signals.py | 2 +- - 11 files changed, 20 insertions(+), 17 deletions(-) + 14 files changed, 46 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index cf3d734..3acee28 100644 @@ -199,8 +202,81 @@ index cc7a4da..c56e4e3 100644 Authors=Steve Frécinaux Copyright=Copyright © 2005 Steve Frécinaux Website=http://www.gedit.org +diff --git a/plugins/externaltools/tools/capture.py b/plugins/externaltools/tools/capture.py +index 05fcf81..4a77e7a 100644 +--- a/plugins/externaltools/tools/capture.py ++++ b/plugins/externaltools/tools/capture.py +@@ -34,61 +34,67 @@ class Capture(GObject.Object): + CAPTURE_NEEDS_SHELL = 0x04 + + WRITE_BUFFER_SIZE = 0x4000 + + __gsignals__ = { + 'stdout-line': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_STRING,)), + 'stderr-line': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_STRING,)), + 'begin-execute': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, tuple()), + 'end-execute': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, (GObject.TYPE_INT,)) + } + + def __init__(self, command, cwd=None, env={}): + GObject.GObject.__init__(self) + self.pipe = None + self.env = env + self.cwd = cwd + self.flags = self.CAPTURE_BOTH | self.CAPTURE_NEEDS_SHELL + self.command = command + self.input_text = None + + def set_env(self, **values): + self.env.update(**values) + + def set_command(self, command): + self.command = command + + def set_flags(self, flags): + self.flags = flags + + def set_input(self, text): +- self.input_text = text.encode("UTF-8") if text else None ++ if text: ++ if isinstance(text, bytes): ++ self.input_text = text ++ else: ++ self.input_text = text.encode("UTF-8") ++ else: ++ self.input_text = None + + def set_cwd(self, cwd): + self.cwd = cwd + + def execute(self): + if self.command is None: + return + + # Initialize pipe + popen_args = { + 'cwd': self.cwd, + 'shell': self.flags & self.CAPTURE_NEEDS_SHELL, + 'env': self.env + } + + if self.input_text is not None: + popen_args['stdin'] = subprocess.PIPE + if self.flags & self.CAPTURE_STDOUT: + popen_args['stdout'] = subprocess.PIPE + if self.flags & self.CAPTURE_STDERR: + popen_args['stderr'] = subprocess.PIPE + + self.tried_killing = False + self.in_channel = None + self.out_channel = None + self.err_channel = None + self.in_channel_id = 0 + self.out_channel_id = 0 + self.err_channel_id = 0 + diff --git a/plugins/externaltools/tools/library.py b/plugins/externaltools/tools/library.py -index adfd943..4d4bce0 100644 +index adfd943..761337c 100644 --- a/plugins/externaltools/tools/library.py +++ b/plugins/externaltools/tools/library.py @@ -1,48 +1,49 @@ @@ -316,7 +392,7 @@ index adfd943..4d4bce0 100644 self.changed = True -@@ -368,141 +369,141 @@ class Tool(object): +@@ -368,141 +369,153 @@ class Tool(object): def get_save_files(self): save_files = self._properties.get('Save-files') if save_files: @@ -425,15 +501,27 @@ index adfd943..4d4bce0 100644 # Write out header for line in header: fp.write(line + "\n") ++ if isinstance(line, bytes): ++ line = unicode(line + "\n", 'utf8') ++ else: ++ line += u"\n" ++ fp.write(line) - fp.write(self._dump_properties()) - fp.write("\n") -+ fp.write(unicode(self._dump_properties(), 'utf8')) ++ outstr = self._dump_properties() ++ if isinstance(outstr, bytes): ++ outstr = unicode(outstr, 'utf8') ++ fp.write(outstr) + fp.write(u"\n") for line in content: - fp.write(line + "\n") -+ fp.write(unicode(line + "\n", 'utf8')) ++ if isinstance(line, bytes): ++ line = unicode(line + "\n", 'utf8') ++ else: ++ line += u"\n" ++ fp.write(line) fp.close() os.chmod(filename, 0o750) @@ -496,6 +584,151 @@ index 68b6faa..17edecc 100644 Authors=Jesse van den Kieboom Copyright=Copyright © 2009 Jesse van den Kieboom Website=http://www.gedit.org +diff --git a/plugins/quickopen/quickopen/__init__.py b/plugins/quickopen/quickopen/__init__.py +index b8b54b0..f5e179f 100644 +--- a/plugins/quickopen/quickopen/__init__.py ++++ b/plugins/quickopen/quickopen/__init__.py +@@ -1,48 +1,49 @@ + # -*- coding: utf-8 -*- + + # Copyright (C) 2009 - Jesse van den Kieboom + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, see . + + from .popup import Popup ++import io + import os + from gi.repository import GObject, Gio, GLib, Gtk, Gedit + from .virtualdirs import RecentDocumentsDirectory + from .virtualdirs import CurrentDocumentsDirectory + + + class QuickOpenAppActivatable(GObject.Object, Gedit.AppActivatable): + app = GObject.property(type=Gedit.App) + + def __init__(self): + GObject.Object.__init__(self) + + def do_activate(self): + self.app.add_accelerator("O", "win.quickopen", None) + + self.menu_ext = self.extend_menu("file-section") + item = Gio.MenuItem.new(_("Quick Open..."), "win.quickopen") + self.menu_ext.prepend_menu_item(item) + + def do_deactivate(self): + self.app.remove_accelerator("win.quickopen", None) + + + class QuickOpenPlugin(GObject.Object, Gedit.WindowActivatable): + __gtype_name__ = "QuickOpenPlugin" + + window = GObject.property(type=Gedit.Window) + + def __init__(self): + GObject.Object.__init__(self) +@@ -94,88 +95,88 @@ class QuickOpenPlugin(GObject.Object, Gedit.WindowActivatable): + + # Local bookmarks + for path in self._local_bookmarks(): + paths.append(path) + + # Desktop directory + desktopdir = self._desktop_dir() + + if desktopdir: + paths.append(Gio.file_new_for_path(desktopdir)) + + # Home directory + paths.append(Gio.file_new_for_path(os.path.expanduser('~'))) + + self._popup = Popup(self.window, paths, self.on_activated) + self.window.get_group().add_window(self._popup) + + self._popup.set_default_size(*self.get_popup_size()) + self._popup.set_transient_for(self.window) + self._popup.set_position(Gtk.WindowPosition.CENTER_ON_PARENT) + self._popup.connect('destroy', self.on_popup_destroy) + + def _local_bookmarks(self): + filename = os.path.expanduser('~/.config/gtk-3.0/bookmarks') + + if not os.path.isfile(filename): + return [] + + paths = [] + +- for line in open(filename, 'r', encoding='utf-8'): ++ for line in io.open(filename, 'r', encoding='utf-8'): + uri = line.strip().split(" ")[0] + f = Gio.file_new_for_uri(uri) + + if f.is_native(): + try: + info = f.query_info(Gio.FILE_ATTRIBUTE_STANDARD_TYPE, + Gio.FileQueryInfoFlags.NONE, + None) + + if info and info.get_file_type() == Gio.FileType.DIRECTORY: + paths.append(f) + except: + pass + + return paths + + def _desktop_dir(self): + config = os.getenv('XDG_CONFIG_HOME') + + if not config: + config = os.path.expanduser('~/.config') + + config = os.path.join(config, 'user-dirs.dirs') + desktopdir = None + + if os.path.isfile(config): +- for line in open(config, 'r', encoding='utf-8'): ++ for line in io.open(config, 'r', encoding='utf-8'): + line = line.strip() + + if line.startswith('XDG_DESKTOP_DIR'): + parts = line.split('=', 1) + desktopdir = parts[1].strip('"').strip("'") + desktopdir = os.path.expandvars(desktopdir) + break + + if not desktopdir: + desktopdir = os.path.expanduser('~/Desktop') + + return desktopdir + + # Callbacks + def on_quick_open_activate(self, action, parameter, user_data=None): + if not self._popup: + self._create_popup() + + self._popup.show() + + def on_popup_destroy(self, popup, user_data=None): + self.set_popup_size(popup.get_final_size()) + + self._popup = None + + def on_activated(self, gfile, user_data=None): + Gedit.commands_load_location(self.window, gfile, None, -1, -1) + return True + + # ex:ts=4:et: diff --git a/plugins/snippets/snippets.plugin.desktop.in b/plugins/snippets/snippets.plugin.desktop.in index 8551b6b..f41a626 100644 --- a/plugins/snippets/snippets.plugin.desktop.in @@ -511,6 +744,77 @@ index 8551b6b..f41a626 100644 Authors=Jesse van den Kieboom Copyright=Copyright © 2005 Jesse van den Kieboom Website=http://www.gedit.org +diff --git a/plugins/snippets/snippets/helper.py b/plugins/snippets/snippets/helper.py +index 2fa3b3f..ee3f3b7 100644 +--- a/plugins/snippets/snippets/helper.py ++++ b/plugins/snippets/snippets/helper.py +@@ -97,62 +97,65 @@ def write_xml(node, f, cdata_nodes=()): + + # Encoding + f.write("\n") + + _write_node(node, f, cdata_nodes) + + def _write_indent(file, text, indent): + file.write(' ' * indent + text) + + def _write_node(node, file, cdata_nodes=(), indent=0): + # write XML to file + tag = node.tag + + if node is et.Comment: + _write_indent(file, "\n" % saxutils.escape(node.text), indent) + elif node is et.ProcessingInstruction: + _write_indent(file, "\n" % saxutils.escape(node.text), indent) + else: + items = node.items() + + if items or node.text or len(node): + _write_indent(file, "<" + tag, indent) + + if items: + items.sort() # lexical order + for k, v in items: + file.write(" %s=%s" % (k, saxutils.quoteattr(v))) + if node.text or len(node): + file.write(">") + if node.text and node.text.strip() != "": ++ node_txt = node.text ++ if isinstance(node_txt, unicode): ++ node_txt = node_txt.encode('utf8') + if tag in cdata_nodes: +- file.write(_cdata(node.text)) ++ file.write(_cdata(node_txt)) + else: + file.write(saxutils.escape(node.text)) + else: + file.write("\n") + + for n in node: + _write_node(n, file, cdata_nodes, indent + 1) + + if not len(node): + file.write("\n") + else: + _write_indent(file, "\n", \ + indent) + else: + file.write(" />\n") + + if node.tail and node.tail.strip() != "": + file.write(saxutils.escape(node.tail)) + + def _cdata(text): + return '', ']]]]>') + ']]>' + + def is_tab_trigger(w): + if len(w) == 1 and not (w.isalnum() or w.isspace()): + return True + + if not is_first_tab_trigger_character(w[0]): + return False + + for c in w: diff --git a/plugins/snippets/snippets/library.py b/plugins/snippets/snippets/library.py index 455ac91..1b454f3 100644 --- a/plugins/snippets/snippets/library.py @@ -747,5 +1051,5 @@ index 647b616..9aaa95a 100644 def block_signal(self, obj, name): if obj not in self._signals: -- -2.3.7 +2.7.4 diff --git a/SPECS/gedit.spec b/SPECS/gedit.spec index 742a8ac..4627c2c 100644 --- a/SPECS/gedit.spec +++ b/SPECS/gedit.spec @@ -13,7 +13,7 @@ Summary: Text editor for the GNOME desktop Name: gedit Epoch: 2 Version: 3.14.3 -Release: 9%{?dist} +Release: 18%{?dist} License: GPLv2+ and GFDL Group: Applications/Editors #VCS: git:git://git.gnome.org/gedit @@ -28,6 +28,32 @@ Patch5: jp-search.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1247999 Patch6: 0001-po-es-use-single-quote-instead-of-chevrons.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1301760 +Patch7: 0005-Fix-desktop-actions.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1301726 +Patch8: 0011-Printing-fix-margins.patch +Patch9: 0012-Printing-set-default-margin-top-to-15mm.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1301761 +Patch10: 0008-spell-don-t-include-gedit-metadata-manager.h-private.patch +Patch11: 0009-spell-fix-bug-with-document-metadata.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1255556 +Patch12: 0010-Unset-correctly-GVFS-file-attributes.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1301764 +Patch13: 0019-build-fix-generation-of-desktop-files-for-external-t.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1301769 +Patch14: 0024-Add-a-snippet-generating-RPM-SPEC-changelog-line.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1279299 +Patch15: 0025-Add-a-shortcut-for-the-open-button-for-german.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1247999 +Patch16: 0001-gedit-document-fix-close-after-save-functionality.patch + URL: http://projects.gnome.org/gedit/ Requires(post): desktop-file-utils >= %{desktop_file_utils_version} @@ -94,6 +120,16 @@ Install gedit-devel if you want to write plugins for gedit. %patch4 -p1 -b .disable-python %patch5 -p1 -b .jp-search %patch6 -p1 -b .es-po-quotes +%patch7 -p1 -b .desktop-actions +%patch8 -p1 -b .printing-margins +%patch9 -p1 -b .printing-margins2 +%patch10 -p1 -b .spell +%patch11 -p1 -b .spell2 +%patch12 -p1 -b .unset-gvfs +%patch13 -p1 -b .external-tools +%patch14 -p1 -b .changelog-snipplet +%patch15 -p1 -b .german-open-shortcut +%patch16 -p1 -b .fix-close-after-save autoreconf -i -f intltoolize -f @@ -199,6 +235,43 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : %{_datadir}/vala/ %changelog +* Mon Aug 01 2016 Ray Strode - 3.14.3-18 +- Updated version of python3→2 patch from Matej Cepl + Resolves: #1360922 + +* Fri Apr 15 2016 Ray Strode - 3.14.3-17 +- Fix close after save functionality when closing window + with unsaved documents + Resolves: #1247999 + +* Fri Apr 15 2016 Mike FABIAN 3.14.3-16 +- Add a shorcut for German for the open button + Resolves: #1279299 + +* Wed Apr 6 2015 Matthias Clasen 3.14.3-15 +- Add a snipplet for rpm changelogs + Resolves: #1301769 + +* Wed Apr 6 2015 Matthias Clasen 3.14.3-14 +- Fix desktop files for external tools + Resolves: #1301764 + +* Wed Apr 6 2015 Matthias Clasen 3.14.3-13 +- Fix spell checker metadata saving + Resolves: #1301761 + +* Wed Apr 6 2015 Matthias Clasen 3.14.3-12 +- Fix printing margins + Resolves: #1301726 + +* Wed Apr 6 2015 Matthias Clasen 3.14.3-11 +- Fix desktop actions + Resolves: #1301760 + +* Wed Apr 6 2015 Matthias Clasen 3.14.3-10 +- Really fix chevrons in schemas + Resolves: #1258357 + * Wed Sep 23 2015 Ray Strode 3.14.3-9 - Add X-RHEL-AliasOf=org.gnome.gedit to compat desktop file Related: #1259292