From 8acb68ed2835410af934459073048339c7b262a0 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 17 Jan 2009 18:42:06 +0000 Subject: Relayout of the settings dialog, so that all Dolphin KPart relevant settings can be made available in Konqueror's settings dialog too. Further cleanups and layout fixes are required and will be done during the next week. svn path=/trunk/KDE/kdebase/apps/; revision=912587 --- src/CMakeLists.txt | 28 ++-- src/dolphinmainwindow.cpp | 3 +- src/kcmdolphin.cpp | 112 --------------- src/kcmdolphin.desktop | 237 ------------------------------- src/kcmdolphin.h | 48 ------- src/kcmdolphinviewmodes.cpp | 105 ++++++++++++++ src/kcmdolphinviewmodes.desktop | 237 +++++++++++++++++++++++++++++++ src/kcmdolphinviewmodes.h | 48 +++++++ src/settings/behaviorsettingspage.cpp | 162 +++++++++++++++++++++ src/settings/behaviorsettingspage.h | 64 +++++++++ src/settings/contextmenusettingspage.cpp | 88 ++++++++++++ src/settings/contextmenusettingspage.h | 51 +++++++ src/settings/dolphinsettingsdialog.cpp | 31 +++- src/settings/dolphinsettingsdialog.h | 7 +- src/settings/generalsettingspage.cpp | 162 ++++++--------------- src/settings/generalsettingspage.h | 31 ++-- src/settings/generalviewsettingspage.cpp | 201 -------------------------- src/settings/generalviewsettingspage.h | 73 ---------- src/settings/navigationsettingspage.cpp | 112 +++++++++++++++ src/settings/navigationsettingspage.h | 54 +++++++ src/settings/previewssettingspage.cpp | 138 ++++++++++++++++++ src/settings/previewssettingspage.h | 62 ++++++++ src/settings/servicessettingspage.cpp | 55 +++++++ src/settings/servicessettingspage.h | 50 +++++++ src/settings/startupsettingspage.cpp | 7 +- src/settings/startupsettingspage.h | 6 +- src/settings/statusbarsettingspage.cpp | 81 +++++++++++ src/settings/statusbarsettingspage.h | 51 +++++++ src/settings/viewsettingspage.cpp | 24 +--- src/settings/viewsettingspage.h | 5 +- 30 files changed, 1472 insertions(+), 861 deletions(-) delete mode 100644 src/kcmdolphin.cpp delete mode 100644 src/kcmdolphin.desktop delete mode 100644 src/kcmdolphin.h create mode 100644 src/kcmdolphinviewmodes.cpp create mode 100644 src/kcmdolphinviewmodes.desktop create mode 100644 src/kcmdolphinviewmodes.h create mode 100644 src/settings/behaviorsettingspage.cpp create mode 100644 src/settings/behaviorsettingspage.h create mode 100644 src/settings/contextmenusettingspage.cpp create mode 100644 src/settings/contextmenusettingspage.h delete mode 100644 src/settings/generalviewsettingspage.cpp delete mode 100644 src/settings/generalviewsettingspage.h create mode 100644 src/settings/navigationsettingspage.cpp create mode 100644 src/settings/navigationsettingspage.h create mode 100644 src/settings/previewssettingspage.cpp create mode 100644 src/settings/previewssettingspage.h create mode 100644 src/settings/servicessettingspage.cpp create mode 100644 src/settings/servicessettingspage.h create mode 100644 src/settings/statusbarsettingspage.cpp create mode 100644 src/settings/statusbarsettingspage.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b6652fc82..b08ffe460 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -111,16 +111,21 @@ set(dolphin_SRCS panels/folders/treeviewcontextmenu.cpp panels/folders/folderspanel.cpp panels/folders/paneltreeview.cpp - settings/settingspagebase.cpp - settings/startupsettingspage.cpp + settings/behaviorsettingspage.cpp settings/columnviewsettingspage.cpp + settings/contextmenusettingspage.cpp settings/dolphinfontrequester.cpp settings/dolphinsettingsdialog.cpp settings/detailsviewsettingspage.cpp settings/generalsettingspage.cpp - settings/generalviewsettingspage.cpp settings/iconsizegroupbox.cpp settings/iconsviewsettingspage.cpp + settings/navigationsettingspage.cpp + settings/previewssettingspage.cpp + settings/servicessettingspage.cpp + settings/settingspagebase.cpp + settings/startupsettingspage.cpp + settings/statusbarsettingspage.cpp settings/viewsettingspage.cpp settings/viewsettingspagebase.cpp statusbarspaceinfo.cpp @@ -169,12 +174,11 @@ install(TARGETS dolphin ${INSTALL_TARGETS_DEFAULT_ARGS}) ########################################## -set(kcm_dolphin_PART_SRCS - kcmdolphin.cpp +set(kcm_dolphinviewmodes_PART_SRCS + kcmdolphinviewmodes.cpp settings/columnviewsettingspage.cpp settings/detailsviewsettingspage.cpp settings/dolphinfontrequester.cpp - settings/generalviewsettingspage.cpp settings/iconsizegroupbox.cpp settings/iconsviewsettingspage.cpp settings/viewsettingspagebase.cpp @@ -182,25 +186,25 @@ set(kcm_dolphin_PART_SRCS zoomlevelinfo.cpp ) -kde4_add_kcfg_files(kcm_dolphin_PART_SRCS +kde4_add_kcfg_files(kcm_dolphinviewmodes_PART_SRCS settings/dolphin_columnmodesettings.kcfgc settings/dolphin_directoryviewpropertysettings.kcfgc settings/dolphin_detailsmodesettings.kcfgc settings/dolphin_iconsmodesettings.kcfgc settings/dolphin_generalsettings.kcfgc) -kde4_add_plugin(kcm_dolphin ${kcm_dolphin_PART_SRCS}) +kde4_add_plugin(kcm_dolphinviewmodes ${kcm_dolphinviewmodes_PART_SRCS}) -target_link_libraries(kcm_dolphin ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} dolphinprivate) +target_link_libraries(kcm_dolphinviewmodes ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} dolphinprivate) if (Nepomuk_FOUND) - target_link_libraries(kcm_dolphin ${NEPOMUK_LIBRARIES}) + target_link_libraries(kcm_dolphinviewmodes ${NEPOMUK_LIBRARIES}) endif (Nepomuk_FOUND) -install(TARGETS kcm_dolphin DESTINATION ${PLUGIN_INSTALL_DIR} ) +install(TARGETS kcm_dolphinviewmodes DESTINATION ${PLUGIN_INSTALL_DIR} ) ########### install files ############### install( FILES dolphin.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) install( FILES settings/dolphin_directoryviewpropertysettings.kcfg settings/dolphin_generalsettings.kcfg settings/dolphin_columnmodesettings.kcfg settings/dolphin_iconsmodesettings.kcfg settings/dolphin_detailsmodesettings.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) install( FILES dolphinui.rc DESTINATION ${DATA_INSTALL_DIR}/dolphin ) -install( FILES kcmdolphin.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) +install( FILES kcmdolphinviewmodes.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 60f6e97b3..c0212a6f1 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -703,7 +703,8 @@ void DolphinMainWindow::toggleShowMenuBar() void DolphinMainWindow::editSettings() { if (m_settingsDialog == 0) { - m_settingsDialog = new DolphinSettingsDialog(this); + const KUrl& url = activeViewContainer()->url(); + m_settingsDialog = new DolphinSettingsDialog(url, this); m_settingsDialog->setAttribute(Qt::WA_DeleteOnClose); m_settingsDialog->show(); } else { diff --git a/src/kcmdolphin.cpp b/src/kcmdolphin.cpp deleted file mode 100644 index 21883e76a..000000000 --- a/src/kcmdolphin.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#include "kcmdolphin.h" - -#include "settings/columnviewsettingspage.h" -#include "settings/detailsviewsettingspage.h" -#include "settings/generalviewsettingspage.h" -#include "settings/iconsviewsettingspage.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -K_PLUGIN_FACTORY(KCMDolphinConfigFactory, registerPlugin("dolphin");) -K_EXPORT_PLUGIN(KCMDolphinConfigFactory("kcmdolphin")) - -DolphinConfigModule::DolphinConfigModule(QWidget* parent, const QVariantList& args) : - KCModule(KCMDolphinConfigFactory::componentData(), parent), - m_pages() -{ - Q_UNUSED(args); - - KGlobal::locale()->insertCatalog("dolphin"); - - setButtons(KCModule::Default | KCModule::Help); - - QVBoxLayout* topLayout = new QVBoxLayout(this); - topLayout->setMargin(0); - topLayout->setSpacing(KDialog::spacingHint()); - - KTabWidget* tabWidget = new KTabWidget(this); - - // initialize 'General' tab - GeneralViewSettingsPage* generalPage = new GeneralViewSettingsPage(QDir::homePath(), tabWidget); - tabWidget->addTab(generalPage, KIcon("view-choose"), i18nc("@title:tab General settings", "General")); - connect(generalPage, SIGNAL(changed()), this, SLOT(changed())); - - // initialize 'Icons' tab - IconsViewSettingsPage* iconsPage = new IconsViewSettingsPage(tabWidget); - tabWidget->addTab(iconsPage, KIcon("view-list-icons"), i18nc("@title:tab", "Icons")); - connect(iconsPage, SIGNAL(changed()), this, SLOT(changed())); - - // initialize 'Details' tab - DetailsViewSettingsPage* detailsPage = new DetailsViewSettingsPage(tabWidget); - tabWidget->addTab(detailsPage, KIcon("view-list-details"), i18nc("@title:tab", "Details")); - connect(detailsPage, SIGNAL(changed()), this, SLOT(changed())); - - // initialize 'Column' tab - ColumnViewSettingsPage* columnPage = new ColumnViewSettingsPage(tabWidget); - tabWidget->addTab(columnPage, KIcon("view-file-columns"), i18nc("@title:tab", "Column")); - connect(columnPage, SIGNAL(changed()), this, SLOT(changed())); - - m_pages.append(generalPage); - m_pages.append(iconsPage); - m_pages.append(detailsPage); - m_pages.append(columnPage); - - topLayout->addWidget(tabWidget, 0, 0); -} - -DolphinConfigModule::~DolphinConfigModule() -{ -} - -void DolphinConfigModule::save() -{ - foreach (ViewSettingsPageBase* page, m_pages) { - page->applySettings(); - } - reparseConfiguration(); -} - -void DolphinConfigModule::defaults() -{ - foreach (ViewSettingsPageBase* page, m_pages) { - page->restoreDefaults(); - } - reparseConfiguration(); -} - -void DolphinConfigModule::reparseConfiguration() -{ - QDBusMessage message = QDBusMessage::createSignal("/KonqMain", "org.kde.Konqueror.Main", "reparseConfiguration"); - QDBusConnection::sessionBus().send(message); -} - -#include "kcmdolphin.moc" diff --git a/src/kcmdolphin.desktop b/src/kcmdolphin.desktop deleted file mode 100644 index 46c0b2ff2..000000000 --- a/src/kcmdolphin.desktop +++ /dev/null @@ -1,237 +0,0 @@ -Name=Dolphin -Name[ar]=دولفين -Name[bn]=ডলফিন -Name[fy]=Dolfyn -Name[gu]=ડોલ્ફિન -Name[hi]=डॉल्फ़िन -Name[km]=ឌូហ្វីន -Name[kn]=ಡಾಲ್ಫಿನ್ -Name[mk]=Делфин -Name[ml]=ഡോള്‍ഫിന്‍ -Name[mr]=डॉल्फिन -Name[ne]=डल्फिन -Name[or]=ଡଲଫିନ -Name[pa]=ਡਾਲਫਿਨ -Name[sr]=Делфин -Name[ta]=டால்பின் -Name[te]=డాల్ఫిన్ -Name[x-test]=xxDolphinxx -Comment=This service allows configuration of the Dolphin views. -Comment[af]=Hierdie diens konfigureer die Dolphin aansigte -Comment[ar]=هذه الخدمة تتيح التحكم بعروض الدولفين -Comment[as]=এই সেৱাৰ দ্বাৰা Dolphin প্ৰদৰ্শন ব্যৱস্থা বিন্যাস কৰা যাব । -Comment[be@latin]=Hetaja słužba dazvalaje naładžvać vyhlad prahramy „Dolphin”. -Comment[bg]=Това ви позволява да настроите показването в Dolphin. -Comment[bn_IN]=এই পরিসেবা দ্বারা Dolphin প্রদর্শন ব্যবস্থা কনফিগার করা যাবে। -Comment[ca]=Aquest servei permet la configuració de les vistes del Dolphin. -Comment[cs]=Tato služba umožňuje nastavení pohledů Dolphinu. -Comment[csb]=Na ùsłëżnota pòzwôlô na kònfigùracëjã wëzdrzatków Dolphina, -Comment[da]=Denne tjeneste tillader indstilling af Dolphin-visningerne. -Comment[de]=Mit diesem Dienst können Dolphin-Ansichten eingerichtet werden. -Comment[el]=Αυτή η υπηρεσία επιτρέπει τη ρύθμιση των προβολών του Dolphin. -Comment[eo]=Ĉi tiu servo permesas agordon de la Dolphin rigardoj. -Comment[es]=Este servicio le permite configurar las vistas de Dolphin. -Comment[et]=See teenus võimaldab seadistada Dolphini vaateid. -Comment[eu]=Zerbitzu honen bitartez Dolphin ikuspegiak konfigura ditzakezu. -Comment[fi]=Tämä palvelu sallii Dolphinin näkymien muokkauksen. -Comment[fr]=Ce service permet de configurer les vues de Dolphin -Comment[fy]=De tsjinst stiet it ynstellen fan de Dolfynwerjefte ta. -Comment[ga]=Leis an tseirbhís seo is féidir na hamhairc Dolphin a chumrú. -Comment[gl]=Este servizo permite configurar as vistas de Dolphin. -Comment[gu]=આ સેવા ડોલ્ફિન દેખાવોનું રૂપરેખાંકન કરવા દેશે. -Comment[he]=שירות זה מאפשר תצורה של תצוגות עבור Dolphin -Comment[hi]=यह सेवा आपको डॉल्फ़िन दृश्य को कॉन्फ़िगर करने देता है. -Comment[hsb]=Tutón serwis dowoli konfiguraciju napohladow Dolphina. -Comment[hu]=Ez a szolgáltatás a Dolphin nézeteinek beállítását teszi lehetővé. -Comment[is]=Þessi þjónusta leyfir stillingar á sýnum Dolphin. -Comment[it]=Questo servizio permette di configurare le viste di Dolphin. -Comment[ja]=このサービスで Dolphin のビューを設定できます。 -Comment[kk]=Бұл Dolphin көрінісін баптауға мүмкіндік беретін қызмет. -Comment[km]=សេវា​នេះ​អនុញ្ញាត​ឲ្យ​កំណត់​រចនាសម្ព័ន្ធ​ទិដ្ឋភាព​ Dolphin ។ -Comment[kn]=ಈ ಸೇವೆಯು ಡಾಲ್ಫಿನ್ ನೋಟಗಳ ಸಂರಚನೆಗೆ ಅನುವುಮಾಡಿಕೊಡುತ್ತದೆ. -Comment[ko]=이 서비스는 Dolphin의 보기를 설정합니다. -Comment[ku]=Ev servîs destûrê dide veavakirina xuyakirina Dolphinê. -Comment[lt]=Ši tarnyba leidžia konfigūruoti Dolphin peržiūros profilius. -Comment[lv]=Šis serviss atļauj konfigurēt Dolphin skatus. -Comment[mk]=Овој сервис овозможува конфигурација на прегледите на Делфин. -Comment[ml]=ഡോള്‍ഫിന്‍ അവതരണരീതി ക്രമീകരിയ്ക്കാന്‍ ഈ സേവനം അനുവദിയ്ക്കുന്നു. -Comment[mr]=ही सेवा तुम्हाला डॉल्फिन दृश्यचे संयोजन करण्यास मदत करते. -Comment[nb]=Denne tjenesten tillater konfigurasjon av Dolphin visninger -Comment[nds]=Mit dissen Deenst laat sik de Dolphin-Ansichten instellen. -Comment[nl]=Met deze dienst kunt u Dolphin-weergaven instellen. -Comment[nn]=Denne tenesta let seg setja opp Dolphin-visingar. -Comment[or]=ଏହି ସର୍ଭିସ ଡଲଫିନ ଦୃଶ୍ୟଗୁଡ଼ିକର ସଂରଚନାକୁ ଅନୁମତି ଦେଇଥାଏ। -Comment[pa]=ਇਹ ਸਰਵਿਸ ਡਾਲਫਿਨ ਝਲਕ ਦੀ ਸੰਰਚਨਾ ਵਾਸਤੇ ਹੈ। -Comment[pl]=Ta usługa umożliwia konfigurację widoków Dolphina. -Comment[pt]=Este serviço permite-lhe configurar as vistas do Dolphin. -Comment[pt_BR]=Este serviço permite configurar as visualizações do Dolphin. -Comment[ro]=Acest serviciu permite configurarea vizualizărilor Dolphin. -Comment[ru]=Эта служба позволяет настраивать виды Dolphin -Comment[sk]=Táto služba umožňuje konfiguráciu pohľadov v Dolphine. -Comment[sl]=Ta storitev omogoča nastavitev Dolphinovih prikazov. -Comment[sr]=Овај сервис омогућава подешавање Делфинових приказа. -Comment[sr@latin]=Ovaj servis omogućava podešavanje Dolphinovih prikaza. -Comment[sv]=Den här tjänsten låter dig anpassa vyer i Dolphin. -Comment[ta]=டால்பின் காட்சிகளை வடிவமைக்க இச்சேவை உதவுகிறது. -Comment[te]=డాల్ఫిన్ వీక్షణిల యొక్క ఆకృతీకరణను ఈ సేవ అనుమతిస్తుంది. -Comment[tg]=Ин хидмат танзимоти намоиши Dolphin-ро иҷозат медиҳад. -Comment[th]=บริการการตั้งค่ามุมมองของ Dolphin -Comment[tr]=Bu servis Dolphin görünümlerini yapılandırmanızı sağlar. -Comment[uk]=Ця служба дасть змогу налаштувати перегляди Dolphin. -Comment[wa]=Ci siervice permet l' apontiaedje des vuwes di Dolhpin. -Comment[x-test]=xxThis service allows configuration of the Dolphin views.xx -Comment[zh_CN]=此服务允许您配置 Dolphin 视图。 -Comment[zh_TW]=此服務允許設定 Dolphin 的檢視。 - -[Desktop Entry] -Icon=view-choose -Type=Service -X-KDE-ServiceTypes=KCModule -Exec=kcmshell4 kcmdolphin - -X-KDE-Library=kcm_dolphin -X-KDE-PluginKeyword=dolphin -X-KDE-ParentApp=kcontrol - -Name=Views -Name[af]=Aansigte -Name[ar]=العروض -Name[as]=প্ৰদৰ্শন ব্যৱস্থা -Name[be@latin]=Vyhlady -Name[bg]=Преглед -Name[bn]=ভিউ -Name[bn_IN]=প্রদর্শন ব্যবস্থা -Name[ca]=Vistes -Name[cs]=Pohledy -Name[csb]=Wëzdrzatczi -Name[da]=Visninger -Name[de]=Ansichten -Name[el]=Προβολές -Name[eo]=Rigardoj -Name[es]=Vistas -Name[et]=Vaated -Name[eu]=Ikuspegiak -Name[fi]=Näkymät -Name[fr]=Vues -Name[fy]=Werjeften -Name[ga]=Amhairc -Name[gl]=Vistas -Name[gu]=દેખાવો -Name[he]=תצוגות -Name[hi]=दृश्य -Name[hr]=Prikazi -Name[hsb]=Napohlady -Name[hu]=Nézetek -Name[is]=Sjónarhorn -Name[it]=Viste -Name[ja]=ビュー -Name[kk]=Көріністер -Name[km]=មើល -Name[kn]=ನೋಟಗಳು -Name[ko]=보기 -Name[ku]=Bergeh -Name[lt]=Profiliai -Name[lv]=Skati -Name[mk]=Прегледи -Name[ml]=അവതരണരീതി -Name[mr]=दृश्य -Name[ms]=Paparan -Name[nb]=Visninger -Name[nds]=Ansichten -Name[nl]=Weergaven -Name[nn]=Visingar -Name[or]=ଦୃଶ୍ୟଗୁଡ଼ିକ -Name[pa]=ਝਲਕ -Name[pl]=Widoki -Name[pt]=Janelas -Name[pt_BR]=Visualizações -Name[ro]=Vizualizări -Name[ru]=Представление папок -Name[sk]=Pohľady -Name[sl]=Prikazi -Name[sr]=Прикази -Name[sr@latin]=Prikazi -Name[sv]=Vyer -Name[ta]=காட்சிகள் -Name[te]=వీక్షణలు -Name[tg]=Намоиш -Name[th]=มุมมอง -Name[tr]=Görünümler -Name[uk]=Перегляди -Name[uz]=Koʻrinishlar -Name[uz@cyrillic]=Кўринишлар -Name[wa]=Vuwes -Name[x-test]=xxViewsxx -Name[zh_CN]=视图 -Name[zh_TW]=檢視 -Comment=Configure file manager settings -Comment[af]=Konfigureer lêerbestuurder instellings -Comment[ar]=اضبط إعدادات مدير الملفات -Comment[as]=নথিপত্ৰ পৰিচালন ব্যৱস্থাৰ বৈশিষ্ট্য বিন্যাস কৰক -Comment[be@latin]=Naładź kiraŭnika fajłaŭ -Comment[bg]=Настройване на файловия мениджър -Comment[bn]=ফাইল ম্যানেজার সেটিংস কনফিগার করুন -Comment[bn_IN]=ফাইল পরিচালন ব্যবস্থার বৈশিষ্ট্য কনফিগার করুন -Comment[ca]=Configura les opcions del gestor de fitxers -Comment[cs]=Nastavení správce souborů -Comment[csb]=Kònfigùracëjô nastôwù menadżera lopków -Comment[da]=Opsætning af filhåndtering -Comment[de]=Einstellungen zum Dateimanager vornehmen -Comment[el]=Ρύθμιση επιλογών διαχείρισης αρχείων -Comment[eo]=Agordi la dosieradministrilon -Comment[es]=Configurar las preferencias gestor de archivos -Comment[et]=Failihalduri seadistuste seadistamine -Comment[eu]=Konfiguratu fitxategia arakatzailearen ezarpenak -Comment[fi]=Muokkaa tiedostonhallinnan asetuksia -Comment[fr]=Configuration du gestionnaire de fichiers -Comment[fy]=Hjir kinne jo de triembehear ynstellings fêststelle -Comment[ga]=Cumraigh socruithe bhainisteoir na gcomhad -Comment[gl]=Configura as opcións do xestor de ficheiros -Comment[gu]=ફાઇલ વ્યવસ્થાપક ગોઠવણીઓ રૂપરેખાંકિત કરો -Comment[he]=הגדרות מנהל הקבצים -Comment[hi]=फ़ाइल प्रबंधक विन्यास कॉन्फ़िगर करें -Comment[hr]=Konfiguriranje postavki upravitelja datotekama -Comment[hsb]=Nastajenja datajoweho managera připrawić -Comment[hu]=A fájlkezelő beállításai -Comment[is]=Stilla skráastjóra -Comment[it]=Configura le impostazioni del gestore dei file -Comment[ja]=ファイルマネージャの設定 -Comment[kk]=Файл менеджер параметрлерін баптау -Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ការ​កំណត់​កម្មវិធី​គ្រប់គ្រង​ឯកសារ -Comment[kn]=ವ್ಯವಸ್ಥಾಪಕದ ಸಂಯೋಜನೆಗಳನ್ನು ಸಂರಚಿಸು -Comment[ko]=파일 관리자 설정 -Comment[ku]=Mîhengên gerînendeyê pelan ava bike -Comment[lt]=Konfigūruokite failų tvarkyklės nustatymus -Comment[lv]=Konfigurē failu pārvaldnieka iestatījumus -Comment[mk]=Конфигурирајте ги поставувањата за менаџерот на датотеки -Comment[ml]=ഫയല്‍ നടത്തിപ്പുകാരന്റെ സജ്ജീകരണങ്ങള്‍ ക്രമീകരിയ്ക്കുക -Comment[mr]=फाइल व्यवस्थपाक संयक्षेत्रा संयोजीत करा -Comment[nb]=Tilpass filbehandler oppsettet -Comment[nds]=Den Dateipleger instellen -Comment[nl]=Bestandsbeheerder instellen -Comment[nn]=Set opp filhandsamar -Comment[or]=ଫାଇଲ ପରିଚାଳକ ବିନ୍ୟାସକୁ ସଂରଚନା କରନ୍ତୁ -Comment[pa]=ਫਾਇਲ ਮੈਨੇਜਰ ਸੈਟਿੰਗ ਸੰਰਚਨਾ -Comment[pl]=Konfiguracja ustawień menadżera plików -Comment[pt]=Configuração as opções do gestor de ficheiros -Comment[pt_BR]=Configurar opções do gerenciador de arquivos -Comment[ro]=Configurează gestionarul de fișiere -Comment[ru]=Настройка параметров менеджера файлов -Comment[sk]=Nastavenie správcu súborov -Comment[sl]=Nastavitve upravitelja datotek -Comment[sr]=Подешавање менаџера фајлова -Comment[sr@latin]=Podešavanje menadžera fajlova -Comment[sv]=Anpassa filhanteringsinställningar -Comment[ta]=கோப்பு மேலாளர் அமைப்புகளை வடிவமை -Comment[te]=దస్త్ర నిర్వాహకి అమర్పులను ఆకృతీకరించుము -Comment[tg]=Танзимоти мудири файлҳо -Comment[th]=ปรับแต่งการตั้งค่าเครื่องมือจัดการแฟ้ม -Comment[tr]=Dosya yöneticisi ayarlarını yapılandır -Comment[uk]=Налаштувати параметри менеджера файлів -Comment[uz]=Fayl boshqaruvchining moslamalarini moslash -Comment[uz@cyrillic]=Файл бошқарувчининг мосламаларини мослаш -Comment[wa]=Apontyî les tchuzes do manaedjeu di fitchîs -Comment[x-test]=xxConfigure file manager settingsxx -Comment[zh_CN]=配置文件管理器设置 -Comment[zh_TW]=設定檔案管理員 -X-KDE-Keywords=file manager diff --git a/src/kcmdolphin.h b/src/kcmdolphin.h deleted file mode 100644 index 0c95622fc..000000000 --- a/src/kcmdolphin.h +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef KCMDOLPHIN_H -#define KCMDOLPHIN_H - -#include - -class ViewSettingsPageBase; - -/** - * @brief Allow to configure the Dolphin views. - */ -class DolphinConfigModule : public KCModule -{ - Q_OBJECT - -public: - DolphinConfigModule(QWidget* parent, const QVariantList& args); - virtual ~DolphinConfigModule(); - - virtual void save(); - virtual void defaults(); - -private: - void reparseConfiguration(); - -private: - QList m_pages; -}; - -#endif diff --git a/src/kcmdolphinviewmodes.cpp b/src/kcmdolphinviewmodes.cpp new file mode 100644 index 000000000..aee0340de --- /dev/null +++ b/src/kcmdolphinviewmodes.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "kcmdolphinviewmodes.h" + +#include "settings/columnviewsettingspage.h" +#include "settings/detailsviewsettingspage.h" +#include "settings/iconsviewsettingspage.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +K_PLUGIN_FACTORY(KCMDolphinConfigFactory, registerPlugin("dolphinviewmodes");) +K_EXPORT_PLUGIN(KCMDolphinConfigFactory("kcmdolphinviewmodes")) + +DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) : + KCModule(KCMDolphinConfigFactory::componentData(), parent), + m_pages() +{ + Q_UNUSED(args); + + KGlobal::locale()->insertCatalog("dolphinviewmodes"); + + setButtons(KCModule::Default | KCModule::Help); + + QVBoxLayout* topLayout = new QVBoxLayout(this); + topLayout->setMargin(0); + topLayout->setSpacing(KDialog::spacingHint()); + + KTabWidget* tabWidget = new KTabWidget(this); + + // initialize 'Icons' tab + IconsViewSettingsPage* iconsPage = new IconsViewSettingsPage(tabWidget); + tabWidget->addTab(iconsPage, KIcon("view-list-icons"), i18nc("@title:tab", "Icons")); + connect(iconsPage, SIGNAL(changed()), this, SLOT(changed())); + + // initialize 'Details' tab + DetailsViewSettingsPage* detailsPage = new DetailsViewSettingsPage(tabWidget); + tabWidget->addTab(detailsPage, KIcon("view-list-details"), i18nc("@title:tab", "Details")); + connect(detailsPage, SIGNAL(changed()), this, SLOT(changed())); + + // initialize 'Column' tab + ColumnViewSettingsPage* columnPage = new ColumnViewSettingsPage(tabWidget); + tabWidget->addTab(columnPage, KIcon("view-file-columns"), i18nc("@title:tab", "Column")); + connect(columnPage, SIGNAL(changed()), this, SLOT(changed())); + + m_pages.append(iconsPage); + m_pages.append(detailsPage); + m_pages.append(columnPage); + + topLayout->addWidget(tabWidget, 0, 0); +} + +DolphinViewModesConfigModule::~DolphinViewModesConfigModule() +{ +} + +void DolphinViewModesConfigModule::save() +{ + foreach (ViewSettingsPageBase* page, m_pages) { + page->applySettings(); + } + reparseConfiguration(); +} + +void DolphinViewModesConfigModule::defaults() +{ + foreach (ViewSettingsPageBase* page, m_pages) { + page->restoreDefaults(); + } + reparseConfiguration(); +} + +void DolphinViewModesConfigModule::reparseConfiguration() +{ + QDBusMessage message = QDBusMessage::createSignal("/KonqMain", "org.kde.Konqueror.Main", "reparseConfiguration"); + QDBusConnection::sessionBus().send(message); +} + +#include "kcmdolphinviewmodes.moc" diff --git a/src/kcmdolphinviewmodes.desktop b/src/kcmdolphinviewmodes.desktop new file mode 100644 index 000000000..46c0b2ff2 --- /dev/null +++ b/src/kcmdolphinviewmodes.desktop @@ -0,0 +1,237 @@ +Name=Dolphin +Name[ar]=دولفين +Name[bn]=ডলফিন +Name[fy]=Dolfyn +Name[gu]=ડોલ્ફિન +Name[hi]=डॉल्फ़िन +Name[km]=ឌូហ្វីន +Name[kn]=ಡಾಲ್ಫಿನ್ +Name[mk]=Делфин +Name[ml]=ഡോള്‍ഫിന്‍ +Name[mr]=डॉल्फिन +Name[ne]=डल्फिन +Name[or]=ଡଲଫିନ +Name[pa]=ਡਾਲਫਿਨ +Name[sr]=Делфин +Name[ta]=டால்பின் +Name[te]=డాల్ఫిన్ +Name[x-test]=xxDolphinxx +Comment=This service allows configuration of the Dolphin views. +Comment[af]=Hierdie diens konfigureer die Dolphin aansigte +Comment[ar]=هذه الخدمة تتيح التحكم بعروض الدولفين +Comment[as]=এই সেৱাৰ দ্বাৰা Dolphin প্ৰদৰ্শন ব্যৱস্থা বিন্যাস কৰা যাব । +Comment[be@latin]=Hetaja słužba dazvalaje naładžvać vyhlad prahramy „Dolphin”. +Comment[bg]=Това ви позволява да настроите показването в Dolphin. +Comment[bn_IN]=এই পরিসেবা দ্বারা Dolphin প্রদর্শন ব্যবস্থা কনফিগার করা যাবে। +Comment[ca]=Aquest servei permet la configuració de les vistes del Dolphin. +Comment[cs]=Tato služba umožňuje nastavení pohledů Dolphinu. +Comment[csb]=Na ùsłëżnota pòzwôlô na kònfigùracëjã wëzdrzatków Dolphina, +Comment[da]=Denne tjeneste tillader indstilling af Dolphin-visningerne. +Comment[de]=Mit diesem Dienst können Dolphin-Ansichten eingerichtet werden. +Comment[el]=Αυτή η υπηρεσία επιτρέπει τη ρύθμιση των προβολών του Dolphin. +Comment[eo]=Ĉi tiu servo permesas agordon de la Dolphin rigardoj. +Comment[es]=Este servicio le permite configurar las vistas de Dolphin. +Comment[et]=See teenus võimaldab seadistada Dolphini vaateid. +Comment[eu]=Zerbitzu honen bitartez Dolphin ikuspegiak konfigura ditzakezu. +Comment[fi]=Tämä palvelu sallii Dolphinin näkymien muokkauksen. +Comment[fr]=Ce service permet de configurer les vues de Dolphin +Comment[fy]=De tsjinst stiet it ynstellen fan de Dolfynwerjefte ta. +Comment[ga]=Leis an tseirbhís seo is féidir na hamhairc Dolphin a chumrú. +Comment[gl]=Este servizo permite configurar as vistas de Dolphin. +Comment[gu]=આ સેવા ડોલ્ફિન દેખાવોનું રૂપરેખાંકન કરવા દેશે. +Comment[he]=שירות זה מאפשר תצורה של תצוגות עבור Dolphin +Comment[hi]=यह सेवा आपको डॉल्फ़िन दृश्य को कॉन्फ़िगर करने देता है. +Comment[hsb]=Tutón serwis dowoli konfiguraciju napohladow Dolphina. +Comment[hu]=Ez a szolgáltatás a Dolphin nézeteinek beállítását teszi lehetővé. +Comment[is]=Þessi þjónusta leyfir stillingar á sýnum Dolphin. +Comment[it]=Questo servizio permette di configurare le viste di Dolphin. +Comment[ja]=このサービスで Dolphin のビューを設定できます。 +Comment[kk]=Бұл Dolphin көрінісін баптауға мүмкіндік беретін қызмет. +Comment[km]=សេវា​នេះ​អនុញ្ញាត​ឲ្យ​កំណត់​រចនាសម្ព័ន្ធ​ទិដ្ឋភាព​ Dolphin ។ +Comment[kn]=ಈ ಸೇವೆಯು ಡಾಲ್ಫಿನ್ ನೋಟಗಳ ಸಂರಚನೆಗೆ ಅನುವುಮಾಡಿಕೊಡುತ್ತದೆ. +Comment[ko]=이 서비스는 Dolphin의 보기를 설정합니다. +Comment[ku]=Ev servîs destûrê dide veavakirina xuyakirina Dolphinê. +Comment[lt]=Ši tarnyba leidžia konfigūruoti Dolphin peržiūros profilius. +Comment[lv]=Šis serviss atļauj konfigurēt Dolphin skatus. +Comment[mk]=Овој сервис овозможува конфигурација на прегледите на Делфин. +Comment[ml]=ഡോള്‍ഫിന്‍ അവതരണരീതി ക്രമീകരിയ്ക്കാന്‍ ഈ സേവനം അനുവദിയ്ക്കുന്നു. +Comment[mr]=ही सेवा तुम्हाला डॉल्फिन दृश्यचे संयोजन करण्यास मदत करते. +Comment[nb]=Denne tjenesten tillater konfigurasjon av Dolphin visninger +Comment[nds]=Mit dissen Deenst laat sik de Dolphin-Ansichten instellen. +Comment[nl]=Met deze dienst kunt u Dolphin-weergaven instellen. +Comment[nn]=Denne tenesta let seg setja opp Dolphin-visingar. +Comment[or]=ଏହି ସର୍ଭିସ ଡଲଫିନ ଦୃଶ୍ୟଗୁଡ଼ିକର ସଂରଚନାକୁ ଅନୁମତି ଦେଇଥାଏ। +Comment[pa]=ਇਹ ਸਰਵਿਸ ਡਾਲਫਿਨ ਝਲਕ ਦੀ ਸੰਰਚਨਾ ਵਾਸਤੇ ਹੈ। +Comment[pl]=Ta usługa umożliwia konfigurację widoków Dolphina. +Comment[pt]=Este serviço permite-lhe configurar as vistas do Dolphin. +Comment[pt_BR]=Este serviço permite configurar as visualizações do Dolphin. +Comment[ro]=Acest serviciu permite configurarea vizualizărilor Dolphin. +Comment[ru]=Эта служба позволяет настраивать виды Dolphin +Comment[sk]=Táto služba umožňuje konfiguráciu pohľadov v Dolphine. +Comment[sl]=Ta storitev omogoča nastavitev Dolphinovih prikazov. +Comment[sr]=Овај сервис омогућава подешавање Делфинових приказа. +Comment[sr@latin]=Ovaj servis omogućava podešavanje Dolphinovih prikaza. +Comment[sv]=Den här tjänsten låter dig anpassa vyer i Dolphin. +Comment[ta]=டால்பின் காட்சிகளை வடிவமைக்க இச்சேவை உதவுகிறது. +Comment[te]=డాల్ఫిన్ వీక్షణిల యొక్క ఆకృతీకరణను ఈ సేవ అనుమతిస్తుంది. +Comment[tg]=Ин хидмат танзимоти намоиши Dolphin-ро иҷозат медиҳад. +Comment[th]=บริการการตั้งค่ามุมมองของ Dolphin +Comment[tr]=Bu servis Dolphin görünümlerini yapılandırmanızı sağlar. +Comment[uk]=Ця служба дасть змогу налаштувати перегляди Dolphin. +Comment[wa]=Ci siervice permet l' apontiaedje des vuwes di Dolhpin. +Comment[x-test]=xxThis service allows configuration of the Dolphin views.xx +Comment[zh_CN]=此服务允许您配置 Dolphin 视图。 +Comment[zh_TW]=此服務允許設定 Dolphin 的檢視。 + +[Desktop Entry] +Icon=view-choose +Type=Service +X-KDE-ServiceTypes=KCModule +Exec=kcmshell4 kcmdolphin + +X-KDE-Library=kcm_dolphin +X-KDE-PluginKeyword=dolphin +X-KDE-ParentApp=kcontrol + +Name=Views +Name[af]=Aansigte +Name[ar]=العروض +Name[as]=প্ৰদৰ্শন ব্যৱস্থা +Name[be@latin]=Vyhlady +Name[bg]=Преглед +Name[bn]=ভিউ +Name[bn_IN]=প্রদর্শন ব্যবস্থা +Name[ca]=Vistes +Name[cs]=Pohledy +Name[csb]=Wëzdrzatczi +Name[da]=Visninger +Name[de]=Ansichten +Name[el]=Προβολές +Name[eo]=Rigardoj +Name[es]=Vistas +Name[et]=Vaated +Name[eu]=Ikuspegiak +Name[fi]=Näkymät +Name[fr]=Vues +Name[fy]=Werjeften +Name[ga]=Amhairc +Name[gl]=Vistas +Name[gu]=દેખાવો +Name[he]=תצוגות +Name[hi]=दृश्य +Name[hr]=Prikazi +Name[hsb]=Napohlady +Name[hu]=Nézetek +Name[is]=Sjónarhorn +Name[it]=Viste +Name[ja]=ビュー +Name[kk]=Көріністер +Name[km]=មើល +Name[kn]=ನೋಟಗಳು +Name[ko]=보기 +Name[ku]=Bergeh +Name[lt]=Profiliai +Name[lv]=Skati +Name[mk]=Прегледи +Name[ml]=അവതരണരീതി +Name[mr]=दृश्य +Name[ms]=Paparan +Name[nb]=Visninger +Name[nds]=Ansichten +Name[nl]=Weergaven +Name[nn]=Visingar +Name[or]=ଦୃଶ୍ୟଗୁଡ଼ିକ +Name[pa]=ਝਲਕ +Name[pl]=Widoki +Name[pt]=Janelas +Name[pt_BR]=Visualizações +Name[ro]=Vizualizări +Name[ru]=Представление папок +Name[sk]=Pohľady +Name[sl]=Prikazi +Name[sr]=Прикази +Name[sr@latin]=Prikazi +Name[sv]=Vyer +Name[ta]=காட்சிகள் +Name[te]=వీక్షణలు +Name[tg]=Намоиш +Name[th]=มุมมอง +Name[tr]=Görünümler +Name[uk]=Перегляди +Name[uz]=Koʻrinishlar +Name[uz@cyrillic]=Кўринишлар +Name[wa]=Vuwes +Name[x-test]=xxViewsxx +Name[zh_CN]=视图 +Name[zh_TW]=檢視 +Comment=Configure file manager settings +Comment[af]=Konfigureer lêerbestuurder instellings +Comment[ar]=اضبط إعدادات مدير الملفات +Comment[as]=নথিপত্ৰ পৰিচালন ব্যৱস্থাৰ বৈশিষ্ট্য বিন্যাস কৰক +Comment[be@latin]=Naładź kiraŭnika fajłaŭ +Comment[bg]=Настройване на файловия мениджър +Comment[bn]=ফাইল ম্যানেজার সেটিংস কনফিগার করুন +Comment[bn_IN]=ফাইল পরিচালন ব্যবস্থার বৈশিষ্ট্য কনফিগার করুন +Comment[ca]=Configura les opcions del gestor de fitxers +Comment[cs]=Nastavení správce souborů +Comment[csb]=Kònfigùracëjô nastôwù menadżera lopków +Comment[da]=Opsætning af filhåndtering +Comment[de]=Einstellungen zum Dateimanager vornehmen +Comment[el]=Ρύθμιση επιλογών διαχείρισης αρχείων +Comment[eo]=Agordi la dosieradministrilon +Comment[es]=Configurar las preferencias gestor de archivos +Comment[et]=Failihalduri seadistuste seadistamine +Comment[eu]=Konfiguratu fitxategia arakatzailearen ezarpenak +Comment[fi]=Muokkaa tiedostonhallinnan asetuksia +Comment[fr]=Configuration du gestionnaire de fichiers +Comment[fy]=Hjir kinne jo de triembehear ynstellings fêststelle +Comment[ga]=Cumraigh socruithe bhainisteoir na gcomhad +Comment[gl]=Configura as opcións do xestor de ficheiros +Comment[gu]=ફાઇલ વ્યવસ્થાપક ગોઠવણીઓ રૂપરેખાંકિત કરો +Comment[he]=הגדרות מנהל הקבצים +Comment[hi]=फ़ाइल प्रबंधक विन्यास कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje postavki upravitelja datotekama +Comment[hsb]=Nastajenja datajoweho managera připrawić +Comment[hu]=A fájlkezelő beállításai +Comment[is]=Stilla skráastjóra +Comment[it]=Configura le impostazioni del gestore dei file +Comment[ja]=ファイルマネージャの設定 +Comment[kk]=Файл менеджер параметрлерін баптау +Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ការ​កំណត់​កម្មវិធី​គ្រប់គ្រង​ឯកសារ +Comment[kn]=ವ್ಯವಸ್ಥಾಪಕದ ಸಂಯೋಜನೆಗಳನ್ನು ಸಂರಚಿಸು +Comment[ko]=파일 관리자 설정 +Comment[ku]=Mîhengên gerînendeyê pelan ava bike +Comment[lt]=Konfigūruokite failų tvarkyklės nustatymus +Comment[lv]=Konfigurē failu pārvaldnieka iestatījumus +Comment[mk]=Конфигурирајте ги поставувањата за менаџерот на датотеки +Comment[ml]=ഫയല്‍ നടത്തിപ്പുകാരന്റെ സജ്ജീകരണങ്ങള്‍ ക്രമീകരിയ്ക്കുക +Comment[mr]=फाइल व्यवस्थपाक संयक्षेत्रा संयोजीत करा +Comment[nb]=Tilpass filbehandler oppsettet +Comment[nds]=Den Dateipleger instellen +Comment[nl]=Bestandsbeheerder instellen +Comment[nn]=Set opp filhandsamar +Comment[or]=ଫାଇଲ ପରିଚାଳକ ବିନ୍ୟାସକୁ ସଂରଚନା କରନ୍ତୁ +Comment[pa]=ਫਾਇਲ ਮੈਨੇਜਰ ਸੈਟਿੰਗ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja ustawień menadżera plików +Comment[pt]=Configuração as opções do gestor de ficheiros +Comment[pt_BR]=Configurar opções do gerenciador de arquivos +Comment[ro]=Configurează gestionarul de fișiere +Comment[ru]=Настройка параметров менеджера файлов +Comment[sk]=Nastavenie správcu súborov +Comment[sl]=Nastavitve upravitelja datotek +Comment[sr]=Подешавање менаџера фајлова +Comment[sr@latin]=Podešavanje menadžera fajlova +Comment[sv]=Anpassa filhanteringsinställningar +Comment[ta]=கோப்பு மேலாளர் அமைப்புகளை வடிவமை +Comment[te]=దస్త్ర నిర్వాహకి అమర్పులను ఆకృతీకరించుము +Comment[tg]=Танзимоти мудири файлҳо +Comment[th]=ปรับแต่งการตั้งค่าเครื่องมือจัดการแฟ้ม +Comment[tr]=Dosya yöneticisi ayarlarını yapılandır +Comment[uk]=Налаштувати параметри менеджера файлів +Comment[uz]=Fayl boshqaruvchining moslamalarini moslash +Comment[uz@cyrillic]=Файл бошқарувчининг мосламаларини мослаш +Comment[wa]=Apontyî les tchuzes do manaedjeu di fitchîs +Comment[x-test]=xxConfigure file manager settingsxx +Comment[zh_CN]=配置文件管理器设置 +Comment[zh_TW]=設定檔案管理員 +X-KDE-Keywords=file manager diff --git a/src/kcmdolphinviewmodes.h b/src/kcmdolphinviewmodes.h new file mode 100644 index 000000000..a04911f48 --- /dev/null +++ b/src/kcmdolphinviewmodes.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef KCMDOLPHIN_H +#define KCMDOLPHIN_H + +#include + +class ViewSettingsPageBase; + +/** + * @brief Allow to configure the Dolphin views. + */ +class DolphinViewModesConfigModule : public KCModule +{ + Q_OBJECT + +public: + DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args); + virtual ~DolphinViewModesConfigModule(); + + virtual void save(); + virtual void defaults(); + +private: + void reparseConfiguration(); + +private: + QList m_pages; +}; + +#endif diff --git a/src/settings/behaviorsettingspage.cpp b/src/settings/behaviorsettingspage.cpp new file mode 100644 index 000000000..a5bcc63c7 --- /dev/null +++ b/src/settings/behaviorsettingspage.cpp @@ -0,0 +1,162 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) and * + * and Patrice Tremblay * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "behaviorsettingspage.h" + +#include "dolphinsettings.h" +#include "dolphin_generalsettings.h" + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +BehaviorSettingsPage::BehaviorSettingsPage(const KUrl& url, QWidget* parent) : + SettingsPageBase(parent), + m_url(url), + m_localProps(0), + m_globalProps(0), + m_confirmMoveToTrash(0), + m_confirmDelete(0), + m_renameInline(0), + m_showToolTips(0), + m_showSelectionToggle(0) +{ + const int spacing = KDialog::spacingHint(); + + QVBoxLayout* topLayout = new QVBoxLayout(this); + KVBox* vBox = new KVBox(this); + vBox->setSpacing(spacing); + + // 'View Properties' box + QGroupBox* propsBox = new QGroupBox(i18nc("@title:group", "View Properties"), vBox); + + m_localProps = new QRadioButton(i18nc("@option:radio", "Remember view properties for each folder"), propsBox); + connect(m_localProps, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + m_globalProps = new QRadioButton(i18nc("@option:radio", "Use common view properties for all folders"), propsBox); + connect(m_globalProps, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + QVBoxLayout* propsBoxLayout = new QVBoxLayout(propsBox); + propsBoxLayout->addWidget(m_localProps); + propsBoxLayout->addWidget(m_globalProps); + + // 'Ask Confirmation For' box + QGroupBox* confirmBox = new QGroupBox(i18nc("@title:group", "Ask For Confirmation When"), vBox); + m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check Ask for Confirmation When", + "Moving files or folders to trash"), confirmBox); + connect(m_confirmMoveToTrash, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + m_confirmDelete = new QCheckBox(i18nc("@option:check Ask for Confirmation When", + "Deleting files or folders"), confirmBox); + connect(m_confirmDelete, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + QVBoxLayout* confirmBoxLayout = new QVBoxLayout(confirmBox); + confirmBoxLayout->addWidget(m_confirmMoveToTrash); + confirmBoxLayout->addWidget(m_confirmDelete); + + m_renameInline = new QCheckBox(i18nc("@option:check", "Rename inline"), vBox); + connect(m_renameInline, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"), vBox); + connect(m_showToolTips, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker"), vBox); + connect(m_showSelectionToggle, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + // Add a dummy widget with no restriction regarding + // a vertical resizing. This assures that the dialog layout + // is not stretched vertically. + new QWidget(vBox); + + topLayout->addWidget(vBox); + + loadSettings(); +} + +BehaviorSettingsPage::~BehaviorSettingsPage() +{ +} + +void BehaviorSettingsPage::applySettings() +{ + ViewProperties props(m_url); // read current view properties + + const bool useGlobalProps = m_globalProps->isChecked(); + + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setGlobalViewProps(useGlobalProps); + + if (useGlobalProps) { + // Remember the global view properties by applying the current view properties. + // It is important that GeneralSettings::globalViewProps() is set before + // the class ViewProperties is used, as ViewProperties uses this setting + // to find the destination folder for storing the view properties. + ViewProperties globalProps(m_url); + globalProps.setDirProperties(props); + } + + KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals); + KConfigGroup confirmationGroup(kioConfig, "Confirmations"); + confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked()); + confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked()); + confirmationGroup.sync(); + + settings->setRenameInline(m_renameInline->isChecked()); + settings->setShowToolTips(m_showToolTips->isChecked()); + settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); +} + +void BehaviorSettingsPage::restoreDefaults() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setDefaults(); + + // TODO: reset default settings for trash and show delete command... + + loadSettings(); +} + +void BehaviorSettingsPage::loadSettings() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + if (settings->globalViewProps()) { + m_globalProps->setChecked(true); + } else { + m_localProps->setChecked(true); + } + + KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::IncludeGlobals); + const KConfigGroup confirmationGroup(kioConfig, "Confirmations"); + m_confirmMoveToTrash->setChecked(confirmationGroup.readEntry("ConfirmTrash", false)); + m_confirmDelete->setChecked(confirmationGroup.readEntry("ConfirmDelete", true)); + + m_renameInline->setChecked(settings->renameInline()); + m_showToolTips->setChecked(settings->showToolTips()); + m_showSelectionToggle->setChecked(settings->showSelectionToggle()); +} + +#include "behaviorsettingspage.moc" diff --git a/src/settings/behaviorsettingspage.h b/src/settings/behaviorsettingspage.h new file mode 100644 index 000000000..401f2240a --- /dev/null +++ b/src/settings/behaviorsettingspage.h @@ -0,0 +1,64 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * peter.penz@gmx.at * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ +#ifndef BEHAVIORSETTINGSPAGE_H +#define BEHAVIORSETTINGSPAGE_H + +#include +#include + +class DolphinMainWindow; +class QCheckBox; +class QRadioButton; + +/** + * @brief Tab page for the 'Behavior' settings of the Dolphin settings dialog. + */ +class BehaviorSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + BehaviorSettingsPage(const KUrl& url, QWidget* parent); + virtual ~BehaviorSettingsPage(); + + /** @see SettingsPageBase::applySettings() */ + virtual void applySettings(); + + /** @see SettingsPageBase::restoreDefaults() */ + virtual void restoreDefaults(); + +private: + void loadSettings(); + +private: + KUrl m_url; + + QRadioButton* m_localProps; + QRadioButton* m_globalProps; + + QCheckBox* m_confirmMoveToTrash; + QCheckBox* m_confirmDelete; + + QCheckBox* m_renameInline; + QCheckBox* m_showToolTips; + QCheckBox* m_showSelectionToggle; +}; + +#endif diff --git a/src/settings/contextmenusettingspage.cpp b/src/settings/contextmenusettingspage.cpp new file mode 100644 index 000000000..77f781c57 --- /dev/null +++ b/src/settings/contextmenusettingspage.cpp @@ -0,0 +1,88 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "contextmenusettingspage.h" +#include "dolphinsettings.h" +#include "dolphin_generalsettings.h" + +#include +#include +#include + +#include +#include + +ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget* parent) : + SettingsPageBase(parent), + m_showDeleteCommand(0), + m_showCopyMoveMenu(0) +{ + QVBoxLayout* topLayout = new QVBoxLayout(this); + KVBox* vBox = new KVBox(this); + vBox->setSpacing(KDialog::spacingHint()); + + m_showDeleteCommand = new QCheckBox(i18nc("@option:check", "Show 'Delete' command"), vBox); + connect(m_showDeleteCommand, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + m_showCopyMoveMenu = new QCheckBox(i18nc("@option:check", "Show 'Copy To' and 'Move To' commands"), vBox); + connect(m_showCopyMoveMenu, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + // Add a dummy widget with no restriction regarding + // a vertical resizing. This assures that the dialog layout + // is not stretched vertically. + new QWidget(vBox); + + topLayout->addWidget(vBox); + + loadSettings(); +} + +ContextMenuSettingsPage::~ContextMenuSettingsPage() +{ +} + +void ContextMenuSettingsPage::applySettings() +{ + KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); + KConfigGroup configGroup(globalConfig, "KDE"); + configGroup.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked()); + configGroup.sync(); + + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setShowCopyMoveMenu(m_showCopyMoveMenu->isChecked()); +} + +void ContextMenuSettingsPage::restoreDefaults() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setDefaults(); + loadSettings(); +} + +void ContextMenuSettingsPage::loadSettings() +{ + KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals); + KConfigGroup configGroup(globalConfig, "KDE"); + m_showDeleteCommand->setChecked(configGroup.readEntry("ShowDeleteCommand", false)); + + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + m_showCopyMoveMenu->setChecked(settings->showCopyMoveMenu()); +} + +#include "contextmenusettingspage.moc" diff --git a/src/settings/contextmenusettingspage.h b/src/settings/contextmenusettingspage.h new file mode 100644 index 000000000..8a11c23c5 --- /dev/null +++ b/src/settings/contextmenusettingspage.h @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ +#ifndef CONTEXTMENUSETTINGSPAGE_H +#define CONTEXTMENUSETTINGSPAGE_H + +#include + +class QCheckBox; + +/** + * @brief Page for the 'Context Menu' settings of the Dolphin settings dialog. + */ +class ContextMenuSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + ContextMenuSettingsPage(QWidget* parent); + virtual ~ContextMenuSettingsPage(); + + /** @see SettingsPageBase::applySettings() */ + virtual void applySettings(); + + /** @see SettingsPageBase::restoreDefaults() */ + virtual void restoreDefaults(); + +private: + void loadSettings(); + +private: + QCheckBox* m_showDeleteCommand; + QCheckBox* m_showCopyMoveMenu; +}; + +#endif diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 54ac74bde..64ebdeed7 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -23,6 +23,8 @@ #include #include #include "generalsettingspage.h" +#include "navigationsettingspage.h" +#include "servicessettingspage.h" #include "startupsettingspage.h" #include "viewsettingspage.h" @@ -30,8 +32,8 @@ #include #include -DolphinSettingsDialog::DolphinSettingsDialog(DolphinMainWindow* mainWindow) : - KPageDialog(mainWindow), +DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) : + KPageDialog(parent), m_pages() { @@ -44,19 +46,36 @@ DolphinSettingsDialog::DolphinSettingsDialog(DolphinMainWindow* mainWindow) : enableButtonApply(false); setDefaultButton(Ok); - StartupSettingsPage* startupSettingsPage = new StartupSettingsPage(mainWindow, this); + // Startup + StartupSettingsPage* startupSettingsPage = new StartupSettingsPage(url, this); KPageWidgetItem* startupSettingsFrame = addPage(startupSettingsPage, i18nc("@title:group", "Startup")); startupSettingsFrame->setIcon(KIcon("go-home")); connect(startupSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); - ViewSettingsPage* viewSettingsPage = new ViewSettingsPage(mainWindow, this); + // View Modes + ViewSettingsPage* viewSettingsPage = new ViewSettingsPage(this); KPageWidgetItem* viewSettingsFrame = addPage(viewSettingsPage, i18nc("@title:group", "View Modes")); viewSettingsFrame->setIcon(KIcon("view-choose")); connect(viewSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); - GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(mainWindow, this); + // Navigation + NavigationSettingsPage* navigationSettingsPage = new NavigationSettingsPage(this); + KPageWidgetItem* navigationSettingsFrame = addPage(navigationSettingsPage, + i18nc("@title:group", "Navigation")); + navigationSettingsFrame->setIcon(KIcon("input-mouse")); + connect(navigationSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + + // Services + ServicesSettingsPage* servicesSettingsPage = new ServicesSettingsPage(this); + KPageWidgetItem* servicesSettingsFrame = addPage(servicesSettingsPage, + i18nc("@title:group", "Services")); + servicesSettingsFrame->setIcon(KIcon("services")); + connect(servicesSettingsPage, SIGNAL(changed()), this, SLOT(enableApply())); + + // General + GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(url, this); KPageWidgetItem* generalSettingsFrame = addPage(generalSettingsPage, i18nc("@title:group General settings", "General")); generalSettingsFrame->setIcon(KIcon("system-run")); @@ -67,6 +86,8 @@ DolphinSettingsDialog::DolphinSettingsDialog(DolphinMainWindow* mainWindow) : m_pages.append(startupSettingsPage); m_pages.append(viewSettingsPage); + m_pages.append(navigationSettingsPage); + m_pages.append(servicesSettingsPage); m_pages.append(generalSettingsPage); } diff --git a/src/settings/dolphinsettingsdialog.h b/src/settings/dolphinsettingsdialog.h index fc17b3774..90cfd3493 100644 --- a/src/settings/dolphinsettingsdialog.h +++ b/src/settings/dolphinsettingsdialog.h @@ -23,22 +23,21 @@ #include +class KUrl; class DolphinMainWindow; class SettingsPageBase; /** * @brief Settings dialog for Dolphin. * - * Contains the pages for startup settings, general settings and view settings. - * - * @author Peter Penz + * Contains the pages for Startup, View Modes, Navigation, Services and General. */ class DolphinSettingsDialog : public KPageDialog { Q_OBJECT public: - explicit DolphinSettingsDialog(DolphinMainWindow* mainWindow); + explicit DolphinSettingsDialog(const KUrl& url, QWidget* parent); virtual ~DolphinSettingsDialog(); protected slots: diff --git a/src/settings/generalsettingspage.cpp b/src/settings/generalsettingspage.cpp index 86b6f1939..6b7d5917c 100644 --- a/src/settings/generalsettingspage.cpp +++ b/src/settings/generalsettingspage.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) and * - * and Patrice Tremblay * + * Copyright (C) 2006 by Peter Penz * + * peter.penz@gmx.at * * * * 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 * @@ -15,99 +15,60 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #include "generalsettingspage.h" -#include "settings/dolphinsettings.h" - -#include "dolphin_generalsettings.h" +#include "behaviorsettingspage.h" +#include "contextmenusettingspage.h" +#include "previewssettingspage.h" +#include "settingspagebase.h" +#include "statusbarsettingspage.h" #include #include -#include +#include +#include -#include -#include -#include #include -GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* parent) : +GeneralSettingsPage::GeneralSettingsPage(const KUrl& url, QWidget* parent) : SettingsPageBase(parent), - m_confirmMoveToTrash(0), - m_confirmDelete(0), - m_showDeleteCommand(0), - m_showCopyMoveMenu(0), - m_showZoomSlider(0), - m_showSpaceInfo(0), - m_browseThroughArchives(0), - m_renameInline(0), - m_autoExpandFolders(0) + m_pages() { - Q_UNUSED(mainWin); - - const int spacing = KDialog::spacingHint(); - QVBoxLayout* topLayout = new QVBoxLayout(this); - KVBox* vBox = new KVBox(this); - vBox->setSpacing(spacing); - - // create 'Ask Confirmation For' group - QGroupBox* confirmBox = new QGroupBox(i18nc("@title:group", "Ask For Confirmation When"), vBox); - m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check Ask for Confirmation When", - "Moving files or folders to trash"), confirmBox); - connect(m_confirmMoveToTrash, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - m_confirmDelete = new QCheckBox(i18nc("@option:check Ask for Confirmation When", - "Deleting files or folders"), confirmBox); - connect(m_confirmDelete, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - QVBoxLayout* confirmBoxLayout = new QVBoxLayout(confirmBox); - confirmBoxLayout->addWidget(m_confirmMoveToTrash); - confirmBoxLayout->addWidget(m_confirmDelete); - - QGroupBox* contextMenuBox = new QGroupBox(i18nc("@title:group", "Context Menu"), vBox); - - // create 'Show the command 'Delete' in context menu' checkbox - m_showDeleteCommand = new QCheckBox(i18nc("@option:check", "Show 'Delete' command"), contextMenuBox); - connect(m_showDeleteCommand, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - m_showCopyMoveMenu = new QCheckBox(i18nc("@option:check", "Show 'Copy To' and 'Move To' commands"), contextMenuBox); - connect(m_showCopyMoveMenu, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - QVBoxLayout* contextMenuBoxLayout = new QVBoxLayout(contextMenuBox); - contextMenuBoxLayout->addWidget(m_showDeleteCommand); - contextMenuBoxLayout->addWidget(m_showCopyMoveMenu); + topLayout->setMargin(0); + topLayout->setSpacing(KDialog::spacingHint()); - QGroupBox* statusBarBox = new QGroupBox(i18nc("@title:group", "Status Bar"), vBox); + KTabWidget* tabWidget = new KTabWidget(this); - m_showZoomSlider = new QCheckBox(i18nc("@option:check", "Show zoom slider"), statusBarBox); - connect(m_showZoomSlider, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + // initialize 'Behavior' tab + BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(url, tabWidget); + tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior")); + connect(behaviorPage, SIGNAL(changed()), this, SIGNAL(changed())); - m_showSpaceInfo = new QCheckBox(i18nc("@option:check", "Show space information"), statusBarBox); - connect(m_showSpaceInfo, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + // initialize 'Previews' tab + PreviewsSettingsPage* previewsPage = new PreviewsSettingsPage(tabWidget); + tabWidget->addTab(previewsPage, i18nc("@title:tab Previews settings", "Previews")); + connect(previewsPage, SIGNAL(changed()), this, SIGNAL(changed())); - QVBoxLayout* statusBarBoxLayout = new QVBoxLayout(statusBarBox); - statusBarBoxLayout->addWidget(m_showZoomSlider); - statusBarBoxLayout->addWidget(m_showSpaceInfo); + // initialize 'Context Menu' tab + ContextMenuSettingsPage* contextMenuPage = new ContextMenuSettingsPage(tabWidget); + tabWidget->addTab(contextMenuPage, i18nc("@title:tab Context Menu settings", "Context Menu")); + connect(contextMenuPage, SIGNAL(changed()), this, SIGNAL(changed())); - m_browseThroughArchives = new QCheckBox(i18nc("@option:check", "Browse through archives"), vBox); - connect(m_browseThroughArchives, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + // initialize 'Status Bar' tab + StatusBarSettingsPage* statusBarPage = new StatusBarSettingsPage(tabWidget); + tabWidget->addTab(statusBarPage, i18nc("@title:tab Status Bar settings", "Status Bar")); + connect(statusBarPage, SIGNAL(changed()), this, SIGNAL(changed())); - m_renameInline = new QCheckBox(i18nc("@option:check", "Rename inline"), vBox); - connect(m_renameInline, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + m_pages.append(behaviorPage); + m_pages.append(previewsPage); + m_pages.append(contextMenuPage); + m_pages.append(statusBarPage); - m_autoExpandFolders = new QCheckBox(i18nc("option:check", "Open folders during drag operations"), vBox); - connect(m_autoExpandFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - // Add a dummy widget with no restriction regarding - // a vertical resizing. This assures that the dialog layout - // is not stretched vertically. - new QWidget(vBox); - - topLayout->addWidget(vBox); - - loadSettings(); + topLayout->addWidget(tabWidget, 0, 0); } GeneralSettingsPage::~GeneralSettingsPage() @@ -116,55 +77,16 @@ GeneralSettingsPage::~GeneralSettingsPage() void GeneralSettingsPage::applySettings() { - GeneralSettings* settings = DolphinSettings::instance().generalSettings(); - - KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals); - KConfigGroup confirmationGroup(kioConfig, "Confirmations"); - confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked()); - confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked()); - confirmationGroup.sync(); - - KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); - KConfigGroup configGroup(globalConfig, "KDE"); - configGroup.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked()); - configGroup.sync(); - - settings->setShowCopyMoveMenu(m_showCopyMoveMenu->isChecked()); - settings->setShowZoomSlider(m_showZoomSlider->isChecked()); - settings->setShowSpaceInfo(m_showSpaceInfo->isChecked()); - settings->setBrowseThroughArchives(m_browseThroughArchives->isChecked()); - settings->setRenameInline(m_renameInline->isChecked()); - settings->setAutoExpandFolders(m_autoExpandFolders->isChecked()); + foreach (SettingsPageBase* page, m_pages) { + page->applySettings(); + } } void GeneralSettingsPage::restoreDefaults() { - GeneralSettings* settings = DolphinSettings::instance().generalSettings(); - settings->setDefaults(); - - // TODO: reset default settings for trash and show delete command... - - loadSettings(); -} - -void GeneralSettingsPage::loadSettings() -{ - KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::IncludeGlobals); - const KConfigGroup confirmationGroup(kioConfig, "Confirmations"); - m_confirmMoveToTrash->setChecked(confirmationGroup.readEntry("ConfirmTrash", false)); - m_confirmDelete->setChecked(confirmationGroup.readEntry("ConfirmDelete", true)); - - KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals); - KConfigGroup configGroup(globalConfig, "KDE"); - m_showDeleteCommand->setChecked(configGroup.readEntry("ShowDeleteCommand", false)); - - GeneralSettings* settings = DolphinSettings::instance().generalSettings(); - m_showCopyMoveMenu->setChecked(settings->showCopyMoveMenu()); - m_showZoomSlider->setChecked(settings->showZoomSlider()); - m_showSpaceInfo->setChecked(settings->showSpaceInfo()); - m_browseThroughArchives->setChecked(settings->browseThroughArchives()); - m_renameInline->setChecked(settings->renameInline()); - m_autoExpandFolders->setChecked(settings->autoExpandFolders()); + foreach (SettingsPageBase* page, m_pages) { + page->restoreDefaults(); + } } #include "generalsettingspage.moc" diff --git a/src/settings/generalsettingspage.h b/src/settings/generalsettingspage.h index 4059dc3c6..ac1e7c61c 100644 --- a/src/settings/generalsettingspage.h +++ b/src/settings/generalsettingspage.h @@ -15,26 +15,33 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef GENERALSETTINGSPAGE_H #define GENERALSETTINGSPAGE_H +#include #include +class KUrl; +class SettingsPageBase; class DolphinMainWindow; -class QLineEdit; -class QCheckBox; /** * @brief Page for the 'General' settings of the Dolphin settings dialog. + * + * The general settings include: + * - Behavior + * - Previews + * - Context Menu + * - Status Bar */ class GeneralSettingsPage : public SettingsPageBase { Q_OBJECT public: - GeneralSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent); + GeneralSettingsPage(const KUrl& url, QWidget* parent); virtual ~GeneralSettingsPage(); /** @see SettingsPageBase::applySettings() */ @@ -44,21 +51,7 @@ public: virtual void restoreDefaults(); private: - void loadSettings(); - -private: - QCheckBox* m_confirmMoveToTrash; - QCheckBox* m_confirmDelete; - - QCheckBox* m_showDeleteCommand; - QCheckBox* m_showCopyMoveMenu; - - QCheckBox* m_showZoomSlider; - QCheckBox* m_showSpaceInfo; - - QCheckBox* m_browseThroughArchives; - QCheckBox* m_renameInline; - QCheckBox* m_autoExpandFolders; + QList m_pages; }; #endif diff --git a/src/settings/generalviewsettingspage.cpp b/src/settings/generalviewsettingspage.cpp deleted file mode 100644 index acea9649c..000000000 --- a/src/settings/generalviewsettingspage.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#include "generalviewsettingspage.h" -#include "dolphinmainwindow.h" -#include "settings/dolphinsettings.h" -#include "dolphinviewcontainer.h" -#include "viewproperties.h" - -#include "dolphin_generalsettings.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -GeneralViewSettingsPage::GeneralViewSettingsPage(const KUrl& url, - QWidget* parent) : - ViewSettingsPageBase(parent), - m_url(url), - m_localProps(0), - m_globalProps(0), - m_maxPreviewSize(0), - m_spinBox(0), - m_useFileThumbnails(0), - m_showSelectionToggle(0), - m_showToolTips(0) -{ - const int spacing = KDialog::spacingHint(); - const int margin = KDialog::marginHint(); - const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - - setSpacing(spacing); - setMargin(margin); - - QGroupBox* propsBox = new QGroupBox(i18nc("@title:group", "View Properties"), this); - - m_localProps = new QRadioButton(i18nc("@option:radio", "Remember view properties for each folder"), propsBox); - connect(m_localProps, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - m_globalProps = new QRadioButton(i18nc("@option:radio", "Use common view properties for all folders"), propsBox); - connect(m_globalProps, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - QVBoxLayout* propsBoxLayout = new QVBoxLayout(propsBox); - propsBoxLayout->addWidget(m_localProps); - propsBoxLayout->addWidget(m_globalProps); - - // create 'File Previews' box - QGroupBox* previewBox = new QGroupBox(i18nc("@title:group", "File Previews"), this); - - KHBox* vBox = new KHBox(previewBox); - vBox->setSpacing(spacing); - - new QLabel(i18nc("@label:slider", "Maximum file size:"), vBox); - m_maxPreviewSize = new QSlider(Qt::Horizontal, vBox); - - m_spinBox = new QSpinBox(vBox); - - connect(m_maxPreviewSize, SIGNAL(valueChanged(int)), - m_spinBox, SLOT(setValue(int))); - connect(m_spinBox, SIGNAL(valueChanged(int)), - m_maxPreviewSize, SLOT(setValue(int))); - - connect(m_maxPreviewSize, SIGNAL(valueChanged(int)), - this, SIGNAL(changed())); - connect(m_spinBox, SIGNAL(valueChanged(int)), - this, SIGNAL(changed())); - - m_useFileThumbnails = new QCheckBox(i18nc("@option:check", "Use thumbnails embedded in files"), previewBox); - connect(m_useFileThumbnails, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - QVBoxLayout* previewBoxLayout = new QVBoxLayout(previewBox); - previewBoxLayout->addWidget(vBox); - previewBoxLayout->addWidget(m_useFileThumbnails); - - m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker"), this); - connect(m_showSelectionToggle, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"), this); - connect(m_showToolTips, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - - // Add a dummy widget with no restriction regarding - // a vertical resizing. This assures that the dialog layout - // is not stretched vertically. - new QWidget(this); - - loadSettings(); -} - - -GeneralViewSettingsPage::~GeneralViewSettingsPage() -{ -} - -void GeneralViewSettingsPage::applySettings() -{ - ViewProperties props(m_url); // read current view properties - - const bool useGlobalProps = m_globalProps->isChecked(); - - GeneralSettings* settings = DolphinSettings::instance().generalSettings(); - settings->setGlobalViewProps(useGlobalProps); - - if (useGlobalProps) { - // Remember the global view properties by applying the current view properties. - // It is important that GeneralSettings::globalViewProps() is set before - // the class ViewProperties is used, as ViewProperties uses this setting - // to find the destination folder for storing the view properties. - ViewProperties globalProps(m_url); - globalProps.setDirProperties(props); - } - - KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings"); - const int byteCount = m_maxPreviewSize->value() * 1024 * 1024; // value() returns size in MB - globalConfig.writeEntry("MaximumSize", - byteCount, - KConfigBase::Normal | KConfigBase::Global); - globalConfig.writeEntry("UseFileThumbnails", - m_useFileThumbnails->isChecked(), - KConfigBase::Normal | KConfigBase::Global); - globalConfig.sync(); - - settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); - settings->setShowToolTips(m_showToolTips->isChecked()); -} - -void GeneralViewSettingsPage::restoreDefaults() -{ - GeneralSettings* settings = DolphinSettings::instance().generalSettings(); - settings->setDefaults(); - loadSettings(); -} - -void GeneralViewSettingsPage::loadSettings() -{ - GeneralSettings* settings = DolphinSettings::instance().generalSettings(); - if (settings->globalViewProps()) { - m_globalProps->setChecked(true); - } else { - m_localProps->setChecked(true); - } - - const int min = 1; // MB - const int max = 100; // MB - m_maxPreviewSize->setRange(min, max); - m_maxPreviewSize->setPageStep(10); - m_maxPreviewSize->setSingleStep(1); - m_maxPreviewSize->setTickPosition(QSlider::TicksBelow); - - KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings"); - // TODO: The default value of 5 MB must match with the default value inside - // kdelibs/kio/kio/previewjob.cpp. Maybe a static getter method in PreviewJob - // should be added for getting the default size? - const int maxByteSize = globalConfig.readEntry("MaximumSize", 5 * 1024 * 1024 /* 5 MB */); - int maxMByteSize = maxByteSize / (1024 * 1024); - if (maxMByteSize < 1) { - maxMByteSize = 1; - } else if (maxMByteSize > max) { - maxMByteSize = max; - } - - m_spinBox->setRange(min, max); - m_spinBox->setSingleStep(1); - m_spinBox->setSuffix(" MB"); - - m_maxPreviewSize->setValue(maxMByteSize); - m_spinBox->setValue(m_maxPreviewSize->value()); - - const bool useFileThumbnails = globalConfig.readEntry("UseFileThumbnails", true); - m_useFileThumbnails->setChecked(useFileThumbnails); - - m_showSelectionToggle->setChecked(settings->showSelectionToggle()); - m_showToolTips->setChecked(settings->showToolTips()); -} - -#include "generalviewsettingspage.moc" diff --git a/src/settings/generalviewsettingspage.h b/src/settings/generalviewsettingspage.h deleted file mode 100644 index b0bd7e005..000000000 --- a/src/settings/generalviewsettingspage.h +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef GENERALVIEWSETTINGSPAGE_H -#define GENERALVIEWSETTINGSPAGE_H - -#include -#include - -class DolphinMainWindow; -class QCheckBox; -class QRadioButton; -class QSlider; -class QSpinBox; - -/** - * @brief Represents the page from the Dolphin Settings which allows - * to modify general settings for the view modes. - */ -class GeneralViewSettingsPage : public ViewSettingsPageBase -{ - Q_OBJECT - -public: - /** - * @param url URL of the currently shown directory, which is used - * to read the viewproperties. - * @param parent Parent widget of the settings page. - */ - GeneralViewSettingsPage(const KUrl& url, QWidget* parent); - virtual ~GeneralViewSettingsPage(); - - /** - * Applies the general settings for the view modes - * The settings are persisted automatically when - * closing Dolphin. - */ - virtual void applySettings(); - - /** Restores the settings to default values. */ - virtual void restoreDefaults(); - -private: - void loadSettings(); - -private: - KUrl m_url; - QRadioButton* m_localProps; - QRadioButton* m_globalProps; - QSlider* m_maxPreviewSize; - QSpinBox* m_spinBox; - QCheckBox* m_useFileThumbnails; - QCheckBox* m_showSelectionToggle; - QCheckBox* m_showToolTips; -}; - -#endif diff --git a/src/settings/navigationsettingspage.cpp b/src/settings/navigationsettingspage.cpp new file mode 100644 index 000000000..81ca7e83a --- /dev/null +++ b/src/settings/navigationsettingspage.cpp @@ -0,0 +1,112 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "navigationsettingspage.h" + +#include "settings/dolphinsettings.h" + +#include "dolphin_generalsettings.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +NavigationSettingsPage::NavigationSettingsPage(QWidget* parent) : + SettingsPageBase(parent), + m_browseThroughArchives(0), + m_autoExpandFolders(0) +{ + const int spacing = KDialog::spacingHint(); + + QVBoxLayout* topLayout = new QVBoxLayout(this); + KVBox* vBox = new KVBox(this); + vBox->setSpacing(spacing); + + // create 'Mouse' group + QGroupBox* mouseBox = new QGroupBox(i18nc("@title:group", "Mouse"), vBox); + m_singleClick = new QRadioButton(i18nc("@option:check Mouse Settings", + "Single-click to open files and folders"), mouseBox); + connect(m_singleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + m_doubleClick = new QRadioButton(i18nc("@option:check Mouse Settings", + "Double-click to open files and folders"), mouseBox); + connect(m_doubleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + QVBoxLayout* mouseBoxLayout = new QVBoxLayout(mouseBox); + mouseBoxLayout->addWidget(m_singleClick); + mouseBoxLayout->addWidget(m_doubleClick); + + m_browseThroughArchives = new QCheckBox(i18nc("@option:check", "Browse through archives"), vBox); + connect(m_browseThroughArchives, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + m_autoExpandFolders = new QCheckBox(i18nc("option:check", "Open folders during drag operations"), vBox); + connect(m_autoExpandFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + // Add a dummy widget with no restriction regarding + // a vertical resizing. This assures that the dialog layout + // is not stretched vertically. + new QWidget(vBox); + + topLayout->addWidget(vBox); + + loadSettings(); +} + +NavigationSettingsPage::~NavigationSettingsPage() +{ +} + +void NavigationSettingsPage::applySettings() +{ + KConfig config("kcminputrc"); + KConfigGroup group = config.group("Mouse"); + group.writeEntry("SingleClick", m_singleClick->isChecked(), KConfig::Persistent|KConfig::Global); + config.sync(); + KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE); + + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setBrowseThroughArchives(m_browseThroughArchives->isChecked()); + settings->setAutoExpandFolders(m_autoExpandFolders->isChecked()); +} + +void NavigationSettingsPage::restoreDefaults() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setDefaults(); + loadSettings(); +} + +void NavigationSettingsPage::loadSettings() +{ + const bool singleClick = KGlobalSettings::singleClick(); + m_singleClick->setChecked(singleClick); + m_doubleClick->setChecked(!singleClick); + + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + m_browseThroughArchives->setChecked(settings->browseThroughArchives()); + m_autoExpandFolders->setChecked(settings->autoExpandFolders()); +} + +#include "navigationsettingspage.moc" diff --git a/src/settings/navigationsettingspage.h b/src/settings/navigationsettingspage.h new file mode 100644 index 000000000..10f75b1a0 --- /dev/null +++ b/src/settings/navigationsettingspage.h @@ -0,0 +1,54 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ +#ifndef NAVIGATIONSETTINGSPAGE_H +#define NAVIGATIONSETTINGSPAGE_H + +#include + +class QCheckBox; +class QRadioButton; + +/** + * @brief Page for the 'Navigation' settings of the Dolphin settings dialog. + */ +class NavigationSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + NavigationSettingsPage(QWidget* parent); + virtual ~NavigationSettingsPage(); + + /** @see SettingsPageBase::applySettings() */ + virtual void applySettings(); + + /** @see SettingsPageBase::restoreDefaults() */ + virtual void restoreDefaults(); + +private: + void loadSettings(); + +private: + QRadioButton* m_singleClick; + QRadioButton* m_doubleClick; + QCheckBox* m_browseThroughArchives; + QCheckBox* m_autoExpandFolders; +}; + +#endif diff --git a/src/settings/previewssettingspage.cpp b/src/settings/previewssettingspage.cpp new file mode 100644 index 000000000..d0fb0ac90 --- /dev/null +++ b/src/settings/previewssettingspage.cpp @@ -0,0 +1,138 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "previewssettingspage.h" +#include "dolphinsettings.h" + +#include "dolphin_generalsettings.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) : + SettingsPageBase(parent), + m_maxPreviewSize(0), + m_spinBox(0), + m_useFileThumbnails(0) +{ + KVBox* vBox = new KVBox(this); + vBox->setSpacing(KDialog::spacingHint()); + vBox->setMargin(KDialog::marginHint()); + + new QLabel("TODO: a major rewrite of this dialog will be done in 4.3", vBox); + + KHBox* hBox = new KHBox(vBox); + hBox->setSpacing(KDialog::spacingHint()); + + new QLabel(i18nc("@label:slider", "Maximum file size:"), hBox); + m_maxPreviewSize = new QSlider(Qt::Horizontal, hBox); + + m_spinBox = new QSpinBox(hBox); + + connect(m_maxPreviewSize, SIGNAL(valueChanged(int)), + m_spinBox, SLOT(setValue(int))); + connect(m_spinBox, SIGNAL(valueChanged(int)), + m_maxPreviewSize, SLOT(setValue(int))); + + connect(m_maxPreviewSize, SIGNAL(valueChanged(int)), + this, SIGNAL(changed())); + connect(m_spinBox, SIGNAL(valueChanged(int)), + this, SIGNAL(changed())); + + m_useFileThumbnails = new QCheckBox(i18nc("@option:check", "Use thumbnails embedded in files"), vBox); + connect(m_useFileThumbnails, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + // Add a dummy widget with no restriction regarding + // a vertical resizing. This assures that the dialog layout + // is not stretched vertically. + new QWidget(vBox); + + loadSettings(); +} + + +PreviewsSettingsPage::~PreviewsSettingsPage() +{ +} + +void PreviewsSettingsPage::applySettings() +{ + KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings"); + const int byteCount = m_maxPreviewSize->value() * 1024 * 1024; // value() returns size in MB + globalConfig.writeEntry("MaximumSize", + byteCount, + KConfigBase::Normal | KConfigBase::Global); + globalConfig.writeEntry("UseFileThumbnails", + m_useFileThumbnails->isChecked(), + KConfigBase::Normal | KConfigBase::Global); + globalConfig.sync(); +} + +void PreviewsSettingsPage::restoreDefaults() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setDefaults(); + loadSettings(); +} + +void PreviewsSettingsPage::loadSettings() +{ + const int min = 1; // MB + const int max = 100; // MB + m_maxPreviewSize->setRange(min, max); + m_maxPreviewSize->setPageStep(10); + m_maxPreviewSize->setSingleStep(1); + m_maxPreviewSize->setTickPosition(QSlider::TicksBelow); + + KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings"); + // TODO: The default value of 5 MB must match with the default value inside + // kdelibs/kio/kio/previewjob.cpp. Maybe a static getter method in PreviewJob + // should be added for getting the default size? + const int maxByteSize = globalConfig.readEntry("MaximumSize", 5 * 1024 * 1024 /* 5 MB */); + int maxMByteSize = maxByteSize / (1024 * 1024); + if (maxMByteSize < 1) { + maxMByteSize = 1; + } else if (maxMByteSize > max) { + maxMByteSize = max; + } + + m_spinBox->setRange(min, max); + m_spinBox->setSingleStep(1); + m_spinBox->setSuffix(" MB"); + + m_maxPreviewSize->setValue(maxMByteSize); + m_spinBox->setValue(m_maxPreviewSize->value()); + + const bool useFileThumbnails = globalConfig.readEntry("UseFileThumbnails", true); + m_useFileThumbnails->setChecked(useFileThumbnails); +} + +#include "previewssettingspage.moc" diff --git a/src/settings/previewssettingspage.h b/src/settings/previewssettingspage.h new file mode 100644 index 000000000..5833a3db5 --- /dev/null +++ b/src/settings/previewssettingspage.h @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (C) 2006 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef PREVIEWSSETTINGSPAGE_H +#define PREVIEWSSETTINGSPAGE_H + +#include +#include + +class DolphinMainWindow; +class QCheckBox; +class QRadioButton; +class QSlider; +class QSpinBox; + +/** + * @brief Allows the configuration of file previews. + */ +class PreviewsSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + PreviewsSettingsPage(QWidget* parent); + virtual ~PreviewsSettingsPage(); + + /** + * Applies the general settings for the view modes + * The settings are persisted automatically when + * closing Dolphin. + */ + virtual void applySettings(); + + /** Restores the settings to default values. */ + virtual void restoreDefaults(); + +private: + void loadSettings(); + +private: + QSlider* m_maxPreviewSize; + QSpinBox* m_spinBox; + QCheckBox* m_useFileThumbnails; +}; + +#endif diff --git a/src/settings/servicessettingspage.cpp b/src/settings/servicessettingspage.cpp new file mode 100644 index 000000000..ee00814a9 --- /dev/null +++ b/src/settings/servicessettingspage.cpp @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "servicessettingspage.h" + +#include "dolphinsettings.h" + +#include "dolphin_generalsettings.h" + +#include +#include +#include + +ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) : + SettingsPageBase(parent) +{ + loadSettings(); +} + +ServicesSettingsPage::~ServicesSettingsPage() +{ +} + +void ServicesSettingsPage::applySettings() +{ +} + +void ServicesSettingsPage::restoreDefaults() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setDefaults(); + loadSettings(); +} + +void ServicesSettingsPage::loadSettings() +{ +} + +#include "servicessettingspage.moc" diff --git a/src/settings/servicessettingspage.h b/src/settings/servicessettingspage.h new file mode 100644 index 000000000..a64602f13 --- /dev/null +++ b/src/settings/servicessettingspage.h @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ +#ifndef SERVICESSETTINGSPAGE_H +#define SERVICESSETTINGSPAGE_H + +#include + +class QLineEdit; +class QCheckBox; + +/** + * @brief Page for the 'Services' settings of the Dolphin settings dialog. + */ +class ServicesSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + ServicesSettingsPage(QWidget* parent); + virtual ~ServicesSettingsPage(); + + /** @see SettingsPageBase::applySettings() */ + virtual void applySettings(); + + /** @see SettingsPageBase::restoreDefaults() */ + virtual void restoreDefaults(); + +private: + void loadSettings(); + +private: +}; + +#endif diff --git a/src/settings/startupsettingspage.cpp b/src/settings/startupsettingspage.cpp index 767fcab66..9ea529132 100644 --- a/src/settings/startupsettingspage.cpp +++ b/src/settings/startupsettingspage.cpp @@ -39,9 +39,9 @@ #include #include -StartupSettingsPage::StartupSettingsPage(DolphinMainWindow* mainWin, QWidget* parent) : +StartupSettingsPage::StartupSettingsPage(const KUrl& url, QWidget* parent) : SettingsPageBase(parent), - m_mainWindow(mainWin), + m_url(url), m_homeUrl(0), m_splitView(0), m_editableUrl(0), @@ -147,8 +147,7 @@ void StartupSettingsPage::selectHomeUrl() void StartupSettingsPage::useCurrentLocation() { - const DolphinView* view = m_mainWindow->activeViewContainer()->view(); - m_homeUrl->setText(view->url().prettyUrl()); + m_homeUrl->setText(m_url.prettyUrl()); } void StartupSettingsPage::useDefaultLocation() diff --git a/src/settings/startupsettingspage.h b/src/settings/startupsettingspage.h index 04844f00c..98219a5a4 100644 --- a/src/settings/startupsettingspage.h +++ b/src/settings/startupsettingspage.h @@ -20,8 +20,8 @@ #define STARTUPSETTINGSPAGE_H #include +#include -class DolphinMainWindow; class KLineEdit; class QCheckBox; @@ -36,7 +36,7 @@ class StartupSettingsPage : public SettingsPageBase Q_OBJECT public: - StartupSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent); + StartupSettingsPage(const KUrl& url, QWidget* parent); virtual ~StartupSettingsPage(); /** @see SettingsPageBase::applySettings() */ @@ -54,7 +54,7 @@ private: void loadSettings(); private: - DolphinMainWindow* m_mainWindow; + KUrl m_url; KLineEdit* m_homeUrl; QCheckBox* m_splitView; diff --git a/src/settings/statusbarsettingspage.cpp b/src/settings/statusbarsettingspage.cpp new file mode 100644 index 000000000..c733c0b3a --- /dev/null +++ b/src/settings/statusbarsettingspage.cpp @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#include "statusbarsettingspage.h" +#include "dolphinsettings.h" +#include "dolphin_generalsettings.h" + +#include +#include +#include + +#include +#include + +StatusBarSettingsPage::StatusBarSettingsPage(QWidget* parent) : + SettingsPageBase(parent), + m_showZoomSlider(0), + m_showSpaceInfo(0) +{ + QVBoxLayout* topLayout = new QVBoxLayout(this); + KVBox* vBox = new KVBox(this); + vBox->setSpacing(KDialog::spacingHint()); + + m_showZoomSlider = new QCheckBox(i18nc("@option:check", "Show zoom slider"), vBox); + connect(m_showZoomSlider, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + m_showSpaceInfo = new QCheckBox(i18nc("@option:check", "Show space information"), vBox); + connect(m_showSpaceInfo, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + + // Add a dummy widget with no restriction regarding + // a vertical resizing. This assures that the dialog layout + // is not stretched vertically. + new QWidget(vBox); + + topLayout->addWidget(vBox); + + loadSettings(); +} + +StatusBarSettingsPage::~StatusBarSettingsPage() +{ +} + +void StatusBarSettingsPage::applySettings() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setShowZoomSlider(m_showZoomSlider->isChecked()); + settings->setShowSpaceInfo(m_showSpaceInfo->isChecked()); +} + +void StatusBarSettingsPage::restoreDefaults() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + settings->setDefaults(); + loadSettings(); +} + +void StatusBarSettingsPage::loadSettings() +{ + GeneralSettings* settings = DolphinSettings::instance().generalSettings(); + m_showZoomSlider->setChecked(settings->showZoomSlider()); + m_showSpaceInfo->setChecked(settings->showSpaceInfo()); +} + +#include "statusbarsettingspage.moc" diff --git a/src/settings/statusbarsettingspage.h b/src/settings/statusbarsettingspage.h new file mode 100644 index 000000000..6e9667be4 --- /dev/null +++ b/src/settings/statusbarsettingspage.h @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ +#ifndef STATUSBARSETTINGSPAGE_H +#define STATUSBARSETTINGSPAGE_H + +#include + +class QCheckBox; + +/** + * @brief Tab page for the 'Status Bar' settings of the Dolphin settings dialog. + */ +class StatusBarSettingsPage : public SettingsPageBase +{ + Q_OBJECT + +public: + StatusBarSettingsPage(QWidget* parent); + virtual ~StatusBarSettingsPage(); + + /** @see SettingsPageBase::applySettings() */ + virtual void applySettings(); + + /** @see SettingsPageBase::restoreDefaults() */ + virtual void restoreDefaults(); + +private: + void loadSettings(); + +private: + QCheckBox* m_showZoomSlider; + QCheckBox* m_showSpaceInfo; +}; + +#endif diff --git a/src/settings/viewsettingspage.cpp b/src/settings/viewsettingspage.cpp index 44d32af81..deb7a31bb 100644 --- a/src/settings/viewsettingspage.cpp +++ b/src/settings/viewsettingspage.cpp @@ -20,25 +20,18 @@ #include "viewsettingspage.h" -#include "settings/columnviewsettingspage.h" -#include "settings/detailsviewsettingspage.h" -#include "dolphinmainwindow.h" -#include "dolphinviewcontainer.h" -#include "settings/generalviewsettingspage.h" -#include "settings/iconsviewsettingspage.h" +#include "columnviewsettingspage.h" +#include "iconsviewsettingspage.h" +#include "detailsviewsettingspage.h" -#include -#include -#include +#include #include #include #include #include - -ViewSettingsPage::ViewSettingsPage(DolphinMainWindow* mainWindow, - QWidget* parent) : +ViewSettingsPage::ViewSettingsPage(QWidget* parent) : SettingsPageBase(parent), m_pages() { @@ -48,12 +41,6 @@ ViewSettingsPage::ViewSettingsPage(DolphinMainWindow* mainWindow, KTabWidget* tabWidget = new KTabWidget(this); - // initialize 'General' tab - const KUrl& url = mainWindow->activeViewContainer()->url(); - GeneralViewSettingsPage* generalPage = new GeneralViewSettingsPage(url, tabWidget); - tabWidget->addTab(generalPage, KIcon("view-choose"), i18nc("@title:tab General settings", "General")); - connect(generalPage, SIGNAL(changed()), this, SIGNAL(changed())); - // initialize 'Icons' tab IconsViewSettingsPage* iconsPage = new IconsViewSettingsPage(tabWidget); tabWidget->addTab(iconsPage, KIcon("view-list-icons"), i18nc("@title:tab", "Icons")); @@ -69,7 +56,6 @@ ViewSettingsPage::ViewSettingsPage(DolphinMainWindow* mainWindow, tabWidget->addTab(columnPage, KIcon("view-file-columns"), i18nc("@title:tab", "Column")); connect(columnPage, SIGNAL(changed()), this, SIGNAL(changed())); - m_pages.append(generalPage); m_pages.append(iconsPage); m_pages.append(detailsPage); m_pages.append(columnPage); diff --git a/src/settings/viewsettingspage.h b/src/settings/viewsettingspage.h index 5e76b30d1..56e9f910d 100644 --- a/src/settings/viewsettingspage.h +++ b/src/settings/viewsettingspage.h @@ -20,11 +20,10 @@ #ifndef VIEWSETTINGSPAGE_H #define VIEWSETTINGSPAGE_H -#include #include class ViewSettingsPageBase; -class DolphinMainWindow; +class QWidget; /** * @brief Page for the 'View' settings of the Dolphin settings dialog. @@ -37,7 +36,7 @@ class ViewSettingsPage : public SettingsPageBase Q_OBJECT public: - ViewSettingsPage(DolphinMainWindow* mainWindow, QWidget* parent); + ViewSettingsPage(QWidget* parent); virtual ~ViewSettingsPage(); /** @see SettingsPageBase::applySettings() */ -- cgit v1.3