┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/dolphinsettingsdialog.cpp
diff options
context:
space:
mode:
authorAlex Richardson <[email protected]>2014-04-06 03:32:55 +0200
committerAlex Richardson <[email protected]>2014-05-05 23:05:13 +0200
commit2f045c60109e0a5811f68bcce617236e3478e402 (patch)
tree9c46f4506f5a693ddecd2564e0883e9fe2d0cf13 /src/settings/dolphinsettingsdialog.cpp
parentc2887688f102d0412ba93c74facd5ed007185e3a (diff)
Allow compiling Dolphin with KF5
This does not work properly yet, there are probably quite a few bad signal/ slot connections due to KUrl -> QUrl. However dolphin starts without crashing. Accessibility is not ported since that changed quite a lot from Qt4 -> Qt5 and I have no idea how it is supposed to be used. This is the first commit for review 117395
Diffstat (limited to 'src/settings/dolphinsettingsdialog.cpp')
-rw-r--r--src/settings/dolphinsettingsdialog.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp
index 609e2ab92..17c25a057 100644
--- a/src/settings/dolphinsettingsdialog.cpp
+++ b/src/settings/dolphinsettingsdialog.cpp
@@ -34,6 +34,9 @@
#include <KMessageBox>
#include <KIcon>
+#include <QPushButton>
+#include <QDialogButtonBox>
+
DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
KPageDialog(parent),
m_pages()
@@ -43,10 +46,12 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
setMinimumSize(QSize(512, minSize.height()));
setFaceType(List);
- setCaption(i18nc("@title:window", "Dolphin Preferences"));
- setButtons(Ok | Apply | Cancel | Default);
- enableButtonApply(false);
- setDefaultButton(Ok);
+ setWindowTitle(i18nc("@title:window", "Dolphin Preferences"));
+ QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Ok
+ | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
+ box->button(QDialogButtonBox::Apply)->setEnabled(false);
+ box->button(QDialogButtonBox::Ok)->setDefault(true);
+ setButtonBox(box);
// Startup
StartupSettingsPage* startupSettingsPage = new StartupSettingsPage(url, this);
@@ -91,7 +96,8 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
connect(generalSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog");
- restoreDialogSize(dialogConfig);
+#pragma message("TODO: port")
+ //restoreDialogSize(dialogConfig);
m_pages.append(startupSettingsPage);
m_pages.append(viewSettingsPage);
@@ -104,23 +110,25 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
DolphinSettingsDialog::~DolphinSettingsDialog()
{
KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog");
- saveDialogSize(dialogConfig);
+#pragma message("TODO: port")
+ //saveDialogSize(dialogConfig);
}
void DolphinSettingsDialog::slotButtonClicked(int button)
{
- if ((button == Ok) || (button == Apply)) {
+ if ((button == QDialogButtonBox::Ok) || (button == QDialogButtonBox::Apply)) {
applySettings();
- } else if (button == Default) {
+ } else if (button == QDialogButtonBox::RestoreDefaults) {
restoreDefaults();
}
- KPageDialog::slotButtonClicked(button);
+#pragma message("TODO: port")
+ //KPageDialog::slotButtonClicked(button);
}
void DolphinSettingsDialog::enableApply()
{
- enableButtonApply(true);
+ buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(true);
}
void DolphinSettingsDialog::applySettings()
@@ -138,8 +146,7 @@ void DolphinSettingsDialog::applySettings()
settings->setModifiedStartupSettings(false);
settings->writeConfig();
}
-
- enableButtonApply(false);
+ buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(false);
}
void DolphinSettingsDialog::restoreDefaults()