]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Relayout of the settings dialog, so that all Dolphin KPart relevant settings can...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 17 Jan 2009 18:42:06 +0000 (18:42 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 17 Jan 2009 18:42:06 +0000 (18:42 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=912587

25 files changed:
src/CMakeLists.txt
src/dolphinmainwindow.cpp
src/kcmdolphinviewmodes.cpp [moved from src/kcmdolphin.cpp with 81% similarity]
src/kcmdolphinviewmodes.desktop [moved from src/kcmdolphin.desktop with 100% similarity]
src/kcmdolphinviewmodes.h [moved from src/kcmdolphin.h with 90% similarity]
src/settings/behaviorsettingspage.cpp [new file with mode: 0644]
src/settings/behaviorsettingspage.h [new file with mode: 0644]
src/settings/contextmenusettingspage.cpp [new file with mode: 0644]
src/settings/contextmenusettingspage.h [new file with mode: 0644]
src/settings/dolphinsettingsdialog.cpp
src/settings/dolphinsettingsdialog.h
src/settings/generalsettingspage.cpp
src/settings/generalsettingspage.h
src/settings/navigationsettingspage.cpp [new file with mode: 0644]
src/settings/navigationsettingspage.h [new file with mode: 0644]
src/settings/previewssettingspage.cpp [moved from src/settings/generalviewsettingspage.cpp with 53% similarity]
src/settings/previewssettingspage.h [moved from src/settings/generalviewsettingspage.h with 72% similarity]
src/settings/servicessettingspage.cpp [new file with mode: 0644]
src/settings/servicessettingspage.h [new file with mode: 0644]
src/settings/startupsettingspage.cpp
src/settings/startupsettingspage.h
src/settings/statusbarsettingspage.cpp [new file with mode: 0644]
src/settings/statusbarsettingspage.h [new file with mode: 0644]
src/settings/viewsettingspage.cpp
src/settings/viewsettingspage.h

index b6652fc82e150e330404865347f21024d35f2d87..b08ffe46068fbfd54198ede132623ea09ac3c0f0 100644 (file)
@@ -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} )
index 60f6e97b3e7d2fa4a867bf5c0cbcc94cf0df353f..c0212a6f123b7b1df6567939223cbce878d1df94 100644 (file)
@@ -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 {
similarity index 81%
rename from src/kcmdolphin.cpp
rename to src/kcmdolphinviewmodes.cpp
index 21883e76ab8e32f890a8de15572070da112535fd..aee0340de235c2520c31e004aa5c6acaec267d0c 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#include "kcmdolphin.h"
+#include "kcmdolphinviewmodes.h"
 
 #include "settings/columnviewsettingspage.h"
 #include "settings/detailsviewsettingspage.h"
-#include "settings/generalviewsettingspage.h"
 #include "settings/iconsviewsettingspage.h"
 
 #include <ktabwidget.h>
 #include <QPushButton>
 #include <QVBoxLayout>
 
-K_PLUGIN_FACTORY(KCMDolphinConfigFactory, registerPlugin<DolphinConfigModule>("dolphin");)
-K_EXPORT_PLUGIN(KCMDolphinConfigFactory("kcmdolphin"))
+K_PLUGIN_FACTORY(KCMDolphinConfigFactory, registerPlugin<DolphinViewModesConfigModule>("dolphinviewmodes");)
+K_EXPORT_PLUGIN(KCMDolphinConfigFactory("kcmdolphinviewmodes"))
 
-DolphinConfigModule::DolphinConfigModule(QWidget* parent, const QVariantList& args) :
+DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) :
     KCModule(KCMDolphinConfigFactory::componentData(), parent),
     m_pages()
 {
     Q_UNUSED(args);
 
-    KGlobal::locale()->insertCatalog("dolphin");
+    KGlobal::locale()->insertCatalog("dolphinviewmodes");
 
     setButtons(KCModule::Default | KCModule::Help);
 
@@ -55,11 +54,6 @@ DolphinConfigModule::DolphinConfigModule(QWidget* parent, const QVariantList& ar
 
     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"));
@@ -75,7 +69,6 @@ DolphinConfigModule::DolphinConfigModule(QWidget* parent, const QVariantList& ar
     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);
@@ -83,11 +76,11 @@ DolphinConfigModule::DolphinConfigModule(QWidget* parent, const QVariantList& ar
     topLayout->addWidget(tabWidget, 0, 0);
 }
 
-DolphinConfigModule::~DolphinConfigModule()
+DolphinViewModesConfigModule::~DolphinViewModesConfigModule()
 {
 }
 
-void DolphinConfigModule::save()
+void DolphinViewModesConfigModule::save()
 {
     foreach (ViewSettingsPageBase* page, m_pages) {
         page->applySettings();
@@ -95,7 +88,7 @@ void DolphinConfigModule::save()
     reparseConfiguration();
 }
 
-void DolphinConfigModule::defaults()
+void DolphinViewModesConfigModule::defaults()
 {
     foreach (ViewSettingsPageBase* page, m_pages) {
         page->restoreDefaults();
@@ -103,10 +96,10 @@ void DolphinConfigModule::defaults()
     reparseConfiguration();
 }
 
-void DolphinConfigModule::reparseConfiguration()
+void DolphinViewModesConfigModule::reparseConfiguration()
 {
     QDBusMessage message = QDBusMessage::createSignal("/KonqMain", "org.kde.Konqueror.Main", "reparseConfiguration");
     QDBusConnection::sessionBus().send(message);
 }
 
-#include "kcmdolphin.moc"
+#include "kcmdolphinviewmodes.moc"
similarity index 90%
rename from src/kcmdolphin.h
rename to src/kcmdolphinviewmodes.h
index 0c95622fcce80a98546e8eb475bc8f67e9ec5cf8..a04911f4879393974c1871571d48743ae4a41810 100644 (file)
@@ -27,13 +27,13 @@ class ViewSettingsPageBase;
 /**
  * @brief Allow to configure the Dolphin views.
  */
-class DolphinConfigModule : public KCModule
+class DolphinViewModesConfigModule : public KCModule
 {
     Q_OBJECT
 
 public:
-    DolphinConfigModule(QWidget* parent, const QVariantList& args);
-    virtual ~DolphinConfigModule();
+    DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args);
+    virtual ~DolphinViewModesConfigModule();
 
     virtual void save();
     virtual void defaults();
diff --git a/src/settings/behaviorsettingspage.cpp b/src/settings/behaviorsettingspage.cpp
new file mode 100644 (file)
index 0000000..a5bcc63
--- /dev/null
@@ -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 <viewproperties.h>
+
+#include <kdialog.h>
+#include <klocale.h>
+#include <kvbox.h>
+
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QLabel>
+#include <QRadioButton>
+#include <QVBoxLayout>
+
+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 (file)
index 0000000..401f224
--- /dev/null
@@ -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 <settings/settingspagebase.h>
+#include <kurl.h>
+
+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 (file)
index 0000000..77f781c
--- /dev/null
@@ -0,0 +1,88 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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            *
+ ***************************************************************************/
+
+#include "contextmenusettingspage.h"
+#include "dolphinsettings.h"
+#include "dolphin_generalsettings.h"
+
+#include <kdialog.h>
+#include <klocale.h>
+#include <kvbox.h>
+
+#include <QCheckBox>
+#include <QVBoxLayout>
+
+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 (file)
index 0000000..8a11c23
--- /dev/null
@@ -0,0 +1,51 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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 CONTEXTMENUSETTINGSPAGE_H
+#define CONTEXTMENUSETTINGSPAGE_H
+
+#include <settings/settingspagebase.h>
+
+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
index 54ac74bdee121ab6203038e811da9c0e25b48331..64ebdeed7331608fb67f76eca1dccbef38f42575 100644 (file)
@@ -23,6 +23,8 @@
 #include <dolphinapplication.h>
 #include <dolphinmainwindow.h>
 #include "generalsettingspage.h"
+#include "navigationsettingspage.h"
+#include "servicessettingspage.h"
 #include "startupsettingspage.h"
 #include "viewsettingspage.h"
 
@@ -30,8 +32,8 @@
 #include <kmessagebox.h>
 #include <kicon.h>
 
-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);
 }
 
index fc17b377403b4712208491f7759bd7ff73d7b4c5..90cfd3493dabf93f8b4f0eeb4520aaa374d8e722 100644 (file)
 
 #include <kpagedialog.h>
 
+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 <peter.penz@gmx.at>
+ * 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:
index 86b6f1939fa42f181bcd352ea60a744293c15255..6b7d5917cd8fa55c63b700d5e9b726f4ba4ecca3 100644 (file)
@@ -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  *
  *   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 <kdialog.h>
 #include <klocale.h>
-#include <kvbox.h>
+#include <kiconloader.h>
+#include <ktabwidget.h>
 
-#include <QCheckBox>
-#include <QGroupBox>
-#include <QLabel>
 #include <QVBoxLayout>
 
-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"
index 4059dc3c686ef35b87059e8cef8dadef28ae0aad..ac1e7c61ce7e145eda5b270f37604c33e728205b 100644 (file)
  *   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 <QWidget>
 #include <settings/settingspagebase.h>
 
+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<SettingsPageBase*> m_pages;
 };
 
 #endif
diff --git a/src/settings/navigationsettingspage.cpp b/src/settings/navigationsettingspage.cpp
new file mode 100644 (file)
index 0000000..81ca7e8
--- /dev/null
@@ -0,0 +1,112 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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            *
+ ***************************************************************************/
+
+#include "navigationsettingspage.h"
+
+#include "settings/dolphinsettings.h"
+
+#include "dolphin_generalsettings.h"
+
+#include <kdialog.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kvbox.h>
+
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QLabel>
+#include <QRadioButton>
+#include <QVBoxLayout>
+
+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 (file)
index 0000000..10f75b1
--- /dev/null
@@ -0,0 +1,54 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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 NAVIGATIONSETTINGSPAGE_H
+#define NAVIGATIONSETTINGSPAGE_H
+
+#include <settings/settingspagebase.h>
+
+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
similarity index 53%
rename from src/settings/generalviewsettingspage.cpp
rename to src/settings/previewssettingspage.cpp
index acea9649c1a199fb3ebc0038b0349721690ee743..d0fb0ac90db168dbc0d705a4ba6f7ea9311ccce7 100644 (file)
  *   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 "previewssettingspage.h"
+#include "dolphinsettings.h"
 
 #include "dolphin_generalsettings.h"
 
 #include <kglobal.h>
 #include <klocale.h>
 #include <khbox.h>
+#include <kvbox.h>
 
-GeneralViewSettingsPage::GeneralViewSettingsPage(const KUrl& url,
-                                                 QWidget* parent) :
-    ViewSettingsPageBase(parent),
-    m_url(url),
-    m_localProps(0),
-    m_globalProps(0),
+PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) :
+    SettingsPageBase(parent),
     m_maxPreviewSize(0),
     m_spinBox(0),
-    m_useFileThumbnails(0),
-    m_showSelectionToggle(0),
-    m_showToolTips(0)
+    m_useFileThumbnails(0)
 {
-    const int spacing = KDialog::spacingHint();
-    const int margin = KDialog::marginHint();
-    const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+    KVBox* vBox = new KVBox(this);
+    vBox->setSpacing(KDialog::spacingHint());
+    vBox->setMargin(KDialog::marginHint());
 
-    setSpacing(spacing);
-    setMargin(margin);
+    new QLabel("TODO: a major rewrite of this dialog will be done in 4.3", vBox);
 
-    QGroupBox* propsBox = new QGroupBox(i18nc("@title:group", "View Properties"), this);
+    KHBox* hBox = new KHBox(vBox);
+    hBox->setSpacing(KDialog::spacingHint());
 
-    m_localProps = new QRadioButton(i18nc("@option:radio", "Remember view properties for each folder"), propsBox);
-    connect(m_localProps, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+    new QLabel(i18nc("@label:slider", "Maximum file size:"), hBox);
+    m_maxPreviewSize = new QSlider(Qt::Horizontal, hBox);
 
-    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);
+    m_spinBox = new QSpinBox(hBox);
 
     connect(m_maxPreviewSize, SIGNAL(valueChanged(int)),
             m_spinBox, SLOT(setValue(int)));
@@ -91,50 +67,24 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(const KUrl& url,
     connect(m_spinBox, SIGNAL(valueChanged(int)),
             this, SIGNAL(changed()));
 
-    m_useFileThumbnails = new QCheckBox(i18nc("@option:check", "Use thumbnails embedded in files"), previewBox);
+    m_useFileThumbnails = new QCheckBox(i18nc("@option:check", "Use thumbnails embedded in files"), vBox);
     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);
+    new QWidget(vBox);
 
     loadSettings();
 }
 
 
-GeneralViewSettingsPage::~GeneralViewSettingsPage()
+PreviewsSettingsPage::~PreviewsSettingsPage()
 {
 }
 
-void GeneralViewSettingsPage::applySettings()
+void PreviewsSettingsPage::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",
@@ -144,27 +94,17 @@ void GeneralViewSettingsPage::applySettings()
                             m_useFileThumbnails->isChecked(),
                             KConfigBase::Normal | KConfigBase::Global);
     globalConfig.sync();
-
-    settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
-    settings->setShowToolTips(m_showToolTips->isChecked());
 }
 
-void GeneralViewSettingsPage::restoreDefaults()
+void PreviewsSettingsPage::restoreDefaults()
 {
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
     settings->setDefaults();
     loadSettings();
 }
 
-void GeneralViewSettingsPage::loadSettings()
+void PreviewsSettingsPage::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);
@@ -193,9 +133,6 @@ void GeneralViewSettingsPage::loadSettings()
 
     const bool useFileThumbnails = globalConfig.readEntry("UseFileThumbnails", true);
     m_useFileThumbnails->setChecked(useFileThumbnails);
-
-    m_showSelectionToggle->setChecked(settings->showSelectionToggle());
-    m_showToolTips->setChecked(settings->showToolTips());
 }
 
-#include "generalviewsettingspage.moc"
+#include "previewssettingspage.moc"
similarity index 72%
rename from src/settings/generalviewsettingspage.h
rename to src/settings/previewssettingspage.h
index b0bd7e005cb3b5554a497b2500fceb61382415ca..5833a3db574abfe64f58a671a238ef9843f6c78d 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#ifndef GENERALVIEWSETTINGSPAGE_H
-#define GENERALVIEWSETTINGSPAGE_H
+#ifndef PREVIEWSSETTINGSPAGE_H
+#define PREVIEWSSETTINGSPAGE_H
 
 #include <kurl.h>
-#include <settings/viewsettingspagebase.h>
+#include <settings/settingspagebase.h>
 
 class DolphinMainWindow;
 class QCheckBox;
@@ -30,21 +30,15 @@ class QSlider;
 class QSpinBox;
 
 /**
- * @brief Represents the page from the Dolphin Settings which allows
- * to modify general settings for the view modes.
+ * @brief Allows the configuration of file previews.
  */
-class GeneralViewSettingsPage : public ViewSettingsPageBase
+class PreviewsSettingsPage : public SettingsPageBase
 {
     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();
+    PreviewsSettingsPage(QWidget* parent);
+    virtual ~PreviewsSettingsPage();
 
     /**
      * Applies the general settings for the view modes
@@ -60,14 +54,9 @@ 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/servicessettingspage.cpp b/src/settings/servicessettingspage.cpp
new file mode 100644 (file)
index 0000000..ee00814
--- /dev/null
@@ -0,0 +1,55 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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            *
+ ***************************************************************************/
+
+#include "servicessettingspage.h"
+
+#include "dolphinsettings.h"
+
+#include "dolphin_generalsettings.h"
+
+#include <kdialog.h>
+#include <klocale.h>
+#include <kvbox.h>
+
+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 (file)
index 0000000..a64602f
--- /dev/null
@@ -0,0 +1,50 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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 SERVICESSETTINGSPAGE_H
+#define SERVICESSETTINGSPAGE_H
+
+#include <settings/settingspagebase.h>
+
+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
index 767fcab667ffda49134bfe37765912da575bb174..9ea5291329cddc6dd4e233d351057c110da5a3d8 100644 (file)
@@ -39,9 +39,9 @@
 #include <QPushButton>
 #include <QRadioButton>
 
-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()
index 04844f00c338b9cde932bc40733d6cbe6537cd03..98219a5a4a64d6a8a5c7da5e33a8013619e35e89 100644 (file)
@@ -20,8 +20,8 @@
 #define STARTUPSETTINGSPAGE_H
 
 #include <settings/settingspagebase.h>
+#include <kurl.h>
 
-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 (file)
index 0000000..c733c0b
--- /dev/null
@@ -0,0 +1,81 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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            *
+ ***************************************************************************/
+
+#include "statusbarsettingspage.h"
+#include "dolphinsettings.h"
+#include "dolphin_generalsettings.h"
+
+#include <kdialog.h>
+#include <klocale.h>
+#include <kvbox.h>
+
+#include <QCheckBox>
+#include <QVBoxLayout>
+
+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 (file)
index 0000000..6e9667b
--- /dev/null
@@ -0,0 +1,51 @@
+/***************************************************************************
+ *   Copyright (C) 2009 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 STATUSBARSETTINGSPAGE_H
+#define STATUSBARSETTINGSPAGE_H
+
+#include <settings/settingspagebase.h>
+
+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
index 44d32af81b07f8ffe80a7be3d6a0b276e983187d..deb7a31bb6beb3667ccdaa72b2ef6e28181debb0 100644 (file)
 
 #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 <QtGui/QBoxLayout>
-#include <QtGui/QLayout>
-#include <QtGui/QLabel>
+#include <QVBoxLayout>
 
 #include <kdialog.h>
 #include <klocale.h>
 #include <kiconloader.h>
 #include <ktabwidget.h>
 
-
-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);
index 5e76b30d1d65eae9ed707f156d98e8bd0ce95326..56e9f910dcb1488208880abbfc7810d59fddcce0 100644 (file)
 #ifndef VIEWSETTINGSPAGE_H
 #define VIEWSETTINGSPAGE_H
 
-#include <QtGui/QWidget>
 #include <settings/settingspagebase.h>
 
 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() */