]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/startup/startupsettingspage.cpp
Add 'Sort By' and 'View Mode' into Dolphin file context menus
[dolphin.git] / src / settings / startup / startupsettingspage.cpp
index 6554493d8066ab6a67c2ed633655e7ff6aed1d89..4071ee04f58fb5b80d47c0e3695b898bae762af1 100644 (file)
 
 #include "startupsettingspage.h"
 
-#include "global.h"
+#include "dolphin_generalsettings.h"
 #include "dolphinmainwindow.h"
 #include "dolphinviewcontainer.h"
-
-#include "dolphin_generalsettings.h"
+#include "global.h"
 
 #include <KLocalizedString>
-#include <QLineEdit>
 #include <KMessageBox>
 
-#include <QVBoxLayout>
 #include <QCheckBox>
+#include <QFileDialog>
 #include <QGroupBox>
 #include <QLabel>
+#include <QLineEdit>
 #include <QPushButton>
-#include <QHBoxLayout>
-#include <QFileDialog>
-
-#include "views/dolphinview.h"
+#include <QVBoxLayout>
 
 StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
     SettingsPageBase(parent),
     m_url(url),
-    m_homeUrl(0),
-    m_splitView(0),
-    m_editableUrl(0),
-    m_showFullPath(0),
-    m_filterBar(0)
+    m_homeUrl(nullptr),
+    m_splitView(nullptr),
+    m_editableUrl(nullptr),
+    m_showFullPath(nullptr),
+    m_filterBar(nullptr),
+    m_showFullPathInTitlebar(nullptr)
 {
     QVBoxLayout* topLayout = new QVBoxLayout(this);
     QWidget* vBox = new QWidget(this);
@@ -104,6 +101,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
     vBoxLayout->addWidget(m_showFullPath);
     m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox);
     vBoxLayout->addWidget(m_filterBar);
+    m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar"), vBox);
+    vBoxLayout->addWidget(m_showFullPathInTitlebar);
 
     // Add a dummy widget with no restriction regarding
     // a vertical resizing. This assures that the dialog layout
@@ -119,6 +118,7 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
     connect(m_editableUrl,  &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
     connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
     connect(m_filterBar,    &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+    connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
 }
 
 StartupSettingsPage::~StartupSettingsPage()
@@ -141,6 +141,7 @@ void StartupSettingsPage::applySettings()
     settings->setEditableUrl(m_editableUrl->isChecked());
     settings->setShowFullPath(m_showFullPath->isChecked());
     settings->setFilterBar(m_filterBar->isChecked());
+    settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked());
 
     settings->save();
 }
@@ -190,4 +191,5 @@ void StartupSettingsPage::loadSettings()
     m_editableUrl->setChecked(GeneralSettings::editableUrl());
     m_showFullPath->setChecked(GeneralSettings::showFullPath());
     m_filterBar->setChecked(GeneralSettings::filterBar());
+    m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar());
 }