]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/dolphinsettingsdialog.cpp
* Use Nepomuk for getting the meta data instead of KFileMetaInfo.
[dolphin.git] / src / settings / dolphinsettingsdialog.cpp
index 64ebdeed7331608fb67f76eca1dccbef38f42575..93f95ca443ccf045a514b97f5db66c4e9ccd7156 100644 (file)
@@ -27,6 +27,7 @@
 #include "servicessettingspage.h"
 #include "startupsettingspage.h"
 #include "viewsettingspage.h"
+#include "trashsettingspage.h"
 
 #include <klocale.h>
 #include <kmessagebox.h>
@@ -74,6 +75,13 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
     servicesSettingsFrame->setIcon(KIcon("services"));
     connect(servicesSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
 
+    // Trash
+    TrashSettingsPage* trashSettingsPage = new TrashSettingsPage(this);
+    KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage,
+                                                   i18nc("@title:group", "Trash"));
+    trashSettingsFrame->setIcon(KIcon("user-trash"));
+    connect(trashSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+
     // General
     GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(url, this);
     KPageWidgetItem* generalSettingsFrame = addPage(generalSettingsPage,
@@ -88,6 +96,7 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
     m_pages.append(viewSettingsPage);
     m_pages.append(navigationSettingsPage);
     m_pages.append(servicesSettingsPage);
+    m_pages.append(trashSettingsPage);
     m_pages.append(generalSettingsPage);
 }
 
@@ -102,10 +111,7 @@ void DolphinSettingsDialog::slotButtonClicked(int button)
     if ((button == Ok) || (button == Apply)) {
         applySettings();
     } else if (button == Default) {
-        const QString text(i18nc("@info", "All settings will be reset to default values. Do you want to continue?"));
-        if (KMessageBox::questionYesNo(this, text) == KMessageBox::Yes) {
-            restoreDefaults();
-        }
+        restoreDefaults();
     }
 
     KPageDialog::slotButtonClicked(button);
@@ -122,6 +128,7 @@ void DolphinSettingsDialog::applySettings()
         page->applySettings();
     }
     DolphinApplication::app()->refreshMainWindows();
+    enableButtonApply(false);
 }
 
 void DolphinSettingsDialog::restoreDefaults()
@@ -129,7 +136,6 @@ void DolphinSettingsDialog::restoreDefaults()
     foreach (SettingsPageBase* page, m_pages) {
         page->restoreDefaults();
     }
-    DolphinApplication::app()->refreshMainWindows();
 }
 
 #include "dolphinsettingsdialog.moc"