Changeset View
Changeset View
Standalone View
Standalone View
src/settings/startup/startupsettingspage.cpp
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | |||||
63 | 63 | | |||
64 | #ifndef QT_NO_ACCESSIBILITY | 64 | #ifndef QT_NO_ACCESSIBILITY | ||
65 | selectHomeUrlButton->setAccessibleName(i18nc("@action:button", "Select Home Location")); | 65 | selectHomeUrlButton->setAccessibleName(i18nc("@action:button", "Select Home Location")); | ||
66 | #endif | 66 | #endif | ||
67 | 67 | | |||
68 | connect(selectHomeUrlButton, &QPushButton::clicked, | 68 | connect(selectHomeUrlButton, &QPushButton::clicked, | ||
69 | this, &StartupSettingsPage::selectHomeUrl); | 69 | this, &StartupSettingsPage::selectHomeUrl); | ||
70 | 70 | | |||
71 | QHBoxLayout *buttonBoxLayout = new QHBoxLayout(); | | |||
72 | buttonBoxLayout->setMargin(0); | | |||
73 | | ||||
74 | QPushButton* useCurrentButton = new QPushButton(i18nc("@action:button", "Use Current Location")); | 71 | QPushButton* useCurrentButton = new QPushButton(i18nc("@action:button", "Use Current Location")); | ||
75 | buttonBoxLayout->addWidget(useCurrentButton); | | |||
76 | connect(useCurrentButton, &QPushButton::clicked, | 72 | connect(useCurrentButton, &QPushButton::clicked, | ||
77 | this, &StartupSettingsPage::useCurrentLocation); | 73 | this, &StartupSettingsPage::useCurrentLocation); | ||
78 | QPushButton* useDefaultButton = new QPushButton(i18nc("@action:button", "Use Default Location")); | | |||
79 | buttonBoxLayout->addWidget(useDefaultButton); | | |||
80 | connect(useDefaultButton, &QPushButton::clicked, | | |||
81 | this, &StartupSettingsPage::useDefaultLocation); | | |||
82 | 74 | | |||
83 | QVBoxLayout *homeBoxLayout = new QVBoxLayout(); | 75 | QVBoxLayout *homeBoxLayout = new QVBoxLayout(); | ||
84 | homeBoxLayout->setMargin(0); | 76 | homeBoxLayout->setMargin(0); | ||
85 | homeBoxLayout->addLayout(homeUrlBoxLayout); | 77 | homeBoxLayout->addLayout(homeUrlBoxLayout); | ||
86 | homeBoxLayout->addLayout(buttonBoxLayout); | 78 | homeBoxLayout->addWidget(useCurrentButton); | ||
87 | 79 | | |||
88 | topLayout->addRow(i18nc("@label:textbox", "Location:"), homeBoxLayout); | 80 | topLayout->addRow(i18nc("@label:textbox", "Location:"), homeBoxLayout); | ||
89 | 81 | | |||
90 | 82 | | |||
91 | topLayout->addItem(new QSpacerItem(0,12, QSizePolicy::Fixed, QSizePolicy::Fixed)); | 83 | topLayout->addItem(new QSpacerItem(0,12, QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
92 | 84 | | |||
93 | 85 | | |||
94 | // create 'Split view', 'Show full path', 'Editable location' and 'Filter bar' checkboxes | 86 | // create 'Split view', 'Show full path', 'Editable location' and 'Filter bar' checkboxes | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 152 | { | |||
166 | } | 158 | } | ||
167 | } | 159 | } | ||
168 | 160 | | |||
169 | void StartupSettingsPage::useCurrentLocation() | 161 | void StartupSettingsPage::useCurrentLocation() | ||
170 | { | 162 | { | ||
171 | m_homeUrl->setText(m_url.toDisplayString(QUrl::PreferLocalFile)); | 163 | m_homeUrl->setText(m_url.toDisplayString(QUrl::PreferLocalFile)); | ||
172 | } | 164 | } | ||
173 | 165 | | |||
174 | void StartupSettingsPage::useDefaultLocation() | | |||
175 | { | | |||
176 | m_homeUrl->setText(QDir::homePath()); | | |||
177 | } | | |||
178 | | ||||
179 | void StartupSettingsPage::loadSettings() | 166 | void StartupSettingsPage::loadSettings() | ||
180 | { | 167 | { | ||
181 | const QUrl url(Dolphin::homeUrl()); | 168 | const QUrl url(Dolphin::homeUrl()); | ||
182 | m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile)); | 169 | m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile)); | ||
183 | m_splitView->setChecked(GeneralSettings::splitView()); | 170 | m_splitView->setChecked(GeneralSettings::splitView()); | ||
184 | m_editableUrl->setChecked(GeneralSettings::editableUrl()); | 171 | m_editableUrl->setChecked(GeneralSettings::editableUrl()); | ||
185 | m_showFullPath->setChecked(GeneralSettings::showFullPath()); | 172 | m_showFullPath->setChecked(GeneralSettings::showFullPath()); | ||
186 | m_filterBar->setChecked(GeneralSettings::filterBar()); | 173 | m_filterBar->setChecked(GeneralSettings::filterBar()); | ||
187 | m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); | 174 | m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); | ||
188 | } | 175 | } |