]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Allow to configure whether an asking for confirmation should be done for the 'Move...
authorPeter Penz <peter.penz19@gmail.com>
Fri, 18 May 2007 19:39:08 +0000 (19:39 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 18 May 2007 19:39:08 +0000 (19:39 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=666103

src/generalsettingspage.cpp
src/generalsettingspage.h

index 1f26d2659a9ee3c05ba4ecc5f670a5fb57192b19..87c8a24c30681a7bfdedc6bd13130e10c74cd694 100644 (file)
@@ -45,7 +45,9 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     m_splitView(0),
     m_editableUrl(0),
     m_filterBar(0),
-    m_showDeleteCommand(0)
+    m_showDeleteCommand(0),
+    m_confirmMoveToTrash(0),
+    m_confirmDelete(0)
 {
     const int spacing = KDialog::spacingHint();
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
@@ -63,7 +65,7 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     new QLabel(i18n("Location:"), homeUrlBox);
     m_homeUrl = new QLineEdit(settings->homeUrl(), homeUrlBox);
 
-    QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder"), QString(), homeUrlBox);
+    QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder-open"), QString(), homeUrlBox);
     connect(selectHomeUrlButton, SIGNAL(clicked()),
             this, SLOT(selectHomeUrl()));
 
@@ -100,6 +102,23 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     startBoxLayout->addWidget(m_editableUrl);
     startBoxLayout->addWidget(m_filterBar);
 
+    // create 'Ask Confirmation For' group
+    KSharedConfig::Ptr konqConfig = KSharedConfig::openConfig("konquerorrc", KConfig::IncludeGlobals);
+    const KConfigGroup trashConfig(konqConfig, "Trash");
+
+    QGroupBox* confirmBox = new QGroupBox(i18n("Ask Confirmation For"), vBox);
+
+    m_confirmMoveToTrash = new QCheckBox(i18n("Move to trash"), confirmBox);
+    m_confirmMoveToTrash->setChecked(trashConfig.readEntry("ConfirmTrash", false));
+
+    m_confirmDelete = new QCheckBox(i18n("Delete"), confirmBox);
+    m_confirmDelete->setChecked(trashConfig.readEntry("ConfirmDelete", true));
+
+    QVBoxLayout* confirmBoxLayout = new QVBoxLayout(confirmBox);
+    confirmBoxLayout->addWidget(m_confirmMoveToTrash);
+    confirmBoxLayout->addWidget(m_confirmDelete);
+
+    // create 'Show the command 'Delete' in context menu' checkbox
     m_showDeleteCommand = new QCheckBox(i18n("Show the command 'Delete' in context menu"), vBox);
     const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals);
     const KConfigGroup kdeConfig(globalConfig, "KDE");
@@ -113,9 +132,9 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     topLayout->addWidget(vBox);
 }
 
-
 GeneralSettingsPage::~GeneralSettingsPage()
-{}
+{
+}
 
 void GeneralSettingsPage::applySettings()
 {
@@ -131,6 +150,11 @@ void GeneralSettingsPage::applySettings()
     settings->setEditableUrl(m_editableUrl->isChecked());
     settings->setFilterBar(m_filterBar->isChecked());
 
+    KSharedConfig::Ptr konqConfig = KSharedConfig::openConfig("konquerorrc", KConfig::IncludeGlobals);
+    KConfigGroup trashConfig(konqConfig, "Trash");
+    trashConfig.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked());
+    trashConfig.writeEntry("ConfirmDelete", m_confirmDelete->isChecked());
+
     KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals);
     KConfigGroup kdeConfig(globalConfig, "KDE");
     kdeConfig.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked());
index 7dab3ea74e7472cb92424ea053efc49e03ae4b2f..83d4b0dba9d61e3ec3d65048c1a16cadc84e6123 100644 (file)
@@ -52,10 +52,14 @@ private slots:
 private:
     DolphinMainWindow* m_mainWindow;
     QLineEdit* m_homeUrl;
+
     QCheckBox* m_splitView;
     QCheckBox* m_editableUrl;
     QCheckBox* m_filterBar;
+
     QCheckBox* m_showDeleteCommand;
+    QCheckBox* m_confirmMoveToTrash;
+    QCheckBox* m_confirmDelete;
 };
 
 #endif