Commit b3130493 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Initial import from the monolithic kde-runtime.

This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:

http://community.kde.org/Frameworks/GitOldHistory

If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.

Branched from the monolithic repo kde-runtime, frameworks  branch, at commit
85b1a18736650e28d8addd441f83083987298233
parent 67ff8fa6
/* config-runtime.h. Generated by cmake from config-runtime.h.cmake */
/* media HAL backend compilation */
#undef COMPILE_HALBACKEND
/* Define if you have long long as datatype */
#cmakedefine HAVE_LONG_LONG 1
/* Define to 1 if you have the `nice' function. */
#cmakedefine HAVE_NICE 1
/* Define to 1 if you have the `sigaction' function. */
#cmakedefine HAVE_SIGACTION 1
/* Define to 1 if you have the `sigset' function. */
#cmakedefine HAVE_SIGSET 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#cmakedefine HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Number of bits in a file offset, on hosts where this is settable. */
#define _FILE_OFFSET_BITS 64
/*
* On HP-UX, the declaration of vsnprintf() is needed every time !
*/
/* type to use in place of socklen_t if not defined */
#define kde_socklen_t socklen_t
add_subdirectory( componentservices )
add_subdirectory( windowmanagers )
########### next target ###############
set(kcm_componentchooser_SRCS
componentchooser.cpp
componentchooserbrowser.cpp
componentchooserfilemanager.cpp
componentchooseremail.cpp
kcm_componentchooser.cpp
)
if(NOT WIN32)
set(kcm_componentchooser_SRCS ${kcm_componentchooser_SRCS}
componentchooserterminal.cpp ktimerdialog.cpp)
endif()
if(Q_WS_X11)
set(kcm_componentchooser_SRCS ${kcm_componentchooser_SRCS}
componentchooserwm.cpp )
endif()
qt5_wrap_ui(kcm_componentchooser_SRCS
browserconfig_ui.ui
filemanagerconfig_ui.ui
emailclientconfig_ui.ui
componentchooser_ui.ui
componentconfig_ui.ui
)
if(NOT WIN32)
qt5_wrap_ui(kcm_componentchooser_SRCS terminalemulatorconfig_ui.ui wmconfig_ui.ui)
endif()
add_library(kcm_componentchooser MODULE ${kcm_componentchooser_SRCS})
target_link_libraries(kcm_componentchooser
KF5::KDE4Support
)
install(TARGETS kcm_componentchooser DESTINATION ${PLUGIN_INSTALL_DIR} )
########### install files ###############
install( FILES componentchooser.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
Name=A nice name you have chosen for your interface
Name[af]='n oulike naam jy het gekies vir jou koppelvlak
Name[ar]=اسم جميل تختاره لواجهتك
Name[ast]=Un prestosu nome qu'escueyas pa la interface
Name[be]=Файная назва, якую вы выбралі для свайго інтэрфейса
Name[be@latin]=Nazva, vybranaja dla tvajho interfejsu
Name[bg]=Име на компонент
Name[bn]=আপনার ইন্টারফেসের জন্য আপনার পছন্দ করা সুন্দর একটা নাম
Name[bn_IN]=ইন্টারফেসের জন্য একটি ভাল নাম নির্ধারিত হয়েছে
Name[bs]=Lijepo ime koje ste izabrali za svoje sučelje
Name[ca]=Un bonic nom que heu triat per a la interfície
Name[ca@valencia]=Un bonic nom que heu triat per a la interfície
Name[cs]=Hezký název pro vaše rozhraní
Name[csb]=Miłé miono, jaczé òstało wëbróné dlô programë
Name[cy]=Enw neis yr ydych wedi dewis am eich rhyngwyneb
Name[da]=Et godt navn som du har valgt for din grænseflade
Name[de]=Der von Ihnen gewählte Name für die Schnittstelle
Name[el]=Ένα όμορφο όνομα που έχετε επιλέξει για τη διασύνδεσή σας
Name[en_GB]=A nice name you have chosen for your interface
Name[eo]=Plaĉa nomo, kiun vi elektis por via interfaco
Name[es]=Un bonito nombre de su elección para su interfaz
Name[et]=Mõni kena nimi, mille sa oma liidesele valinud oled
Name[eu]=Zure interfazerako aukeratu duzun izen polit bat
Name[fa]=لقبی که برای واسط خود انتخاب کرده‌اید
Name[fi]=Valitsemasi nimi rajapinnalle
Name[fr]=Un joli nom que vous avez choisi pour votre interface
Name[fy]=In namme dy jo koazen ha foar jo ynterface
Name[ga]=Ainm deas a chuir tú ar do chomhéadan
Name[gl]=Un bon nome que escolleu para a súa interface
Name[gu]=તમારા ઇન્ટરફેસ માટે તમે પસંદ કરેલ સરસ નામ
Name[he]=שם נחמד שבחרת לממשק שלך
Name[hi]=आपने अपने इंटरफेस के लिए एक अच्छा नाम चुना है
Name[hne]=आप मन अपन इंटरफेस बर एक अच्छा नाम चुने हव
Name[hr]=Naziv koji ste odabrali za vaše sučelje
Name[hsb]=Rjane mjeno sće wubrali za Waš interfejs
Name[hu]=Egy Ön által választott név a felülethez
Name[ia]=Un nomine gratiose que tu ha seligite pro tu interfacie
Name[id]=Anda telah memilih sebuah nama yang bagus untuk antarmuka anda
Name[is]=Vingjarnlegt nafn þú hefur valið fyrir umhverfið þitt
Name[it]=Un bel nome per la tua interfaccia
Name[ja]=あなたのインターフェースに素敵な名前を付けてください
Name[ka]=მშვენიერი სახელია ინტერფეისისთვის
Name[kk]=Интерфейсіңізге таңдаған атауыңыз
Name[km]=ឈ្មោះ​ដ៏​ល្អ​មួយ​ដែល​អ្នក​បាន​ជ្រើស​សម្រាប់​ចំណុច​ប្រទាក់​របស់​អ្នក
Name[kn]=ನಿನ್ನ ಸಂಪರ್ಕತಟ (ಇಂಟರ್ಫೇಸ್) ಗೆ ನೀನು ಆರಿಸಿರುವ ಒಂದು ಒಳ್ಳೆಯ ಹೆಸರು
Name[ko]=인터페이스에 지정할 이름
Name[ku]=te ji bo navrûyê navelî xweş hilbijart
Name[lt]=Gražus vardas, kurį Jūs pasirinkote savo sąsajai
Name[lv]=Jauks nosaukums, ko jūs izvēlējāties savai saskarnei
Name[mai]=अहाँ अपन इंटरफेस क' लेल एकटा नीक नाम चुननै छी
Name[mk]=Убаво име што сте го избрале за вашиот интерфејс
Name[ml]=നിങ്ങളുടെ വിനിമയതലത്തിനു് നിങ്ങള്‍ തെരഞ്ഞെടുത്ത മനോഹരമായൊരു പേരു്
Name[mr]=तुम्ही संवादपट करिता एक चांगले नाव निवडले आहे
Name[ms]=Nama yang anda pilih untuk antara muka anda
Name[nb]=Et fint navn som du har valgt for grensesnittet
Name[nds]=Dor hest Du Di'n smucken Naam för Dien Koppelsteed utsöcht
Name[ne]=तपाईँले इन्टरफेसका लागि रोजेको नाम राम्रो छ
Name[nl]=Een naam die u hebt gekozen voor uw interface
Name[nn]=Eit fint namn du har valt for grensesnittet
Name[or]=ଆପଣ ଆପଣଙ୍କର ଅନ୍ତରାପୃଷ୍ଠ ପାଇଁ ପସନ୍ଦ କରିଥିବା ଗୋଟିଏ ସୁନ୍ଦର ନାମ
Name[pa]=ਆਪਣੇ ਇੰਟਰਫੇਸ ਲਈ ਇੱਕ ਸੋਹਣਾ ਨਾਂ ਚੁਣੋ
Name[pl]=Zgrabna nazwa, którą wybrano dla interfejsu
Name[pt]=Um nome bonito que escolheu para a sua interface
Name[pt_BR]=Um bom nome que você escolheu para a sua interface
Name[ro]=Un nume drăguț ales de dumneavoastră pentru interfață
Name[ru]=Имя, которое вы выбрали для своего интерфейса
Name[se]=Du lavtta čáppa namma
Name[si]=ඔබේ අතුරුමුහුණතෙහි භාවිත වන නාමය.
Name[sk]=Pekný názov pre vaše rozhranie
Name[sl]=Lepo ime, ki ste ga izbrali za svoj vmesnik
Name[sr]=Лепо име које сте изабрали за своје сучеље
Name[sr@ijekavian]=Лијепо име које сте изабрали за своје сучеље
Name[sr@ijekavianlatin]=Lijepo ime koje ste izabrali za svoje sučelje
Name[sr@latin]=Lepo ime koje ste izabrali za svoje sučelje
Name[sv]=Ett bra namn som du har valt för gränssnittet
Name[ta]=உங்கள் இடைமுகத்துக்கு நல்ல பெயரை தேர்ந்தெடுத்துள்ளீர்கள்
Name[te]=మీ ఇంటర్‌ఫేస్ కొరకు ఒక మంచిపేరును మీరు ఎంచుకొనినారు
Name[tg]=Номи аҷоибе, ки шумо барои интерфейси худ интихоб кардед
Name[th]=ชื่อดี ๆ ที่คุณเลือกสำหรับระบบติดต่อผู้ใช้ของคุณ
Name[tr]=Arayüzünüz için seçtiğiniz güzel isim
Name[ug]=ئارايۈزگە ئاتتىن بىرنى تاللاڭ
Name[uk]=Гарна назва, вибрана вами для вашого інтерфейсу
Name[uz]=Interfeysingiz uchun chiroyli nom
Name[uz@cyrillic]=Интерфейсингиз учун чиройли ном
Name[vi]=Một cái tên đẹp bạn đã chọn cho giao diện của mình
Name[wa]=On clapant no ki vos avoz tchoezi po voste eterface
Name[xh]=Igama elihle olikhetileyo kujongano lwakho
Name[x-test]=xxA nice name you have chosen for your interfacexx
Name[zh_CN]=您为界面选择的好名字
Name[zh_TW]=您為您的界面選擇的好名字
Comment=A helpful description of the interface for the top right info box
Comment[af]='n hulpvaardig beskrywing van die koppelvlak vir die bo regterkant inligting boks
Comment[ar]=وصف مفيد للواجهة ليُستخدم في صندوق المعلومات في الزاوية العلوية اليمنى
Comment[ast]=Una descripción útil de la interface pal cuadru d'información superior derechu
Comment[be]=Карыснае апісанне інтэрфейсу для інфармацыйнай скрыні ў правым верхнім куце
Comment[be@latin]=Apisańnie dla vierchniaha pravaha pola źviestak
Comment[bg]=Описание на компонент
Comment[bn]=ইন্টারফেসটির সহজবোধ্য বর্ণনা, উপরে ডানদিকের ইনফো বক্স-এর জন্য
Comment[bn_IN]=উপরে ডিনদিকে অবস্থিত পরিচিত নির্দেশকারী বক্সে প্রদর্শনের উদ্দেশ্যে এই ইন্টারফেসের একটি সহায়ক বর্ণনা।
Comment[bs]=Opis sučelja za gornje desno informativno polje
Comment[ca]=Una descripció útil de la interfície per al rètol informatiu superior dret
Comment[ca@valencia]=Una descripció útil de la interfície per al rètol informatiu superior dret
Comment[cs]=Smysluplný popis vašeho rozhraní pro informační box
Comment[csb]=Pòmòcny òpisënk programë (dlô wëdowiédzë w oczénkù w prawim, górnym rogù)
Comment[cy]=Disgrifiad cymorthwyol o'r rhyngwyneb i'r blwch gwybodaeth top de
Comment[da]=En nyttig beskrivelse af grænsefladen for infofeltet øverst til højre
Comment[de]=Hilfreiche Beschreibung der Schnittstelle für das Infofeld rechts oben
Comment[el]=Μια χρήσιμη περιγραφή της διασύνδεσης για το πάνω δεξιά πλαίσιο πληροφοριών
Comment[en_GB]=A helpful description of the interface for the top right info box
Comment[eo]=Helpema priskribo de la interfaco por la supre-dekstra informkesto
Comment[es]=Una descripción útil de la interfaz para el cuadro de información superior derecho
Comment[et]=Abiks kirjeldus
Comment[eu]=Interfazearen deskribapen lagungarria, goian eskuinean azalduko den informazio-koadrorako
Comment[fa]=یک توصیف مفید واسط برای سمت راست بالای جعبه اطلاعات
Comment[fi]=Tässä pitäisi olla pieni kuvaus rajapinnasta oikean yläkulman laatikkoon
Comment[fr]=Une description utile de l'interface pour la boîte d'informations en haut à droite
Comment[fy]=In helpzame omskriuwing fan de ynterface, Wat bedoelt is foar it ynformaasjefak rjochtboppe
Comment[ga]=Cur síos cabhrach ar chomhéadan an bhosca faisnéise ag an mbarr ar dheis
Comment[gl]=Unha descrición da interface para o botón de información de riba á dereita
Comment[gu]=જમણી બાજુનાં માહિતી ખાનાં માટે ઇન્ટરફેસનું મદદરૂપ વર્ણન
Comment[he]=תיאור שימושי של הממשק בשביל תיבת המידע המוצגת מצד שמאל למעלה
Comment[hi]=ऊपरी दाएँ कोने के जानकारी बाक्स के इंटरफेस का उपयोगी वर्णन.
Comment[hne]=ऊपर के जेवनी कोना के जानकारी डब्बा के इंटरफेस के उपयोगी वर्नन.
Comment[hr]=Koristan opis sučelja u info-okviru gore desno
Comment[hsb]=Spomožne wopisanje interfejsa za informaciski kašćik horjeka naprawo.
Comment[hu]=A felület leírása a jobb felső sarokban található tájékoztató ablakhoz
Comment[ia]=Un description utile del interface pro le cassa de info in alto a dextera
Comment[id]=Deskripsi yang berguna tentang antarmuka untuk kotak info di kanan atas
Comment[is]=Jamm, hér ætti að vera smá lýsing á viðbótinni
Comment[it]=Un'utile descrizione dell'interfaccia per la casella delle informazioni
Comment[ja]=右上の情報ボックスのためのインターフェースに関する説明
Comment[kk]=Жоғары оң жақтағы мәлімет терезесі үшін интерфейстің сипаттамасы
Comment[km]=សេចក្ដី​ពិពណ៌នា​ដ៏​មាន​ប្រយោជន៍​របស់​ចំណុច​ប្រទាក់​សម្រាប់​ប្រអប់​ព័ត៌មាន​ខាង​ស្ដាំ​កំពូល
Comment[kn]=ಮೇಲ್ಬಲಭಾಗದ ಮಾಹಿತಿ ಚೌಕದ ಸಂಪರ್ಕತಟದ (ಇಂಟರ್ಫೇಸ್) ಬಗೆಗಿನ ಒಂದು ಉಪಯುಕ್ತ ವಿವರಣೆ
Comment[ko]=오른쪽 위 정보 상자의 인터페이스에 대한 설명
Comment[ku]=Ravekirineke alîker ji bo agahiya qutîka jor-rastê a navrûyê
Comment[lt]=Naudingas sąsajos aprašymas, skirtas viršutinei dešinei informacijos langelio daliai
Comment[lv]=Noderīgs saskarnes apraksts augšējai labajai informācijas rūtij
Comment[mai]=ऊपरका दहिन्ना कोना केर सूचना बाक्स केर इंटरफेस क' उपयोगी वर्णन.
Comment[mk]=Опис со објаснување за интерфејсот за горното десно поле за инфо.
Comment[ml]=വലത്തു് മുകളിലായുള്ള വിവരം നല്‍കുന്ന കളത്തില്‍ കാണിയ്ക്കാനായി നിങ്ങളുടെ വിനിമയതലത്തിനുള്ള സഹായകരമായ ഒരു വിവരണം.
Comment[mr]=वरील उजव्या कोपऱ्या वरील माहिती बॉक्स संवादपट करिता उपयोगी वर्णन
Comment[ms]=Huraian antara muka yang sangat membantu untuk kotak maklumat kanan atas
Comment[nb]=Beskrivelse av grensesnittet for infoboksen øverst til høyre
Comment[nds]=En hölpsche Beschrieven vun de Koppelsteed för den Info-Kasten rechterhand baven
Comment[ne]=माथिको दायाँ सूचना बाकसका लागि इन्टरफेसको उपयोगी वर्णन
Comment[nl]=Een behulpzame omschrijving van de interface, bedoelt voor het informatievak rechts boven
Comment[nn]=Ei hjelpsam skildring av grensesnittet for infoboksen oppe til høgre
Comment[or]=ଡ଼ାହାଣ ପାଖ ଉପର ଅଂଶ ସୂଚନା ବାକ୍ସ ପାଇଁ ଅନ୍ତରାପୃଷ୍ଠର ଗୋଟିଏ ସହାୟକ ବର୍ଣ୍ଣନା
Comment[pa]=ਸੱਜੇ ਜਾਣਕਾਰੀ ਬਕਸੇ ਲਈ ਇੰਟਰਫੇਸ ਲ਼ਈ ਮੱਦਦ ਵੇਰਵਾ
Comment[pl]=Pomocny opis programu (dla informacji w okienku w prawym, górnym rogu)
Comment[pt]=Uma descrição útil da interface para a zona de informação do canto superior direito
Comment[pt_BR]=Uma descrição útil da interface para a caixa de informação superior direita
Comment[ro]=Aici trebuie să fie descrierea interfeței pentru căsuța din dreapta-sus
Comment[ru]=Полезное описание интерфейса в верхнем правом информационном окне
Comment[se]=Laktaválddahus maid infoboksa badjin olgešbealde geavaha.
Comment[si]=ඉහළ දකුණු තොරතුරු කොටුවේ ප්‍රයෝජනවත් විස්තර
Comment[sk]=Pomocný popis rozhrania pre informačný box v pravom hornom rohu
Comment[sl]=Primeren opis vmesnika za gornjo desno okno z podrobnostmi
Comment[sr]=Опис сучеља за горње десно информативно поље
Comment[sr@ijekavian]=Опис сучеља за горње десно информативно поље
Comment[sr@ijekavianlatin]=Opis sučelja za gornje desno informativno polje
Comment[sr@latin]=Opis sučelja za gornje desno informativno polje
Comment[sv]=Hjälpsam beskrivning av gränssnittet för informationsrutan uppe till höger
Comment[ta]=மேல் வலது தகவல் பெட்டிக்கான பயனுள்ள விவர இடைமுகம்
Comment[te]=పైన కుడప్రక్కనగల సమాచార పెట్టె ఇంటర్‌పేస్ యొక్క సహాయకర వివరణ
Comment[tg]=Тафсилоти кӯмаккунандаи интерфейс барои варақаи маълумот дар боло аз тарафи рост
Comment[th]=คำอธิบายเกี่ยวกับรูปแบบส่วนติดต่อสำหรับกล่องข้อมูลด้านขวาบน
Comment[tr]=Sağ üst bilgi kutucuğu için arayüzün açıklayıcı tanımı
Comment[ug]=ئوڭ ئۈستى ئۇچۇر قۇتىسىدا كۆرۈنىدىغان ئارايۈز ياردەم چۈشەندۈرۈشى
Comment[uk]=Допоміжний опис інтерфейсу для віконця інформації вгорі праворуч
Comment[vi]=Một mô tả giao diện có ích cho hộp thông tin ở trên cùng bên phải
Comment[wa]=Èn ahessåve discrijhaedje di l' eterface, pol boesse d' infôrmåcion del coine å dzeu a droete
Comment[xh]=Uchazo oluluncedo lojongano olungaphezulu ekunene kwebhokisi yolwazi
Comment[x-test]=xxA helpful description of the interface for the top right info boxxx
Comment[zh_CN]=右上方信息框中显示的界面描述
Comment[zh_TW]=用於右上方資訊方塊界面的有用敘述
configurationType=Possible values are component and application. Only component is handled at the moment though
ServiceTypeToConfigure=The service type, which should be configured. If this line is empty you have to provide a plugin (not supported yet)
defaultImplementation=The name of the default implementation as it would be returned by KService::desktopEntryName()
storeInFile=default_components //the file where the setting should be saved (default_components sounds reasonable for a central storage)
valueSection=The desktop section, where the setting should be stored
valueName=the name of the value entry
#! /usr/bin/env bash
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp -o $podir/kcmcomponentchooser.pot
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BrowserConfig_UI</class>
<widget class="QWidget" name="BrowserConfig_UI">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;qt&gt;Open &lt;b&gt;http&lt;/b&gt; and &lt;b&gt;https&lt;/b&gt; URLs&lt;/qt&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioKIO">
<property name="text">
<string>in an application based on the contents of the URL</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioExec">
<property name="text">
<string>in the following browser:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KLineEdit" name="lineExec">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnSelectBrowser">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">KDE/KLineEdit</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>radioExec</sender>
<signal>toggled(bool)</signal>
<receiver>lineExec</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>radioExec</sender>
<signal>toggled(bool)</signal>
<receiver>btnSelectBrowser</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/***************************************************************************
componentchooser.cpp - description
-------------------
copyright : (C) 2002 by Joseph Wenninger
email : jowenn@kde.org
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License verstion 2 as *
* published by the Free Software Foundation *
* *
***************************************************************************/
#include "componentchooser.h"
#include "componentchooser.moc"
#include "componentchooserbrowser.h"
#include "componentchooseremail.h"
#include "componentchooserfilemanager.h"
#ifdef Q_OS_UNIX
#include "componentchooserterminal.h"
#endif
#ifdef Q_WS_X11
#include "componentchooserwm.h"
#endif
#include <QCheckBox>
#include <klocale.h>
#include <kmessagebox.h>
#include <kconfig.h>
#include <kstandarddirs.h>
#include <kmimetypetrader.h>
#include <kurlrequester.h>
#include <ktoolinvocation.h>
#include <kconfiggroup.h>
#include <KServiceTypeTrader>
#include <KGlobal>
#include <KIcon>
#include <KLocalizedString>
//BEGIN General kpart based Component selection
CfgComponent::CfgComponent(QWidget *parent)
: QWidget(parent), Ui::ComponentConfig_UI(), CfgPlugin()
{
setupUi( this );
connect(ComponentSelector,SIGNAL(activated(const QString&)),this,SLOT(slotComponentChanged(const QString&)));
}
CfgComponent::~CfgComponent()
{
}
void CfgComponent::slotComponentChanged(const QString&) {
emit changed(true);
}
void CfgComponent::save(KConfig *cfg) {
// yes, this can happen if there are NO KTrader offers for this component
if (!m_lookupDict.contains(ComponentSelector->currentText()))
return;
KConfigGroup mainGroup = cfg->group(QByteArray());
QString serviceTypeToConfigure=mainGroup.readEntry("ServiceTypeToConfigure");
KConfig store(mainGroup.readPathEntry("storeInFile", "null"));
KConfigGroup cg(&store, mainGroup.readEntry("valueSection"));
cg.writePathEntry(mainGroup.readEntry("valueName", "kcm_componenchooser_null"),
m_lookupDict.value(ComponentSelector->currentText()));
store.sync();
emit changed(false);
}
void CfgComponent::load(KConfig *cfg) {
ComponentSelector->clear();
m_lookupDict.clear();
m_revLookupDict.clear();
const KConfigGroup mainGroup = cfg->group(QByteArray());
const QString serviceTypeToConfigure = mainGroup.readEntry("ServiceTypeToConfigure");
const KService::List offers = KServiceTypeTrader::self()->query(serviceTypeToConfigure);
for (KService::List::const_iterator tit = offers.begin(); tit != offers.end(); ++tit) {
ComponentSelector->addItem((*tit)->name());
m_lookupDict.insert((*tit)->name(), (*tit)->desktopEntryName());
m_revLookupDict.insert((*tit)->desktopEntryName(), (*tit)->name());
}
KConfig store(mainGroup.readPathEntry("storeInFile","null"));
const KConfigGroup group(&store, mainGroup.readEntry("valueSection"));
QString setting = group.readEntry(mainGroup.readEntry("valueName","kcm_componenchooser_null"), QString());
if (setting.isEmpty())
setting = mainGroup.readEntry("defaultImplementation", QString());
QString tmp = m_revLookupDict.value(setting);
if (!tmp.isEmpty()) {
for (int i=0;i<ComponentSelector->count();i++)
if (tmp==ComponentSelector->itemText(i))
{
ComponentSelector->setCurrentIndex(i);
break;
}
}
emit changed(false);
}
void CfgComponent::defaults()
{
//todo
}
//END General kpart based Component selection
ComponentChooser::ComponentChooser(QWidget *parent):
QWidget(parent), Ui::ComponentChooser_UI(), somethingChanged(false), configWidget(0)
{
setupUi(this);
static_cast<QGridLayout*>(layout())->setRowStretch(1, 1);
const QStringList services=KGlobal::dirs()->findAllResources( "data","kcm_componentchooser/*.desktop",
KStandardDirs::NoDuplicates);
for (QStringList::const_iterator it=services.constBegin(); it!=services.constEnd(); ++it)
{
KConfig cfg(*it, KConfig::SimpleConfig);
KConfigGroup cg = cfg.group(QByteArray());
QListWidgetItem *item = new QListWidgetItem(
KIcon(cg.readEntry("Icon",QString("preferences-desktop-default-applications"))),
cg.readEntry("Name",i18n("Unknown")));
item->setData(Qt::UserRole, (*it));
ServiceChooser->addItem(item);
}
ServiceChooser->setFixedWidth(ServiceChooser->sizeHintForColumn(0) + 20);
ServiceChooser->sortItems();
connect(ServiceChooser,SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),this,SLOT(slotServiceSelected(QListWidgetItem*)));
ServiceChooser->setCurrentRow(0);
slotServiceSelected(ServiceChooser->item(0));
}