]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/dolphinsettingsdialog.cpp
Rewrite search integration
[dolphin.git] / src / settings / dolphinsettingsdialog.cpp
index c564dd196c0b692232c8fc8bc8a052e2f5f2f611..d9184759e70a3517e7d66495dfad707e438af8b5 100644 (file)
@@ -21,6 +21,7 @@
 #include <KAuthorized>
 #include <KLocalizedString>
 #include <KMessageBox>
+#include <KRuntimePlatform>
 #include <KWindowConfig>
 
 #include <kwidgetsaddons_version.h>
@@ -37,16 +38,8 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl &url, QWidget *parent, K
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(540, minSize.height()));
 
-    setFaceType(List);
+    setFaceType(KRuntimePlatform::runtimePlatform().contains(QLatin1String("phone")) ? Tabbed : List);
     setWindowTitle(i18nc("@title:window", "Configure"));
-    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);
-
-    connect(box->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
-    connect(box->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
-    connect(box->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, this, &DolphinSettingsDialog::restoreDefaults);
 
     // Interface
     InterfaceSettingsPage *interfaceSettingsPage = new InterfaceSettingsPage(this);
@@ -112,6 +105,16 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl &url, QWidget *parent, K
     }
 #endif
 
+    // Create the buttons last so they are also last in the keyboard Tab focus order.
+    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);
+
+    connect(box->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+    connect(box->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+    connect(box->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, this, &DolphinSettingsDialog::restoreDefaults);
+
     const KConfigGroup dialogConfig(KSharedConfig::openStateConfig(), QStringLiteral("SettingsDialog"));
     KWindowConfig::restoreWindowSize(windowHandle(), dialogConfig);
 }