#include <kdialog.h>
#include <kfiledialog.h>
#include <klocale.h>
+#include <kmessagebox.h>
#include <kvbox.h>
#include <QCheckBox>
homeBoxLayout->addWidget(homeUrlBox);
homeBoxLayout->addWidget(buttonBox);
- QGroupBox* startBox = new QGroupBox(i18nc("@title:group", "Settings"), vBox);
-
// create 'Split view', 'Editable location' and 'Filter bar' checkboxes
- m_splitView = new QCheckBox(i18nc("@option:check Startup Settings", "Split view mode"), startBox);
- m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar"), startBox);
- m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"),startBox);
-
- QVBoxLayout* startBoxLayout = new QVBoxLayout(startBox);
- startBoxLayout->addWidget(m_splitView);
- startBoxLayout->addWidget(m_editableUrl);
- startBoxLayout->addWidget(m_filterBar);
+ m_splitView = new QCheckBox(i18nc("@option:check Startup Settings", "Split view mode"), vBox);
+ m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar"), vBox);
+ m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox);
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
const KUrl url(m_homeUrl->text());
- KFileItem fileItem(S_IFDIR, KFileItem::Unknown, url);
+ KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, url);
if (url.isValid() && fileItem.isDir()) {
settings->setHomeUrl(url.prettyUrl());
+ } else {
+ KMessageBox::error(this, i18n("The location for the home folder is invalid and will not get applied."));
}
settings->setSplitView(m_splitView->isChecked());
void StartupSettingsPage::useDefaultLocation()
{
- m_homeUrl->setText("file://" + QDir::homePath());
+ m_homeUrl->setText(QDir::homePath());
}
void StartupSettingsPage::loadSettings()