#include <kdialog.h>
#include <kfiledialog.h>
#include <klocale.h>
+#include <klineedit.h>
#include <kmessagebox.h>
#include <kvbox.h>
#include <QCheckBox>
#include <QGroupBox>
#include <QLabel>
-#include <QLineEdit>
#include <QPushButton>
#include <QRadioButton>
homeUrlBox->setSpacing(spacing);
new QLabel(i18nc("@label:textbox", "Location:"), homeUrlBox);
- m_homeUrl = new QLineEdit(homeUrlBox);
+ m_homeUrl = new KLineEdit(homeUrlBox);
+ m_homeUrl->setClearButtonShown(true);
QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder-open"), QString(), homeUrlBox);
connect(selectHomeUrlButton, SIGNAL(clicked()),
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);
+ connect(m_splitView, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+ connect(m_editableUrl, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+ connect(m_filterBar, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
topLayout->addWidget(vBox);
loadSettings();
+
+ // it's important connecting 'textChanged' after loadSettings(), as loadSettings()
+ // invokes m_homeUrl->setText()
+ connect(m_homeUrl, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed()));
}
StartupSettingsPage::~StartupSettingsPage()
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."));
+ KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid and will not be applied."));
}
settings->setSplitView(m_splitView->isChecked());
void StartupSettingsPage::selectHomeUrl()
{
const QString homeUrl = m_homeUrl->text();
- KUrl url = KFileDialog::getExistingDirectoryUrl(homeUrl);
+ KUrl url = KFileDialog::getExistingDirectoryUrl(homeUrl, this);
if (!url.isEmpty()) {
m_homeUrl->setText(url.prettyUrl());
+ emit changed();
}
}