[packages/kde4-kcm-gtk] - initial, from FC
arekm
arekm at pld-linux.org
Tue Nov 25 08:27:49 CET 2014
commit 9faeb51a881535d170d254d0dbc485fe7017ac98
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Nov 25 08:27:35 2014 +0100
- initial, from FC
kcm-gtk-0.5.3-fix-de.patch | 132 +++++++++++++++++++
kcm-gtk-0.5.3-gtkrc_setenv.patch | 27 ++++
kcm-gtk-0.5.3-settings_category.patch | 8 ++
kde4-kcm-gtk.spec | 56 ++++++++
kubuntu_01_xsettings_kipc.patch | 233 ++++++++++++++++++++++++++++++++++
5 files changed, 456 insertions(+)
---
diff --git a/kde4-kcm-gtk.spec b/kde4-kcm-gtk.spec
new file mode 100644
index 0000000..972ec24
--- /dev/null
+++ b/kde4-kcm-gtk.spec
@@ -0,0 +1,56 @@
+Summary: Configure the appearance of GTK apps in KDE
+Name: kde4-kcm-gtk
+Version: 0.5.3
+Release: 1
+License: GPL v2+
+Group: X11/Applications
+URL: https://launchpad.net/kcm-gtk
+Source0: http://launchpad.net/kcm-gtk/0.5.x/%{version}/+download/kcm-gtk_%{version}.orig.tar.gz
+# Source0-md5: b49e2df3cce3bcb8c6dc96e7af73716d
+Patch1: kcm-gtk-0.5.3-settings_category.patch
+Patch2: kcm-gtk-0.5.3-gtkrc_setenv.patch
+Patch3: kcm-gtk-0.5.3-fix-de.patch
+Patch4: kubuntu_01_xsettings_kipc.patch
+BuildRequires: gettext
+BuildRequires: kde4-kdelibs-devel >= 4.8
+Requires: kde4-kdebase-runtime
+
+%description
+This is a System Settings configuration module for configuring the
+appearance of GTK apps in KDE.
+
+%prep
+%setup -q -n kcm-gtk-%{version}
+%patch1 -p1 -b .settings_category
+%patch2 -p1 -b .gtkrc_setenv
+%patch3 -p1 -b .fix-de
+%patch4 -p1 -b .xsettings_kipc
+
+# fixup for kde-4.5+, see http://bugzilla.redhat.com/628381
+sed -i.kde45 -e 's|^X-KDE-System-Settings-Parent-Category=appearance$|X-KDE-System-Settings-Parent-Category=application-appearance|' \
+ kcmgtk.desktop
+
+%build
+install -d build
+cd build
+%{cmake} ..
+
+%{__make}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%find_lang kcm_gtk
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f kcm_gtk.lang
+%defattr(644,root,root,755)
+%doc Changelog
+%attr(755,root,root) %{_libdir}/kde4/kcm_gtk.so
+%{_iconsdir}/kcm_gtk.png
+%{_datadir}/kde4/services/kcmgtk.desktop
diff --git a/kcm-gtk-0.5.3-fix-de.patch b/kcm-gtk-0.5.3-fix-de.patch
new file mode 100644
index 0000000..c291247
--- /dev/null
+++ b/kcm-gtk-0.5.3-fix-de.patch
@@ -0,0 +1,132 @@
+diff -ur kcm-gtk-0.5.3/po/de/kcm_gtk.po kcm-gtk-0.5.3-fix-de/po/de/kcm_gtk.po
+--- kcm-gtk-0.5.3/po/de/kcm_gtk.po 2009-10-23 15:07:44.000000000 +0200
++++ kcm-gtk-0.5.3-fix-de/po/de/kcm_gtk.po 2009-12-20 11:47:45.000000000 +0100
+@@ -21,7 +21,7 @@
+ #: kcmgtk.cpp:107
+ #, kde-format
+ msgid "%1 (size %2)"
+-msgstr "%1 (Gre %2)"
++msgstr "%1 (Größe %2)"
+
+ #. i18n: file: kcmgtkwidget.ui:19
+ #. i18n: ectx: property (title), widget (QGroupBox, groupBox)
+@@ -39,7 +39,7 @@
+ #. i18n: ectx: property (text), widget (QPushButton, warning3)
+ #: rc.cpp:9 rc.cpp:50
+ msgid "Change search paths..."
+-msgstr "Suchpfade ndern ..."
++msgstr "Suchpfade ändern ..."
+
+ #. i18n: file: kcmgtkwidget.ui:94
+ #. i18n: ectx: property (title), widget (QGroupBox, groupBox_2)
+@@ -63,7 +63,7 @@
+ #. i18n: ectx: property (text), widget (QPushButton, fontChange)
+ #: rc.cpp:21 rc.cpp:62
+ msgid "Change..."
+-msgstr "ndern ..."
++msgstr "Ändern ..."
+
+ #. i18n: file: kcmgtkwidget.ui:165
+ #. i18n: ectx: property (text), widget (KSqueezedTextLabel, qtcurveFontLabel)
+@@ -84,7 +84,7 @@
+ #. i18n: ectx: property (windowTitle), widget (QWidget, SearchPaths)
+ #: rc.cpp:30 rc.cpp:71
+ msgid "Change search paths"
+-msgstr "Suchpfade ndern"
++msgstr "Suchpfade ändern"
+
+ #. i18n: file: searchpaths.ui:26
+ #. i18n: ectx: property (text), widget (QLabel, textLabel1)
+@@ -99,7 +99,7 @@
+ #. i18n: ectx: property (text), widget (QPushButton, addButton)
+ #: rc.cpp:36 rc.cpp:77
+ msgid "Add"
+-msgstr "Hinzufgen"
++msgstr "Hinzufügen"
+
+ #. i18n: file: searchpaths.ui:63
+ #. i18n: ectx: property (text), widget (QPushButton, removeButton)
+@@ -147,7 +147,7 @@
+ "right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-"
+ "weight:600;\">Warnung:</span> Die Gtk-Qt-Theme-Engine ist nicht installiert. "
+ "Das bedeutet, dass Sie Ihren KDE-Stil nicht in GTK-Anwendungen verwenden "
+-"knnen.</p></body></html>"
++"können.</p></body></html>"
+
+ msgid "Gtk-Qt theme engine homepage"
+ msgstr "Homepage der Gtk-Qt-Theme-Engine"
+@@ -156,7 +156,7 @@
+ msgstr "http://gtk-qt.ecs.soton.ac.uk"
+
+ msgid "The Quick Brown Fox Jumped Over The Lazy Dog"
+-msgstr "Falsches ben von Xylophonmusik qult jeden greren Zwerg"
++msgstr "Falsches Üben von Xylophonmusik quält jeden größeren Zwerg"
+
+ msgid "Firefox and Thunderbird"
+ msgstr "Firefox und Thunderbird"
+@@ -166,12 +166,12 @@
+ "Thunderbird. This can be fixed by installing some files into your Mozilla "
+ "profile."
+ msgstr ""
+-"Die Knpfe der Bildlaufleiste werden in Firefox und Thunderbird gelegentlich "
++"Die Knöpfe der Bildlaufleiste werden in Firefox und Thunderbird gelegentlich "
+ "falsch dargestellt. Dies kann durch das Installieren einiger Dateien in das "
+ "Mozilla-Profilverzeichnis behoben werden."
+
+ msgid "I&nstall scrollbar fix..."
+-msgstr "Korrektur fr Bildlaufleiste i&nstallieren ..."
++msgstr "Korrektur für Bildlaufleiste i&nstallieren ..."
+
+ msgid ""
+ "The control center module could not find the GTK-Qt theme engine in its list "
+@@ -180,7 +180,7 @@
+ msgstr ""
+ "Das Kontrollzentrum-Modul konnte die GTK-Qt-Theme-Engine nicht in der Liste "
+ "der Suchpfade finden. Wenn Sie sie an einem anderen Ort installiert haben, "
+-"mssen Sie den korrekten Pfad der Liste hinzufgen."
++"müssen Sie den korrekten Pfad der Liste hinzufügen."
+
+ msgid "No Mozilla profiles found"
+ msgstr "Keine Mozilla-Profile gefunden"
+@@ -193,14 +193,14 @@
+ "all Firefox and Thunderbird windows for the changes to take effect"
+ msgstr ""
+ "Das Mozilla-Profil wurde erfolgreich aktualisiert. Alle laufenden Firefox- "
+-"und Thunderbird-Fenster mssen geschlossen und neu geffnet werden, um die "
+-"nderungen zu bernehmen."
++"und Thunderbird-Fenster müssen geschlossen und neu geöffnet werden, um die "
++"Änderungen zu übernehmen."
+
+ msgid "Mozilla profile"
+ msgstr "Mozilla-Profil"
+
+ msgid "Could not write to %1"
+-msgstr "%1 lie sich nicht schreiben"
++msgstr "%1 ließ sich nicht schreiben"
+
+ msgid ""
+ "_: NAME OF TRANSLATORS\n"
+@@ -230,19 +230,19 @@
+ "will not be able to use your KDE style in GTK applications."
+ msgstr ""
+ "<b>Warnung:</b> Die Gtk-Qt-Theme-Engine ist nicht installiert. Das bedeutet ,"
+-"dass Ihre KDE-Stile nicht in GTK-Anwendungen verwendet werden knnen."
++"dass Ihre KDE-Stile nicht in GTK-Anwendungen verwendet werden können."
+
+ msgid "Preview line 1"
+ msgstr "Vorschauzeile 1"
+
+ msgid "GTK Keyboard Shortcuts"
+-msgstr "GTK-Tastenkrzel"
++msgstr "GTK-Tastenkürzel"
+
+ msgid "Use Emacs-like key&board shortcuts for text editing"
+-msgstr "Emacs-Tastenkrzel zum Editieren von Text verwenden"
++msgstr "Emacs-Tastenkürzel zum Editieren von Text verwenden"
+
+ msgid "Profile"
+ msgstr "Profil"
+
+ msgid "Please select the profiles that you want to fix:"
+-msgstr "Bitte whlen Sie die zu korrigierenden Profile aus:"
++msgstr "Bitte wählen Sie die zu korrigierenden Profile aus:"
diff --git a/kcm-gtk-0.5.3-gtkrc_setenv.patch b/kcm-gtk-0.5.3-gtkrc_setenv.patch
new file mode 100644
index 0000000..da76519
--- /dev/null
+++ b/kcm-gtk-0.5.3-gtkrc_setenv.patch
@@ -0,0 +1,27 @@
+diff -up kcm-gtk-0.5.3/gtkrcfile.cpp.gtkrc_setenv kcm-gtk-0.5.3/gtkrcfile.cpp
+--- kcm-gtk-0.5.3/gtkrcfile.cpp.gtkrc_setenv 2009-10-23 08:07:44.000000000 -0500
++++ kcm-gtk-0.5.3/gtkrcfile.cpp 2009-10-30 12:42:28.186035811 -0500
+@@ -26,6 +26,8 @@
+ #include <QTextStream>
+ #include <QStringList>
+ #include <QtDebug>
++#include <ktoolinvocation.h>
++#include <klauncher_iface.h>
+
+ QRegExp GtkRcFile::k_themeNameRe("([^/]+)/gtk-2.0/gtkrc$");
+
+@@ -134,6 +136,14 @@ void GtkRcFile::save()
+ stream << "\n";
+ stream << "gtk-theme-name=\"" << m_themeName << "\"\n";
+ stream << "gtk-font-name=\"" << fontName << "\"\n";
++
++ QByteArray gtkrc = getenv("GTK2_RC_FILES");
++ QStringList list = QFile::decodeName(gtkrc).split( ':');
++ if (!list.contains(m_fileName)) {
++ list.append(m_fileName);
++ QString value = QFile::encodeName(list.join(":"));
++ KToolInvocation::klauncher()->setLaunchEnv("GTK2_RC_FILES", value);
++ }
+ }
+
+ void GtkRcFile::setFont(const QString& family, int pointSize, bool bold, bool italic)
diff --git a/kcm-gtk-0.5.3-settings_category.patch b/kcm-gtk-0.5.3-settings_category.patch
new file mode 100644
index 0000000..788165f
--- /dev/null
+++ b/kcm-gtk-0.5.3-settings_category.patch
@@ -0,0 +1,8 @@
+diff -up kcm-gtk-0.5.3/kcmgtk.desktop.settings_category kcm-gtk-0.5.3/kcmgtk.desktop
+--- kcm-gtk-0.5.3/kcmgtk.desktop.settings_category 2009-10-23 08:07:44.000000000 -0500
++++ kcm-gtk-0.5.3/kcmgtk.desktop 2012-05-14 13:39:27.760760927 -0500
+@@ -29,3 +29,4 @@ X-KDE-Library=kcm_gtk
+ X-KDE-ParentApp=kcontrol
+ Categories=Qt;KDE;X-KDE-settings-looknfeel;
+ X-KDE-System-Settings-Parent-Category=appearance
++X-KDE-System-Settings-Parent-Category-V2=application-appearance
diff --git a/kubuntu_01_xsettings_kipc.patch b/kubuntu_01_xsettings_kipc.patch
new file mode 100644
index 0000000..d20a2ca
--- /dev/null
+++ b/kubuntu_01_xsettings_kipc.patch
@@ -0,0 +1,233 @@
+Description: Notify xsettings-kde when the gtk theme has changed.
+Author: Felix Geyer <debfx at ubuntu.com>
+
+--- kcm-gtk-0.5.3.orig/CMakeLists.txt
++++ kcm-gtk-0.5.3/CMakeLists.txt
+@@ -3,6 +3,7 @@ project(kcm-gtk)
+ # Find the required Libaries
+ find_package(KDE4 REQUIRED)
+ include(KDE4Defaults)
++find_package(X11 REQUIRED)
+
+ add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
+ include_directories(
+@@ -20,6 +20,7 @@ SET(kcm_gtk_SOURCES
+ kcmgtk.cpp
+ gtkrcfile.cpp
+ searchpaths.cpp
++ kipc.cpp
+ )
+
+ # UI files
+@@ -35,7 +37,7 @@ KDE4_ADD_PLUGIN(kcm_gtk ${kcm_gtk_SOURCE
+ INCLUDE_DIRECTORIES(${KDE4_INCLUDE_DIR})
+ LINK_DIRECTORIES(${KDE4_LIB_DIR})
+
+-TARGET_LINK_LIBRARIES(kcm_gtk ${KDE4_KDECORE_LIBRARY} ${KDE4_KDEUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
++TARGET_LINK_LIBRARIES(kcm_gtk ${KDE4_KDECORE_LIBRARY} ${KDE4_KDEUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${X11_X11_LIB})
+
+ INSTALL(
+ TARGETS kcm_gtk
+--- kcm-gtk-0.5.3.orig/kcmgtk.cpp
++++ kcm-gtk-0.5.3/kcmgtk.cpp
+@@ -21,6 +21,7 @@
+ #include "kcmgtk.h"
+ #include "gtkrcfile.h"
+ #include "searchpaths.h"
++#include "kipc.h"
+
+ #include <kgenericfactory.h>
+ #include <kaboutdata.h>
+@@ -111,6 +112,7 @@ void KcmGtk::save()
+ {
+ // Write ~/.gtkrc-2.0-kde4
+ m_gtkRc->save();
++ KIPC::sendMessageAll(KIPC::StyleChanged);
+ }
+
+ void KcmGtk::defaults()
+--- /dev/null
++++ kcm-gtk-0.5.3/kipc.cpp
+@@ -0,0 +1,100 @@
++/* This file is part of the KDE libraries
++
++ Copyright (C) 1999 Mattias Ettrich (ettrich at kde.org)
++ Copyright (C) 1999,2000 Geert Jansen <jansen at kde.org>
++
++ This library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Library General Public
++ License as published by the Free Software Foundation; either
++ version 2 of the License, or (at your option) any later version.
++
++ This library 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
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public License
++ along with this library; see the file COPYING.LIB. If not, write to
++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ Boston, MA 02110-1301, USA.
++*/
++
++
++/*
++ * kipc.cpp: Send a message to one/all KDE apps.
++ *
++ * $Id: kipc.cpp 482239 2005-11-22 08:32:28Z coolo $
++ */
++#include "kipc.h"
++#include <QX11Info>
++
++#if defined Q_WS_X11
++#include <X11/X.h>
++#include <X11/Xlib.h>
++#endif
++
++
++
++#if defined Q_WS_X11
++static long getSimpleProperty(Window w, Atom a)
++{
++ Atom real_type;
++ int format;
++ unsigned long n, extra, res = 0;
++ int status;
++ unsigned char *p = 0;
++
++ status = XGetWindowProperty(QX11Info::display(), w, a, 0L, 1L, False, a,
++ &real_type, &format, &n, &extra, &p);
++ if ((status == Success) && (n == 1) && (format == 32))
++ res = *(unsigned long*)p;
++ if (p) XFree(p);
++ return res;
++}
++#endif
++
++void KIPC::sendMessage(Message msg, WId w, int data)
++{
++#if defined Q_WS_X11
++ static Atom a = 0;
++ if (a == 0)
++ a = XInternAtom(QX11Info::display(), "KIPC_COMM_ATOM", False);
++ XEvent ev;
++ ev.xclient.type = ClientMessage;
++ ev.xclient.display = QX11Info::display();
++ ev.xclient.window = (Window) w;
++ ev.xclient.message_type = a;
++ ev.xclient.format = 32;
++ ev.xclient.data.l[0] = msg;
++ ev.xclient.data.l[1] = data;
++ XSendEvent(QX11Info::display(), (Window) w, False, 0L, &ev);
++
++#endif
++}
++
++
++void KIPC::sendMessageAll(Message msg, int data)
++{
++#if defined Q_WS_X11
++ unsigned int i, nrootwins;
++ Window dw1, dw2, *rootwins = 0;
++ Display *dpy = QX11Info::display();
++ int screen_count = ScreenCount(dpy);
++
++ for (int s = 0; s < screen_count; s++)
++ {
++ Window root = RootWindow(dpy, s);
++
++ XQueryTree(dpy, root, &dw1, &dw2, &rootwins, &nrootwins);
++ Atom a = XInternAtom(QX11Info::display(), "KDE_DESKTOP_WINDOW", False);
++ for (i = 0; i < nrootwins; i++)
++ {
++ if (getSimpleProperty(rootwins[i], a) != 0L)
++ sendMessage(msg, rootwins[i], data);
++ }
++ XFree((char *) rootwins);
++ }
++ XSync(dpy,False);
++#endif
++}
++
+--- /dev/null
++++ kcm-gtk-0.5.3/kipc.h
+@@ -0,0 +1,79 @@
++/* This file is part of the KDE libraries
++
++ Copyright (C) 1999 Mattias Ettrich (ettrich at kde.org)
++ Copyright (C) 1999,2000 Geert Jansen <jansen at kde.org>
++
++ This library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Library General Public
++ License as published by the Free Software Foundation; either
++ version 2 of the License, or (at your option) any later version.
++
++ This library 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
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public License
++ along with this library; see the file COPYING.LIB. If not, write to
++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ Boston, MA 02110-1301, USA.
++*/
++
++#ifndef __KIPC_h_Included__
++#define __KIPC_h_Included__
++
++/**
++ * This class implements a very simple IPC mechanism for KDE. You can send
++ * a message of a predefined type to either a specific application, or to all
++ * KDE application on the current display. The message can carry one integer of
++ * data.
++ *
++ * KIPC is mainly used in KDE for sending "Change Messages", i.e. a message to
++ * all KDE apps that a certain setting (the font, for example) has changed.
++ * For anything more complex it is recommended to use DCOP -- the Desktop
++ * Communications Protocol.
++ *
++ * Messages with id code < 32 are called "System Messages". These are
++ * directly handled by KApplication. Examples are: PaletteChanged and
++ * StyleChanged. Messages with id code >= 32 are user messages. KApplication
++ * emits the signal kipcMessage(id,arg) for each user message it receives.
++ *
++ * KIPC is implemented using X11 ClientMessage events.
++ *
++ * @see KApplication::kipcMessage()
++ * @author Geert Jansen <jansen at kde.org>
++ */
++
++#include <QWidget>
++
++class KIPC
++{
++public:
++ /**
++ * A identifier for messages. Messages below UserMessage are system
++ * messages, messages above can be defined by the user.
++ */
++ enum Message { PaletteChanged=0, FontChanged, StyleChanged,
++ BackgroundChanged, SettingsChanged, IconChanged, ToolbarStyleChanged,
++ ClipboardConfigChanged, /// @since 3.1
++ BlockShortcuts, /// @since 3.5
++ UserMessage=32 };
++
++ /**
++ * Send a message to a specific application.
++ *
++ * @param msg The message to send.
++ * @param w The window id of a toplevel window of the target application.
++ * @param data An optional integer of data.
++ */
++ static void sendMessage(Message msg, WId w, int data=0);
++
++ /**
++ * Send a message to all KDE application on the current display.
++ *
++ * @param msg The message to send.
++ * @param data An optional integer of data.
++ */
++ static void sendMessageAll(Message msg, int data=0);
++};
++#endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kde4-kcm-gtk.git/commitdiff/9faeb51a881535d170d254d0dbc485fe7017ac98
More information about the pld-cvs-commit
mailing list