Changeset View
Changeset View
Standalone View
Standalone View
src/settings/startup/startupsettingspage.cpp
Show All 37 Lines | |||||
38 | StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : | 38 | StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : | ||
39 | SettingsPageBase(parent), | 39 | SettingsPageBase(parent), | ||
40 | m_url(url), | 40 | m_url(url), | ||
41 | m_homeUrl(nullptr), | 41 | m_homeUrl(nullptr), | ||
42 | m_splitView(nullptr), | 42 | m_splitView(nullptr), | ||
43 | m_editableUrl(nullptr), | 43 | m_editableUrl(nullptr), | ||
44 | m_showFullPath(nullptr), | 44 | m_showFullPath(nullptr), | ||
45 | m_filterBar(nullptr), | 45 | m_filterBar(nullptr), | ||
46 | m_showFullPathInTitlebar(nullptr) | 46 | m_showFullPathInTitlebar(nullptr), | ||
47 | m_openExternallyCalledFolderInNewTab(nullptr) | ||||
47 | { | 48 | { | ||
48 | QFormLayout* topLayout = new QFormLayout(this); | 49 | QFormLayout* topLayout = new QFormLayout(this); | ||
49 | 50 | | |||
50 | 51 | | |||
51 | // create 'Home URL' editor | 52 | // create 'Home URL' editor | ||
52 | QHBoxLayout* homeUrlBoxLayout = new QHBoxLayout(); | 53 | QHBoxLayout* homeUrlBoxLayout = new QHBoxLayout(); | ||
53 | homeUrlBoxLayout->setContentsMargins(0, 0, 0, 0); | 54 | homeUrlBoxLayout->setContentsMargins(0, 0, 0, 0); | ||
54 | 55 | | |||
Show All 40 Lines | 65 | #endif | |||
95 | m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar")); | 96 | m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar")); | ||
96 | topLayout->addRow(QString(), m_editableUrl); | 97 | topLayout->addRow(QString(), m_editableUrl); | ||
97 | m_showFullPath = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path inside location bar")); | 98 | m_showFullPath = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path inside location bar")); | ||
98 | topLayout->addRow(QString(), m_showFullPath); | 99 | topLayout->addRow(QString(), m_showFullPath); | ||
99 | m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar")); | 100 | m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar")); | ||
100 | topLayout->addRow(QString(), m_filterBar); | 101 | topLayout->addRow(QString(), m_filterBar); | ||
101 | m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar")); | 102 | m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar")); | ||
102 | topLayout->addRow(QString(), m_showFullPathInTitlebar); | 103 | topLayout->addRow(QString(), m_showFullPathInTitlebar); | ||
104 | m_openExternallyCalledFolderInNewTab = new QCheckBox(i18nc("@option:check Startup Settings", "Open new folders in tabs")); | ||||
elvisangelaccio: Can we find a different wording here? I feel like "externally called" is too technical.
Maybe… | |||||
I feel like we need to make it clear just what will be opened in a new tab, or else some people might think that regular navigation using their existing window will create new tabs. Maybe "Open new tabs instead of new windows"? ngraham: I feel like we need to make it clear just //what// will be opened in a new tab, or else some… | |||||
Okular (which has the same feature) presents the option as "open new files in tabs", so I've opted for "open new folders in tabs" for consistency. feverfew: Okular (which has the same feature) presents the option as "open new files in tabs", so I've… | |||||
105 | topLayout->addRow(QString(), m_openExternallyCalledFolderInNewTab); | ||||
103 | 106 | | |||
104 | 107 | | |||
105 | loadSettings(); | 108 | loadSettings(); | ||
106 | 109 | | |||
107 | connect(m_homeUrl, &QLineEdit::textChanged, this, &StartupSettingsPage::slotSettingsChanged); | 110 | connect(m_homeUrl, &QLineEdit::textChanged, this, &StartupSettingsPage::slotSettingsChanged); | ||
108 | connect(m_splitView, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | 111 | connect(m_splitView, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | ||
109 | connect(m_editableUrl, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | 112 | connect(m_editableUrl, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | ||
110 | connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | 113 | connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | ||
111 | connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | 114 | connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | ||
112 | connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | 115 | connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | ||
116 | connect(m_openExternallyCalledFolderInNewTab, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); | ||||
113 | } | 117 | } | ||
114 | 118 | | |||
115 | StartupSettingsPage::~StartupSettingsPage() | 119 | StartupSettingsPage::~StartupSettingsPage() | ||
116 | { | 120 | { | ||
117 | } | 121 | } | ||
118 | 122 | | |||
119 | void StartupSettingsPage::applySettings() | 123 | void StartupSettingsPage::applySettings() | ||
120 | { | 124 | { | ||
121 | GeneralSettings* settings = GeneralSettings::self(); | 125 | GeneralSettings* settings = GeneralSettings::self(); | ||
122 | 126 | | |||
123 | const QUrl url(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile)); | 127 | const QUrl url(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile)); | ||
124 | KFileItem fileItem(url); | 128 | KFileItem fileItem(url); | ||
125 | if ((url.isValid() && fileItem.isDir()) || (url.scheme() == QLatin1String("timeline"))) { | 129 | if ((url.isValid() && fileItem.isDir()) || (url.scheme() == QLatin1String("timeline"))) { | ||
126 | settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile)); | 130 | settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile)); | ||
127 | } else { | 131 | } else { | ||
128 | KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid or does not exist, it will not be applied.")); | 132 | KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid or does not exist, it will not be applied.")); | ||
129 | } | 133 | } | ||
130 | 134 | | |||
131 | settings->setSplitView(m_splitView->isChecked()); | 135 | settings->setSplitView(m_splitView->isChecked()); | ||
132 | settings->setEditableUrl(m_editableUrl->isChecked()); | 136 | settings->setEditableUrl(m_editableUrl->isChecked()); | ||
133 | settings->setShowFullPath(m_showFullPath->isChecked()); | 137 | settings->setShowFullPath(m_showFullPath->isChecked()); | ||
134 | settings->setFilterBar(m_filterBar->isChecked()); | 138 | settings->setFilterBar(m_filterBar->isChecked()); | ||
135 | settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked()); | 139 | settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked()); | ||
136 | 140 | settings->setOpenExternallyCalledFolderInNewTab(m_openExternallyCalledFolderInNewTab->isChecked()); | |||
137 | settings->save(); | 141 | settings->save(); | ||
138 | } | 142 | } | ||
139 | 143 | | |||
140 | void StartupSettingsPage::restoreDefaults() | 144 | void StartupSettingsPage::restoreDefaults() | ||
141 | { | 145 | { | ||
142 | GeneralSettings* settings = GeneralSettings::self(); | 146 | GeneralSettings* settings = GeneralSettings::self(); | ||
143 | settings->useDefaults(true); | 147 | settings->useDefaults(true); | ||
144 | loadSettings(); | 148 | loadSettings(); | ||
Show All 33 Lines | |||||
178 | { | 182 | { | ||
179 | const QUrl url(Dolphin::homeUrl()); | 183 | const QUrl url(Dolphin::homeUrl()); | ||
180 | m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile)); | 184 | m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile)); | ||
181 | m_splitView->setChecked(GeneralSettings::splitView()); | 185 | m_splitView->setChecked(GeneralSettings::splitView()); | ||
182 | m_editableUrl->setChecked(GeneralSettings::editableUrl()); | 186 | m_editableUrl->setChecked(GeneralSettings::editableUrl()); | ||
183 | m_showFullPath->setChecked(GeneralSettings::showFullPath()); | 187 | m_showFullPath->setChecked(GeneralSettings::showFullPath()); | ||
184 | m_filterBar->setChecked(GeneralSettings::filterBar()); | 188 | m_filterBar->setChecked(GeneralSettings::filterBar()); | ||
185 | m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); | 189 | m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); | ||
190 | m_openExternallyCalledFolderInNewTab->setChecked(GeneralSettings::openExternallyCalledFolderInNewTab()); | ||||
186 | } | 191 | } |
Can we find a different wording here? I feel like "externally called" is too technical.
Maybe just a simpler "Open new folders in a tab" ?