Changeset View
Changeset View
Standalone View
Standalone View
src/EditProfileDialog.cpp
Show All 14 Lines | 1 | /* | |||
---|---|---|---|---|---|
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
18 | 02110-1301 USA. | 18 | 02110-1301 USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | // Own | 21 | // Own | ||
22 | #include "EditProfileDialog.h" | 22 | #include "EditProfileDialog.h" | ||
23 | #include "KonsoleSettings.h" | ||||
23 | 24 | | |||
24 | // Standard | 25 | // Standard | ||
25 | #include <cmath> | 26 | #include <cmath> | ||
26 | 27 | | |||
27 | // Qt | 28 | // Qt | ||
28 | #include <QBrush> | 29 | #include <QBrush> | ||
29 | #include <QDialog> | 30 | #include <QDialog> | ||
30 | #include <QDialogButtonBox> | 31 | #include <QDialogButtonBox> | ||
Show All 13 Lines | |||||
44 | 45 | | |||
45 | // KDE | 46 | // KDE | ||
46 | #include <KCodecAction> | 47 | #include <KCodecAction> | ||
47 | #include <KIconDialog> | 48 | #include <KIconDialog> | ||
48 | #include <KLocalizedString> | 49 | #include <KLocalizedString> | ||
49 | #include <KMessageBox> | 50 | #include <KMessageBox> | ||
50 | #include <KNSCore/DownloadManager> | 51 | #include <KNSCore/DownloadManager> | ||
51 | #include <KWindowSystem> | 52 | #include <KWindowSystem> | ||
53 | #include <KConfigDialogManager> | ||||
52 | 54 | | |||
53 | // Konsole | 55 | // Konsole | ||
54 | #include "ui_EditProfileGeneralPage.h" | 56 | #include "ui_EditProfileGeneralPage.h" | ||
55 | #include "ui_EditProfileTabsPage.h" | 57 | #include "ui_EditProfileTabsPage.h" | ||
56 | #include "ui_EditProfileAppearancePage.h" | 58 | #include "ui_EditProfileAppearancePage.h" | ||
57 | #include "ui_EditProfileScrollingPage.h" | 59 | #include "ui_EditProfileScrollingPage.h" | ||
58 | #include "ui_EditProfileKeyboardPage.h" | 60 | #include "ui_EditProfileKeyboardPage.h" | ||
59 | #include "ui_EditProfileMousePage.h" | 61 | #include "ui_EditProfileMousePage.h" | ||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 92 | { | |||
165 | appearanceAligner.align(); | 167 | appearanceAligner.align(); | ||
166 | 168 | | |||
167 | // Scrolling page | 169 | // Scrolling page | ||
168 | 170 | | |||
169 | const QString scrollingPageName = i18n("Scrolling"); | 171 | const QString scrollingPageName = i18n("Scrolling"); | ||
170 | auto *scrollingPageWidget = new QWidget(this); | 172 | auto *scrollingPageWidget = new QWidget(this); | ||
171 | _scrollingUi = new Ui::EditProfileScrollingPage(); | 173 | _scrollingUi = new Ui::EditProfileScrollingPage(); | ||
172 | _scrollingUi->setupUi(scrollingPageWidget); | 174 | _scrollingUi->setupUi(scrollingPageWidget); | ||
175 | _scrollingUi->historySizeWidget->setTemporary(false); | ||||
173 | auto *scrollingPageItem = addPage(scrollingPageWidget, scrollingPageName); | 176 | auto *scrollingPageItem = addPage(scrollingPageWidget, scrollingPageName); | ||
174 | scrollingPageItem->setHeader(scrollingPageName); | 177 | scrollingPageItem->setHeader(scrollingPageName); | ||
175 | scrollingPageItem->setIcon(QIcon::fromTheme(QStringLiteral("transform-move-vertical"), | 178 | scrollingPageItem->setIcon(QIcon::fromTheme(QStringLiteral("transform-move-vertical"), | ||
176 | defaultIcon)); | 179 | defaultIcon)); | ||
177 | _pages[scrollingPageItem] = Page(&EditProfileDialog::setupScrollingPage); | 180 | _pages[scrollingPageItem] = Page(&EditProfileDialog::setupScrollingPage); | ||
178 | 181 | | |||
179 | // adjust "history size" label height to match history size widget's first radio button | | |||
180 | _scrollingUi->historySizeLabel->setFixedHeight(_scrollingUi->historySizeWidget->preferredLabelHeight()); | | |||
181 | | ||||
182 | // Keyboard page | 182 | // Keyboard page | ||
183 | 183 | | |||
184 | const QString keyboardPageName = i18n("Keyboard"); | 184 | const QString keyboardPageName = i18n("Keyboard"); | ||
185 | const QString keyboardPageTitle = i18n("Key bindings"); | 185 | const QString keyboardPageTitle = i18n("Key bindings"); | ||
186 | auto *keyboardPageWidget = new QWidget(this); | 186 | auto *keyboardPageWidget = new QWidget(this); | ||
187 | _keyboardUi = new Ui::EditProfileKeyboardPage(); | 187 | _keyboardUi = new Ui::EditProfileKeyboardPage(); | ||
188 | _keyboardUi->setupUi(keyboardPageWidget); | 188 | _keyboardUi->setupUi(keyboardPageWidget); | ||
189 | auto *keyboardPageItem = addPage(keyboardPageWidget, keyboardPageName); | 189 | auto *keyboardPageItem = addPage(keyboardPageWidget, keyboardPageName); | ||
Show All 35 Lines | |||||
225 | // | 225 | // | ||
226 | // the _pageNeedsUpdate vector keeps track of the pages that have | 226 | // the _pageNeedsUpdate vector keeps track of the pages that have | ||
227 | // not been updated since the last profile change and will need | 227 | // not been updated since the last profile change and will need | ||
228 | // to be refreshed when the user switches to them | 228 | // to be refreshed when the user switches to them | ||
229 | connect(this, &KPageDialog::currentPageChanged, | 229 | connect(this, &KPageDialog::currentPageChanged, | ||
230 | this, &Konsole::EditProfileDialog::preparePage); | 230 | this, &Konsole::EditProfileDialog::preparePage); | ||
231 | 231 | | |||
232 | createTempProfile(); | 232 | createTempProfile(); | ||
233 | | ||||
234 | KConfigDialogManager* manager = new KConfigDialogManager(this, KonsoleSettings::self()); | ||||
235 | connect(_buttonBox, &QDialogButtonBox::accepted, manager, &KConfigDialogManager::updateSettings); | ||||
236 | connect(_buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, manager, &KConfigDialogManager::updateSettings); | ||||
237 | connect(_buttonBox, &QDialogButtonBox::rejected, manager, &KConfigDialogManager::updateWidgets); | ||||
238 | manager->addWidget(scrollingPageWidget); | ||||
233 | } | 239 | } | ||
234 | 240 | | |||
235 | EditProfileDialog::~EditProfileDialog() | 241 | EditProfileDialog::~EditProfileDialog() | ||
236 | { | 242 | { | ||
237 | delete _generalUi; | 243 | delete _generalUi; | ||
238 | delete _tabsUi; | 244 | delete _tabsUi; | ||
239 | delete _appearanceUi; | 245 | delete _appearanceUi; | ||
240 | delete _scrollingUi; | 246 | delete _scrollingUi; | ||
▲ Show 20 Lines • Show All 1715 Lines • Show Last 20 Lines |