summaryrefslogtreecommitdiffstats
path: root/kcontrol/iccconfig
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/iccconfig')
-rw-r--r--kcontrol/iccconfig/CMakeLists.txt38
-rw-r--r--kcontrol/iccconfig/Makefile.am17
-rw-r--r--kcontrol/iccconfig/configure.in.in7
-rw-r--r--kcontrol/iccconfig/iccconfig.cpp437
-rw-r--r--kcontrol/iccconfig/iccconfig.desktop30
-rw-r--r--kcontrol/iccconfig/iccconfig.h87
-rw-r--r--kcontrol/iccconfig/iccconfigbase.ui194
7 files changed, 810 insertions, 0 deletions
diff --git a/kcontrol/iccconfig/CMakeLists.txt b/kcontrol/iccconfig/CMakeLists.txt
new file mode 100644
index 000000000..4af3af694
--- /dev/null
+++ b/kcontrol/iccconfig/CMakeLists.txt
@@ -0,0 +1,38 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### other data ################################
+
+install( FILES iccconfig.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+
+
+##### kcm_iccconfig (module) ####################
+
+set_source_files_properties( iccconfig.cpp PROPERTIES COMPILE_FLAGS -DKDE_CONFDIR=\\"${TDE_CONFIG_DIR}\\" )
+
+tde_add_kpart( kcm_iccconfig AUTOMOC
+ SOURCES
+ iccconfig.cpp iccconfigbase.ui iccconfig.skel
+ LINK tdeio-shared tderandr-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/kcontrol/iccconfig/Makefile.am b/kcontrol/iccconfig/Makefile.am
new file mode 100644
index 000000000..1462fd428
--- /dev/null
+++ b/kcontrol/iccconfig/Makefile.am
@@ -0,0 +1,17 @@
+AM_CPPFLAGS = $(all_includes)
+kde_module_LTLIBRARIES = kcm_iccconfig.la
+
+kcm_iccconfig_la_SOURCES = iccconfig.cpp iccconfigbase.ui iccconfig.skel
+
+kcm_iccconfig_la_LDFLAGS = $(all_libraries) -ltderandr -module -avoid-version -no-undefined
+
+kcm_iccconfig_la_LIBADD = -ltdeui $(LIB_TDEIO) $(LIB_XRANDR)
+
+METASOURCES = AUTO
+
+noinst_HEADERS = iccconfig.h
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kcmiccconfig.pot
+
+xdg_apps_DATA = iccconfig.desktop
diff --git a/kcontrol/iccconfig/configure.in.in b/kcontrol/iccconfig/configure.in.in
new file mode 100644
index 000000000..a98dfc1b2
--- /dev/null
+++ b/kcontrol/iccconfig/configure.in.in
@@ -0,0 +1,7 @@
+case "$host" in
+ *-*-linux*)
+ FOUND_LINUX=yes
+ ;;
+esac
+
+AM_CONDITIONAL(include_kcontrol_iccconfig, test "$FOUND_LINUX" = "yes") \ No newline at end of file
diff --git a/kcontrol/iccconfig/iccconfig.cpp b/kcontrol/iccconfig/iccconfig.cpp
new file mode 100644
index 000000000..2cf0a58f4
--- /dev/null
+++ b/kcontrol/iccconfig/iccconfig.cpp
@@ -0,0 +1,437 @@
+/**
+ * iccconfig.cpp
+ *
+ * Copyright (c) 2009-2010 Timothy Pearson <[email protected]>
+ *
+ * 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 <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+
+#include <dcopclient.h>
+
+#include <tdeaboutdata.h>
+#include <tdeapplication.h>
+#include <tdeconfig.h>
+#include <kcombobox.h>
+#include <kdebug.h>
+#include <kdialog.h>
+#include <tdeglobal.h>
+#include <tdelistview.h>
+#include <tdelocale.h>
+#include <tdemessagebox.h>
+#include <tdepopupmenu.h>
+#include <kinputdialog.h>
+#include <kurlrequester.h>
+#include <kgenericfactory.h>
+
+#include <unistd.h>
+#include <ksimpleconfig.h>
+#include <string>
+#include <stdio.h>
+#include <tqstring.h>
+
+#include "iccconfig.h"
+
+using namespace std;
+
+/**** DLL Interface ****/
+typedef KGenericFactory<KICCConfig, TQWidget> KICCCFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_iccconfig, KICCCFactory("kcmiccconfig") )
+
+KSimpleConfig *config;
+KSimpleConfig *systemconfig;
+
+/**** KICCConfig ****/
+
+KICCConfig::KICCConfig(TQWidget *parent, const char *name, const TQStringList &)
+ : TDECModule(KICCCFactory::instance(), parent, name), iccFileArray(NULL)
+{
+
+ TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ if (getuid() != 0) {
+ config = new KSimpleConfig( TQString::fromLatin1( "kiccconfigrc" ));
+ }
+ else {
+ config = NULL;
+ }
+ systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/kicc/kiccconfigrc" ));
+
+ TDEAboutData *about =
+ new TDEAboutData(I18N_NOOP("kcmiccconfig"), I18N_NOOP("TDE ICC Profile Control Module"),
+ 0, 0, TDEAboutData::License_GPL,
+ I18N_NOOP("(c) 2009,2010 Timothy Pearson"));
+
+ about->addAuthor("Timothy Pearson", 0, "[email protected]");
+ setAboutData( about );
+
+ base = new ICCConfigBase(this);
+ layout->add(base);
+
+ setRootOnlyMsg(i18n("<b>The global ICC color profile is a system wide setting, and requires administrator access</b><br>To alter the system's global ICC profile, click on the \"Administrator Mode\" button below."));
+// setUseRootOnlyMsg(true); // Setting this hides the Apply button!
+
+ connect(base->systemEnableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(changed()));
+ connect(base->systemEnableSupport, TQT_SIGNAL(toggled(bool)), base->systemIccFile, TQT_SLOT(setEnabled(bool)));
+ connect(base->enableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(changed()));
+ connect(base->enableSupport, TQT_SIGNAL(toggled(bool)), base->iccFile, TQT_SLOT(setEnabled(bool)));
+ connect(base->enableSupport, TQT_SIGNAL(toggled(bool)), base->randrScreenList, TQT_SLOT(setEnabled(bool)));
+ connect(base->enableSupport, TQT_SIGNAL(toggled(bool)), base->iccProfileList, TQT_SLOT(setEnabled(bool)));
+ connect(base->enableSupport, TQT_SIGNAL(toggled(bool)), base->addProfileButton, TQT_SLOT(setEnabled(bool)));
+ connect(base->enableSupport, TQT_SIGNAL(toggled(bool)), base->renameProfileButton, TQT_SLOT(setEnabled(bool)));
+ connect(base->enableSupport, TQT_SIGNAL(toggled(bool)), base->deleteProfileButton, TQT_SLOT(setEnabled(bool)));
+ connect(base->iccProfileList, TQT_SIGNAL(activated(int)), this, TQT_SLOT(selectProfile(int)));
+ connect(base->randrScreenList, TQT_SIGNAL(activated(int)), this, TQT_SLOT(selectScreen(int)));
+ connect(base->iccFile, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(updateArray()));
+ connect(base->systemIccFile, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(changed()));
+
+ connect(base->addProfileButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addProfile()));
+ connect(base->renameProfileButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(renameProfile()));
+ connect(base->deleteProfileButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteProfile()));
+
+ load();
+
+ if (!config || !config->checkConfigFilesWritable( true )) {
+ base->enableSupport->setEnabled(false);
+ base->randrScreenList->setEnabled(false);
+ base->iccProfileList->setEnabled(false);
+ base->iccFile->setEnabled(false);
+ base->addProfileButton->setEnabled(false);
+ base->renameProfileButton->setEnabled(false);
+ base->deleteProfileButton->setEnabled(false);
+ }
+
+ if (getuid() != 0 || !systemconfig->checkConfigFilesWritable( true )) {
+ base->systemEnableSupport->setEnabled(false);
+ base->systemIccFile->setEnabled(false);
+ }
+}
+
+KICCConfig::~KICCConfig()
+{
+ if (iccFileArray) {
+ delete [] iccFileArray;
+ }
+ if (config) {
+ delete config;
+ }
+ delete systemconfig;
+}
+
+void KICCConfig::deleteProfile () {
+ int i;
+ TQString *iccFileArrayNew;
+
+ // Delete the profile
+ if (config) config->deleteGroup(base->iccProfileList->currentText());
+ base->iccProfileList->removeItem(base->iccProfileList->currentItem());
+ base->iccProfileList->setCurrentItem(base->iccProfileList->count()-1);
+
+ // Contract the profile memory
+ numberOfProfiles--;
+ iccFileArrayNew = new TQString[numberOfProfiles*numberOfScreens];
+ for (i=0;i<(numberOfProfiles*numberOfScreens);i++) {
+ iccFileArrayNew[i] = iccFileArray[i];
+ }
+ delete [] iccFileArray;
+ iccFileArray = iccFileArrayNew;
+}
+
+void KICCConfig::renameProfile () {
+ int i;
+ TQString *iccFileArrayNew;
+
+ // Pop up a text entry box asking for the name of the new profile
+ bool _ok = false;
+ bool _end = false;
+ TQString _new;
+ TQString _text = i18n("Please enter the new profile name below:");
+ TQString _error;
+
+ while (!_end) {
+ _new = KInputDialog::getText( i18n("ICC Profile Configuration"), _error + _text, TQString::null, &_ok, this);
+ if (!_ok ) {
+ _end = true;
+ } else {
+ _error = TQString();
+ if (!_new.isEmpty()) {
+ if (findProfileIndex(_new) != -1)
+ _error = i18n("Error: A profile with that name already exists") + TQString("\n");
+ else
+ _end = true;
+ }
+ }
+ }
+ if (!_ok) return;
+
+ // Rename the profile
+ if (config) config->deleteGroup(base->iccProfileList->currentText());
+ base->iccProfileList->changeItem(_new, base->iccProfileList->currentItem());
+
+ updateDisplayedInformation();
+ emit changed();
+}
+
+void KICCConfig::addProfile () {
+ int i;
+ TQString *iccFileArrayNew;
+
+ // Pop up a text entry box asking for the name of the new profile
+ bool _ok = false;
+ bool _end = false;
+ TQString _new;
+ TQString _text = i18n("Please enter the new profile name below:");
+ TQString _error;
+
+ while (!_end) {
+ _new = KInputDialog::getText( i18n("ICC Profile Configuration"), _error + _text, TQString::null, &_ok, this);
+ if (!_ok ) {
+ _end = true;
+ } else {
+ _error = TQString();
+ if (!_new.isEmpty()) {
+ if (findProfileIndex(_new) != -1)
+ _error = i18n("Error: A profile with that name already exists") + TQString("\n");
+ else
+ _end = true;
+ }
+ }
+ }
+ if (!_ok) return;
+
+ // Expand the profile memory
+ numberOfProfiles++;
+ iccFileArrayNew = new TQString[numberOfProfiles*numberOfScreens];
+ for (i=0;i<((numberOfProfiles-1)*numberOfScreens);i++) {
+ iccFileArrayNew[i] = iccFileArray[i];
+ }
+ delete [] iccFileArray;
+ iccFileArray = iccFileArrayNew;
+ for (;i<(numberOfProfiles*numberOfScreens);i++) {
+ iccFileArray[i] = "";
+ }
+
+ // Insert the new profile name
+ base->iccProfileList->insertItem(_new, -1);
+ base->iccProfileList->setCurrentItem(base->iccProfileList->count()-1);
+
+ updateDisplayedInformation();
+ emit changed();
+}
+
+void KICCConfig::load()
+{
+ load( false );
+}
+
+void KICCConfig::selectProfile (int slotNumber) {
+ updateDisplayedInformation();
+ emit changed();
+}
+
+void KICCConfig::selectScreen (int slotNumber) {
+ updateDisplayedInformation();
+}
+
+void KICCConfig::updateArray (void) {
+ iccFileArray[((base->iccProfileList->currentItem())*(base->randrScreenList->count()))+(base->randrScreenList->currentItem())] = base->iccFile->url();
+ if (config) {
+ config->setGroup(base->iccProfileList->currentText());
+ if (config->readEntry(base->randrScreenList->currentText()) != iccFileArray[((base->iccProfileList->currentItem())*(base->randrScreenList->count()))+(base->randrScreenList->currentItem())]) {
+ emit changed();
+ }
+ }
+}
+
+void KICCConfig::updateDisplayedInformation () {
+ base->iccFile->setURL(iccFileArray[((base->iccProfileList->currentItem())*(base->randrScreenList->count()))+(base->randrScreenList->currentItem())]);
+}
+
+TQString KICCConfig::extractFileName(TQString displayName, TQString profileName) {
+ return TQString();
+}
+
+int KICCConfig::findProfileIndex(TQString profileName) {
+ int i;
+ for (i=0;i<numberOfProfiles;i++) {
+ if (base->iccProfileList->text(i) == profileName) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+int KICCConfig::findScreenIndex(TQString screenName) {
+ int i;
+ for (i=0;i<(base->randrScreenList->count());i++) {
+ if (base->randrScreenList->text(i) == screenName) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+void KICCConfig::load(bool useDefaults )
+{
+ //Update the toggle buttons with the current configuration
+ int i;
+ int j;
+
+ // FIXME Should use font size (basically resultant string length) to set button widths...
+ base->addProfileButton->setFixedWidth(110);
+ base->renameProfileButton->setFixedWidth(90);
+ base->deleteProfileButton->setFixedWidth(90);
+
+ XRROutputInfo *output_info;
+ KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI();
+
+ if (config) {
+ config->setReadDefaults( useDefaults );
+
+ config->setGroup(NULL);
+ base->enableSupport->setChecked(config->readBoolEntry("EnableICC", false));
+ base->randrScreenList->setEnabled(config->readBoolEntry("EnableICC", false));
+ base->iccProfileList->setEnabled(config->readBoolEntry("EnableICC", false));
+ base->iccFile->setEnabled(config->readBoolEntry("EnableICC", false));
+ base->addProfileButton->setEnabled(config->readBoolEntry("EnableICC", false));
+ base->renameProfileButton->setEnabled(config->readBoolEntry("EnableICC", false));
+ base->deleteProfileButton->setEnabled(config->readBoolEntry("EnableICC", false));
+
+ numberOfScreens = 0;
+ if (randrsimple->isValid() == true) {
+ randr_display = XOpenDisplay(NULL);
+ randr_screen_info = randrsimple->read_screen_info(randr_display);
+ for (i = 0; i < randr_screen_info->n_output; i++) {
+ output_info = randr_screen_info->outputs[i]->info;
+ base->randrScreenList->insertItem(output_info->name, -1);
+ numberOfScreens++;
+ }
+ }
+ else {
+ base->randrScreenList->insertItem("Default", -1);
+ numberOfScreens++;
+ }
+
+ // Find all profile names
+ numberOfProfiles = 0;
+ cfgProfiles = config->groupList();
+ for (TQStringList::Iterator i(cfgProfiles.begin()); i != cfgProfiles.end(); ++i) {
+ base->iccProfileList->insertItem((*i), -1);
+ numberOfProfiles++;
+ }
+ if (numberOfProfiles == 0) {
+ base->iccProfileList->insertItem("<default>", -1);
+ numberOfProfiles++;
+ }
+
+ // Load all profiles into memory
+ iccFileArray = new TQString[numberOfProfiles*numberOfScreens];
+ for (i=0;i<(base->iccProfileList->count());i++) {
+ config->setGroup(base->iccProfileList->text(i));
+ for (j=0;j<(base->randrScreenList->count());j++) {
+ iccFileArray[(i*(base->randrScreenList->count()))+j] = config->readEntry(base->randrScreenList->text(j));
+ }
+ }
+
+ if ((findProfileIndex(base->iccProfileList->currentText()) >= 0) && (findScreenIndex(base->randrScreenList->currentText()) >= 0)) {
+ base->iccFile->setURL(iccFileArray[(findProfileIndex(base->iccProfileList->currentText())*base->randrScreenList->count())+findScreenIndex(base->randrScreenList->currentText())]);
+ }
+ else {
+ base->iccFile->setURL("");
+ }
+ }
+ else {
+ base->enableSupport->setChecked(false);
+ base->randrScreenList->setEnabled(false);
+ base->iccProfileList->setEnabled(false);
+ base->iccFile->setEnabled(false);
+ base->addProfileButton->setEnabled(false);
+ base->renameProfileButton->setEnabled(false);
+ base->deleteProfileButton->setEnabled(false);
+ }
+
+ systemconfig->setGroup(NULL);
+ base->systemEnableSupport->setChecked(systemconfig->readBoolEntry("EnableICC", false));
+ base->systemIccFile->setEnabled(systemconfig->readBoolEntry("EnableICC", false));
+ base->systemIccFile->setURL(systemconfig->readEntry("ICCFile"));
+
+ delete randrsimple;
+
+ emit changed(useDefaults);
+}
+
+void KICCConfig::save()
+{
+ int i;
+ int j;
+ KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI();
+
+ // Write system configuration
+ systemconfig->setGroup(NULL);
+ systemconfig->writeEntry("EnableICC", base->systemEnableSupport->isChecked());
+ systemconfig->writeEntry("ICCFile", base->systemIccFile->url());
+ systemconfig->sync();
+
+ if (config) {
+ // Write user configuration
+ config->setGroup(NULL);
+ config->writeEntry("DefaultProfile", m_defaultProfile);
+ config->writeEntry("EnableICC", base->enableSupport->isChecked());
+
+ // Save all profiles to disk
+ for (i=0;i<(base->iccProfileList->count());i++) {
+ config->setGroup(base->iccProfileList->text(i));
+ for (j=0;j<(base->randrScreenList->count());j++) {
+ config->writeEntry(base->randrScreenList->text(j), iccFileArray[(i*(base->randrScreenList->count()))+j]);
+ }
+ }
+
+ config->sync();
+ }
+
+ TQString errorstr;
+ if (base->enableSupport->isChecked() == true) {
+ errorstr = randrsimple->applyIccConfiguration(base->iccProfileList->currentText(), KDE_CONFDIR);
+ }
+ else if (base->systemEnableSupport->isChecked() == true) {
+ errorstr = randrsimple->applySystemWideIccConfiguration(KDE_CONFDIR);
+ }
+ else {
+ errorstr = randrsimple->clearIccConfiguration();
+ }
+ if (errorstr != "") {
+ KMessageBox::error(this, TQString("Unable to apply ICC configuration:\n%1").arg(errorstr));
+ }
+
+ emit changed(false);
+}
+
+void KICCConfig::defaults()
+{
+ load( true );
+}
+
+TQString KICCConfig::quickHelp() const
+{
+ return i18n("<h1>ICC Profile Configuration</h1> This module allows you to configure TDE support"
+ " for ICC profiles. This allows you to easily color correct your monitor"
+ " for a more lifelike and vibrant image.");
+}
+
+#include "iccconfig.moc"
diff --git a/kcontrol/iccconfig/iccconfig.desktop b/kcontrol/iccconfig/iccconfig.desktop
new file mode 100644
index 000000000..528464f7b
--- /dev/null
+++ b/kcontrol/iccconfig/iccconfig.desktop
@@ -0,0 +1,30 @@
+[Desktop Entry]
+Exec=tdecmshell iccconfig
+Icon=background
+Type=Application
+X-DocPath=kcontrol/iccconfig/index.html
+
+X-TDE-Library=iccconfig
+X-TDE-ParentApp=kcontrol
+X-TDE-RootOnly=true
+X-TDE-SubstituteUID=true
+
+Categories=Qt;TDE;X-TDE-settings-hardware;
+Comment=Configure display ICC profile
+Comment[en_US]=Configure display ICC profile
+Comment[fr]=Configurer les profils de couleurs ICC
+Comment[it]=Configurazione del profilo ICC del display
+Comment[ru]=Конфигурация профиля ICC экрана
+Comment[uk]=Конфігурація профілю ICC екрану
+GenericName=
+GenericName[en_US]=
+Keywords=ICC;display;color;profile;
+MimeType=
+Name=ICC Color Profile
+Name[en_US]=ICC Color Profile
+Name[fr]=Profils de couleurs ICC
+Name[it]=Profilo dei colori ICC
+Name[ru]=ICC Профиль цвета
+Name[uk]=ICC Профіль кольору
+
+NoDisplay=false
diff --git a/kcontrol/iccconfig/iccconfig.h b/kcontrol/iccconfig/iccconfig.h
new file mode 100644
index 000000000..4fd29e4e9
--- /dev/null
+++ b/kcontrol/iccconfig/iccconfig.h
@@ -0,0 +1,87 @@
+/**
+ * iccconfig.h
+ *
+ * Copyright (c) 2009-2010 Timothy Pearson <[email protected]>
+ *
+ * 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 _KCM_ICCCONFIG_H
+#define _KCM_ICCCONFIG_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <dcopobject.h>
+
+#include <libtderandr/libtderandr.h>
+
+#include "iccconfigbase.h"
+
+class TDEConfig;
+class TDEPopupMenu;
+class TDEListViewItem;
+
+class KICCConfig : public TDECModule, public DCOPObject
+{
+ K_DCOP
+ Q_OBJECT
+
+
+public:
+ //KICCConfig(TQWidget *parent = 0L, const char *name = 0L);
+ KICCConfig(TQWidget *parent, const char *name, const TQStringList &);
+ virtual ~KICCConfig();
+
+ ICCConfigBase *base;
+
+ void load();
+ void load( bool useDefaults);
+ void save();
+ void defaults();
+
+ TQString quickHelp() const;
+
+ k_dcop:
+
+private:
+
+ TDEConfig *config;
+ bool _ok;
+ Display *randr_display;
+ ScreenInfo *randr_screen_info;
+ int numberOfProfiles;
+ int numberOfScreens;
+ TQStringList cfgScreenInfo;
+ TQStringList cfgProfiles;
+ void updateDisplayedInformation ();
+ TQString extractFileName(TQString displayName, TQString profileName);
+ TQString *iccFileArray;
+ int findProfileIndex(TQString profileName);
+ int findScreenIndex(TQString screenName);
+ TQString m_defaultProfile;
+
+private slots:
+ void selectProfile (int slotNumber);
+ void selectScreen (int slotNumber);
+ void updateArray (void);
+ void addProfile (void);
+ void renameProfile (void);
+ void deleteProfile (void);
+};
+
+#endif
+
diff --git a/kcontrol/iccconfig/iccconfigbase.ui b/kcontrol/iccconfig/iccconfigbase.ui
new file mode 100644
index 000000000..0666c6e9f
--- /dev/null
+++ b/kcontrol/iccconfig/iccconfigbase.ui
@@ -0,0 +1,194 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ICCConfigBase</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>ICCConfigBase</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>TabWidget2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>ICC Color Profile Configuration</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupSystemSettings</cstring>
+ </property>
+ <property name="title">
+ <string>System Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQCheckBox" row="0" column="0" colspan="2">
+ <property name="name">
+ <cstring>systemEnableSupport</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable global ICC color profile support</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="1" colspan="4">
+ <property name="name">
+ <cstring>systemIccFile</cstring>
+ </property>
+ <property name="filter">
+ <string>*.icc|ICC Standard Color Profiles (*.icc)\n*.icm|Windows(R) Color Profiles (*.icm)</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>ICC File</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="TQGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupUserSettings</cstring>
+ </property>
+ <property name="title">
+ <string>User Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQCheckBox" row="0" column="0" colspan="2">
+ <property name="name">
+ <cstring>enableSupport</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable user ICC color profile support</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>iccProfileList</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2_9</cstring>
+ </property>
+ <property name="text">
+ <string>Current Profile</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>addProfileButton</cstring>
+ </property>
+ <property name="text">
+ <string>Create New</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>renameProfileButton</cstring>
+ </property>
+ <property name="text">
+ <string>Rename</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="4">
+ <property name="name">
+ <cstring>deleteProfileButton</cstring>
+ </property>
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="2" column="1" colspan="4">
+ <property name="name">
+ <cstring>randrScreenList</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel2_8</cstring>
+ </property>
+ <property name="text">
+ <string>Settings for output</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="3" column="1" colspan="4">
+ <property name="name">
+ <cstring>iccFile</cstring>
+ </property>
+ <property name="filter">
+ <string>*.icc|ICC Standard Color Profiles (*.icc)\n*.icm|Windows(R) Color Profiles (*.icm)</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>ICC File</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="4" column="0">
+ <property name="name" stdset="0">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>enableSupport</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ICCConfigBase</receiver>
+ <slot>enableSupport_toggled(bool)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">ICCConfigBase.ui.h</include>
+</includes>
+<Q_SLOTS>
+ <slot>enableSupport_toggled(bool)</slot>
+</Q_SLOTS>
+<includes>
+ <include location="local" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="3" margin="6"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>