summaryrefslogtreecommitdiffstats
path: root/kioslave/media/kcmodule
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kioslave/media/kcmodule
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslave/media/kcmodule')
-rw-r--r--kioslave/media/kcmodule/Makefile.am21
-rw-r--r--kioslave/media/kcmodule/main.cpp103
-rw-r--r--kioslave/media/kcmodule/main.h45
-rw-r--r--kioslave/media/kcmodule/managermodule.cpp74
-rw-r--r--kioslave/media/kcmodule/managermodule.h34
-rw-r--r--kioslave/media/kcmodule/managermoduleview.ui72
-rw-r--r--kioslave/media/kcmodule/media.desktop197
-rw-r--r--kioslave/media/kcmodule/mimetypelistboxitem.cpp35
-rw-r--r--kioslave/media/kcmodule/mimetypelistboxitem.h37
-rw-r--r--kioslave/media/kcmodule/notifiermodule.cpp230
-rw-r--r--kioslave/media/kcmodule/notifiermodule.h57
-rw-r--r--kioslave/media/kcmodule/notifiermoduleview.ui171
-rw-r--r--kioslave/media/kcmodule/serviceconfigdialog.cpp151
-rw-r--r--kioslave/media/kcmodule/serviceconfigdialog.h48
-rw-r--r--kioslave/media/kcmodule/serviceview.ui248
15 files changed, 1523 insertions, 0 deletions
diff --git a/kioslave/media/kcmodule/Makefile.am b/kioslave/media/kcmodule/Makefile.am
new file mode 100644
index 000000000..72f9f385c
--- /dev/null
+++ b/kioslave/media/kcmodule/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = -I$(srcdir)/../libmediacommon -I../libmediacommon $(all_includes)
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = kcm_media.la
+kcm_media_la_SOURCES = notifiermodule.cpp notifiermoduleview.ui \
+ serviceconfigdialog.cpp serviceview.ui \
+ mimetypelistboxitem.cpp \
+ managermodule.cpp managermoduleview.ui \
+ main.cpp
+
+kcm_media_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+kcm_media_la_LIBADD = ../libmediacommon/libmediacommon.la $(LIB_KIO)
+
+noinst_HEADERS = notifiermodule.h managermodule.h \
+ serviceconfigdialog.h mimetypelistboxitem.h \
+ main.h
+
+xdg_apps_DATA = media.desktop
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kcmmedia.pot
diff --git a/kioslave/media/kcmodule/main.cpp b/kioslave/media/kcmodule/main.cpp
new file mode 100644
index 000000000..e431e95f8
--- /dev/null
+++ b/kioslave/media/kcmodule/main.cpp
@@ -0,0 +1,103 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kévin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "main.h"
+
+#include <qtabwidget.h>
+#include <qlayout.h>
+
+#include <klocale.h>
+#include <kaboutdata.h>
+#include <kdialog.h>
+
+#include <kgenericfactory.h>
+
+#include "notifiermodule.h"
+#include "managermodule.h"
+
+
+typedef KGenericFactory<MediaModule, QWidget> MediaFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_media, MediaFactory( "kcmmedia" ) )
+
+
+MediaModule::MediaModule( QWidget *parent, const char *name, const QStringList& )
+ : KCModule(MediaFactory::instance(), parent, name )
+{
+ KGlobal::locale()->insertCatalogue("kio_media");
+ QVBoxLayout *layout = new QVBoxLayout( this, 0, KDialog::spacingHint() );
+ QTabWidget *tab = new QTabWidget( this );
+
+ layout->addWidget( tab );
+
+
+
+ m_notifierModule = new NotifierModule( this, "notifier" );
+ tab->addTab( m_notifierModule, i18n( "&Notifications" ) );
+ connect( m_notifierModule, SIGNAL( changed( bool ) ),
+ this, SLOT( moduleChanged( bool ) ) );
+
+ m_managerModule = new ManagerModule( this, "manager" );
+ tab->addTab( m_managerModule, i18n( "&Advanced" ) );
+ connect( m_managerModule, SIGNAL( changed( bool ) ),
+ this, SLOT( moduleChanged( bool ) ) );
+
+
+
+ KAboutData * about = new KAboutData("kcmmedia",
+ I18N_NOOP("Storage Media"),
+ "0.6",
+ I18N_NOOP("Storage Media Control Panel Module"),
+ KAboutData::License_GPL_V2,
+ I18N_NOOP("(c) 2005 Jean-Remy Falleri"));
+ about->addAuthor("Jean-Remy Falleri", I18N_NOOP("Maintainer"), "jr.falleri@laposte.net");
+ about->addAuthor("Kevin Ottens", 0, "ervin ipsquad net");
+ about->addCredit("Achim Bohnet", I18N_NOOP("Help for the application design"));
+
+ setAboutData( about );
+}
+
+void MediaModule::load()
+{
+ m_notifierModule->load();
+ m_managerModule->load();
+}
+
+void MediaModule::save()
+{
+ m_notifierModule->save();
+ m_managerModule->save();
+}
+
+void MediaModule::defaults()
+{
+ m_notifierModule->defaults();
+ m_managerModule->defaults();
+}
+
+void MediaModule::moduleChanged( bool state )
+{
+ emit changed( state );
+}
+
+QString MediaModule::quickHelp() const
+{
+ return i18n("FIXME : Write me...");
+}
+
+#include "main.moc"
diff --git a/kioslave/media/kcmodule/main.h b/kioslave/media/kcmodule/main.h
new file mode 100644
index 000000000..1ab909527
--- /dev/null
+++ b/kioslave/media/kcmodule/main.h
@@ -0,0 +1,45 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kvin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _MAIN_H_
+#define _MAIN_H_
+
+#include <kcmodule.h>
+
+class MediaModule : public KCModule
+{
+ Q_OBJECT
+
+public:
+ MediaModule( QWidget *parent, const char *name, const QStringList& );
+
+ virtual void load();
+ virtual void save();
+ virtual void defaults();
+ virtual QString quickHelp() const;
+
+protected slots:
+ void moduleChanged( bool state );
+
+private:
+ KCModule *m_notifierModule;
+ KCModule *m_managerModule;
+};
+
+#endif
diff --git a/kioslave/media/kcmodule/managermodule.cpp b/kioslave/media/kcmodule/managermodule.cpp
new file mode 100644
index 000000000..e5f493d27
--- /dev/null
+++ b/kioslave/media/kcmodule/managermodule.cpp
@@ -0,0 +1,74 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Kvin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <config.h>
+
+#include "managermodule.h"
+
+#include <klocale.h>
+#include <dcopref.h>
+#include <qcheckbox.h>
+#include <kdirnotify_stub.h>
+
+#include "managermoduleview.h"
+#include "mediamanagersettings.h"
+
+ManagerModule::ManagerModule( QWidget* parent, const char* name )
+ : KCModule( parent, name )
+{
+ ManagerModuleView *view = new ManagerModuleView( this );
+
+ addConfig( MediaManagerSettings::self(), view );
+
+#ifndef COMPILE_HALBACKEND
+ QString hal_text = view->kcfg_HalBackendEnabled->text();
+ hal_text += " ("+i18n("No support for HAL on this system")+")";
+ view->kcfg_HalBackendEnabled->setText( hal_text );
+#endif
+ view->kcfg_HalBackendEnabled->setEnabled( false );
+
+#ifndef COMPILE_LINUXCDPOLLING
+ QString poll_text = view->kcfg_CdPollingEnabled->text();
+ poll_text += " ("+i18n("No support for CD polling on this system")+")";
+ view->kcfg_CdPollingEnabled->setText( poll_text );
+#endif
+ view->kcfg_CdPollingEnabled->setEnabled( false );
+
+ load();
+}
+
+void ManagerModule::save()
+{
+ KCModule::save();
+
+ //Well... reloadBackends is buggy with HAL, it seems to be linked
+ //to a bug in the unmaintained Qt3 DBUS binding ;-/
+ //DCOPRef mediamanager( "kded", "mediamanager" );
+ //DCOPReply reply = mediamanager.call( "reloadBackends" );
+
+ // So we use this hack instead...
+ DCOPRef kded( "kded", "kded" );
+ kded.call( "unloadModule", "mediamanager" );
+ kded.call( "loadModule", "mediamanager" );
+
+ KDirNotify_stub notifier( "*", "*" );
+ notifier.FilesAdded( "media:/" );
+}
+
+
+#include "managermodule.moc"
diff --git a/kioslave/media/kcmodule/managermodule.h b/kioslave/media/kcmodule/managermodule.h
new file mode 100644
index 000000000..7fa3d649a
--- /dev/null
+++ b/kioslave/media/kcmodule/managermodule.h
@@ -0,0 +1,34 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Kvin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _MANAGERMODULE_H_
+#define _MANAGERMODULE_H_
+
+#include <kcmodule.h>
+
+class ManagerModule : public KCModule
+{
+ Q_OBJECT
+
+public:
+ ManagerModule( QWidget* parent = 0, const char* name = 0);
+
+ void save();
+};
+
+#endif
diff --git a/kioslave/media/kcmodule/managermoduleview.ui b/kioslave/media/kcmodule/managermoduleview.ui
new file mode 100644
index 000000000..598718389
--- /dev/null
+++ b/kioslave/media/kcmodule/managermoduleview.ui
@@ -0,0 +1,72 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ManagerModuleView</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ManagerModuleView</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_HalBackendEnabled</cstring>
+ </property>
+ <property name="text">
+ <string>Enable HAL backend</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if you want to enable the Hardware Abstraction Layer (http://hal.freedesktop.org/wiki/Software/hal) support.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_CdPollingEnabled</cstring>
+ </property>
+ <property name="text">
+ <string>Enable CD polling</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this to enable the CD polling.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_AutostartEnabled</cstring>
+ </property>
+ <property name="text">
+ <string>Enable medium application autostart after mount</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if you want to enable application autostart after mounting a device.</string>
+ </property>
+ </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>21</width>
+ <height>360</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kioslave/media/kcmodule/media.desktop b/kioslave/media/kcmodule/media.desktop
new file mode 100644
index 000000000..c49945253
--- /dev/null
+++ b/kioslave/media/kcmodule/media.desktop
@@ -0,0 +1,197 @@
+[Desktop Entry]
+Type=Application
+#DocPath=
+Icon=system
+Exec=kcmshell media
+
+
+X-KDE-Library=media
+X-KDE-FactoryName=media
+X-KDE-ParentApp=kcontrol
+
+Name=Storage Media
+Name[af]=Stoor Media
+Name[ar]=وسائط التخزين
+Name[be]=Носьбіты
+Name[bg]=Съхраняващи устройства
+Name[bn]=স্টোরেজ মিডিয়া
+Name[bs]=Uređaji za smještaj podataka
+Name[ca]=Suports d'emmagatzematge
+Name[cs]=Úložná zařízení
+Name[csb]=Zôpisowné media
+Name[da]=Opbevaringsmedie
+Name[de]=Speichermedien
+Name[el]=Συσκευές αποθήκευσης
+Name[eo]=Enmemoriga Medio
+Name[es]=Dispositivos de almacenamiento
+Name[et]=Andmekandjad
+Name[eu]=Biltegiratze-euskarria
+Name[fa]=رسانۀ ذخیره‌گاه
+Name[fi]=Tallennusmedia
+Name[fr]=Support de stockage
+Name[fy]=Opslachapparaten
+Name[ga]=Meán Stórais
+Name[gl]=Medios de armacenaxe
+Name[he]=התקנים
+Name[hi]=भंडार मीडिया
+Name[hr]=Mediji za pohranjivanje
+Name[hu]=Tárolóeszközök
+Name[is]=Geymslumiðlar
+Name[it]=Dispositivi di archiviazione
+Name[ja]=記憶メディア
+Name[ka]=მონაცემთა შენახვის მოწყობილობები
+Name[kk]=Жинақтаушы құрылғылар
+Name[km]=ឧបករណ៍​ផ្ទុក
+Name[lt]=Saugojimo įrenginiai
+Name[lv]=Datu nesējs
+Name[mk]=Медиуми за податоци
+Name[ms]=Media Storan
+Name[nb]=Lagringsenheter
+Name[nds]=Spiekermedien
+Name[ne]=भण्डारण मिडिया
+Name[nl]=Opslagapparaten
+Name[nn]=Lagringsmedium
+Name[pa]=ਸਟੋਰੇਜ਼ ਮੀਡਿਆ
+Name[pl]=Urządzenia przechowywania danych
+Name[pt]=Dispositivos de Armazenamento
+Name[pt_BR]=Mídia de Armazenamento
+Name[ro]=Mediu de stocare
+Name[ru]=Устройства хранения данных
+Name[rw]=Uburyo bwo Kubika
+Name[se]=Vurkenmedia
+Name[sk]=Zálohovacie médiá
+Name[sl]=Nosilci za shranjevanje
+Name[sr]=Складишни медијуми
+Name[sr@Latn]=Skladišni medijumi
+Name[sv]=Lagringsmedia
+Name[ta]=சேகரிப்பு ஊடகம்
+Name[tg]=Захирагоҳи маълумот
+Name[th]=สื่อเก็บข้อมูล
+Name[tr]=Depolama Ortamı
+Name[tt]=Saqlawlı Media
+Name[uk]=Пристрої зберігання інформації
+Name[uz]=Saqlash uskunalari
+Name[uz@cyrillic]=Сақлаш ускуналари
+Name[vi]=Ổ chứa Dữ liệu
+Name[wa]=Sopoirts di wårdaedje
+Name[zh_CN]=存储介质
+Name[zh_TW]=儲存媒體
+
+Comment=Configure Storage Media
+Comment[af]=Stel Stoor Media op
+Comment[ar]=إعداد وسائط التخزين
+Comment[be]=Настаўленні носьбітаў
+Comment[bg]=Настройване на устройствата за съхранение на информация
+Comment[bn]=স্টোরেজ মিডিয়া কনফিগার করুন
+Comment[bs]=Podesite prikaz uređaja
+Comment[ca]=Configura els suports d'emmagatzematge
+Comment[cs]=Nastavení úložných médií
+Comment[csb]=Kònfigùracëjô zôpisownëch mediów
+Comment[da]=Opsætning af opbevarelsesmedie
+Comment[de]=Speichermedien einrichten
+Comment[el]=Ρύθμιση μέσων αποθήκευσης
+Comment[eo]=Agordo de enmemoriga medio
+Comment[es]=Configuración de las medios de almacenamiento
+Comment[et]=Salvestusandmekandjate seadistused
+Comment[eu]=Konfiguratu biltegiratze-euskarria
+Comment[fa]=پیکربندی رسانۀ ذخیره‌گاه
+Comment[fi]=Aseta tallennusmedia
+Comment[fr]=Configurer le média de stockage
+Comment[fy]=Opslachmedia ynstelle
+Comment[ga]=Cumraigh Meáin Stórála
+Comment[gl]=Configurar Medios de Armacenaxe
+Comment[he]=שינוי הגדרות מדיות אחסון
+Comment[hr]=Konfiguriranje medija za pohranu
+Comment[hu]=A tárolóeszközök beállítása
+Comment[is]=Stillingar geymslumiðla
+Comment[it]=Configura dispositivi di archiviazione
+Comment[ja]=記憶メディアの設定
+Comment[ka]=შენახვის მედიის გამართვა
+Comment[kk]=Жинақтаушыларды баптау
+Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ឧបករណ៍​ផ្ទុក
+Comment[lt]=Konfigūruoti saugojimo įrenginius
+Comment[mk]=Конфигурирајте ги медиумите за податоци
+Comment[nb]=Sett opp lagringsmedier
+Comment[nds]=Spiekermedien instellen
+Comment[ne]=भण्डारण मिडिया कन्फिगर गर्नुहोस्
+Comment[nl]=Opslagmedia instellen
+Comment[nn]=Set opp lagringsmedium
+Comment[pa]=ਸਟੋਰੇਜ਼ ਮੀਡਿਆ ਸੰਰਚਨਾ
+Comment[pl]=Konfiguracja nośników danych
+Comment[pt]=Configurar os Suportes de Armazenamento
+Comment[pt_BR]=Configura as mídias de armazenamento
+Comment[ro]=Configurează mediile de stocare
+Comment[ru]=Настройка подключаемых устройств хранения
+Comment[se]=Heivet vurkenmediaid
+Comment[sk]=Nastavenie zálohovacích médií
+Comment[sl]=Nastavitve nosilcev za shranjevanje
+Comment[sr]=Подешавање медијума за складиштење
+Comment[sr@Latn]=Podešavanje medijuma za skladištenje
+Comment[sv]=Anpassa lagringsmedia
+Comment[th]=ตั้งค่าสื่อบันทึก
+Comment[tr]=Depolama Aygıtlarını Yapılandır
+Comment[tt]=Saqlaw Cıhazların Caylaw
+Comment[uk]=Налаштування пристроїв зберігання інформації
+Comment[uz]=Saqlash uskunalarni moslash
+Comment[uz@cyrillic]=Сақлаш ускуналарни мослаш
+Comment[vi]=Cấu hình Ổ lưu trữ Dữ liệu
+Comment[wa]=Apontiaedjes sopoirts di wårdaedje
+Comment[zh_CN]=配置存储介质
+Comment[zh_TW]=設定儲存媒體
+
+Keywords=storage,media,usb,cdrom,device
+Keywords[ar]=تخزين,وسائط,usb,قرص مدمج cdrom,جهاز
+Keywords[be]=Носьбіт,Прылада,storage,media,usb,cdrom,device
+Keywords[bg]=съхранение, информация, компактдиск, устройство, данни, storage, media, usb, cdrom, device
+Keywords[bs]=storage,media,usb,cdrom,device,uređaji,mediji
+Keywords[ca]=emmagatzematge,suport,usb,cdrom,dispositiu
+Keywords[cs]=úložiště,média,USB,CDROM,zařízení
+Keywords[csb]=pòdôwczi,trzëmanié pòdôwków,zôpisowné media,usb,cdrom,ùrządzenié,nëk
+Keywords[da]=opbevaring,medie,usb,cdrom,enhed
+Keywords[de]=Speicher,Medien,Medium,USB,CD-Rom,cdrom,Gerät
+Keywords[el]=αποθήκευση,μέσο,usb,cdrom,συσκευή
+Keywords[eo]=memorigilo,medio,usb,lumdisko,aparato
+Keywords[es]=almacenamiento,medios,usb,cdrom,dispositivo
+Keywords[et]=salvestamine,andmekandja,usb,cd,seade
+Keywords[eu]=biltegiratzea,euskarriak,usb,cdrom,gailua
+Keywords[fa]=ذخیره‌گاه، رسانه، گذرگاه سریال جهانی، دیسک فشرده، دستگاه
+Keywords[fi]=varasto,media,usb,cdrom,laite
+Keywords[fr]=stockage,media,média,medium,usb,cdrom,périphérique
+Keywords[fy]=storage,opslach,media,usb,cd-rom,kompakt-skiif,device,apparaat,mp3-speler,usb-stick,geheugenkaart
+Keywords[ga]=stóráil,stóras,meáin,meán,usb,cdrom,dlúthdhiosca,gléas
+Keywords[gl]=armacenaxe,medios,usb,cdrom,dispositivo
+Keywords[he]=storage,media,usb,cdrom,device,מדיה,התקן,סידירום,תקליטור
+Keywords[hr]=storage,media,usb,cdrom,device,pohrana,snimanje,mediji,uređaj
+Keywords[hu]=tároló,adathordozó,USB,CD-ROM,eszköz
+Keywords[is]=geymsla,miðill,usb,cdrom,tæki
+Keywords[it]=storage,media,usb,cdrom,dispositivi,dvd,penna usb,memory stick,stick
+Keywords[ja]=記憶,メディア,usb,cdrom,デバイス
+Keywords[km]=ឧបករណ៍​ផ្ទុក, usb,ស៊ីឌីរ៉ូម,ឧបករណ៍
+Keywords[lt]=storage,media,usb,cdrom,device,saugojimas,media,įrenginiai,usb
+Keywords[mk]=storage,media,usb,cdrom,device,медиуми,усб,цдром,уред
+Keywords[nb]=lagring,media,usb,CD-spiller,CD-ROM,enheter,minnepinner,harddisker,HD,eksterne harddisker,zip-disker
+Keywords[nds]=Spieker,Medien,USB,CDROM,Reedschap
+Keywords[ne]=भण्डारण, मिडिया,usb,cdrom, यन्त्र
+Keywords[nl]=storage,opslag,media,usb,cd-rom,device,apparaat,mp3-speler,usb-stick,geheugenkaart
+Keywords[nn]=lagring,media,usb,CD-spiller,CD-ROM,einingar,minnepinnar,harddiskar,HD,eksterne harddiskar,zip-diskar
+Keywords[pa]=ਸਟੋਰੇਜ਼,ਮੀਡਿਆ,ਜੰਤਰ,usb,cdrom
+Keywords[pl]=dane,przechowywanie danych,nośnik danych,nośniki danych,usb,cdrom,urządzenie
+Keywords[pt]=armazenamento,discos,usb,cdrom,dispositivo
+Keywords[pt_BR]=armazenamento,mídia,usb,cd-rom,device,dispositivo
+Keywords[ro]=stocare,mediu,usb,cdrom,dispozitiv
+Keywords[ru]=storage,media,usb,cdrom,device,устройство хранения
+Keywords[sl]=shranjevanje,nosilec,usb,cdrom,naprava
+Keywords[sr]=storage,media,usb,cdrom,device,складиштење,медијум,уређај
+Keywords[sr@Latn]=storage,media,usb,cdrom,device,skladištenje,medijum,uređaj
+Keywords[sv]=lagring,media,usb,cdrom,enhet
+Keywords[th]=ที่เก็บข้อมูล,สื่อ,ยูเอสบี,,ซีดีรอม,อุปกรณ์
+Keywords[tr]=depolama,ortam,usb,cdrom,device
+Keywords[uk]=зберігання,носій,медіа,usb,cdrom,пристрій
+Keywords[uz]=saqlash uskunasi,usb,cdrom,kompakt-disk
+Keywords[uz@cyrillic]=сақлаш ускунаси,usb,cdrom,компакт-диск
+Keywords[vi]=lưu trữ,ổ,usb,cdrom,thiết bị
+Keywords[wa]=wårdaedje,media,usb,cdrom,device,éndjin
+Keywords[zh_CN]=storage,media,usb,cdrom,device,存储,介质,设备
+Keywords[zh_TW]=storage,media,usb,cdrom,device,儲存,媒體,光碟機,裝置
+
+Categories=Qt;KDE;X-KDE-settings-peripherals;
diff --git a/kioslave/media/kcmodule/mimetypelistboxitem.cpp b/kioslave/media/kcmodule/mimetypelistboxitem.cpp
new file mode 100644
index 000000000..86460ed88
--- /dev/null
+++ b/kioslave/media/kcmodule/mimetypelistboxitem.cpp
@@ -0,0 +1,35 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kévin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "mimetypelistboxitem.h"
+
+#include <kmimetype.h>
+
+MimetypeListBoxItem::MimetypeListBoxItem(const QString &mimetype, QListBox *parent)
+ : QListBoxText(parent), m_mimetype(mimetype)
+{
+ KMimeType::Ptr mime = KMimeType::mimeType( mimetype );
+ setText( mime->comment() );
+}
+
+const QString &MimetypeListBoxItem::mimetype() const
+{
+ return m_mimetype;
+}
+
diff --git a/kioslave/media/kcmodule/mimetypelistboxitem.h b/kioslave/media/kcmodule/mimetypelistboxitem.h
new file mode 100644
index 000000000..fee215ecf
--- /dev/null
+++ b/kioslave/media/kcmodule/mimetypelistboxitem.h
@@ -0,0 +1,37 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kvin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _MIMETYPELISTBOXITEM_H_
+#define _MIMETYPELISTBOXITEM_H_
+
+#include <qlistbox.h>
+#include <qstring.h>
+
+class MimetypeListBoxItem : public QListBoxText
+{
+public:
+ MimetypeListBoxItem(const QString &mimetype, QListBox *parent);
+
+ const QString &mimetype() const;
+
+private:
+ QString m_mimetype;
+};
+
+#endif
diff --git a/kioslave/media/kcmodule/notifiermodule.cpp b/kioslave/media/kcmodule/notifiermodule.cpp
new file mode 100644
index 000000000..015d7396a
--- /dev/null
+++ b/kioslave/media/kcmodule/notifiermodule.cpp
@@ -0,0 +1,230 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kévin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "notifiermodule.h"
+
+#include <klocale.h>
+
+#include <qlayout.h>
+#include <kcombobox.h>
+#include <kpushbutton.h>
+#include <kstdguiitem.h>
+
+#include "notifiersettings.h"
+#include "serviceconfigdialog.h"
+#include "actionlistboxitem.h"
+#include "mimetypelistboxitem.h"
+
+NotifierModule::NotifierModule(QWidget *parent, const char *name)
+ : KCModule(parent, name)
+{
+ QBoxLayout *layout = new QVBoxLayout( this, 0, KDialog::spacingHint() );
+
+ m_view = new NotifierModuleView( this );
+ layout->addWidget( m_view );
+
+ m_view->addButton->setGuiItem( KStdGuiItem::add() );
+ m_view->editButton->setGuiItem( KStdGuiItem::properties() );
+ m_view->deleteButton->setGuiItem( KStdGuiItem::del() );
+
+ m_view->mimetypesCombo->insertItem( i18n("All Mime Types") );
+
+ QStringList mimetypes = m_settings.supportedMimetypes();
+
+ QStringList::iterator it = mimetypes.begin();
+ QStringList::iterator end = mimetypes.end();
+
+ for ( ; it!=end; ++it )
+ {
+ new MimetypeListBoxItem( *it, m_view->mimetypesCombo->listBox() );
+ }
+
+ updateListBox();
+
+ connect( m_view->mimetypesCombo, SIGNAL( activated(int) ),
+ this, SLOT( slotMimeTypeChanged(int) ) );
+ connect( m_view->actionsList, SIGNAL( selectionChanged(QListBoxItem*) ),
+ this, SLOT( slotActionSelected(QListBoxItem*) ) );
+ connect( m_view->addButton, SIGNAL( clicked() ),
+ this, SLOT( slotAdd() ) );
+ connect( m_view->editButton, SIGNAL( clicked() ),
+ this, SLOT( slotEdit() ) );
+ connect( m_view->deleteButton, SIGNAL( clicked() ),
+ this, SLOT( slotDelete() ) );
+ connect( m_view->toggleAutoButton, SIGNAL( clicked() ),
+ this, SLOT( slotToggleAuto() ) );
+}
+
+NotifierModule::~NotifierModule()
+{
+}
+
+void NotifierModule::load()
+{
+ m_settings.reload();
+ slotMimeTypeChanged( m_view->mimetypesCombo->currentItem() );
+}
+
+void NotifierModule::save()
+{
+ m_settings.save();
+}
+
+void NotifierModule::defaults()
+{
+ m_settings.clearAutoActions();
+ slotMimeTypeChanged( m_view->mimetypesCombo->currentItem() );
+}
+
+void NotifierModule::updateListBox()
+{
+ m_view->actionsList->clear();
+ slotActionSelected( 0L );
+
+ QValueList<NotifierAction*> services;
+ if ( m_mimetype.isEmpty() )
+ {
+ services = m_settings.actions();
+ }
+ else
+ {
+ services = m_settings.actionsForMimetype( m_mimetype );
+ }
+
+ QValueList<NotifierAction*>::iterator it;
+
+ for ( it = services.begin(); it != services.end(); ++it )
+ {
+ new ActionListBoxItem( *it, m_mimetype, m_view->actionsList );
+ }
+}
+
+void NotifierModule::slotActionSelected(QListBoxItem *item)
+{
+ NotifierAction *action = 0L;
+
+ if ( item!=0L )
+ {
+ ActionListBoxItem *action_item
+ = static_cast<ActionListBoxItem*>(item);
+ action = action_item->action();
+ }
+
+ bool isWritable = action!=0L && action->isWritable();
+ m_view->deleteButton->setEnabled( isWritable );
+ m_view->editButton->setEnabled( isWritable );
+ m_view->addButton->setEnabled( TRUE );
+ m_view->toggleAutoButton->setEnabled( action!=0L && !m_mimetype.isEmpty() );
+}
+
+void NotifierModule::slotMimeTypeChanged(int index)
+{
+ if ( index == 0 )
+ {
+ m_mimetype = QString();
+ }
+ else
+ {
+ QListBoxItem *item = m_view->mimetypesCombo->listBox()->item( index );
+ MimetypeListBoxItem *mime_item
+ = static_cast<MimetypeListBoxItem*>( item );
+ m_mimetype = mime_item->mimetype();
+ }
+
+ updateListBox();
+}
+
+void NotifierModule::slotAdd()
+{
+ NotifierServiceAction *action = new NotifierServiceAction();
+ ServiceConfigDialog dialog(action, m_settings.supportedMimetypes(), this);
+
+ int value = dialog.exec();
+
+ if ( value == QDialog::Accepted )
+ {
+ m_settings.addAction( action );
+ updateListBox();
+ emit changed( true );
+ }
+ else
+ {
+ delete action;
+ }
+}
+
+void NotifierModule::slotEdit()
+{
+ ActionListBoxItem *action_item
+ = static_cast<ActionListBoxItem*>(m_view->actionsList->selectedItem());
+
+ NotifierServiceAction * action = dynamic_cast<NotifierServiceAction*>( action_item->action() );
+ if ( action )
+ {
+ ServiceConfigDialog dialog(action, m_settings.supportedMimetypes(), this);
+
+ int value = dialog.exec();
+
+ if ( value == QDialog::Accepted )
+ {
+ updateListBox();
+ emit changed( true );
+ }
+ }
+}
+
+void NotifierModule::slotDelete()
+{
+ ActionListBoxItem *action_item
+ = static_cast<ActionListBoxItem*>(m_view->actionsList->selectedItem());
+
+ NotifierServiceAction *action;
+ action = dynamic_cast<NotifierServiceAction*>( action_item->action() );
+ if ( action )
+ {
+ m_settings.deleteAction( action );
+ updateListBox();
+ emit changed( true );
+ }
+}
+
+void NotifierModule::slotToggleAuto()
+{
+ ActionListBoxItem *action_item
+ = static_cast<ActionListBoxItem*>( m_view->actionsList->selectedItem() );
+ NotifierAction *action = action_item->action();
+
+ int index = m_view->actionsList->index( action_item );
+
+ if ( action->autoMimetypes().contains( m_mimetype ) )
+ {
+ m_settings.resetAutoAction( m_mimetype );
+ }
+ else
+ {
+ m_settings.setAutoAction( m_mimetype, action );
+ }
+
+ updateListBox();
+ emit changed( true );
+
+ m_view->actionsList->setSelected( index, true );
+}
+
+#include "notifiermodule.moc"
diff --git a/kioslave/media/kcmodule/notifiermodule.h b/kioslave/media/kcmodule/notifiermodule.h
new file mode 100644
index 000000000..6c71df51f
--- /dev/null
+++ b/kioslave/media/kcmodule/notifiermodule.h
@@ -0,0 +1,57 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kvin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _NOTIFIERMODULE_H_
+#define _NOTIFIERMODULE_H_
+
+#include <kcmodule.h>
+
+#include "notifiersettings.h"
+#include "notifiermoduleview.h"
+
+class NotifierModule : public KCModule
+{
+ Q_OBJECT
+
+public:
+ NotifierModule( QWidget* parent = 0, const char* name = 0);
+ ~NotifierModule();
+
+ void load();
+ void save();
+ void defaults();
+
+private slots:
+ void slotAdd();
+ void slotDelete();
+ void slotEdit();
+ void slotToggleAuto();
+
+ void slotActionSelected( QListBoxItem * item );
+ void slotMimeTypeChanged( int index );
+
+private:
+ void updateListBox();
+
+ QString m_mimetype;
+ NotifierSettings m_settings;
+ NotifierModuleView *m_view;
+};
+
+#endif
diff --git a/kioslave/media/kcmodule/notifiermoduleview.ui b/kioslave/media/kcmodule/notifiermoduleview.ui
new file mode 100644
index 000000000..87edc0f36
--- /dev/null
+++ b/kioslave/media/kcmodule/notifiermoduleview.ui
@@ -0,0 +1,171 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>NotifierModuleView</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>NotifierModuleView</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>mediumType</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Medium types:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>mimetypesCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here is the list of the available types of medium which can be monitored. You can filter the available actions by selecting a type of medium. If you want to see all the actions, select "All Mime Types".</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>addButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to add an action.</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>deleteButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to delete the selected action if possible.</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>editButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to edit the selected action if possible.</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>toggleAutoButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Toggle as Auto Action</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to perform this action automatically on detection of the selected medium type (this option is disabled when "All Mime Types" is selected).</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>buttonSpacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>70</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListBox" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>actionsList</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here is the list of the available actions. You can modify them by using the buttons on your right.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+</includehints>
+</UI>
diff --git a/kioslave/media/kcmodule/serviceconfigdialog.cpp b/kioslave/media/kcmodule/serviceconfigdialog.cpp
new file mode 100644
index 000000000..1a127d12b
--- /dev/null
+++ b/kioslave/media/kcmodule/serviceconfigdialog.cpp
@@ -0,0 +1,151 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kévin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "serviceconfigdialog.h"
+
+#include <klocale.h>
+#include <klineedit.h>
+#include <kactionselector.h>
+#include <kicondialog.h>
+#include <qlistbox.h>
+#include <kservice.h>
+#include <kopenwith.h>
+#include <kpushbutton.h>
+#include <kiconloader.h>
+#include <qpixmap.h>
+#include <qiconset.h>
+
+
+#include "mimetypelistboxitem.h"
+
+ServiceConfigDialog::ServiceConfigDialog(NotifierServiceAction *action,
+ const QStringList &mimetypesList,
+ QWidget* parent, const char* name)
+ : KDialogBase(parent, name, true, i18n("Edit Service"), Ok|Cancel, Ok, true),
+ m_action(action)
+{
+ m_view = new ServiceView(this);
+
+ m_view->iconButton->setIcon( m_action->iconName() );
+ m_view->labelEdit->setText( m_action->label() );
+ m_view->commandEdit->setText( m_action->service().m_strExec );
+
+ QIconSet iconSet = SmallIconSet("configure");
+ QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal );
+ m_view->commandButton->setIconSet( iconSet );
+ m_view->commandButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 );
+
+ m_iconChanged = false;
+
+ QStringList all_mimetypes = mimetypesList;
+ QStringList action_mimetypes = action->mimetypes();
+
+ QStringList::iterator it = all_mimetypes.begin();
+ QStringList::iterator end = all_mimetypes.end();
+
+ for ( ; it!=end; ++it )
+ {
+ QListBox *list;
+
+ if ( action_mimetypes.contains( *it ) )
+ {
+ list = m_view->mimetypesSelector->selectedListBox();
+ }
+ else
+ {
+ list = m_view->mimetypesSelector->availableListBox();
+ }
+
+ new MimetypeListBoxItem( *it, list );
+ }
+
+ setMainWidget(m_view);
+ setCaption( m_action->label() );
+
+ connect( m_view->iconButton, SIGNAL( iconChanged(QString) ),
+ this, SLOT( slotIconChanged() ) );
+ connect( m_view->commandButton, SIGNAL( clicked() ),
+ this, SLOT( slotCommand() ) );
+}
+
+bool operator==( KDEDesktopMimeType::Service s1, KDEDesktopMimeType::Service s2 )
+{
+ return ( s1.m_strName==s2.m_strName )
+ && ( s1.m_strIcon==s2.m_strIcon )
+ && ( s1.m_strExec==s2.m_strExec );
+}
+
+bool operator!=( KDEDesktopMimeType::Service s1, KDEDesktopMimeType::Service s2 )
+{
+ return !( s1==s2 );
+}
+
+void ServiceConfigDialog::slotOk()
+{
+ KDEDesktopMimeType::Service service;
+ service.m_strName = m_view->labelEdit->text();
+ service.m_strIcon = m_view->iconButton->icon();
+ service.m_strExec = m_view->commandEdit->text();
+
+ QStringList mimetypes;
+
+ uint list_count = m_view->mimetypesSelector->selectedListBox()->count();
+ for( uint i=0; i < list_count; ++i )
+ {
+ QListBoxItem *item = m_view->mimetypesSelector->selectedListBox()->item(i);
+ MimetypeListBoxItem *mime_item = static_cast<MimetypeListBoxItem*>( item );
+ mimetypes.append( mime_item->mimetype() );
+ }
+
+ if ( service!=m_action->service() || mimetypes!=m_action->mimetypes() )
+ {
+ m_action->setService( service );
+ m_action->setMimetypes( mimetypes );
+ accept();
+ }
+ else
+ {
+ reject();
+ }
+}
+
+void ServiceConfigDialog::slotIconChanged()
+{
+ m_iconChanged = true;
+}
+
+void ServiceConfigDialog::slotCommand()
+{
+ KOpenWithDlg d(this);
+ int value = d.exec();
+ if ( value == QDialog::Accepted )
+ {
+ KService::Ptr service = d.service();
+ if ( service != 0L )
+ {
+ m_view->commandEdit->setText( service->exec() );
+ if ( m_iconChanged == false )
+ {
+ m_view->iconButton->setIcon( service->icon() );
+ }
+ }
+ }
+}
+
+#include "serviceconfigdialog.moc"
diff --git a/kioslave/media/kcmodule/serviceconfigdialog.h b/kioslave/media/kcmodule/serviceconfigdialog.h
new file mode 100644
index 000000000..090a978d4
--- /dev/null
+++ b/kioslave/media/kcmodule/serviceconfigdialog.h
@@ -0,0 +1,48 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
+ Copyright (c) 2005 Kvin Ottens <ervin ipsquad net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _SERVICECONFIGDIALOG_H_
+#define _SERVICECONFIGDIALOG_H_
+
+#include <kdialogbase.h>
+
+#include "notifierserviceaction.h"
+#include "serviceview.h"
+
+class ServiceConfigDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ ServiceConfigDialog(NotifierServiceAction *action,
+ const QStringList &mimetypesList,
+ QWidget* parent = 0, const char* name = 0);
+
+public slots:
+ void slotOk();
+ void slotIconChanged();
+ void slotCommand();
+
+private:
+ ServiceView *m_view;
+ NotifierServiceAction *m_action;
+ bool m_iconChanged;
+};
+
+#endif
diff --git a/kioslave/media/kcmodule/serviceview.ui b/kioslave/media/kcmodule/serviceview.ui
new file mode 100644
index 000000000..938a9bf89
--- /dev/null
+++ b/kioslave/media/kcmodule/serviceview.ui
@@ -0,0 +1,248 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ServiceView</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ServiceView</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>664</width>
+ <height>503</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>640</width>
+ <height>480</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Edit Service</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Edit Service</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIconButton">
+ <property name="name">
+ <cstring>iconButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>40</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="iconSize">
+ <number>32</number>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>labelEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="KActionSelector">
+ <property name="name">
+ <cstring>mimetypesSelector</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="availableLabel">
+ <string>Available &amp;medium types:</string>
+ </property>
+ <property name="selectedLabel">
+ <string>Displa&amp;y service for:</string>
+ </property>
+ <property name="showUpDownButtons">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KActiveLabel">
+ <property name="name">
+ <cstring>m_lbCommmand</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Command:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>commandEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>commandButton</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kicondialog.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kactionselector.h</includehint>
+ <includehint>kactivelabel.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>