summaryrefslogtreecommitdiffstats
path: root/kcm_gtk
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 01:37:00 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 01:37:00 +0000
commit0e865e2b7e566235912012e357111792f4e31d8c (patch)
treefd2d295c7beae0050cc8bd657f09ed294819eaf0 /kcm_gtk
downloadgtk-qt-engine-0e865e2b7e566235912012e357111792f4e31d8c.tar.gz
gtk-qt-engine-0e865e2b7e566235912012e357111792f4e31d8c.zip
Added abandoned KDE3 version of the GTK Qt theme engine
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gtk-qt-engine@1084394 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcm_gtk')
-rw-r--r--kcm_gtk/CMakeLists.txt30
-rw-r--r--kcm_gtk/emacsdetails.ui233
-rw-r--r--kcm_gtk/kcmgtk.cpp704
-rw-r--r--kcm_gtk/kcmgtk.desktop28
-rw-r--r--kcm_gtk/kcmgtk.h104
-rw-r--r--kcm_gtk/kcmgtkwidget.ui645
-rw-r--r--kcm_gtk/mozillaprofile.ui74
-rw-r--r--kcm_gtk/searchpaths.ui152
8 files changed, 1970 insertions, 0 deletions
diff --git a/kcm_gtk/CMakeLists.txt b/kcm_gtk/CMakeLists.txt
new file mode 100644
index 0000000..d5537c5
--- /dev/null
+++ b/kcm_gtk/CMakeLists.txt
@@ -0,0 +1,30 @@
+INCLUDE(KDE3Macros)
+INCLUDE(GtkQt)
+
+# Sources
+SET(kcm_kcmgtk_SOURCES
+ kcmgtk.cpp)
+
+KDE3_AUTOMOC(${kcm_kcmgtk_SOURCES})
+
+# UI files
+SET(kcm_kcmgtk_UI
+ kcmgtkwidget.ui
+ mozillaprofile.ui
+ emacsdetails.ui
+ searchpaths.ui)
+
+KDE3_ADD_UI_FILES(kcm_kcmgtk_SOURCES ${kcm_kcmgtk_UI})
+
+GTKQT_KDE3_ADD_KPART(kcm_kcmgtk "${INSTALL_PATH_KCONTROL_MODULES}/kde3" ${kcm_kcmgtk_SOURCES})
+
+INSTALL(
+ TARGETS kcm_kcmgtk
+ DESTINATION ${INSTALL_PATH_KCONTROL_MODULES}/kde3
+)
+
+INSTALL(
+ FILES kcmgtk.desktop
+ DESTINATION share/applications/
+)
+
diff --git a/kcm_gtk/emacsdetails.ui b/kcm_gtk/emacsdetails.ui
new file mode 100644
index 0000000..677a69c
--- /dev/null
+++ b/kcm_gtk/emacsdetails.ui
@@ -0,0 +1,233 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>EmacsDetails</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EmacsDetails</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>489</width>
+ <height>296</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Emacs Keyboard Shortcuts</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>These keyboard shortcuts are useful for Emacs users.
+When enabled, they will override the standard keyboard shortcuts in GTK applications.</string>
+ </property>
+ </widget>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Shortcut</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>false</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>false</bool>
+ </property>
+ </column>
+ <item>
+ <property name="text">
+ <string>Ctrl+A</string>
+ </property>
+ <property name="text">
+ <string>Go to beginning of line</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+E</string>
+ </property>
+ <property name="text">
+ <string>Go to end of line</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+F</string>
+ </property>
+ <property name="text">
+ <string>Go right one character</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+B</string>
+ </property>
+ <property name="text">
+ <string>Go left one character</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+K</string>
+ </property>
+ <property name="text">
+ <string>Delete to end of line</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+U</string>
+ </property>
+ <property name="text">
+ <string>Delete entire line</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+W</string>
+ </property>
+ <property name="text">
+ <string>Delete word, left</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+H</string>
+ </property>
+ <property name="text">
+ <string>Delete character, left</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ctrl+D</string>
+ </property>
+ <property name="text">
+ <string>Delete character, right</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>list</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>101</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;lose</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>pushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>EmacsDetails</receiver>
+ <slot>close()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kcm_gtk/kcmgtk.cpp b/kcm_gtk/kcmgtk.cpp
new file mode 100644
index 0000000..036836d
--- /dev/null
+++ b/kcm_gtk/kcmgtk.cpp
@@ -0,0 +1,704 @@
+/***************************************************************************
+ * Copyright (C) 2004 by David Sansome *
+ * david@dave-linux *
+ * *
+ * 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, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include <qlayout.h>
+
+#include <klocale.h>
+#include <kglobal.h>
+#include <kfontdialog.h>
+#include <kiconloader.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+#include <qdir.h>
+#include <qcombobox.h>
+#include <qmap.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlabel.h>
+#include <kurllabel.h>
+#include <kapplication.h>
+#include <kfontcombo.h>
+#include <qspinbox.h>
+#include <ksqueezedtextlabel.h>
+#include <stdlib.h>
+#include <kmessagebox.h>
+#include <kconfig.h>
+#include <qstyle.h>
+#include <qheader.h>
+#include <klistview.h>
+#include <qmessagebox.h>
+#include <qcheckbox.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "kcmgtk.h"
+#include "mozillaprofile.h"
+
+const QString KcmGtk::GTK_RC_FILE(".gtkrc-2.0-kde-kde4");
+const QString KcmGtk::KDE_RC_DIR(KGlobal::dirs()->localkdedir() + "/env/");
+const QString KcmGtk::GTK_QT_RC_FILE("gtk-qt-engine.rc.sh");
+
+/*typedef KGenericFactory<KcmGtk, QWidget> KcmGtkFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_gtk, KcmGtkFactory("gtk"))*/
+
+extern "C"
+{
+ KCModule *create_kcmgtk( QWidget * parent, const char * name )
+ {
+ KGlobal::locale()->insertCatalogue( "gtkqtengine" );
+ return new KcmGtk( parent, "kcmgtk" );
+ }
+}
+
+GtkRcParser::GtkRcParser()
+ : emacs(false)
+{
+}
+
+void GtkRcParser::parse(QString fileName)
+{
+ QFile file(fileName);
+ file.open(IO_ReadOnly);
+ QTextStream stream(&file);
+
+ QRegExp includeRe("include\\s*\"([^\"]*)\"");
+ QRegExp fontRe("font_name\\s*=\\s*\"([^\"]*)\"");
+ QRegExp keyThemeRe("gtk-key-theme-name\\s*=\\s*\"([^\"]*)\"");
+
+ QStringList includes;
+
+ while (1)
+ {
+ QString line = stream.readLine();
+ if (line.isNull())
+ break;
+ if (line.startsWith("#"))
+ continue;
+
+ line = line.stripWhiteSpace();
+
+ if (line.startsWith("include"))
+ {
+ if (includeRe.search(line) == -1)
+ continue;
+ QString themePath = includeRe.cap(1);
+ if (themePath.endsWith("/gtk-2.0/gtkrc") && !themePath.startsWith("/etc"))
+ style = includeRe.cap(1);
+ }
+ if (line.startsWith("font_name"))
+ {
+ if (fontRe.search(line) == -1)
+ continue;
+ // Assume there will only be one font line
+ font = parseFont(fontRe.cap(1));
+ }
+ if (line.startsWith("gtk-key-theme-name"))
+ {
+ if (keyThemeRe.search(line) == -1)
+ continue;
+ if (keyThemeRe.cap(1).lower() == "emacs")
+ emacs = true;
+ }
+ }
+
+ file.close();
+}
+
+QFont GtkRcParser::parseFont(QString fontString)
+{
+ QFont ret;
+ while (true)
+ {
+ int lastSpacePos = fontString.findRev(' ');
+ if (lastSpacePos == -1)
+ break;
+
+ QString lastWord = fontString.right(fontString.length() - lastSpacePos).stripWhiteSpace();
+
+ if (lastWord.lower() == "bold")
+ ret.setBold(true);
+ else if (lastWord.lower() == "italic")
+ ret.setItalic(true);
+ else
+ {
+ bool ok;
+ int fontSize = lastWord.toInt(&ok);
+ if (!ok)
+ break;
+ ret.setPointSize(fontSize);
+ }
+
+ fontString = fontString.left(lastSpacePos);
+ }
+ ret.setFamily(fontString);
+ return ret;
+}
+
+KcmGtk::KcmGtk(QWidget *parent, const char *name, const QStringList&)
+ : KCModule(parent, name),
+ myAboutData(0),
+ emacsDetailsDialog(NULL),
+ searchPathsDialog(NULL)
+{
+ KGlobal::locale()->insertCatalogue("gtkqtengine");
+
+ config = new KConfig("kcmgtkrc");
+
+ QStringList gtkSearchPathsDefault;
+ gtkSearchPathsDefault.append("/usr");
+ gtkSearchPathsDefault.append("/usr/local");
+ gtkSearchPathsDefault.append("/opt/gnome");
+ gtkSearchPathsDefault.append(QDir::homeDirPath() + "/.local");
+
+ gtkSearchPaths = config->readListEntry("gtkSearchPaths", gtkSearchPathsDefault);
+
+
+ // Add the widget to our layout
+ QBoxLayout* l = new QVBoxLayout(this);
+ widget = new KcmGtkWidget(this);
+ l->addWidget(widget);
+
+ // Load the icons
+ KIconLoader iconLoader;
+ widget->styleIcon->setPixmap(iconLoader.loadIcon("style", KIcon::Desktop));
+ widget->fontIcon->setPixmap(iconLoader.loadIcon("fonts", KIcon::Desktop));
+ widget->firefoxIcon->setPixmap(iconLoader.loadIcon("firefox", KIcon::Desktop));
+ widget->keyboardIcon->setPixmap(iconLoader.loadIcon("keyboard", KIcon::Desktop));
+
+ getInstalledThemes();
+ load();
+
+ // Connect some signals
+ connect(widget->warning2, SIGNAL(leftClickedURL(const QString&)), KApplication::kApplication(), SLOT(invokeBrowser(const QString&)));
+ connect(widget->styleGroup, SIGNAL(clicked(int)), SLOT(itemChanged()));
+ connect(widget->fontGroup, SIGNAL(clicked(int)), SLOT(itemChanged()));
+ connect(widget->styleBox, SIGNAL(activated(int)), SLOT(itemChanged()));
+ connect(widget->styleBox, SIGNAL(activated(int)), SLOT(styleChanged()));
+ connect(widget->emacsBox, SIGNAL(toggled(bool)), SLOT(itemChanged()));
+ connect(widget->fontChange, SIGNAL(clicked()), SLOT(fontChangeClicked()));
+ connect(widget->firefoxFix, SIGNAL(clicked()), SLOT(firefoxFixClicked()));
+ connect(widget->emacsDetails, SIGNAL(clicked()), SLOT(emacsDetailsClicked()));
+ connect(widget->warning3, SIGNAL(clicked()), SLOT(searchPathsClicked()));
+}
+
+void KcmGtk::getInstalledThemes()
+{
+ themes.clear();
+ for ( QStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it )
+ {
+ QString path = (*it) + "/share/themes/";
+ QDir dir(path);
+ QStringList entryList = dir.entryList(QDir::Dirs, QDir::Unsorted);
+ for ( QStringList::Iterator it2 = entryList.begin(); it2 != entryList.end(); ++it2 )
+ {
+ if ((*it2).startsWith("."))
+ continue;
+ if (themes.find(*it2) != themes.end())
+ continue;
+ if (!QFile::exists(path + (*it2) + "/gtk-2.0/gtkrc"))
+ continue;
+ themes.insert((*it2), path + (*it2) + "/gtk-2.0/gtkrc");
+ }
+ }
+
+ widget->styleBox->clear();
+ widget->styleBox->insertStringList(themes.keys());
+
+ bool installed = (themes.find("Qt") != themes.end());
+ widget->styleKde->setEnabled(installed);
+ widget->warning1->setHidden(installed);
+ widget->warning2->setHidden(installed);
+ widget->warning3->setHidden(installed);
+}
+
+void KcmGtk::itemChanged()
+{
+ // In KDE < 3.3 there is no changed() slot - only a signal.
+ emit changed(true);
+}
+
+void KcmGtk::fontChangeClicked()
+{
+ if ( KFontDialog::getFont( font ) == KFontDialog::Accepted )
+ {
+ updateFontPreview();
+ widget->fontGroup->setButton(widget->fontGroup->id(widget->fontOther));
+ itemChanged();
+ }
+}
+
+void KcmGtk::styleChanged()
+{
+ widget->styleGroup->setButton(widget->styleGroup->id(widget->styleOther));
+ itemChanged();
+}
+
+QString KcmGtk::env(QString key)
+{
+ char* value = getenv(key.latin1());
+ if (value == NULL)
+ return QString::null;
+ else
+ return QString(value);
+}
+
+void KcmGtk::updateFontPreview()
+{
+ widget->fontPreview->setFont(font);
+ widget->fontPreview->setText(
+ i18n("%1 (size %2)").arg(font.family()).arg(QString::number(font.pointSize())));
+ widget->fontPreview2->setFont(font);
+}
+
+
+KcmGtk::~KcmGtk()
+{
+ delete config;
+}
+
+
+void KcmGtk::load()
+{
+ parser.parse(QDir::homeDirPath() + "/" + GTK_RC_FILE);
+
+ bool usingQtEngine = false;
+ if (!parser.style.isEmpty())
+ {
+ for ( QMapIterator<QString, QString> it = themes.begin(); it != themes.end(); ++it )
+ {
+ if (it.data() != parser.style)
+ continue;
+
+ if (it.key() == "Qt")
+ usingQtEngine = true;
+
+ for (int i=0 ; i<widget->styleBox->count() ; ++i)
+ {
+ if (widget->styleBox->text(i) == it.key())
+ {
+ widget->styleBox->setCurrentItem(i);
+ break;
+ }
+ }
+
+ break;
+ }
+
+ if (usingQtEngine)
+ widget->styleGroup->setButton(widget->styleGroup->id(widget->styleKde));
+ else
+ widget->styleGroup->setButton(widget->styleGroup->id(widget->styleOther));
+ }
+
+ font = parser.font;
+ if (QApplication::font().family() == font.family() &&
+ QApplication::font().pointSize() == font.pointSize() &&
+ QApplication::font().bold() == font.bold() &&
+ QApplication::font().italic() == font.italic())
+ widget->fontGroup->setButton(widget->fontGroup->id(widget->fontKde));
+ else
+ widget->fontGroup->setButton(widget->fontGroup->id(widget->fontOther));
+
+ widget->emacsBox->setChecked(parser.emacs);
+
+ updateFontPreview();
+}
+
+
+void KcmGtk::save()
+{
+ // First write out the gtkrc file
+ QFile file(QDir::homeDirPath() + "/" + GTK_RC_FILE);
+ file.open(IO_WriteOnly);
+ QTextStream stream(&file);
+
+ QFont selectedFont(widget->fontKde->isChecked() ? QApplication::font() : font);
+ QString fontName = selectedFont.family() + " " +
+ QString(selectedFont.bold() ? "Bold " : "") +
+ QString(selectedFont.italic() ? "Italic " : "") +
+ QString::number(selectedFont.pointSize());
+
+ QString themeName = widget->styleKde->isChecked() ? themes["Qt"] : themes[widget->styleBox->currentText()];
+ QString themeNameShort = widget->styleKde->isChecked() ? QString("Qt") : widget->styleBox->currentText();
+
+ stream << "# This file was written by KDE\n";
+ stream << "# You can edit it in the KDE control center, under \"GTK Styles and Fonts\"\n";
+ stream << "\n";
+ stream << "include \"" << themeName << "\"\n";
+ if (QFile::exists("/etc/gtk-2.0/gtkrc"))
+ stream << "include \"/etc/gtk-2.0/gtkrc\"\n";
+ stream << "\n";
+ stream << "style \"user-font\"\n";
+ stream << "{\n";
+ stream << "\tfont_name=\"" << fontName << "\"\n";
+ stream << "}\n";
+ stream << "widget_class \"*\" style \"user-font\"\n";
+ stream << "\n";
+ stream << "gtk-theme-name=\"" << themeNameShort << "\"\n";
+ stream << "gtk-font-name=\"" << fontName << "\"\n";
+
+ if (widget->emacsBox->isChecked())
+ stream << "gtk-key-theme-name=\"Emacs\"\n";
+
+ file.close();
+
+ // Now we check if that file is actually being loaded.
+ QDir kdeRcDir;
+ if (!kdeRcDir.exists(KDE_RC_DIR))
+ {
+ // Make sure KDE's rc dir exists
+ kdeRcDir.mkdir(KDE_RC_DIR);
+ }
+ file.setName(KDE_RC_DIR + "/" + GTK_QT_RC_FILE);
+
+ bool envFileDidNotExist = (!file.exists());
+
+ file.open(IO_ReadWrite);
+ stream.setDevice(&file);
+ bool found = false;
+ for (;;)
+ {
+ QString line = stream.readLine();
+ if (line.isNull())
+ break;
+
+ if (line.stripWhiteSpace().startsWith("export GTK2_RC_FILES=$HOME/" + GTK_RC_FILE))
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ stream << "#!/bin/bash\n\n";
+ stream << "# Make sure our customised gtkrc file is loaded.\n";
+ stream << "export GTK2_RC_FILES=$HOME/" + GTK_RC_FILE + "\n";
+ }
+ file.close();
+
+ // Make it executable
+ if (!found)
+ chmod(file.name().utf8(), 0755);
+
+ // Tell the user to restart KDE if the environment file was created this time
+ if (envFileDidNotExist)
+ QMessageBox::information(this, "Restart KDE", "Your changes have been saved, but you will have to restart KDE for them to take effect.", QMessageBox::Ok);
+
+ // Older versions of the Gtk-Qt theme engine wrote directly into ~/.gtkrc-2.0
+ // If the user has upgraded, that file needs to be deleted so the old settings
+ // won't override the new ones set now.
+ file.setName(QDir::homeDirPath() + "/.gtkrc-2.0");
+ if (file.exists())
+ {
+ file.open(IO_ReadOnly);
+ QString firstLine;
+ file.readLine(firstLine, 50);
+ file.close();
+
+ if (firstLine == "# This file was written by KDE")
+ file.remove();
+ }
+
+ // Simarly, remove the line we added to ~/.bashrc to tell GTK to load ~/.gtkrc-2.0
+ file.setName(QDir::homeDirPath() + "/.bashrc");
+ if (file.exists())
+ {
+ file.open(IO_ReadOnly);
+ QByteArray fileData = file.readAll();
+ file.close();
+
+ QString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0";
+ QString fileDataString(fileData);
+ fileDataString.replace("\n" + rcLine, "\n# (This is no longer needed from version 0.8 of the theme engine)\n# " + rcLine);
+
+ file.open(IO_WriteOnly);
+ stream.setDevice(&file);
+ stream << fileDataString;
+ file.close();
+ }
+
+ emit changed(true);
+}
+
+
+int KcmGtk::buttons()
+{
+ return KCModule::Apply;
+}
+
+QString KcmGtk::quickHelp() const
+{
+ return i18n("");
+}
+
+
+void KcmGtk::firefoxFixClicked()
+{
+ profiles.clear();
+ getProfiles(QDir::homeDirPath() + "/.mozilla/firefox/", 0);
+ getProfiles(QDir::homeDirPath() + "/.thunderbird/", 1);
+
+ QString profilePath;
+ if (profiles.count() == 0)
+ {
+ KMessageBox::error(this, i18n("No Mozilla profiles found"), i18n("Could not load Mozilla profiles"));
+ return;
+ }
+ else if (profiles.count() == 1)
+ {
+ fixProfile(profiles.begin().data());
+ }
+ else
+ {
+ KDialogBase* dialog = new KDialogBase(this, "", true, i18n("Mozilla profile"), KDialogBase::Ok | KDialogBase::Cancel);
+ MozillaProfileWidget* w = new MozillaProfileWidget(dialog);
+ w->profilesList->header()->hide();
+ w->profilesList->hideColumn(1);
+
+ QPixmap icon = KGlobal::iconLoader()->loadIcon("kuser", KIcon::Small);
+
+ for ( QMapIterator<QString,QString> it = profiles.begin(); it != profiles.end(); ++it )
+ {
+ KListViewItem* i = new KListViewItem(w->profilesList);
+ i->setPixmap(0, icon);
+ i->setText(0, it.key());
+ i->setText(1, it.data());
+ }
+
+ dialog->setMainWidget(w);
+ if (dialog->exec() == QDialog::Rejected)
+ {
+ delete dialog;
+ return;
+ }
+
+ QListViewItemIterator it2(w->profilesList, QListViewItemIterator::Selected);
+ while (it2.current())
+ {
+ KListViewItem* i = (KListViewItem*) it2.current();
+ ++it2;
+
+ fixProfile(i->text(1));
+ }
+ delete dialog;
+ }
+
+ KMessageBox::information(this, i18n("Your Mozilla profile was updated sucessfully. You must close and restart all Firefox and Thunderbird windows for the changes to take effect"), i18n("Mozilla profile"));
+}
+
+void KcmGtk::getProfiles(const QString& basePath, int type)
+{
+ QString fileName = basePath + "/profiles.ini";
+ if (QFile::exists(fileName))
+ {
+ KConfig config(fileName, true, false);
+ QStringList groups = config.groupList();
+
+ for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it )
+ {
+ if (!(*it).lower().startsWith("profile"))
+ continue;
+
+ config.setGroup(*it);
+ QString name = (type ? i18n("Thunderbird") : i18n("Firefox")) + " - " + config.readEntry("Name");
+ QString path = config.readEntry("Path");
+ if (!path.startsWith("/"))
+ path = basePath + path;
+ profiles.insert(name, path);
+ }
+ }
+}
+
+void KcmGtk::fixProfile(const QString& path)
+{
+ if (!QFile::exists(path + "/chrome"))
+ {
+ QDir dir(path);
+ dir.mkdir("chrome");
+ }
+
+ QString data = scrollBarCSS();
+ writeFirefoxCSS(path + "/chrome/userChrome.css", data);
+ writeFirefoxCSS(path + "/chrome/userContent.css", data);
+}
+
+QString KcmGtk::scrollBarCSS()
+{
+ // The following code determines how many buttons are on a scrollbar
+ // It works by looking at each pixel of the scrollbar's area not taken up by the groove,
+ // and asking the style which subcontrol is at that location.
+ QScrollBar sbar(NULL);
+ sbar.setOrientation(Qt::Horizontal);
+ sbar.setValue(1);
+ sbar.resize(200,25);
+
+ QRect rect = qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, &sbar, QStyle::SC_ScrollBarGroove);
+
+ bool back1 = false;
+ bool forward1 = false;
+ bool back2 = false;
+ bool forward2 = false;
+
+ QStyle::SubControl sc = QStyle::SC_None;
+ for (QPoint pos(0,7) ; pos.x()<rect.x() ; pos.setX(pos.x()+1))
+ {
+ QStyle::SubControl sc2 = qApp->style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos);
+ if (sc != sc2)
+ {
+ if (sc2 == QStyle::SC_ScrollBarAddLine) forward1 = true;
+ if (sc2 == QStyle::SC_ScrollBarSubLine) back1 = true;
+ sc = sc2;
+ }
+ }
+ sc = QStyle::SC_None;
+ for (QPoint pos(rect.x()+rect.width(),7) ; pos.x()<200 ; pos.setX(pos.x()+1))
+ {
+ QStyle::SubControl sc2 = qApp->style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos);
+ if (sc != sc2)
+ {
+ if (sc2 == QStyle::SC_ScrollBarAddLine) forward2 = true;
+ if (sc2 == QStyle::SC_ScrollBarSubLine) back2 = true;
+ sc = sc2;
+ }
+ }
+
+ QString upTop = (back1 ? "-moz-box" : "none");
+ QString downTop = (forward1 ? "-moz-box" : "none");
+ QString upBottom = (back2 ? "-moz-box" : "none");
+ QString downBottom = (forward2 ? "-moz-box" : "none");
+
+ QString data;
+ data += "/* The following four lines were added by KDE */\n";
+ data += "scrollbarbutton[sbattr=\"scrollbar-up-top\"] { display: " + upTop + " !important; }\n";
+ data += "scrollbarbutton[sbattr=\"scrollbar-down-top\"] { display: " + downTop + " !important; }\n";
+ data += "scrollbarbutton[sbattr=\"scrollbar-up-bottom\"] { display: " + upBottom + " !important; }\n";
+ data += "scrollbarbutton[sbattr=\"scrollbar-down-bottom\"] { display: " + downBottom + " !important; }\n";
+
+ return data;
+}
+
+void KcmGtk::writeFirefoxCSS(const QString& path, const QString& data)
+{
+ QString fileData;
+ QFile file(path);
+ if (file.open(IO_ReadOnly))
+ {
+ QTextStream stream(&file);
+ for (;;)
+ {
+ QString line = stream.readLine();
+ if (line.isNull())
+ break;
+
+ if ((line == "# The following four lines were added by KDE") ||
+ (line == "/* The following four lines were added by KDE */"))
+ {
+ for (int i=0 ; i<4 ; i++)
+ stream.readLine();
+ continue;
+ }
+
+ fileData += line + "\n";
+ }
+ file.close();
+ }
+
+ if (!file.open(IO_WriteOnly | IO_Truncate))
+ {
+ KMessageBox::error(this, i18n("Could not write to %1").arg(path), i18n("Mozilla profile"));
+ return;
+ }
+ QTextStream stream(&file);
+ stream << fileData << data;
+ file.close();
+
+ return;
+}
+
+void KcmGtk::emacsDetailsClicked()
+{
+ if (emacsDetailsDialog == NULL)
+ {
+ emacsDetailsDialog = new EmacsDetails(this);
+ emacsDetailsDialog->list->header()->setStretchEnabled(true, 1);
+ }
+
+ emacsDetailsDialog->show();
+}
+
+void KcmGtk::searchPathsClicked()
+{
+ if (searchPathsDialog == NULL)
+ {
+ searchPathsDialog = new SearchPaths(this);
+ connect(searchPathsDialog->okButton, SIGNAL(clicked()), SLOT(searchPathsOk()));
+ connect(searchPathsDialog->pathBox, SIGNAL(textChanged(const QString&)), SLOT(searchPathsTextChanged(const QString&)));
+ connect(searchPathsDialog->pathList, SIGNAL(currentChanged(QListBoxItem*)), SLOT(searchPathsCurrentChanged(QListBoxItem*)));
+ connect(searchPathsDialog->addButton, SIGNAL(clicked()), SLOT(searchPathsAddClicked()));
+ connect(searchPathsDialog->removeButton, SIGNAL(clicked()), SLOT(searchPathsRemoveClicked()));
+ }
+
+ searchPathsDialog->pathList->clear();
+ for (QStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it )
+ new QListBoxText(searchPathsDialog->pathList, *it);
+
+ searchPathsDialog->show();
+}
+
+void KcmGtk::searchPathsOk()
+{
+ gtkSearchPaths.clear();
+ int i=0;
+ QListBoxItem* item = 0;
+ while ((item = searchPathsDialog->pathList->item(i++)))
+ gtkSearchPaths.append(item->text());
+
+ config->writeEntry("gtkSearchPaths", gtkSearchPaths);
+ getInstalledThemes();
+}
+
+void KcmGtk::searchPathsTextChanged(const QString& text)
+{
+ searchPathsDialog->addButton->setDisabled(text.isEmpty());
+}
+
+void KcmGtk::searchPathsCurrentChanged(QListBoxItem* item)
+{
+ searchPathsDialog->removeButton->setEnabled(item != NULL);
+}
+
+void KcmGtk::searchPathsAddClicked()
+{
+ new QListBoxText(searchPathsDialog->pathList, searchPathsDialog->pathBox->text());
+ searchPathsDialog->pathBox->clear();
+}
+
+void KcmGtk::searchPathsRemoveClicked()
+{
+ searchPathsDialog->pathList->removeItem(searchPathsDialog->pathList->currentItem());
+}
+
+
+#include "kcmgtk.moc"
diff --git a/kcm_gtk/kcmgtk.desktop b/kcm_gtk/kcmgtk.desktop
new file mode 100644
index 0000000..78d52ca
--- /dev/null
+++ b/kcm_gtk/kcmgtk.desktop
@@ -0,0 +1,28 @@
+[Desktop Entry]
+Name=GTK Styles and Fonts
+Comment=Control the style and fonts used by GTK applications
+Exec=kcmshell kcmgtk
+Terminal=false
+Icon=gnome_apps.png
+OnlyShowIn=KDE;
+
+Encoding=UTF-8
+X-Keywords=kcmgtk,gtk,style,font
+X-KDE-FactoryName=kcmgtk
+X-KDE-Library=kcmgtk
+X-KDE-ModuleType=Library
+
+Name[de]=GTK-Stile und Schriftarten
+Comment[de]=Einstellung der Stile und Schriftarten in GTK-Anwendungen
+Name[fr]=Styles et Polices GTK
+Comment[fr]=Détermine le style et les polices utilisés par les applications GTK
+Name[it]=Stili e font GTK
+Comment[it]=Configura gli stili e i font usati dalle applicazioni GTK
+Name[tr]=GTK Stil ve Yazıtipleri
+Comment[tr]=GTK uygulamalarının stil ve yazıtiplerini KDE görünümlü yapar
+Name[ru]=Стили и шрифты GTK
+Comment[ru]=Управление стилями и шрифтами GTK
+
+Type=Application
+Categories=X-KDE-systemsettings-lookandfeel-appearance;X-KDE-settings-looknfeel;
+
diff --git a/kcm_gtk/kcmgtk.h b/kcm_gtk/kcmgtk.h
new file mode 100644
index 0000000..2f132ab
--- /dev/null
+++ b/kcm_gtk/kcmgtk.h
@@ -0,0 +1,104 @@
+/***************************************************************************
+ * Copyright (C) 2004 by David Sansome *
+ * david@dave-linux *
+ * *
+ * 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, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#ifndef _KCMTEST_H_
+#define _KCMTEST_H_
+
+#include <kcmodule.h>
+#include <kaboutdata.h>
+
+#include "kcmgtkwidget.h"
+#include "emacsdetails.h"
+#include "searchpaths.h"
+
+class GtkRcParser
+{
+public:
+ GtkRcParser();
+ ~GtkRcParser() {}
+
+ void parse(QString fileName);
+
+ QFont font;
+ QString style;
+ bool emacs;
+
+private:
+ QFont parseFont(QString fontString);
+};
+
+class KcmGtk: public KCModule
+{
+ Q_OBJECT
+
+ // How to name the kde-specific gtk-rc-file
+ static const QString GTK_RC_FILE;
+ // Where to search for KDE's config files
+ static const QString KDE_RC_DIR;
+ // How to name qtk-qt-engines rc-file
+ static const QString GTK_QT_RC_FILE;
+
+public:
+ KcmGtk( QWidget *parent=0, const char *name=0, const QStringList& = QStringList() );
+ ~KcmGtk();
+
+ virtual void load();
+ virtual void save();
+ virtual int buttons();
+ virtual QString quickHelp() const;
+ virtual const KAboutData *aboutData()const
+ { return myAboutData; };
+
+public slots:
+ void styleChanged();
+ void fontChangeClicked();
+ void itemChanged();
+ void firefoxFixClicked();
+ void emacsDetailsClicked();
+ void searchPathsClicked();
+ void searchPathsOk();
+ void searchPathsAddClicked();
+ void searchPathsRemoveClicked();
+ void searchPathsTextChanged(const QString& text);
+ void searchPathsCurrentChanged(QListBoxItem* item);
+
+private:
+ void updateFontPreview();
+ void getProfiles(const QString& basePath, int type);
+ void fixProfile(const QString& path);
+ QString scrollBarCSS();
+ void writeFirefoxCSS(const QString& path, const QString& data);
+ void getInstalledThemes();
+
+ QString env(QString key);
+
+ KcmGtkWidget* widget;
+ QMap<QString,QString> themes;
+ GtkRcParser parser;
+ KAboutData *myAboutData;
+ QFont font;
+ QMap<QString,QString> profiles;
+ EmacsDetails* emacsDetailsDialog;
+ QStringList gtkSearchPaths;
+ SearchPaths* searchPathsDialog;
+ KConfig* config;
+};
+
+#endif
diff --git a/kcm_gtk/kcmgtkwidget.ui b/kcm_gtk/kcmgtkwidget.ui
new file mode 100644
index 0000000..99107ed
--- /dev/null
+++ b/kcm_gtk/kcmgtkwidget.ui
@@ -0,0 +1,645 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KcmGtkWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KcmGtkWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>506</width>
+ <height>615</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form2</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>styleGroup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>GTK Styles</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>styleIcon</cstring>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout17</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>spacer8_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>150</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout16</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>warning3</cstring>
+ </property>
+ <property name="text">
+ <string>Change search paths...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>176</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>styleKde</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use my KDE style in GTK applications</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>styleBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>styleOther</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;another style:</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>warning1</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Warning:&lt;/b&gt; The Gtk-Qt theme engine is not installed. This means you will not be able to use your KDE style in GTK applications.</string>
+ </property>
+ </widget>
+ <widget class="KURLLabel" row="4" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>warning2</cstring>
+ </property>
+ <property name="text">
+ <string>Gtk-Qt theme engine homepage</string>
+ </property>
+ <property name="url" stdset="0">
+ <string>http://gtk-qt.ecs.soton.ac.uk/</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>fontGroup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>GTK Fonts</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>fontIcon</cstring>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>fontChange</cstring>
+ </property>
+ <property name="text">
+ <string>Change...</string>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>238</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>fontOther</cstring>
+ </property>
+ <property name="text">
+ <string>Use another font:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer8_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KSqueezedTextLabel">
+ <property name="name">
+ <cstring>fontPreview2</cstring>
+ </property>
+ <property name="text">
+ <string>The Quick Brown Fox Jumped Over The Lazy Dog</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>fontKde</cstring>
+ </property>
+ <property name="text">
+ <string>Use m&amp;y KDE fonts in GTK applications</string>
+ </property>
+ <property name="accel">
+ <string>Alt+Y</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KSqueezedTextLabel">
+ <property name="name">
+ <cstring>fontPreview</cstring>
+ </property>
+ <property name="text">
+ <string>Preview line 1</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>GTK Keyboard Shortcuts</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>keyboardIcon</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>emacsBox</cstring>
+ </property>
+ <property name="text">
+ <string>Use Emacs-like key&amp;board shortcuts for text editing</string>
+ </property>
+ <property name="accel">
+ <string>Alt+B</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>emacsDetails</cstring>
+ </property>
+ <property name="text">
+ <string>Details...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer11_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>141</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Firefox and Thunderbird</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7_2_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>firefoxIcon</cstring>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Scrollbar buttons may sometimes be displayed incorrectly in Firefox and Thunderbird. This can be fixed by installing some files into your Mozilla profile.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>firefoxFix</cstring>
+ </property>
+ <property name="text">
+ <string>I&amp;nstall scrollbar fix...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>101</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Note that changes made here will only affect GTK applications when KDE is running. To change the styles and fonts used by applications in GNOME, use the GNOME configuration tools.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>51</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>styleKde</tabstop>
+ <tabstop>styleOther</tabstop>
+ <tabstop>styleBox</tabstop>
+ <tabstop>warning3</tabstop>
+ <tabstop>warning2</tabstop>
+ <tabstop>fontKde</tabstop>
+ <tabstop>fontOther</tabstop>
+ <tabstop>fontChange</tabstop>
+ <tabstop>emacsBox</tabstop>
+ <tabstop>emacsDetails</tabstop>
+ <tabstop>firefoxFix</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurllabel.h</includehint>
+ <includehint>ksqueezedtextlabel.h</includehint>
+ <includehint>ksqueezedtextlabel.h</includehint>
+</includehints>
+</UI>
diff --git a/kcm_gtk/mozillaprofile.ui b/kcm_gtk/mozillaprofile.ui
new file mode 100644
index 0000000..0c56821
--- /dev/null
+++ b/kcm_gtk/mozillaprofile.ui
@@ -0,0 +1,74 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>MozillaProfileWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>MozillaProfileWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>309</width>
+ <height>293</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form2</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Please select the profiles that you want to fix:</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Profile</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>profilesList</cstring>
+ </property>
+ <property name="selectionMode" stdset="0">
+ <enum>Multi</enum>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>false</bool>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kcm_gtk/searchpaths.ui b/kcm_gtk/searchpaths.ui
new file mode 100644
index 0000000..3785983
--- /dev/null
+++ b/kcm_gtk/searchpaths.ui
@@ -0,0 +1,152 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SearchPaths</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SearchPaths</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>447</width>
+ <height>312</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Change search paths</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>The control center module could not find the GTK-Qt theme engine in its list of search paths. If you have installed it elsewhere, you will need to add the correct path to the list below.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QListBox">
+ <property name="name">
+ <cstring>pathList</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout31</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>pathBox</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addButton</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeButton</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout33</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer26</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>51</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>Ok</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SearchPaths</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SearchPaths</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>