[packages/xfce4-terminal] - load color schemes also from user config dir - rel 1

baggins baggins at pld-linux.org
Thu Jan 17 12:15:57 CET 2013


commit a3ee9d16993fdf48837bafedc2f367791e64495a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Jan 17 12:14:52 2013 +0100

    - load color schemes also from user config dir
    - rel 1

 xfce4-terminal-user-colors.patch | 86 ++++++++++++++++++++++++++++++++++++++++
 xfce4-terminal.spec              |  9 +++--
 2 files changed, 91 insertions(+), 4 deletions(-)
---
diff --git a/xfce4-terminal.spec b/xfce4-terminal.spec
index be7a3e6..c21cbe4 100644
--- a/xfce4-terminal.spec
+++ b/xfce4-terminal.spec
@@ -4,12 +4,13 @@ Summary:	Xfce Terminal Emulator
 Summary(pl.UTF-8):	Emulator terminala dla Xfce
 Name:		xfce4-terminal
 Version:	0.6.1
-Release:	0.1
+Release:	1
 License:	GPL v2
 Group:		X11/Applications
 Source0:	http://archive.xfce.org/src/apps/xfce4-terminal/0.6/%{name}-%{version}.tar.bz2
 # Source0-md5:	98613ce500fef2ed62cdbe788084acca
 Patch0:		%{name}-desktop.patch
+Patch1:		%{name}-user-colors.patch
 URL:		http://www.xfce.org/projects/terminal/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake >= 1:1.8
@@ -39,10 +40,11 @@ Zaawansowany emulator terminala dla systemu X Window.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 # already present as ur
 %{__sed} -i 's,ur_PK ,,' configure.ac
-
+ 
 %build
 %{__intltoolize}
 %{__libtoolize}
@@ -50,8 +52,7 @@ Zaawansowany emulator terminala dla systemu X Window.
 %{__autoheader}
 %{__automake}
 %{__autoconf}
-%configure \
-	--enable-dbus
+%configure
 
 %{__make}
 
diff --git a/xfce4-terminal-user-colors.patch b/xfce4-terminal-user-colors.patch
new file mode 100644
index 0000000..3ef51a2
--- /dev/null
+++ b/xfce4-terminal-user-colors.patch
@@ -0,0 +1,86 @@
+--- xfce4-terminal-0.6.1/terminal/terminal-preferences-dialog.c~	2013-01-17 12:02:00.584298133 +0100
++++ xfce4-terminal-0.6.1/terminal/terminal-preferences-dialog.c	2013-01-17 12:06:11.493576768 +0100
+@@ -670,7 +670,7 @@
+ static void
+ terminal_preferences_dialog_presets_load (TerminalPreferencesDialog *dialog)
+ {
+-  gchar       **presets;
++  gchar       **sys_presets,**user_presets;
+   guint         n;
+   GObject      *object;
+   guint         n_presets = 0;
+@@ -682,8 +682,9 @@
+   gchar        *path;
+ 
+   /* load schemes */
+-  presets = xfce_resource_match (XFCE_RESOURCE_DATA, "xfce4/terminal/colorschemes/*", TRUE);
+-  if (G_LIKELY (presets != NULL))
++  sys_presets = xfce_resource_match (XFCE_RESOURCE_DATA, "xfce4/terminal/colorschemes/*", TRUE);
++  user_presets = xfce_resource_match (XFCE_RESOURCE_CONFIG, "xfce4/terminal/colorschemes/*.theme", TRUE);
++  if (G_LIKELY (sys_presets != NULL) || (user_presets != NULL))
+     {
+       /* create sorting store */
+       store = gtk_list_store_new (N_PRESET_COLUMNS, G_TYPE_STRING,
+@@ -693,10 +693,11 @@
+                                             GTK_SORT_ASCENDING);
+ 
+       /* append files */
+-      for (n = 0; presets[n] != NULL; n++)
++      if (G_LIKELY (sys_presets != NULL)) {
++      for (n = 0; sys_presets[n] != NULL; n++)
+         {
+           /* open the scheme */
+-          path = xfce_resource_lookup (XFCE_RESOURCE_DATA, presets[n]);
++          path = xfce_resource_lookup (XFCE_RESOURCE_DATA, sys_presets[n]);
+           if (G_UNLIKELY (path == NULL))
+             continue;
+ 
+@@ -722,6 +723,38 @@
+           xfce_rc_close (rc);
+           g_free (path);
+         }
++      }
++      if (user_presets != NULL) {
++      for (n = 0; user_presets[n] != NULL; n++)
++        {
++          /* open the scheme */
++          path = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, user_presets[n]);
++          if (G_UNLIKELY (path == NULL))
++            continue;
++
++          rc = xfce_rc_simple_open (path, TRUE);
++          if (G_UNLIKELY (rc == NULL))
++            {
++              g_free (path);
++              continue;
++            }
++
++          xfce_rc_set_group (rc, "Scheme");
++
++          /* translated name */
++          title = xfce_rc_read_entry (rc, "Name", NULL);
++          if (G_LIKELY (title != NULL))
++            {
++              gtk_list_store_insert_with_values (store, NULL, n_presets++,
++                                                 PRESET_COLUMN_TITLE, title,
++                                                 PRESET_COLUMN_PATH, path,
++                                                 -1);
++            }
++
++          xfce_rc_close (rc);
++          g_free (path);
++        }
++      }
+ 
+       /* stop sorting */
+       gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
+@@ -748,7 +781,8 @@
+       g_object_unref (store);
+     }
+ 
+-  g_strfreev (presets);
++  g_strfreev (sys_presets);
++  g_strfreev (user_presets);
+ 
+   if (n_presets == 0)
+     {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xfce4-terminal.git/commitdiff/a3ee9d16993fdf48837bafedc2f367791e64495a



More information about the pld-cvs-commit mailing list