summaryrefslogtreecommitdiffstats
path: root/kdelirc/kcmlirc
diff options
context:
space:
mode:
Diffstat (limited to 'kdelirc/kcmlirc')
-rw-r--r--kdelirc/kcmlirc/Makefile.am15
-rw-r--r--kdelirc/kcmlirc/addaction.cpp375
-rw-r--r--kdelirc/kcmlirc/addaction.h73
-rw-r--r--kdelirc/kcmlirc/addactionbase.ui1608
-rw-r--r--kdelirc/kcmlirc/editaction.cpp362
-rw-r--r--kdelirc/kcmlirc/editaction.h55
-rw-r--r--kdelirc/kcmlirc/editactionbase.ui1287
-rw-r--r--kdelirc/kcmlirc/editmode.cpp38
-rw-r--r--kdelirc/kcmlirc/editmode.h33
-rw-r--r--kdelirc/kcmlirc/editmodebase.ui303
-rw-r--r--kdelirc/kcmlirc/kcmlirc.cpp544
-rw-r--r--kdelirc/kcmlirc/kcmlirc.desktop119
-rw-r--r--kdelirc/kcmlirc/kcmlirc.h83
-rw-r--r--kdelirc/kcmlirc/kcmlircbase.ui506
-rw-r--r--kdelirc/kcmlirc/kcmlircbase.ui.h37
-rw-r--r--kdelirc/kcmlirc/modeslist.cpp33
-rw-r--r--kdelirc/kcmlirc/modeslist.h33
-rw-r--r--kdelirc/kcmlirc/newmode.ui158
-rw-r--r--kdelirc/kcmlirc/newmode.ui.h24
-rw-r--r--kdelirc/kcmlirc/selectprofile.ui128
20 files changed, 5814 insertions, 0 deletions
diff --git a/kdelirc/kcmlirc/Makefile.am b/kdelirc/kcmlirc/Makefile.am
new file mode 100644
index 0000000..57bdef8
--- /dev/null
+++ b/kdelirc/kcmlirc/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = -I../irkick -I$(srcdir)/../irkick -I$(srcdir)/../kdelirc $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = kcm_kcmlirc.la
+
+noinst_HEADERS = kcmlirc.h addaction.h addactionbase.h
+kcm_kcmlirc_la_SOURCES = selectprofile.ui newmode.ui kcmlircbase.ui kcmlirc.cpp addactionbase.ui addaction.cpp kcmlirc.skel editactionbase.ui editmodebase.ui editmode.cpp editaction.cpp modeslist.cpp
+kcm_kcmlirc_la_LIBADD = $(LIB_KDEUI) $(LIB_KFILE) ../kdelirc/libkdelirc.la
+kcm_kcmlirc_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined
+
+xdg_apps_DATA = kcmlirc.desktop
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/kcmlirc.pot
diff --git a/kdelirc/kcmlirc/addaction.cpp b/kdelirc/kcmlirc/addaction.cpp
new file mode 100644
index 0000000..1a3ecef
--- /dev/null
+++ b/kdelirc/kcmlirc/addaction.cpp
@@ -0,0 +1,375 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Gav Wood *
+ * gav@kde.org *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <qregexp.h>
+#include <qlabel.h>
+#include <qradiobutton.h>
+#include <qwidgetstack.h>
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+
+#include <kdebug.h>
+#include <klineedit.h>
+#include <klistview.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <knuminput.h>
+#include <keditlistbox.h>
+#include <klocale.h>
+
+#include <dcopclient.h>
+#include <irkick_stub.h>
+
+#include "prototype.h"
+#include "addaction.h"
+#include "profileserver.h"
+#include "remoteserver.h"
+
+AddAction::AddAction(QWidget *parent, const char *name, const Mode &mode): AddActionBase(parent, name), theMode(mode)
+{
+ connect(this, SIGNAL( selected(const QString &) ), SLOT( updateForPageChange() ));
+ connect(this, SIGNAL( selected(const QString &) ), SLOT( slotCorrectPage() ));
+ curPage = 0;
+ updateProfiles();
+ updateButtons();
+ updateObjects();
+ updateProfileFunctions();
+}
+
+AddAction::~AddAction()
+{
+}
+
+
+void AddAction::slotNextParam()
+{
+ // TODO: go on to next parameter
+}
+
+void AddAction::slotModeSelected()
+{
+ theSwitchMode->setChecked(true);
+}
+
+void AddAction::slotCorrectPage()
+{
+ int lastPage = curPage;
+ curPage = indexOf(currentPage());
+
+ if(curPage == 2 && theUseProfile->isChecked())
+ showPage(((QWizard *)this)->page(lastPage > 1 ? 1 : 3));
+ if((curPage == 2 || curPage == 5) && theChangeMode->isChecked())
+ showPage(((QWizard *)this)->page(lastPage > 1 ? 1 : 6));
+
+ if(curPage == 3 && theUseDCOP->isChecked())
+ showPage(((QWizard *)this)->page(lastPage == 4 ? 2 : 4));
+
+ if(curPage == 4 && (
+ (theUseDCOP->isChecked() && theFunctions->currentItem() && !Prototype(theFunctions->currentItem()->text(2)).count()) ||
+ (theUseProfile->isChecked() && (theProfileFunctions->currentItem() && !theProfileFunctions->currentItem()->text(1).toInt() || theJustStart->isChecked()))
+ ))
+ showPage(((QWizard *)this)->page(lastPage == 5 ? (theUseDCOP->isChecked() ? 2 : 3) : 5));
+}
+
+void AddAction::requestNextPress()
+{
+ IRKick_stub("irkick", "IRKick").stealNextPress(DCOPClient::mainClient()->appId(), "KCMLirc", "gotButton(QString, QString)");
+}
+
+void AddAction::cancelRequest()
+{
+ IRKick_stub("irkick", "IRKick").dontStealNextPress();
+}
+
+void AddAction::updateButton(const QString &remote, const QString &button)
+{
+ if(theMode.remote() == remote)
+ { // note this isn't the "correct" way of doing it; really i should iterate throughg the items and try to find the item which when put through buttonMap[item] returns the current button name. but i cant be arsed.
+ theButtons->setCurrentItem(theButtons->findItem(RemoteServer::remoteServer()->getButtonName(remote, button), 0));
+ theButtons->ensureItemVisible(theButtons->findItem(RemoteServer::remoteServer()->getButtonName(remote, button), 0));
+ }
+ else
+ KMessageBox::error(this, i18n( "You did not select a mode of that remote control. Please use %1, "
+ "or revert back to select a different mode." ).arg( theMode.remoteName() ),
+ i18n( "Incorrect Remote Control Detected" ));
+
+ if(indexOf(currentPage()) == 1)
+ requestNextPress();
+}
+
+void AddAction::updateButtons()
+{
+ theButtons->clear();
+ buttonMap.clear();
+ IRKick_stub IRKick("irkick", "IRKick");
+ QStringList buttons = IRKick.buttons(theMode.remote());
+ for(QStringList::iterator j = buttons.begin(); j != buttons.end(); ++j)
+ buttonMap[new QListViewItem(theButtons, RemoteServer::remoteServer()->getButtonName(theMode.remote(), *j))] = *j;
+}
+
+void AddAction::updateForPageChange()
+{
+ if(indexOf(currentPage()) == 1) requestNextPress(); else cancelRequest();
+ switch(indexOf(currentPage()))
+ { case 0: break;
+ case 1: break;
+ case 2: break;
+ case 3: break;
+ case 4: break;
+ }
+ updateButtonStates();
+}
+
+void AddAction::updateButtonStates()
+{
+ switch(indexOf(currentPage()))
+ { case 0: setNextEnabled(currentPage(), theProfiles->currentItem() != 0 || !theUseProfile->isChecked()); break;
+ case 1: setNextEnabled(currentPage(), theButtons->currentItem() != 0); break;
+ case 2: setNextEnabled(currentPage(), theFunctions->currentItem() != 0); break;
+ case 3: setNextEnabled(currentPage(), theProfileFunctions->currentItem() != 0 || theJustStart->isChecked()); break;
+ case 4: setNextEnabled(currentPage(), true); break;
+ case 5: setNextEnabled(currentPage(), false); setFinishEnabled(currentPage(), true); break;
+ case 6: setNextEnabled(currentPage(), false); setFinishEnabled(currentPage(), theModes->currentItem() || !theSwitchMode->isChecked()); break;
+ }
+}
+
+const QStringList AddAction::getFunctions(const QString app, const QString obj)
+{
+ QStringList ret;
+ DCOPClient *theClient = KApplication::kApplication()->dcopClient();
+ QCStringList theApps = theClient->remoteFunctions(app.utf8(), obj.utf8());
+ for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
+ if( *i != "QCStringList interfaces()" &&
+ *i != "QCStringList functions()" &&
+ *i != "QCStringList objects()" &&
+ *i != "QCStringList find(QCString)" )
+ ret += QString::fromUtf8(*i);
+ return ret;
+}
+
+void AddAction::updateProfiles()
+{
+ ProfileServer *theServer = ProfileServer::profileServer();
+ theProfiles->clear();
+ profileMap.clear();
+
+ QDict<Profile> dict = theServer->profiles();
+ QDictIterator<Profile> i(dict);
+ for(; i.current(); ++i)
+ profileMap[new QListViewItem(theProfiles, i.current()->name())] = i.currentKey();
+}
+
+void AddAction::updateOptions()
+{
+ IfMulti im;
+ if(theUseProfile->isChecked())
+ {
+ ProfileServer *theServer = ProfileServer::profileServer();
+ if(!theProfiles->currentItem()) return;
+ const Profile *p = theServer->profiles()[profileMap[theProfiles->currentItem()]];
+ im = p->ifMulti();
+ isUnique = p->unique();
+ }
+ else if(theUseDCOP->isChecked())
+ {
+ if(!theObjects->selectedItem()) return;
+ QListViewItem* i = theObjects->selectedItem()->parent();
+ if(!i) return;
+ isUnique = uniqueProgramMap[i];
+ QRegExp r("(.*)-[0-9]+");
+ program = r.exactMatch(nameProgramMap[i]) ? r.cap(1) : nameProgramMap[i];
+ im = IM_DONTSEND;
+ }
+ else return;
+
+ theIMLabel->setEnabled(!isUnique);
+ theIMGroup->setEnabled(!isUnique);
+ theIMLine->setEnabled(!isUnique);
+ theIMTop->setEnabled(!isUnique);
+ theDontSend->setEnabled(!isUnique);
+ theSendToBottom->setEnabled(!isUnique);
+ theSendToTop->setEnabled(!isUnique);
+ theSendToAll->setEnabled(!isUnique);
+ switch(im)
+ { case IM_DONTSEND: theDontSend->setChecked(true); break;
+ case IM_SENDTOTOP: theSendToTop->setChecked(true); break;
+ case IM_SENDTOBOTTOM: theSendToBottom->setChecked(true); break;
+ case IM_SENDTOALL: theSendToAll->setChecked(true); break;
+ }
+}
+
+void AddAction::updateProfileFunctions()
+{
+ ProfileServer *theServer = ProfileServer::profileServer();
+ theProfileFunctions->clear();
+ profileFunctionMap.clear();
+ if(!theProfiles->currentItem()) return;
+
+ const Profile *p = theServer->profiles()[profileMap[theProfiles->currentItem()]];
+ QDict<ProfileAction> dict = p->actions();
+ for(QDictIterator<ProfileAction> i(dict); i.current(); ++i)
+ profileFunctionMap[new QListViewItem(theProfileFunctions, i.current()->name(), QString().setNum(i.current()->arguments().count()), i.current()->comment())] = i.currentKey();
+ updateParameters();
+ updateOptions();
+}
+
+void AddAction::updateParameters()
+{
+ theParameters->clear();
+ theArguments.clear();
+ if(theUseDCOP->isChecked() && theFunctions->currentItem())
+ {
+ Prototype p(theFunctions->currentItem()->text(2));
+ for(unsigned k = 0; k < p.count(); k++)
+ { new KListViewItem(theParameters, p.name(k).isEmpty() ? i18n( "<anonymous>" ) : p.name(k), "", p.type(k), QString().setNum(k + 1));
+ theArguments.append(QVariant(""));
+ theArguments.back().cast(QVariant::nameToType(p.type(k).utf8()));
+ }
+ }
+ else if(theUseProfile->isChecked() && theProfiles->currentItem())
+ {
+ ProfileServer *theServer = ProfileServer::profileServer();
+
+ if(!theProfiles->currentItem()) return;
+ if(!theProfileFunctions->currentItem()) return;
+ const Profile *p = theServer->profiles()[profileMap[theProfiles->currentItem()]];
+ const ProfileAction *pa = p->actions()[profileFunctionMap[theProfileFunctions->currentItem()]];
+
+ int index = 1;
+ for(QValueList<ProfileActionArgument>::const_iterator i = pa->arguments().begin(); i != pa->arguments().end(); ++i, index++)
+ { theArguments.append(QVariant((*i).getDefault()));
+ theArguments.back().cast(QVariant::nameToType((*i).type().utf8()));
+ new QListViewItem(theParameters, (*i).comment(), theArguments.back().toString(), (*i).type(), QString().setNum(index));
+ }
+
+ // quicky update options too...
+ theRepeat->setChecked(pa->repeat());
+ theAutoStart->setChecked(pa->autoStart());
+ }
+
+ updateParameter();
+}
+
+void AddAction::updateParameter()
+{
+ if(theParameters->currentItem())
+ { QString type = theParameters->currentItem()->text(2);
+ int index = theParameters->currentItem()->text(3).toInt() - 1;
+ if(type.find("int") != -1 || type.find("short") != -1 || type.find("long") != -1)
+ { theValue->raiseWidget(2);
+ theValueIntNumInput->setValue(theArguments[index].toInt());
+ }
+ else if(type.find("double") != -1 || type.find("float") != -1)
+ { theValue->raiseWidget(3);
+ theValueDoubleNumInput->setValue(theArguments[index].toDouble());
+ }
+ else if(type.find("bool") != -1)
+ { theValue->raiseWidget(1);
+ theValueCheckBox->setChecked(theArguments[index].toBool());
+ }
+ else if(type.find("QStringList") != -1)
+ { theValue->raiseWidget(4);
+ QStringList backup = theArguments[index].toStringList();
+ // backup needed because calling clear will kill what ever has been saved.
+ theValueEditListBox->clear();
+ theValueEditListBox->insertStringList(backup);
+ theArguments[index].asStringList() = backup;
+ }
+ else
+ { theValue->raiseWidget(0);
+ theValueLineEdit->setText(theArguments[index].toString());
+ }
+ theCurParameter->setText(theParameters->currentItem()->text(0));
+ theCurParameter->setEnabled(true);
+ theValue->setEnabled(true);
+ }
+ else
+ { theCurParameter->setText("");
+ theValueLineEdit->setText("");
+ theValueCheckBox->setChecked(false);
+ theValueIntNumInput->setValue(0);
+ theValueDoubleNumInput->setValue(0.0);
+ theCurParameter->setEnabled(false);
+ theValue->setEnabled(false);
+ }
+}
+
+// called when the textbox/checkbox/whatever changes value
+void AddAction::slotParameterChanged()
+{
+ if(!theParameters->currentItem()) return;
+ int index = theParameters->currentItem()->text(3).toInt() - 1;
+ QString type = theParameters->currentItem()->text(2);
+ if(type.find("int") != -1 || type.find("short") != -1 || type.find("long") != -1)
+ theArguments[index].asInt() = theValueIntNumInput->value();
+ else if(type.find("double") != -1 || type.find("float") != -1)
+ theArguments[index].asDouble() = theValueDoubleNumInput->value();
+ else if(type.find("bool") != -1)
+ theArguments[index].asBool() = theValueCheckBox->isChecked();
+ else if(type.find("QStringList") != -1)
+ theArguments[index].asStringList() = theValueEditListBox->items();
+ else
+ theArguments[index].asString() = theValueLineEdit->text();
+
+ theArguments[theParameters->currentItem()->text(3).toInt() - 1].cast(QVariant::nameToType(theParameters->currentItem()->text(2).utf8()));
+ updateArgument(theParameters->currentItem());
+}
+
+// takes theArguments[theIndex] and puts it into theItem
+void AddAction::updateArgument(QListViewItem *theItem)
+{
+ theItem->setText(1, theArguments[theItem->text(3).toInt() - 1].toString());
+}
+
+void AddAction::updateObjects()
+{
+ QStringList names;
+ theObjects->clear();
+ uniqueProgramMap.clear();
+ nameProgramMap.clear();
+
+ DCOPClient *theClient = KApplication::kApplication()->dcopClient();
+ QCStringList theApps = theClient->registeredApplications();
+ for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
+ {
+ if(!QString(*i).find("anonymous")) continue;
+ if(!QString(*i).find(i18n( "anonymous" ))) continue;
+ QRegExp r("(.*)-[0-9]+");
+ QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i;
+ if(names.contains(name)) continue;
+ names += name;
+
+ KListViewItem *a = new KListViewItem(theObjects, name);
+ uniqueProgramMap[a] = name == QString(*i);
+ nameProgramMap[a] = *i;
+
+ QCStringList theObjects = theClient->remoteObjects(*i);
+ for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
+ if(*j != "ksycoca" && *j != "qt")// && getFunctions(*i, *j).count())
+ new KListViewItem(a, *j);
+ }
+ updateFunctions();
+}
+
+void AddAction::updateFunctions()
+{
+ theFunctions->clear();
+ if(theObjects->currentItem() && theObjects->currentItem()->parent())
+ { QStringList functions = getFunctions(nameProgramMap[theObjects->currentItem()->parent()], theObjects->currentItem()->text(0));
+ for(QStringList::iterator i = functions.begin(); i != functions.end(); ++i)
+ { Prototype p((QString)(*i));
+ new KListViewItem(theFunctions, p.name(), p.argumentList(), *i);
+ }
+ }
+ updateOptions();
+}
+
+
+#include "addaction.moc"
diff --git a/kdelirc/kcmlirc/addaction.h b/kdelirc/kcmlirc/addaction.h
new file mode 100644
index 0000000..4d13659
--- /dev/null
+++ b/kdelirc/kcmlirc/addaction.h
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Gav Wood *
+ * gav@kde.org *
+ * *
+ * 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. *
+ ***************************************************************************/
+#ifndef ADDACTION_H
+#define ADDACTION_H
+
+#include <qvaluelist.h>
+#include <qpair.h>
+
+#include <addactionbase.h>
+
+#include "mode.h"
+#include "arguments.h"
+
+/**
+@author Gav Wood
+*/
+
+class QListViewItem;
+
+class AddAction : public AddActionBase
+{
+ Q_OBJECT
+
+ int curPage;
+ Mode theMode;
+
+public slots:
+ virtual void slotCorrectPage();
+ virtual void slotModeSelected();
+ virtual void slotNextParam();
+ virtual void slotParameterChanged();
+
+ // connected to KCMLirc class to receive DCOP calls to tell it what button has been pressed
+ virtual void updateForPageChange();
+ virtual void updateButton(const QString &remote, const QString &button);
+ virtual void updateButtons();
+ virtual void updateFunctions();
+ virtual void updateObjects();
+ virtual void updateButtonStates();
+ virtual void updateParameters();
+ virtual void updateParameter();
+ virtual void updateProfiles();
+ virtual void updateProfileFunctions();
+ virtual void updateOptions();
+
+public:
+ Arguments theArguments;
+ QString program;
+ bool isUnique;
+
+ static const QStringList getFunctions(const QString app, const QString obj);
+ void updateArgument(QListViewItem *theItem);
+ void requestNextPress();
+ void cancelRequest();
+
+ QMap<QListViewItem *, QString> profileMap;
+ QMap<QListViewItem *, QString> profileFunctionMap;
+ QMap<QListViewItem *, QString> buttonMap;
+ QMap<QListViewItem *, bool> uniqueProgramMap;
+ QMap<QListViewItem *, QString> nameProgramMap;
+
+ AddAction(QWidget *parent, const char *name, const Mode &mode);
+ ~AddAction();
+};
+
+#endif
diff --git a/kdelirc/kcmlirc/addactionbase.ui b/kdelirc/kcmlirc/addactionbase.ui
new file mode 100644
index 0000000..092463a
--- /dev/null
+++ b/kdelirc/kcmlirc/addactionbase.ui
@@ -0,0 +1,1608 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>AddActionBase</class>
+<author>Gav Wood</author>
+<widget class="QWizard">
+ <property name="name">
+ <cstring>AddActionBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>723</width>
+ <height>593</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Action</string>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Select Action to Carry Out on Button Press</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theUseProfile</cstring>
+ </property>
+ <property name="text">
+ <string>I wish to select an &amp;application below for usage:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>81</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Applications</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theProfiles</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>3</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer14</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>101</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </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>311</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theUseDCOP</cstring>
+ </property>
+ <property name="text">
+ <string>I wish to manually select a &amp;function from a running program</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>321</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theChangeMode</cstring>
+ </property>
+ <property name="text">
+ <string>I wish to change the remote control's &amp;mode</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Select Button to Configure</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theButtonText</cstring>
+ </property>
+ <property name="text">
+ <string>You are attempting to configure an action for a button on [remote] (in mode [mode]). Press a button on this remote control or select from the list.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer12_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>110</width>
+ <height>41</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Button</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theButtons</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>110</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Select Program Function</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSplitter">
+ <property name="name">
+ <cstring>splitter8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Program</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <item>
+ <property name="text">
+ <string>IR Kick</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Xine</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>kicker</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <item>
+ <property name="text">
+ <string>kicker</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ </item>
+ <item>
+ <property name="text">
+ <string>noatun</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ <item>
+ <property name="text">
+ <string>Marquis</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Noatun</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>noatun</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ </item>
+ <property name="name">
+ <cstring>theObjects</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="fullWidth">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Function</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Parameter</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Prototype</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theFunctions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Select Program Function</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup4</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theNotJustStart</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Perform a function in the application:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout37</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer39</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>61</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Function</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Options</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theProfileFunctions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>7</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theJustStart</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Just start the application. Do not do anything else.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer40</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>81</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Populate Parameters</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Option Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Place</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theParameters</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout35</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout34</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer32</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>111</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theCurParameter</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Parameter:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer27</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>146</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>theValue</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer28</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>61</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>theValueLineEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer29</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>61</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>theValueCheckBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>2</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer30</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>61</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>theValueIntNumInput</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>3</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer31</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>theValueDoubleNumInput</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>4</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KEditListBox" row="0" column="0">
+ <property name="name">
+ <cstring>theValueEditListBox</cstring>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <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>147</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Finishing Up</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Miscellaneous Options</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1_2</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="QCheckBox">
+ <property name="name">
+ <cstring>theRepeat</cstring>
+ </property>
+ <property name="text">
+ <string>This action is &amp;repeatable if the button is held down</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>theAutoStart</cstring>
+ </property>
+ <property name="text">
+ <string>This action causes the application to &amp;start if not already running</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer22</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>670</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theIMTop</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Multiple Instances</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>theIMLine</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </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="QLabel">
+ <property name="name">
+ <cstring>theIMLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>This application may have multiple instances. In the case of having multiple instances at once when this action should be executed, choose a course of action:</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>theIMGroup</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theDontSend</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Ignore the action</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theSendToTop</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send the action to the instance hi&amp;ghest in the window stacking order</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theSendToBottom</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send the action to the instance &amp;lowest in window stacking order</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theSendToAll</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send the action to &amp;all instances</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>170</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Select Required Mode Change</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theSwitchMode</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Switch to mode:</string>
+ </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>spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>131</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Mode</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theModes</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>3</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>131</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theExitMode</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Exit current mode</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer15_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>551</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Options&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line2</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="QCheckBox">
+ <property name="name">
+ <cstring>theDoBefore</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;xecute all other actions before mode change (in original mode)</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>theDoAfter</cstring>
+ </property>
+ <property name="text">
+ <string>Exec&amp;ute all actions after mode change (in new mode)</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>theObjects</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateFunctions()</slot>
+ </connection>
+ <connection>
+ <sender>theParameters</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateParameter()</slot>
+ </connection>
+ <connection>
+ <sender>theFunctions</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theSwitchMode</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theExitMode</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theChangeMode</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theProfiles</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theModes</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateButtonStates()</slot>
+ </connection>
+ <connection>
+ <sender>theModes</sender>
+ <signal>clicked(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>slotModeSelected()</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theProfiles</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theValueDoubleNumInput</sender>
+ <signal>valueChanged(double)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theValueIntNumInput</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theValueLineEdit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theValueCheckBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theProfileFunctions</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateParameters()</slot>
+ </connection>
+ <connection>
+ <sender>theFunctions</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateParameters()</slot>
+ </connection>
+ <connection>
+ <sender>theProfiles</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateProfileFunctions()</slot>
+ </connection>
+ <connection>
+ <sender>theValueEditListBox</sender>
+ <signal>changed()</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theProfileFunctions</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theAutoStart</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theAutoStart</receiver>
+ <slot>setChecked(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theRepeat</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theRepeat</receiver>
+ <slot>setChecked(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theProfileFunctions</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theFunctions</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theProfiles</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection>
+ <sender>theButtons</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection>
+ <sender>theFunctions</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection>
+ <sender>theProfileFunctions</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>next()</slot>
+ </connection>
+ <connection>
+ <sender>theModes</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
+ <receiver>AddActionBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>updateFunctions()</slot>
+ <slot>updateParameter()</slot>
+ <slot>updateParameters()</slot>
+ <slot>updateButtonStates()</slot>
+ <slot>updateCurrentParam(const QString &amp;)</slot>
+ <slot>slotNextParam()</slot>
+ <slot>slotCorrectPage()</slot>
+ <slot>slotModeSelected()</slot>
+ <slot>updateProfileFunctions()</slot>
+ <slot>updateForPageChange()</slot>
+ <slot>slotParameterChanged()</slot>
+ <slot>updateOptions()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>keditlistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kdelirc/kcmlirc/editaction.cpp b/kdelirc/kcmlirc/editaction.cpp
new file mode 100644
index 0000000..5a2a28b
--- /dev/null
+++ b/kdelirc/kcmlirc/editaction.cpp
@@ -0,0 +1,362 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Gav Wood <gav@kde.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include <qregexp.h>
+#include <qlabel.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qcheckbox.h>
+#include <qwidgetstack.h>
+#include <qbuttongroup.h>
+
+#include <kdebug.h>
+#include <klineedit.h>
+#include <klistview.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <knuminput.h>
+#include <keditlistbox.h>
+
+#include <dcopclient.h>
+#include <irkick_stub.h>
+
+#include "prototype.h"
+#include "profileserver.h"
+#include "remoteserver.h"
+#include "editaction.h"
+#include "addaction.h"
+
+EditAction::EditAction(IRAIt action, QWidget *parent, const char *name) : EditActionBase(parent, name)
+{
+ theAction = action;
+
+ updateApplications();
+ updateDCOPApplications();
+}
+
+EditAction::~EditAction()
+{
+}
+
+void EditAction::readFrom()
+{
+ theRepeat->setChecked((*theAction).repeat());
+ theAutoStart->setChecked((*theAction).autoStart());
+ theDoBefore->setChecked((*theAction).doBefore());
+ theDoAfter->setChecked((*theAction).doAfter());
+ theDontSend->setChecked((*theAction).ifMulti() == IM_DONTSEND);
+ theSendToTop->setChecked((*theAction).ifMulti() == IM_SENDTOTOP);
+ theSendToBottom->setChecked((*theAction).ifMulti() == IM_SENDTOBOTTOM);
+ theSendToAll->setChecked((*theAction).ifMulti() == IM_SENDTOALL);
+
+ if((*theAction).isModeChange())
+ { // change mode
+ theChangeMode->setChecked(true);
+ if((*theAction).object().isEmpty())
+ theModes->setCurrentText(i18n("[Exit current mode]"));
+ else
+ theModes->setCurrentText((*theAction).object());
+ }
+ else if((*theAction).isJustStart())
+ { // profile action
+ theUseProfile->setChecked(true);
+ const Profile *p = ProfileServer::profileServer()->profiles()[(*theAction).program()];
+ theApplications->setCurrentText(p->name());
+ updateFunctions();
+ updateArguments();
+ theJustStart->setChecked(true);
+ }
+ else if(ProfileServer::profileServer()->getAction((*theAction).program(), (*theAction).object(), (*theAction).method().prototype()))
+ { // profile action
+ theUseProfile->setChecked(true);
+ const ProfileAction *a = ProfileServer::profileServer()->getAction((*theAction).program(), (*theAction).object(), (*theAction).method().prototype());
+ theApplications->setCurrentText(a->profile()->name());
+ updateFunctions();
+ theFunctions->setCurrentText(a->name());
+ arguments = (*theAction).arguments();
+ updateArguments();
+ theNotJustStart->setChecked(true);
+ }
+ else
+ { // dcop action
+ theUseDCOP->setChecked(true);
+ theDCOPApplications->setCurrentText((*theAction).program());
+ updateDCOPObjects();
+ theDCOPObjects->setCurrentText((*theAction).object());
+ updateDCOPFunctions();
+ theDCOPFunctions->setCurrentText((*theAction).method().prototype());
+ arguments = (*theAction).arguments();
+ updateArguments();
+ }
+ updateOptions();
+}
+
+void EditAction::writeBack()
+{
+ if(theChangeMode->isChecked())
+ {
+ (*theAction).setProgram("");
+ if(theModes->currentText() == i18n("[Exit current mode]"))
+ (*theAction).setObject("");
+ else
+ (*theAction).setObject(theModes->currentText());
+ (*theAction).setDoBefore(theDoBefore->isChecked());
+ (*theAction).setDoAfter(theDoAfter->isChecked());
+ }
+ else if(theUseProfile->isChecked() && (
+ ProfileServer::profileServer()->getAction(applicationMap[theApplications->currentText()], functionMap[theFunctions->currentText()])
+ ||
+ theJustStart->isChecked() && ProfileServer::profileServer()->profiles()[theApplications->currentText()]
+ )
+ )
+ { if(theJustStart->isChecked())
+ { (*theAction).setProgram(ProfileServer::profileServer()->profiles()[applicationMap[theApplications->currentText()]]->id());
+ (*theAction).setObject("");
+ }
+ else
+ { const ProfileAction *a = ProfileServer::profileServer()->getAction(applicationMap[theApplications->currentText()], functionMap[theFunctions->currentText()]);
+ (*theAction).setProgram(ProfileServer::profileServer()->profiles()[applicationMap[theApplications->currentText()]]->id());
+ (*theAction).setObject(a->objId());
+ (*theAction).setMethod(a->prototype());
+ (*theAction).setArguments(arguments);
+ }
+ }
+ else
+ {
+ (*theAction).setProgram(program);//theDCOPApplications->currentText());
+ (*theAction).setObject(theDCOPObjects->currentText());
+ (*theAction).setMethod(theDCOPFunctions->currentText());
+ (*theAction).setArguments(arguments);
+ }
+ (*theAction).setRepeat(theRepeat->isChecked());
+ (*theAction).setAutoStart(theAutoStart->isChecked());
+ (*theAction).setUnique(isUnique);
+ (*theAction).setIfMulti(theDontSend->isChecked() ? IM_DONTSEND : theSendToTop->isChecked() ? IM_SENDTOTOP : theSendToBottom->isChecked() ? IM_SENDTOBOTTOM : IM_SENDTOALL);
+}
+
+void EditAction::updateArguments()
+{
+ kdDebug() << k_funcinfo << endl;
+ if(theUseProfile->isChecked())
+ {
+ theArguments->clear();
+ const ProfileAction *a = ProfileServer::profileServer()->getAction(applicationMap[theApplications->currentText()], functionMap[theFunctions->currentText()]);
+ if(!a) { arguments.clear(); return; }
+ const QValueList<ProfileActionArgument> &p = a->arguments();
+ if(p.count() != arguments.count())
+ { arguments.clear();
+ for(unsigned i = 0; i < p.count(); i++)
+ arguments.append(QVariant(""));
+ }
+ theArguments->setEnabled(p.count());
+ for(unsigned i = 0; i < p.count(); i++)
+ { theArguments->insertItem(p[i].comment() + " (" + p[i].type() + ")");
+ arguments[i].cast(QVariant::nameToType(p[i].type().utf8()));
+ }
+ if(p.count()) updateArgument(0); else updateArgument(-1);
+ }
+ else if(theUseDCOP->isChecked())
+ {
+ theArguments->clear();
+ Prototype p(theDCOPFunctions->currentText());
+ if(p.count() != arguments.count())
+ { arguments.clear();
+ for(unsigned i = 0; i < p.count(); i++)
+ arguments.append(QVariant(""));
+ }
+ theArguments->setEnabled(p.count());
+ for(unsigned i = 0; i < p.count(); i++)
+ { theArguments->insertItem(QString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? p.type(i) : p.name(i) + " (" + p.type(i) + ")"));
+ arguments[i].cast(QVariant::nameToType(p.type(i).utf8()));
+ }
+ if(p.count()) updateArgument(0); else updateArgument(-1);
+ }
+}
+
+void EditAction::updateOptions()
+{
+ if (theUseProfile->isChecked())
+ {
+ ProfileServer *theServer = ProfileServer::profileServer();
+ if(!theApplications->currentItem()) return;
+ const Profile *p = theServer->profiles()[applicationMap[theApplications->currentText()]];
+ isUnique = p->unique();
+ }
+ else if (theUseDCOP->isChecked())
+ {
+ if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
+ program = theDCOPApplications->currentText();
+ isUnique = uniqueProgramMap[theDCOPApplications->currentText()];
+ }
+ else
+ isUnique = true;
+
+ theIMLabel->setEnabled(!isUnique);
+ theIMGroup->setEnabled(!isUnique);
+ theDontSend->setEnabled(!isUnique);
+ theSendToTop->setEnabled(!isUnique);
+ theSendToBottom->setEnabled(!isUnique);
+ theSendToAll->setEnabled(!isUnique);
+}
+
+// called when the textbox/checkbox/whatever changes value
+void EditAction::slotParameterChanged()
+{
+ kdDebug() << "in: " << arguments[theArguments->currentItem()].toString() << endl;
+ int type = arguments[theArguments->currentItem()].type();
+ kdDebug() << type << endl;
+ switch(type)
+ {
+ case QVariant::Int: case QVariant::UInt:
+ arguments[theArguments->currentItem()].asInt() = theValueIntNumInput->value();
+ break;
+ case QVariant::Double:
+ arguments[theArguments->currentItem()].asDouble() = theValueDoubleNumInput->value();
+ break;
+ case QVariant::Bool:
+ arguments[theArguments->currentItem()].asBool() = theValueCheckBox->isChecked();
+ break;
+ case QVariant::StringList:
+ arguments[theArguments->currentItem()].asStringList() = theValueEditListBox->items();
+ break;
+ default:
+ arguments[theArguments->currentItem()].asString() = theValueLineEdit->text();
+ }
+ arguments[theArguments->currentItem()].cast(QVariant::Type(type));
+ kdDebug() << "out: " << arguments[theArguments->currentItem()].toString() << endl;
+
+}
+
+void EditAction::updateArgument(int index)
+{
+ kdDebug() << k_funcinfo << " i: " << index << endl;
+ if(index >= 0)
+ { switch(arguments[index].type())
+ {
+ case QVariant::Int: case QVariant::UInt:
+ theValue->raiseWidget(2);
+ theValueIntNumInput->setValue(arguments[index].toInt());
+ break;
+ case QVariant::Double:
+ theValue->raiseWidget(3);
+ theValueDoubleNumInput->setValue(arguments[index].toDouble());
+ break;
+ case QVariant::Bool:
+ theValue->raiseWidget(1);
+ theValueCheckBox->setChecked(arguments[index].toBool());
+ break;
+ case QVariant::StringList:
+ { theValue->raiseWidget(4);
+ QStringList backup = arguments[index].toStringList();
+ // backup needed because calling clear will kill what ever has been saved.
+ theValueEditListBox->clear();
+ theValueEditListBox->insertStringList(backup);
+ arguments[index].asStringList() = backup;
+ break;
+ }
+ default:
+ theValue->raiseWidget(0);
+ theValueLineEdit->setText(arguments[index].toString());
+ }
+ theValue->setEnabled(true);
+ }
+ else
+ { theValueLineEdit->setText("");
+ theValueCheckBox->setChecked(false);
+ theValueIntNumInput->setValue(0);
+ theValueDoubleNumInput->setValue(0.0);
+ theValue->setEnabled(false);
+ }
+}
+
+void EditAction::updateApplications()
+{
+ ProfileServer *theServer = ProfileServer::profileServer();
+ theApplications->clear();
+ applicationMap.clear();
+
+ QDict<Profile> dict = theServer->profiles();
+ QDictIterator<Profile> i(dict);
+ for(; i.current(); ++i)
+ { theApplications->insertItem(i.current()->name());
+ applicationMap[i.current()->name()] = i.currentKey();
+ }
+ updateFunctions();
+}
+
+void EditAction::updateFunctions()
+{
+ ProfileServer *theServer = ProfileServer::profileServer();
+ theFunctions->clear();
+ functionMap.clear();
+ if(theApplications->currentText().isNull() || theApplications->currentText().isEmpty()) return;
+
+ const Profile *p = theServer->profiles()[applicationMap[theApplications->currentText()]];
+
+ QDict<ProfileAction> dict = p->actions();
+ for(QDictIterator<ProfileAction> i(dict); i.current(); ++i)
+ { theFunctions->insertItem(i.current()->name());
+ functionMap[i.current()->name()] = i.currentKey();
+ }
+ updateArguments();
+}
+
+void EditAction::updateDCOPApplications()
+{
+ QStringList names;
+
+ theDCOPApplications->clear();
+ DCOPClient *theClient = KApplication::kApplication()->dcopClient();
+ QCStringList theApps = theClient->registeredApplications();
+ for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
+ {
+ if(!QString(*i).find("anonymous")) continue;
+ QRegExp r("(.*)-[0-9]+");
+ QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i;
+ if(names.contains(name)) continue;
+ names += name;
+
+ theDCOPApplications->insertItem(name);
+ uniqueProgramMap[name] = name == QString(*i);
+ nameProgramMap[name] = *i;
+
+
+ }
+ updateDCOPObjects();
+}
+
+void EditAction::updateDCOPObjects()
+{
+ theDCOPObjects->clear();
+ DCOPClient *theClient = KApplication::kApplication()->dcopClient();
+ if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
+ QCStringList theObjects = theClient->remoteObjects(nameProgramMap[theDCOPApplications->currentText()].utf8());
+ if(!theObjects.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPObjects->insertItem((*theAction).object());
+ for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
+ if(*j != "ksycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count())
+ theDCOPObjects->insertItem(QString::fromUtf8(*j));
+ updateDCOPFunctions();
+}
+
+void EditAction::updateDCOPFunctions()
+{
+ theDCOPFunctions->clear();
+ if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
+ QStringList functions = AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], theDCOPObjects->currentText());
+ if(!functions.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPFunctions->insertItem((*theAction).method().prototype());
+ for(QStringList::iterator i = functions.begin(); i != functions.end(); ++i)
+ theDCOPFunctions->insertItem(*i);
+ updateArguments();
+}
+
+
+#include "editaction.moc"
diff --git a/kdelirc/kcmlirc/editaction.h b/kdelirc/kcmlirc/editaction.h
new file mode 100644
index 0000000..1a7aa00
--- /dev/null
+++ b/kdelirc/kcmlirc/editaction.h
@@ -0,0 +1,55 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Gav Wood <gav@kde.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef EDITACTION_H
+#define EDITACTION_H
+
+#include <qstring.h>
+
+#include "iractions.h"
+#include "editactionbase.h"
+#include "arguments.h"
+
+/**
+@author Gav Wood
+*/
+
+class EditAction : public EditActionBase
+{
+ Q_OBJECT
+ IRAIt theAction;
+ QMap<QString, QString> applicationMap, functionMap;
+ QMap<QString, QString> nameProgramMap;
+ QMap<QString, bool> uniqueProgramMap;
+ Arguments arguments;
+ QString program;
+ bool isUnique;
+
+public:
+ void writeBack();
+ void readFrom();
+
+ virtual void slotParameterChanged();
+ virtual void updateArgument(int index);
+ virtual void updateArguments();
+ virtual void updateApplications();
+ virtual void updateFunctions();
+ virtual void updateOptions();
+ virtual void updateDCOPApplications();
+ virtual void updateDCOPObjects();
+ virtual void updateDCOPFunctions();
+
+ EditAction(IRAIt action, QWidget *parent = 0, const char *name = 0);
+ ~EditAction();
+};
+
+#endif
diff --git a/kdelirc/kcmlirc/editactionbase.ui b/kdelirc/kcmlirc/editactionbase.ui
new file mode 100644
index 0000000..02e238c
--- /dev/null
+++ b/kdelirc/kcmlirc/editactionbase.ui
@@ -0,0 +1,1287 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>EditActionBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EditActionBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>754</width>
+ <height>715</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Action</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget3</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Function</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout40</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="2" column="3">
+ <property name="name">
+ <cstring>theDCOPApplications</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel4_3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>O&amp;bject:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>theDCOPObjects</cstring>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>buttonGroup5</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>theNotJustStart</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Perform function:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>theFunctions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>theJustStart</cstring>
+ </property>
+ <property name="text">
+ <string>Just start application</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel4_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Fu&amp;nction:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>theDCOPFunctions</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Application:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>theApplications</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>theApplications</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="4" column="3">
+ <property name="name">
+ <cstring>theDCOPFunctions</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>theUseProfile</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use application:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel5_2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>App&amp;lication:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>theDCOPApplications</cstring>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>theUseDCOP</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;DCOP:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="3" column="3">
+ <property name="name">
+ <cstring>theDCOPObjects</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout36</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QWidgetStack" row="0" column="2" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>theValue</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>theValueLineEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer35</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>91</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>theValueCheckBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer36</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>2</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>theValueIntNumInput</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer37</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>3</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>theValueDoubleNumInput</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer38</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>4</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KEditListBox" row="0" column="0">
+ <property name="name">
+ <cstring>theValueEditListBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer33</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>111</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>theArguments</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>106</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>spacer34</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel8</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;pplication/DCOP options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>theArguments</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer14</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>481</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout17</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theChangeMode</cstring>
+ </property>
+ <property name="text">
+ <string>Change &amp;mode to:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>theModes</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer15</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Options</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;DCOP/Application Action Options&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line2</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="QCheckBox">
+ <property name="name">
+ <cstring>theRepeat</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Action repeats if button is held down</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>theAutoStart</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Start program/service if not already running</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer20</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>491</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Mode Change Options&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line2_2</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="QCheckBox">
+ <property name="name">
+ <cstring>theDoBefore</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>E&amp;xecute all other actions before mode change (in original mode)</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>theDoAfter</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Exec&amp;ute all actions after mode change (in new mode)</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer22</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>670</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theIMTop</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Multiple Instances</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>theIMLine</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </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="QLabel">
+ <property name="name">
+ <cstring>theIMLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>This application may have multiple instances. In the case of having multiple instances at once when this action should be executed, choose a course of action:</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>theIMGroup</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theDontSend</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Ignore the action</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theSendToTop</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send the action to the instance hi&amp;ghest in window stacking order</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theSendToBottom</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send the action to the instance &amp;lowest in window stacking order</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>theSendToAll</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send the action to all i&amp;nstances</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theApplications</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theFunctions</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theDCOPApplications</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theDCOPObjects</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theDCOPFunctions</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theChangeMode</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theModes</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theApplications</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateFunctions()</slot>
+ </connection>
+ <connection>
+ <sender>theDCOPApplications</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateDCOPObjects()</slot>
+ </connection>
+ <connection>
+ <sender>theDCOPObjects</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateDCOPFunctions()</slot>
+ </connection>
+ <connection>
+ <sender>theFunctions</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateArguments()</slot>
+ </connection>
+ <connection>
+ <sender>theDCOPFunctions</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateArguments()</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theArguments</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theArguments</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theArguments</sender>
+ <signal>activated(int)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateArgument(int)</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>clicked()</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateArguments()</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>clicked()</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateArguments()</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theAutoStart</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theAutoStart</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theRepeat</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theRepeat</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theChangeMode</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theDoAfter</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theChangeMode</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theDoBefore</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theValueDoubleNumInput</sender>
+ <signal>valueChanged(double)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theValueLineEdit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theValueCheckBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theValueIntNumInput</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theValueEditListBox</sender>
+ <signal>changed()</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>slotParameterChanged()</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theFunctions</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theAutoStart</receiver>
+ <slot>setChecked(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theRepeat</receiver>
+ <slot>setChecked(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theAutoStart</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theRepeat</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theArguments</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theValue</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theNotJustStart</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theJustStart</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>theNotJustStart</receiver>
+ <slot>setChecked(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theDCOPApplications</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theApplications</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theChangeMode</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theNotJustStart</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditActionBase</receiver>
+ <slot>updateOptions()</slot>
+ </connection>
+ <connection>
+ <sender>theUseProfile</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel5</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel5_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel4_3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theUseDCOP</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel4_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>theChangeMode</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel8</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>tabWidget3</tabstop>
+ <tabstop>theUseProfile</tabstop>
+ <tabstop>theApplications</tabstop>
+ <tabstop>theFunctions</tabstop>
+ <tabstop>theDCOPApplications</tabstop>
+ <tabstop>theDCOPObjects</tabstop>
+ <tabstop>theDCOPFunctions</tabstop>
+ <tabstop>theModes</tabstop>
+ <tabstop>theRepeat</tabstop>
+ <tabstop>theAutoStart</tabstop>
+ <tabstop>buttonHelp</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot>updateFunctions()</slot>
+ <slot>updateApplications()</slot>
+ <slot>updateDCOPApplications()</slot>
+ <slot>updateDCOPObjects()</slot>
+ <slot>updateDCOPFunctions()</slot>
+ <slot>updateArguments()</slot>
+ <slot>updateArgument(int)</slot>
+ <slot>slotParameterChanged()</slot>
+ <slot>updateOptions()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>keditlistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/kdelirc/kcmlirc/editmode.cpp b/kdelirc/kcmlirc/editmode.cpp
new file mode 100644
index 0000000..3fba8f0
--- /dev/null
+++ b/kdelirc/kcmlirc/editmode.cpp
@@ -0,0 +1,38 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Gav Wood <gav@kde.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include <kicondialog.h>
+#include <kiconloader.h>
+#include <kpushbutton.h>
+
+#include "editmode.h"
+
+EditMode::EditMode(QWidget *parent, const char *name, bool modal, WFlags fl) : EditModeBase(parent, name, modal, fl)
+{
+ theIcon->setIconType(KIcon::Panel, KIcon::Any);
+}
+
+EditMode::~EditMode()
+{
+}
+
+void EditMode::slotClearIcon()
+{
+ theIcon->resetIcon();
+}
+
+void EditMode::slotCheckText(const QString &newText)
+{
+ theOK->setEnabled(!newText.isEmpty());
+}
+
+#include "editmode.moc"
diff --git a/kdelirc/kcmlirc/editmode.h b/kdelirc/kcmlirc/editmode.h
new file mode 100644
index 0000000..14a709d
--- /dev/null
+++ b/kdelirc/kcmlirc/editmode.h
@@ -0,0 +1,33 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Gav Wood <gav@kde.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef EDITMODE_H
+#define EDITMODE_H
+
+#include "editmodebase.h"
+
+/**
+@author Gav Wood
+*/
+class EditMode : public EditModeBase
+{
+ Q_OBJECT
+
+public:
+ void slotCheckText(const QString &newText);
+ void slotClearIcon();
+
+ EditMode(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags fl = 0);
+ ~EditMode();
+};
+
+#endif
diff --git a/kdelirc/kcmlirc/editmodebase.ui b/kdelirc/kcmlirc/editmodebase.ui
new file mode 100644
index 0000000..dd26940
--- /dev/null
+++ b/kdelirc/kcmlirc/editmodebase.ui
@@ -0,0 +1,303 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>EditModeBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EditModeBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>461</width>
+ <height>334</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Mode</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Description&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line3_2</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>layout25</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Icon for system tray:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>theIcon</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>layout24</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>110</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KIconButton">
+ <property name="name">
+ <cstring>theIcon</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton9</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image0</pixmap>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>theName</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Mode name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>theName</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>410</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Behavior&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line2</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="QCheckBox">
+ <property name="name">
+ <cstring>theDefault</cstring>
+ </property>
+ <property name="text">
+ <string>Mo&amp;de is the default for its remote control</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>90</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line3</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>layout15</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>231</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>theOK</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton8</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="620">789c7dd0cd4e84301405e03d4fd17077c438201421c647d0b834312efa03c31d0648745c18e3bbcbb905fc8d0768fa1d202dec12757f77a3925df47c322776ca75e64925fe65185e1f1eafdfa2382b15ce4b95c567517cae9cba9dc606739ae7944ac009cc2a1ce008e6599ee6f2e20016599116c223a88df6da803d589ab22e851d58d9aaae2c7800eba2d67501ee856ea6033d680b5b5ab9db08fd4c0fba8526d02e6c020de8b46d9c065bd06b7fe1850cb612f9f61fd93afaccdad1ef8ec858e74de36cbb7644fb8eb93b60583aa2be3f32b35ca1231ae68c8c8cc3d24d129aab791a3a0ecbc973dbbabc5414cab02e4bb70ecbfef88f3d7f2bb7efe52df4ef7ff9dabd5f451f45248a2d</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>theName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>EditModeBase</receiver>
+ <slot>slotCheckText(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>theOK</sender>
+ <signal>clicked()</signal>
+ <receiver>EditModeBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton8</sender>
+ <signal>clicked()</signal>
+ <receiver>EditModeBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton9</sender>
+ <signal>clicked()</signal>
+ <receiver>EditModeBase</receiver>
+ <slot>slotClearIcon()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotCheckText(const QString &amp;)</slot>
+ <slot>slotClearIcon()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kicondialog.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kdelirc/kcmlirc/kcmlirc.cpp b/kdelirc/kcmlirc/kcmlirc.cpp
new file mode 100644
index 0000000..1686bcd
--- /dev/null
+++ b/kdelirc/kcmlirc/kcmlirc.cpp
@@ -0,0 +1,544 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Gav Wood *
+ * gav@kde.org *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qevent.h>
+#include <qlistview.h>
+
+#include <kpushbutton.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kconfig.h>
+#include <kicondialog.h>
+#include <kiconloader.h>
+#include <kdebug.h>
+#include <ksimpleconfig.h>
+#include <kgenericfactory.h>
+#include <klistview.h>
+#include <kmessagebox.h>
+#include <kpushbutton.h>
+
+#include <dcopclient.h>
+#include <dcopref.h>
+
+#include <irkick_stub.h>
+
+#include "addaction.h"
+#include "newmode.h"
+#include "profileserver.h"
+#include "remoteserver.h"
+#include "kcmlirc.h"
+#include "editaction.h"
+#include "editmode.h"
+#include "modeslist.h"
+#include "selectprofile.h"
+
+typedef KGenericFactory<KCMLirc, QWidget> theFactory;
+K_EXPORT_COMPONENT_FACTORY(kcmlirc, theFactory("kcmlirc"))
+
+KCMLirc::KCMLirc(QWidget *parent, const char *name, QStringList /*args*/) : DCOPObject("KCMLirc"), KCModule(parent, name)
+{
+ KGlobal::locale()->insertCatalogue( "kcmlirc" );
+ setAboutData(new KAboutData("kcmlirc", I18N_NOOP("KDE Lirc"), VERSION, I18N_NOOP("The KDE IR Remote Control System"), KAboutData::License_GPL_V2, "Copyright (c)2003 Gav Wood", I18N_NOOP("Use this to configure KDE's infrared remote control system in order to control any KDE application with your infrared remote control."), "http://www.kde.org"));
+ setButtons(KCModule::Help);
+ setQuickHelp(i18n("<h1>Remote Controls</h1><p>This module allows you to configure bindings between your remote controls and KDE applications. Simply select your remote control and click Add under the Actions/Buttons list. If you want KDE to attempt to automatically assign buttons to a supported application's actions, try clicking the Auto-Populate button.</p><p>To view the recognised applications and remote controls, simply select the <em>Loaded Extensions</em> tab.</p>"));
+ bool ok;
+ KApplication::kApplication()->dcopClient()->remoteInterfaces("irkick", "IRKick", &ok);
+ if(!ok)
+ if(KMessageBox::questionYesNo(this, i18n("The Infrared Remote Control software is not currently running. This configuration module will not work properly without it. Would you like to start it now?"), i18n("Software Not Running"), i18n("Start"), i18n("Do Not Start")) == KMessageBox::Yes)
+ { kdDebug() << "S" << KApplication::startServiceByDesktopName("irkick") << endl;
+ KSimpleConfig theConfig("irkickrc");
+ theConfig.setGroup("General");
+ if(theConfig.readBoolEntry("AutoStart", true) == false)
+ if(KMessageBox::questionYesNo(this, i18n("Would you like the infrared remote control software to start automatically when you begin KDE?"), i18n("Automatically Start?"), i18n("Start Automatically"), i18n("Do Not Start")) == KMessageBox::Yes)
+ theConfig.writeEntry("AutoStart", true);
+ }
+
+ KApplication::kApplication()->dcopClient()->remoteInterfaces("irkick", "IRKick", &ok);
+ kdDebug() << "OK" << ok << endl;
+
+
+ (new QHBoxLayout(this))->setAutoAdd(true);
+ theKCMLircBase = new KCMLircBase(this);
+ connect(theKCMLircBase->theModes, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateActions() ));
+ connect(theKCMLircBase->theModes, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateModesStatus(QListViewItem *) ));
+ connect(theKCMLircBase->theActions, SIGNAL( currentChanged(QListViewItem *) ), this, SLOT( updateActionsStatus(QListViewItem *) ));
+ connect(theKCMLircBase->theExtensions, SIGNAL( selectionChanged(QListViewItem *) ), this, SLOT( updateInformation() ));
+ connect(theKCMLircBase->theModes, SIGNAL( itemRenamed(QListViewItem *) ), this, SLOT( slotRenamed(QListViewItem *) ));
+ connect(theKCMLircBase->theModes, SIGNAL(dropped(KListView*, QDropEvent*, QListViewItem*, QListViewItem*)), this, SLOT(slotDrop(KListView*, QDropEvent*, QListViewItem*, QListViewItem*)));
+ connect((QObject *)(theKCMLircBase->theAddActions), SIGNAL( clicked() ), this, SLOT( slotAddActions() ));
+ connect((QObject *)(theKCMLircBase->theAddAction), SIGNAL( clicked() ), this, SLOT( slotAddAction() ));
+ connect((QObject *)(theKCMLircBase->theEditAction), SIGNAL( clicked() ), this, SLOT( slotEditAction() ));
+ connect((QObject *)(theKCMLircBase->theActions), SIGNAL( doubleClicked(QListViewItem *) ), this, SLOT( slotEditAction() ));
+ connect((QObject *)(theKCMLircBase->theRemoveAction), SIGNAL( clicked() ), this, SLOT( slotRemoveAction() ));
+ connect((QObject *)(theKCMLircBase->theAddMode), SIGNAL( clicked() ), this, SLOT( slotAddMode() ));
+ connect((QObject *)(theKCMLircBase->theEditMode), SIGNAL( clicked() ), this, SLOT( slotEditMode() ));
+ connect((QObject *)(theKCMLircBase->theRemoveMode), SIGNAL( clicked() ), this, SLOT( slotRemoveMode() ));
+ load();
+}
+
+KCMLirc::~KCMLirc()
+{
+}
+
+void KCMLirc::updateModesStatus(QListViewItem *item)
+{
+ theKCMLircBase->theModes->setItemsRenameable(item && item->parent());
+ theKCMLircBase->theAddActions->setEnabled(ProfileServer::profileServer()->profiles().count() && theKCMLircBase->theModes->selectedItem() && RemoteServer::remoteServer()->remotes()[modeMap[theKCMLircBase->theModes->selectedItem()].remote()]);
+ theKCMLircBase->theAddAction->setEnabled(item);
+ theKCMLircBase->theAddMode->setEnabled(item);
+ theKCMLircBase->theRemoveMode->setEnabled(item && item->parent());
+ theKCMLircBase->theEditMode->setEnabled(item);
+}
+
+void KCMLirc::updateActionsStatus(QListViewItem *item)
+{
+ theKCMLircBase->theRemoveAction->setEnabled(item);
+ theKCMLircBase->theEditAction->setEnabled(item);
+}
+
+void KCMLirc::slotRenamed(QListViewItem *item)
+{
+ if(!item) return;
+
+ if(item->parent() && item->text(0) != modeMap[item].name())
+ { allActions.renameMode(modeMap[item], item->text(0));
+ allModes.rename(modeMap[item], item->text(0));
+ emit changed(true);
+ updateModes();
+ }
+}
+
+void KCMLirc::slotEditAction()
+{
+ if(!theKCMLircBase->theActions->currentItem()) return;
+
+ EditAction theDialog(actionMap[theKCMLircBase->theActions->currentItem()], this);
+ QListViewItem *item = theKCMLircBase->theModes->currentItem();
+ if(item->parent()) item = item->parent();
+ theDialog.theModes->insertItem(i18n("[Exit current mode]"));
+ for(item = item->firstChild(); item; item = item->nextSibling())
+ theDialog.theModes->insertItem(item->text(0));
+ theDialog.readFrom();
+ if(theDialog.exec() == QDialog::Accepted) { theDialog.writeBack(); emit changed(true); updateActions(); }
+}
+
+void KCMLirc::slotAddActions()
+{
+ if(!theKCMLircBase->theModes->selectedItem()) return;
+ Mode m = modeMap[theKCMLircBase->theModes->selectedItem()];
+ if(!RemoteServer::remoteServer()->remotes()[m.remote()]) return;
+
+ SelectProfile theDialog(this, 0);
+
+ QMap<QListViewItem *, Profile *> profileMap;
+ QDict<Profile> dict = ProfileServer::profileServer()->profiles();
+ for(QDictIterator<Profile> i(dict); i.current(); ++i) profileMap[new QListViewItem(theDialog.theProfiles, i.current()->name())] = i.current();
+
+ if(theDialog.exec() == QDialog::Accepted && theDialog.theProfiles->currentItem())
+ { autoPopulate(*(profileMap[theDialog.theProfiles->currentItem()]), *(RemoteServer::remoteServer()->remotes()[m.remote()]), m.name());
+ updateActions();
+ emit changed(true);
+ }
+}
+
+void KCMLirc::slotAddAction()
+{
+ kdDebug() << k_funcinfo << endl;
+ if(!theKCMLircBase->theModes->selectedItem()) return;
+ Mode m = modeMap[theKCMLircBase->theModes->selectedItem()];
+
+ AddAction theDialog(this, 0, m);
+ connect(this, SIGNAL(haveButton(const QString &, const QString &)), &theDialog, SLOT(updateButton(const QString &, const QString &)));
+
+ // populate the modes list box
+ QListViewItem *item = theKCMLircBase->theModes->selectedItem();
+ if(item->parent()) item = item->parent();
+ theDialog.theModes->setEnabled(item->firstChild());
+ theDialog.theSwitchMode->setEnabled(item->firstChild());
+ for(item = item->firstChild(); item; item = item->nextSibling())
+ { KListViewItem *a = new KListViewItem(theDialog.theModes, item->text(0));
+ if(item->isSelected()) { a->setSelected(true); theDialog.theModes->setCurrentItem(a); }
+ }
+
+ if(theDialog.exec() == QDialog::Accepted && theDialog.theButtons->selectedItem())
+ { IRAction a;
+ a.setRemote(m.remote());
+ a.setMode(m.name());
+ a.setButton(theDialog.buttonMap[theDialog.theButtons->selectedItem()]);
+ a.setRepeat(theDialog.theRepeat->isChecked());
+ a.setAutoStart(theDialog.theAutoStart->isChecked());
+ a.setDoBefore(theDialog.theDoBefore->isChecked());
+ a.setDoAfter(theDialog.theDoAfter->isChecked());
+ a.setUnique(theDialog.isUnique);
+ a.setIfMulti(theDialog.theDontSend->isChecked() ? IM_DONTSEND : theDialog.theSendToTop->isChecked() ? IM_SENDTOTOP : theDialog.theSendToBottom->isChecked() ? IM_SENDTOBOTTOM : IM_SENDTOALL);
+ // change mode?
+ if(theDialog.theChangeMode->isChecked())
+ {
+ if(theDialog.theSwitchMode->isChecked() && theDialog.theModes->selectedItem())
+ {
+ a.setProgram("");
+ a.setObject(theDialog.theModes->selectedItem()->text(0));
+ }
+ else if(theDialog.theExitMode->isChecked())
+ {
+ a.setProgram("");
+ a.setObject("");
+ }
+ a.setAutoStart(false);
+ a.setRepeat(false);
+ }
+ // DCOP?
+ else if(theDialog.theUseDCOP->isChecked() && theDialog.theObjects->selectedItem() && theDialog.theObjects->selectedItem()->parent() && theDialog.theFunctions->selectedItem())
+ {
+ a.setProgram(theDialog.program);
+ a.setObject(theDialog.theObjects->selectedItem()->text(0));
+ a.setMethod(theDialog.theFunctions->selectedItem()->text(2));
+ theDialog.theParameters->setSorting(3);
+ a.setArguments(theDialog.theArguments);
+ }
+ // profile?
+ else if(theDialog.theUseProfile->isChecked() && theDialog.theProfiles->selectedItem() && (theDialog.theProfileFunctions->selectedItem() || theDialog.theJustStart->isChecked()))
+ {
+ ProfileServer *theServer = ProfileServer::profileServer();
+
+ if(theDialog.theNotJustStart->isChecked())
+ { const ProfileAction *theAction = theServer->getAction(theDialog.profileMap[theDialog.theProfiles->selectedItem()], theDialog.profileFunctionMap[theDialog.theProfileFunctions->selectedItem()]);
+ a.setProgram(theAction->profile()->id());
+ a.setObject(theAction->objId());
+ a.setMethod(theAction->prototype());
+ theDialog.theParameters->setSorting(3);
+ a.setArguments(theDialog.theArguments);
+ }
+ else
+ { a.setProgram(theServer->profiles()[theDialog.profileMap[theDialog.theProfiles->selectedItem()]]->id());
+ a.setObject("");
+ }
+ }
+
+ // save our new action
+ allActions.addAction(a);
+ updateActions();
+ emit changed(true);
+ }
+}
+
+void KCMLirc::slotRemoveAction()
+{
+ if(!theKCMLircBase->theActions->currentItem()) return;
+
+ IRAIt i = actionMap[theKCMLircBase->theActions->currentItem()];
+ allActions.erase(i);
+ updateActions();
+ emit changed(true);
+}
+
+void KCMLirc::autoPopulate(const Profile &profile, const Remote &remote, const QString &mode)
+{
+ QDict<RemoteButton> d = remote.buttons();
+ for(QDictIterator<RemoteButton> i(d); i.current(); ++i)
+ { const ProfileAction *pa = profile.searchClass(i.current()->getClass());
+ if(pa)
+ {
+ IRAction a;
+ a.setRemote(remote.id());
+ a.setMode(mode);
+ a.setButton(i.current()->id());
+ a.setRepeat(pa->repeat());
+ a.setAutoStart(pa->autoStart());
+ a.setProgram(pa->profile()->id());
+ a.setObject(pa->objId());
+ a.setMethod(pa->prototype());
+ a.setUnique(pa->profile()->unique());
+ a.setIfMulti(pa->profile()->ifMulti());
+ Arguments l;
+ // argument count should be either 0 or 1. undefined if > 1.
+ if(Prototype(pa->prototype()).argumentCount() == 1)
+ { l.append(QString().setNum(i.current()->parameter().toFloat() * pa->multiplier()));
+ l.back().cast(QVariant::nameToType(Prototype(pa->prototype()).type(0).utf8()));
+ }
+ a.setArguments(l);
+ allActions.addAction(a);
+ }
+ }
+}
+
+void KCMLirc::slotAddMode()
+{
+ if(!theKCMLircBase->theModes->selectedItem()) return;
+
+ NewMode theDialog(this, 0);
+ QMap<QListViewItem *, QString> remoteMap;
+ QListViewItem *tr = theKCMLircBase->theModes->selectedItem();
+ if(tr) if(tr->parent()) tr = tr->parent();
+ for(QListViewItem *i = theKCMLircBase->theModes->firstChild(); i; i = i->nextSibling())
+ { KListViewItem *a = new KListViewItem(theDialog.theRemotes, i->text(0));
+ remoteMap[a] = modeMap[i].remote();
+ if(i == tr) { a->setSelected(true); theDialog.theRemotes->setCurrentItem(a); }
+ }
+ if(theDialog.exec() == QDialog::Accepted && theDialog.theRemotes->selectedItem() && !theDialog.theName->text().isEmpty())
+ {
+ allModes.add(Mode(remoteMap[theDialog.theRemotes->selectedItem()], theDialog.theName->text()));
+ updateModes();
+ emit changed(true);
+ }
+}
+
+void KCMLirc::slotEditMode()
+{
+ if(!theKCMLircBase->theModes->selectedItem()) return;
+
+ EditMode theDialog(this, 0);
+
+ Mode &mode = modeMap[theKCMLircBase->theModes->selectedItem()];
+ theDialog.theName->setEnabled(theKCMLircBase->theModes->selectedItem()->parent());
+ theDialog.theName->setText(mode.name().isEmpty() ? mode.remoteName() : mode.name());
+ if(!mode.iconFile().isNull())
+ theDialog.theIcon->setIcon(mode.iconFile());
+ else
+ theDialog.theIcon->resetIcon();
+ theDialog.theDefault->setChecked(allModes.isDefault(mode));
+ theDialog.theDefault->setEnabled(!allModes.isDefault(mode));
+
+ if(theDialog.exec() == QDialog::Accepted)
+ { kdDebug() << "Setting icon : " << theDialog.theIcon->icon() << endl;
+ mode.setIconFile(theDialog.theIcon->icon().isEmpty() ? QString::null : theDialog.theIcon->icon());
+ allModes.updateMode(mode);
+ if(!mode.name().isEmpty())
+ { allActions.renameMode(mode, theDialog.theName->text());
+ allModes.rename(mode, theDialog.theName->text());
+ }
+ if(theDialog.theDefault->isChecked()) allModes.setDefault(mode);
+ emit changed(true);
+ updateModes();
+ }
+}
+
+void KCMLirc::slotRemoveMode()
+{
+ if(!theKCMLircBase->theModes->selectedItem()) return;
+ if(!theKCMLircBase->theModes->selectedItem()->parent()) return;
+
+ if(KMessageBox::warningContinueCancel(this, i18n("Are you sure you want to remove %1 and all its actions?").arg(theKCMLircBase->theModes->selectedItem()->text(0)), i18n("Erase Actions?")) == KMessageBox::Continue)
+ {
+ allModes.erase(modeMap[theKCMLircBase->theModes->selectedItem()]);
+ updateModes();
+ emit changed(true);
+ }
+}
+
+void KCMLirc::slotSetDefaultMode()
+{
+ if(!theKCMLircBase->theModes->selectedItem()) return;
+ allModes.setDefault(modeMap[theKCMLircBase->theModes->selectedItem()]);
+ updateModes();
+ emit changed(true);
+}
+
+void KCMLirc::slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem *after)
+{
+ Mode m = modeMap[after];
+
+ if(modeMap[theKCMLircBase->theModes->selectedItem()].remote() != m.remote())
+ {
+ KMessageBox::error(this, i18n("You may only drag the selected items onto a mode of the same remote control"), i18n("You May Not Drag Here"));
+ return;
+ }
+ for(QListViewItem *i = theKCMLircBase->theActions->firstChild(); i; i = i->nextSibling())
+ if(i->isSelected())
+ (*(actionMap[i])).setMode(m.name());
+
+ updateActions();
+ emit changed(true);
+}
+
+void KCMLirc::updateActions()
+{
+ IRAIt oldCurrent;
+ if(theKCMLircBase->theActions->selectedItem()) oldCurrent = actionMap[theKCMLircBase->theActions->selectedItem()];
+
+ theKCMLircBase->theActions->clear();
+ actionMap.clear();
+
+ if(!theKCMLircBase->theModes->selectedItem()) { updateActionsStatus(0); return; }
+
+ Mode m = modeMap[theKCMLircBase->theModes->selectedItem()];
+ theKCMLircBase->theModeLabel->setText(m.remoteName() + ": " + (m.name().isEmpty() ? i18n("Actions <i>always</i> available") : i18n("Actions available only in mode <b>%1</b>").arg(m.name())));
+ IRAItList l = allActions.findByMode(m);
+ for(IRAItList::iterator i = l.begin(); i != l.end(); ++i)
+ { QListViewItem *b = new KListViewItem(theKCMLircBase->theActions, (**i).buttonName(), (**i).application(), (**i).function(), (**i).arguments().toString(), (**i).notes());
+ actionMap[b] = *i;
+ if(*i == oldCurrent) { b->setSelected(true); theKCMLircBase->theActions->setCurrentItem(b); }
+ }
+
+ if(theKCMLircBase->theActions->currentItem())
+ theKCMLircBase->theActions->currentItem()->setSelected(true);
+ updateActionsStatus(theKCMLircBase->theActions->currentItem());
+}
+
+void KCMLirc::gotButton(QString remote, QString button)
+{
+ emit haveButton(remote, button);
+}
+
+void KCMLirc::updateModes()
+{
+ Mode oldCurrent;
+ if(theKCMLircBase->theModes->selectedItem()) oldCurrent = modeMap[theKCMLircBase->theModes->selectedItem()];
+
+ theKCMLircBase->theModes->clear();
+ modeMap.clear();
+
+ IRKick_stub IRKick("irkick", "IRKick");
+ QStringList remotes = IRKick.remotes();
+ if(remotes.begin() == remotes.end())
+ theKCMLircBase->theMainLabel->setMaximumSize(32767, 32767);
+ else
+ theKCMLircBase->theMainLabel->setMaximumSize(0, 0);
+ for(QStringList::iterator i = remotes.begin(); i != remotes.end(); ++i)
+ { Mode mode = allModes.getMode(*i, "");
+ QListViewItem *a = new KListViewItem(theKCMLircBase->theModes, RemoteServer::remoteServer()->getRemoteName(*i), allModes.isDefault(mode) ? "Default" : "", mode.iconFile().isNull() ? "" : "");
+ if(!mode.iconFile().isNull())
+ a->setPixmap(2, KIconLoader().loadIcon(mode.iconFile(), KIcon::Panel));
+ modeMap[a] = mode; // the null mode
+ if(modeMap[a] == oldCurrent) { a->setSelected(true); theKCMLircBase->theModes->setCurrentItem(a); }
+ a->setOpen(true);
+ ModeList l = allModes.getModes(*i);
+ for(ModeList::iterator j = l.begin(); j != l.end(); ++j)
+ if(!(*j).name().isEmpty())
+ { QListViewItem *b = new KListViewItem(a, (*j).name(), allModes.isDefault(*j) ? i18n("Default") : "", (*j).iconFile().isNull() ? "" : "");
+ if(!(*j).iconFile().isNull())
+ b->setPixmap(2, KIconLoader().loadIcon((*j).iconFile(), KIcon::Panel));
+ modeMap[b] = *j;
+ if(*j == oldCurrent) { b->setSelected(true); theKCMLircBase->theModes->setCurrentItem(b); }
+ }
+ }
+ if(theKCMLircBase->theModes->currentItem())
+ theKCMLircBase->theModes->currentItem()->setSelected(true);
+ updateModesStatus(theKCMLircBase->theModes->currentItem());
+ updateActions();
+}
+
+void KCMLirc::updateExtensions()
+{
+ theKCMLircBase->theExtensions->clear();
+
+ { ProfileServer *theServer = ProfileServer::profileServer();
+ QListViewItem *a = new QListViewItem(theKCMLircBase->theExtensions, i18n("Applications"));
+ a->setOpen(true);
+ profileMap.clear();
+ QDict<Profile> dict = theServer->profiles();
+ QDictIterator<Profile> i(dict);
+ for(; i.current(); ++i)
+ profileMap[new QListViewItem(a, i.current()->name())] = i.currentKey();
+ }
+ { RemoteServer *theServer = RemoteServer::remoteServer();
+ QListViewItem *a = new QListViewItem(theKCMLircBase->theExtensions, i18n("Remote Controls"));
+ a->setOpen(true);
+ remoteMap.clear();
+ QDict<Remote> dict = theServer->remotes();
+ QDictIterator<Remote> i(dict);
+ for(; i.current(); ++i)
+ remoteMap[new QListViewItem(a, i.current()->name())] = i.currentKey();
+ }
+ updateInformation();
+}
+
+void KCMLirc::updateInformation()
+{
+ theKCMLircBase->theInformation->clear();
+ theKCMLircBase->theInformationLabel->setText("");
+
+ if(!theKCMLircBase->theExtensions->selectedItem()) return;
+
+ if(!theKCMLircBase->theExtensions->selectedItem()->parent())
+ {
+ theKCMLircBase->theInformationLabel->setText(i18n("Information on <b>%1</b>:").arg(theKCMLircBase->theExtensions->selectedItem()->text(0)));
+ if(theKCMLircBase->theExtensions->selectedItem()->text(0) == i18n("Applications"))
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Applications"), QString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount()));
+ else if(theKCMLircBase->theExtensions->selectedItem()->text(0) == i18n("Remote Controls"))
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Remote Controls"), QString().setNum(theKCMLircBase->theExtensions->selectedItem()->childCount()));
+ }
+ else if(theKCMLircBase->theExtensions->selectedItem()->parent()->text(0) == i18n("Applications"))
+ {
+ ProfileServer *theServer = ProfileServer::profileServer();
+ const Profile *p = theServer->profiles()[profileMap[theKCMLircBase->theExtensions->selectedItem()]];
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name());
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author());
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Application Identifier"), p->id());
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Actions"), QString().setNum(p->actions().count()));
+ theKCMLircBase->theInformationLabel->setText(i18n("Information on <b>%1</b>:").arg(p->name()));
+ }
+ else if(theKCMLircBase->theExtensions->selectedItem()->parent()->text(0) == i18n("Remote Controls"))
+ {
+ RemoteServer *theServer = RemoteServer::remoteServer();
+ const Remote *p = theServer->remotes()[remoteMap[theKCMLircBase->theExtensions->selectedItem()]];
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Name"), p->name());
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Extension Author"), p->author());
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Remote Control Identifier"), p->id());
+ new QListViewItem(theKCMLircBase->theInformation, i18n("Number of Buttons"), QString().setNum(p->buttons().count()));
+ theKCMLircBase->theInformationLabel->setText(i18n("Information on <b>%1</b>:").arg(p->name()));
+ }
+}
+
+void KCMLirc::load()
+{
+ KSimpleConfig theConfig("irkickrc");
+ allActions.loadFromConfig(theConfig);
+ allModes.loadFromConfig(theConfig);
+ allModes.generateNulls(IRKick_stub("irkick", "IRKick").remotes());
+
+ updateExtensions();
+ updateModes();
+ updateActions();
+}
+
+void KCMLirc::defaults()
+{
+ // insert your default settings code here...
+ emit changed(true);
+}
+
+void KCMLirc::save()
+{
+ KSimpleConfig theConfig("irkickrc");
+ allActions.saveToConfig(theConfig);
+ allModes.saveToConfig(theConfig);
+
+ theConfig.sync();
+ IRKick_stub("irkick", "IRKick").reloadConfiguration();
+
+ emit changed(true);
+}
+
+void KCMLirc::configChanged()
+{
+ // insert your saving code here...
+ emit changed(true);
+}
+
+// TODO: Take this out when I know how
+extern "C"
+{
+ KDE_EXPORT KCModule *create_kcmlirc(QWidget *parent, const char *)
+ { KGlobal::locale()->insertCatalogue("kcmlirc");
+ return new KCMLirc(parent, "KCMLirc");
+ }
+}
+
+#include <irkick_stub.cpp>
+
+#include "kcmlirc.moc"
diff --git a/kdelirc/kcmlirc/kcmlirc.desktop b/kdelirc/kcmlirc/kcmlirc.desktop
new file mode 100644
index 0000000..3e50fae
--- /dev/null
+++ b/kdelirc/kcmlirc/kcmlirc.desktop
@@ -0,0 +1,119 @@
+[Desktop Entry]
+Icon=irkick
+Comment=Configure your remote controls for use with applications
+Comment[ar]=إعداد التحكّم عن بعد لاستخدامه في تطبيقاتك
+Comment[bg]=Настройване на дистанционното управление
+Comment[bs]=Podesite vaš daljinski upravljač za upotrebu sa programima
+Comment[ca]=Configura els teus controls remots per usar amb aplicacions
+Comment[cs]=Nastavení dálkových ovladačů
+Comment[cy]=Ffurfweddu eich rheolyddion pell ar gyfer ddefnydd efo cymhwysiadau
+Comment[da]=Indstil dine fjernbetjeninger til brug for programmer
+Comment[de]=Einrichtung diverser Applikationen zur Bedienung mit einer Fernsteuerung
+Comment[el]=Ρυθμίστε τα τηλεχειριστήρια σας για χρήση σε εφαρμογές
+Comment[es]=Configurar sus controles remotos para usarlos en las aplicaciones
+Comment[et]=Kaugjuhtimise seadistamine rakenduste jaoks
+Comment[eu]=Konfiguratu zure urruneko kontrolak aplikazioekin erabiltzeko
+Comment[fa]=برای استفاده با کاربردها، کنترلهای از راه دورتان را پیکربندی کنید
+Comment[fi]=Muokkaa kauko-ohjaimesi toimimaan ohjelmien kanssa
+Comment[fr]=Configurer vos contrôleurs distants pour l'utiliser avec vos applications
+Comment[ga]=Cumraigh do chuid cianrialtáin chun iad a úsáid le feidhmchláir
+Comment[he]=הגדרת שלט רחוק לשימוש ביישומים
+Comment[hi]=अनुप्रयोगों के साथ उपयोग के लिए अपने रिमोट नियंत्रण को कॉन्फ़िगर करें
+Comment[hu]=Az infravörös távirányítók jellemzői
+Comment[is]=Her má stilla fjarstýringar ýmissa forrita
+Comment[it]=Configura i telecomandi per l'uso con le applicazioni
+Comment[ja]=アプリケーションで使用するリモートコントロールを設定
+Comment[ka]=დააკონფიგურირეთ თქვენი დაშორებული მართვა ამ პროგრამით
+Comment[kk]=Қашықтан басқаруды қолданбалармен қолдану үшін баптау
+Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ការបញ្ជា​ពី​ចម្ងាយ​របស់​អ្នក សម្រាប់​ការប្រើ​ជាមួយនឹង​កម្មវិធី
+Comment[lt]=Nuotolinio valdymo programomis konfigūravimas
+Comment[mk]=Конфигурирајте ги вашите далечински управувачи за користење со апликации
+Comment[nb]=Sett opp fjernkontroll for bruk mot programmer
+Comment[nds]=Feernbedeners för den Bruuk mit Programmen instellen
+Comment[ne]=अनुप्रयोगसँग प्रयोग गर्न तपाईंको टाढाको नियन्त्रण कन्फिगर गर्नुहोस्
+Comment[nl]=Uw afstandsbedieningen instellen voor gebruik in KDE
+Comment[nn]=Set opp bruken av fjernkontroll i ulike program
+Comment[pa]=ਕਾਰਜਾਂ ਨਾਲ ਵਰਤਣ ਲਈ ਆਪਣੇ ਰਿਮੋਟ ਕੰਟਰੋਲ ਦੀ ਸੰਰਚਨਾ ਕਰੋ
+Comment[pl]=Konfiguruje piloty do użycia w programach
+Comment[pt]=Configure os seus comandos à distância para os usar nas aplicações
+Comment[pt_BR]=Configura seus controles remotos para o uso com as aplicações
+Comment[ro]=Configurează telecomneziile de utilizat cu aplicaţii
+Comment[ru]=Настройка удалённого управления приложениями
+Comment[sk]=Nastavenie diaľkového ovládania pre vaše aplikácie
+Comment[sl]=Nastavite vaš daljinski upravljalnik za uporabo v programih
+Comment[sr]=Подесите контроле вашег даљинског управљача за употребу у програмима
+Comment[sr@Latn]=Podesite kontrole vašeg daljinskog upravljača za upotrebu u programima
+Comment[sv]=Ställ in fjärrkontroller att använda med program
+Comment[ta]=பயன்பாடுகளுடன் பயன்படுத்த தொலைதூர கட்டுப்பாடுகளை வடிவமை
+Comment[tg]=Ба воситаи замимаҳо танзимкунии идоракунии дурдасти шумо
+Comment[tr]=Uzaktan kontrol ayarlarınızı uygulamalarla kullanmak için ayarla
+Comment[uk]=Налаштування елементів дистанційного керування для використання з програмами
+Comment[zh_CN]=配置您的远程控制以供应用程序使用
+Comment[zh_TW]=設定遙控按鍵與應用程式的關聯
+Exec=kcmshell kcmlirc
+Keywords=KCMLirc,kcmlirc
+Keywords[bg]=дистанционно устройство, дистанционно, инфрачервени, лъчи, KCMLirc, kcmlirc
+Keywords[nl]=kcmlirc,linux infrarood,infrarood,afstandsbediening
+Keywords[pl]=KCMLirc,kcmlirc,piloty,podczerwień
+Keywords[pt]=kcmlirc
+Keywords[ta]= KCMLirc,kcmlirc
+Keywords[uz]=KCMLirc,kcmlirc,infraqizil nur
+Keywords[uz@cyrillic]=KCMLirc,kcmlirc,инфрақизил нур
+Name=Remote Controls
+Name[ar]=التحكّم عن بعد
+Name[bg]=Дистанционно
+Name[bs]=Daljinsko upravljanje
+Name[ca]=Controls remots
+Name[cs]=Dálková ovládání
+Name[cy]=Rheolyddion Pell
+Name[da]=Fjernbetjeninger
+Name[de]=Fernsteuerungen
+Name[el]=Τηλεχειριστήρια
+Name[eo]=Teleregiloj
+Name[es]=Controles remotos
+Name[et]=Kaugjuhtimine
+Name[eu]=Urruneko Aginteak
+Name[fa]=کنترلهای از راه دور
+Name[fi]=Kauko-ohjaimet
+Name[fr]=Contrôleurs distants
+Name[ga]=Cianrialtáin
+Name[he]=שליטה מרחוק
+Name[hi]=रिमोट नियंत्रण
+Name[hu]=Távirányító
+Name[is]=Fjarstýringar
+Name[it]=Telecomandi
+Name[ja]=リモートコントロール
+Name[ka]=დაშორებული მართვა
+Name[kk]=Қашықтан басқару
+Name[km]=បញ្ជា​ពី​ចម្ងាយ
+Name[lt]=Nuotolinis valdymas
+Name[mk]=Далечински управувачи
+Name[nb]=Fjernkontroll
+Name[nds]=Feernbedeners
+Name[ne]=टाढाको नियन्त्रण
+Name[nl]=Afstandsbediening
+Name[nn]=Fjernkontrollar
+Name[pa]=ਰਿਮੋਟ ਕੰਟਰੋਲ
+Name[pl]=Piloty
+Name[pt]=Comandos à Distância
+Name[pt_BR]=Controles Remotos
+Name[ro]=Telecomenzi
+Name[ru]=Удалённое управление
+Name[sk]=Diaľkový ovládač
+Name[sl]=Daljinski upravljalci
+Name[sr]=Даљински управљачи
+Name[sr@Latn]=Daljinski upravljači
+Name[sv]=Fjärrkontroller
+Name[ta]= தொலைதூர கட்டுப்பாடுகள்
+Name[tg]=Идоракунии Дурдаст
+Name[tr]=Uzaktan Kontroller
+Name[uk]=Елементи дистанційного керування
+Name[zh_CN]=远程控制
+Name[zh_TW]=遙控鍵
+Terminal=false
+Type=Application
+X-KDE-FactoryName=kcmlirc
+X-KDE-Library=kcmlirc
+X-KDE-ModuleType=Library
+DocPath=kcmlirc/index.html
+Categories=Qt;KDE;X-KDE-settings-peripherals;
diff --git a/kdelirc/kcmlirc/kcmlirc.h b/kdelirc/kcmlirc/kcmlirc.h
new file mode 100644
index 0000000..ba88ae2
--- /dev/null
+++ b/kdelirc/kcmlirc/kcmlirc.h
@@ -0,0 +1,83 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Gav Wood *
+ * gav@kde.org
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#ifndef _KCMLIRC_H_
+#define _KCMLIRC_H_
+
+#include <qstringlist.h>
+#include <qmap.h>
+
+#include <kcmodule.h>
+
+#include <dcopobject.h>
+
+#include "kcmlircbase.h"
+#include "iractions.h"
+#include "modes.h"
+
+class QListViewItem;
+class KListView;
+class QDropEvent;
+class Profile;
+class Remote;
+
+class KCMLirc: public KCModule, virtual public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+
+private:
+ KCMLircBase *theKCMLircBase;
+ IRActions allActions;
+ Modes allModes;
+ QMap<QListViewItem *, IRAIt > actionMap;
+ QMap<QListViewItem *, Mode> modeMap;
+ QMap<QListViewItem *, QString> profileMap, remoteMap;
+
+ void autoPopulate(const Profile &profile, const Remote &remote, const QString &mode);
+
+public slots:
+ void updateActions();
+ void updateModesStatus(QListViewItem *);
+ void updateActionsStatus(QListViewItem *);
+ void updateModes();
+ void updateExtensions();
+ void updateInformation();
+ void slotAddMode();
+ void slotRemoveMode();
+ void slotSetDefaultMode();
+ void slotAddAction();
+ void slotAddActions();
+ void slotEditAction();
+ void slotRemoveAction();
+ void slotDrop(KListView *, QDropEvent *, QListViewItem *, QListViewItem *after);
+ void slotRenamed(QListViewItem *item);
+ void slotEditMode();
+
+
+// MOC_SKIP_BEGIN
+k_dcop:
+// MOC_SKIP_END
+ // now just used as a proxy to AddAction class
+ virtual void gotButton(QString remote, QString button);
+signals:
+ void haveButton(const QString &remote, const QString &button);
+
+public:
+ virtual void load();
+ virtual void save();
+ virtual void defaults();
+ virtual void configChanged();
+
+ KCMLirc(QWidget *parent = 0, const char *name = 0, QStringList args = QStringList());
+ ~KCMLirc();
+};
+
+#endif
diff --git a/kdelirc/kcmlirc/kcmlircbase.ui b/kdelirc/kcmlirc/kcmlircbase.ui
new file mode 100644
index 0000000..c4b0b81
--- /dev/null
+++ b/kdelirc/kcmlirc/kcmlircbase.ui
@@ -0,0 +1,506 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>KCMLircBase</class>
+<author>Gav Wood</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KCMLircBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>469</width>
+ <height>326</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Linux Infrared Remote Control</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Controller Functions</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theMainLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>138</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="margin">
+ <number>1</number>
+ </property>
+ <property name="text">
+ <string>There are currently no remote controls available. You must first set up LIRC correctly; see www.lirc.org for more information.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QSplitter">
+ <property name="name">
+ <cstring>splitter4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>modeLayout</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theRemotesLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Remote controls and modes:</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>New Column</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>New Column</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theModes</cstring>
+ </property>
+ <property name="acceptDrops">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="itemsRenameable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>modeButtonLayout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>17</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>theAddMode</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>theEditMode</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>theRemoveMode</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theModeLabel</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Button</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Program</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Function</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Options</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theActions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="dragAutoScroll">
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode" stdset="0">
+ <enum>FileManager</enum>
+ </property>
+ <property name="dragEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>240</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>theAddActions</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Auto-Populate...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>theAddAction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>A&amp;dd...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>theEditAction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Ed&amp;it...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>theRemoveAction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Re&amp;move</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Loaded Extensions</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSplitter" row="0" column="0">
+ <property name="name">
+ <cstring>splitter5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theExtensions</cstring>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>theInformationLabel</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Information</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theInformation</cstring>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<includes>
+ <include location="local" impldecl="in implementation">kcmlircbase.ui.h</include>
+</includes>
+<functions>
+ <function access="private" specifier="non virtual">init()</function>
+</functions>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kdelirc/kcmlirc/kcmlircbase.ui.h b/kdelirc/kcmlirc/kcmlircbase.ui.h
new file mode 100644
index 0000000..f9082b6
--- /dev/null
+++ b/kdelirc/kcmlirc/kcmlircbase.ui.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Gav Wood *
+ * gav@kde.org *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+#include "modeslist.h"
+
+void KCMLircBase::init()
+{
+ delete theModes;
+ modeLayout->removeItem(modeButtonLayout);
+ theModes = new ModesList(dynamic_cast<QWidget *>(modeLayout->parent()), "theModes");
+ theModes->addColumn(i18n("Remote Control"));
+ theModes->addColumn(i18n("Default"));
+ theModes->addColumn(i18n("Icon"));
+ theModes->setAcceptDrops(true);
+ theModes->setRootIsDecorated(true);
+ theModes->setItemsRenameable(true);
+ modeLayout->addWidget(theModes);
+ modeLayout->addLayout(modeButtonLayout);
+ modeLayout->invalidate();
+ modeLayout->activate();
+}
diff --git a/kdelirc/kcmlirc/modeslist.cpp b/kdelirc/kcmlirc/modeslist.cpp
new file mode 100644
index 0000000..6150705
--- /dev/null
+++ b/kdelirc/kcmlirc/modeslist.cpp
@@ -0,0 +1,33 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Gav Wood <gav@kde.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include <qwidget.h>
+
+#include <kdebug.h>
+
+#include "modeslist.h"
+
+ModesList::ModesList(QWidget *parent, const char *name) : KListView(parent, name)
+{
+ setAcceptDrops(true);
+ setDropVisualizer(false);
+ setDropHighlighter(true);
+}
+
+bool ModesList::acceptDrag(QDropEvent *) const
+{
+ // TODO: make safer by checking source/mime type
+ // TODO: make safer by only allowing drops on the correct remote control's modes
+ return true;
+}
+
+#include "modeslist.moc"
diff --git a/kdelirc/kcmlirc/modeslist.h b/kdelirc/kcmlirc/modeslist.h
new file mode 100644
index 0000000..2fee458
--- /dev/null
+++ b/kdelirc/kcmlirc/modeslist.h
@@ -0,0 +1,33 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Gav Wood <gav@kde.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef MODESLIST_H
+#define MODESLIST_H
+
+#include <klistview.h>
+
+#include <klistview.h>
+
+/**
+
+@author Gav Wood
+*/
+
+class ModesList : public KListView
+{
+ Q_OBJECT
+public:
+ virtual bool acceptDrag(QDropEvent *) const;
+ ModesList(QWidget *parent = 0, const char *name = 0);
+};
+
+#endif
diff --git a/kdelirc/kcmlirc/newmode.ui b/kdelirc/kcmlirc/newmode.ui
new file mode 100644
index 0000000..e3da8ef
--- /dev/null
+++ b/kdelirc/kcmlirc/newmode.ui
@@ -0,0 +1,158 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>NewMode</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>NewMode</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>309</width>
+ <height>341</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New Mode</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Remote Controls</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theRemotes</cstring>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>theName</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line2</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>layout12</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>61</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton6</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>kPushButton6</sender>
+ <signal>clicked()</signal>
+ <receiver>NewMode</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton5</sender>
+ <signal>clicked()</signal>
+ <receiver>NewMode</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>theName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>NewMode</receiver>
+ <slot>slotTextChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">newmode.ui.h</include>
+</includes>
+<slots>
+ <slot>slotTextChanged( const QString &amp; newText )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kdelirc/kcmlirc/newmode.ui.h b/kdelirc/kcmlirc/newmode.ui.h
new file mode 100644
index 0000000..96c1eb4
--- /dev/null
+++ b/kdelirc/kcmlirc/newmode.ui.h
@@ -0,0 +1,24 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Gav Wood *
+ * gav@kde.org *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+
+void NewMode::slotTextChanged( const QString &newText )
+{
+ kPushButton6->setEnabled(newText != "");
+}
diff --git a/kdelirc/kcmlirc/selectprofile.ui b/kdelirc/kcmlirc/selectprofile.ui
new file mode 100644
index 0000000..2d4ac18
--- /dev/null
+++ b/kdelirc/kcmlirc/selectprofile.ui
@@ -0,0 +1,128 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SelectProfile</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SelectProfile</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>263</width>
+ <height>328</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Select Profile to Add</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Profile Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>theProfiles</cstring>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line8</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>layout47</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer53</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton12</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>kPushButton13</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>kPushButton12</sender>
+ <signal>clicked()</signal>
+ <receiver>SelectProfile</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>kPushButton13</sender>
+ <signal>clicked()</signal>
+ <receiver>SelectProfile</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>