X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d9c3648d5a4601d8e11e148ca77b3e9d84cf3207..2060fa8d4676fb2d5116830c304db8fdb556d959:/src/generalsettingspage.cpp diff --git a/src/generalsettingspage.cpp b/src/generalsettingspage.cpp index ba5473054..4a2b6df68 100644 --- a/src/generalsettingspage.cpp +++ b/src/generalsettingspage.cpp @@ -38,13 +38,13 @@ #include "dolphin_generalsettings.h" -GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* parent) : - SettingsPageBase(parent), - m_mainWindow(mainWin), - m_homeUrl(0), - m_startSplit(0), - m_startEditable(0), - m_showDeleteCommand(0) +GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* parent) : + SettingsPageBase(parent), + m_mainWindow(mainWin), + m_homeUrl(0), + m_startSplit(0), + m_startEditable(0), + m_showDeleteCommand(0) { const int spacing = KDialog::spacingHint(); GeneralSettings* settings = DolphinSettings::instance().generalSettings(); @@ -54,7 +54,7 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par vBox->setSpacing(spacing); // create 'Home URL' editor - QGroupBox* homeBox = new QGroupBox(i18n("Home folder"), vBox); + QGroupBox* homeBox = new QGroupBox(i18n("Home Folder"), vBox); KHBox* homeUrlBox = new KHBox(homeBox); homeUrlBox->setSpacing(spacing); @@ -62,17 +62,17 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par new QLabel(i18n("Location:"), homeUrlBox); m_homeUrl = new QLineEdit(settings->homeUrl(), homeUrlBox); - QPushButton* selectHomeUrlButton = new QPushButton(SmallIcon("folder"), QString(), homeUrlBox); + QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder"), QString(), homeUrlBox); connect(selectHomeUrlButton, SIGNAL(clicked()), this, SLOT(selectHomeUrl())); KHBox* buttonBox = new KHBox(homeBox); buttonBox->setSpacing(spacing); - QPushButton* useCurrentButton = new QPushButton(i18n("Use current location"), buttonBox); + QPushButton* useCurrentButton = new QPushButton(i18n("Use Current Location"), buttonBox); connect(useCurrentButton, SIGNAL(clicked()), this, SLOT(useCurrentLocation())); - QPushButton* useDefaultButton = new QPushButton(i18n("Use default location"), buttonBox); + QPushButton* useDefaultButton = new QPushButton(i18n("Use Default Location"), buttonBox); connect(useDefaultButton, SIGNAL(clicked()), this, SLOT(useDefaultLocation())); @@ -95,8 +95,9 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par startBoxLayout->addWidget(m_startEditable); m_showDeleteCommand = new QCheckBox(i18n("Show the command 'Delete' in context menu"), vBox); - // TODO: use global config like in Konqueror or is this a custom setting for Dolphin? - m_showDeleteCommand->setChecked(settings->showDeleteCommand()); + const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); + const KConfigGroup kdeConfig(globalConfig, "KDE"); + m_showDeleteCommand->setChecked(kdeConfig.readEntry("ShowDeleteCommand", false)); // Add a dummy widget with no restriction regarding // a vertical resizing. This assures that the dialog layout @@ -108,8 +109,7 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par GeneralSettingsPage::~GeneralSettingsPage() -{ -} +{} void GeneralSettingsPage::applySettings() { @@ -123,13 +123,17 @@ void GeneralSettingsPage::applySettings() settings->setSplitView(m_startSplit->isChecked()); settings->setEditableUrl(m_startEditable->isChecked()); - settings->setShowDeleteCommand(m_showDeleteCommand->isChecked()); + + KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); + KConfigGroup kdeConfig(globalConfig, "KDE"); + kdeConfig.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked()); + kdeConfig.sync(); } void GeneralSettingsPage::selectHomeUrl() { const QString homeUrl(m_homeUrl->text()); - KUrl url(KFileDialog::getExistingUrl(homeUrl)); + KUrl url(KFileDialog::getExistingDirectoryUrl(homeUrl)); if (!url.isEmpty()) { m_homeUrl->setText(url.prettyUrl()); }