Changeset View
Changeset View
Standalone View
Standalone View
kcms/ksmserver/smserverconfigimpl.cpp
Show All 11 Lines | |||||
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * | ||
15 | * * | 15 | * * | ||
16 | ***************************************************************************/ | 16 | ***************************************************************************/ | ||
17 | 17 | | |||
18 | #include "smserverconfigimpl.h" | 18 | #include "smserverconfigimpl.h" | ||
19 | 19 | | |||
20 | #include <KMessageWidget> | ||||
sitter: Not needed? .h includes ui_.h and that would include kmessagewidget.h | |||||
21 | | ||||
20 | SMServerConfigImpl::SMServerConfigImpl(QWidget *parent ) : SMServerConfigDlg(parent) { | 22 | SMServerConfigImpl::SMServerConfigImpl(QWidget *parent ) : SMServerConfigDlg(parent) { | ||
21 | connect(confirmLogoutCheck,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | 23 | connect(confirmLogoutCheck,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | ||
22 | connect(previousSessionRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | 24 | connect(previousSessionRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | ||
23 | connect(savedSessionRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | 25 | connect(savedSessionRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | ||
24 | connect(emptySessionRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | 26 | connect(emptySessionRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | ||
25 | connect(logoutRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | 27 | connect(logoutRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | ||
26 | connect(haltRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | 28 | connect(haltRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | ||
27 | connect(rebootRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | 29 | connect(rebootRadio,&QAbstractButton::toggled, this, &SMServerConfigImpl::configChanged); | ||
28 | connect(excludeLineedit,&QLineEdit::textChanged,this, &SMServerConfigImpl::configChanged); | 30 | connect(excludeLineedit,&QLineEdit::textChanged,this, &SMServerConfigImpl::configChanged); | ||
29 | connect(offerShutdownCheck,&QAbstractButton::toggled,this, &SMServerConfigImpl::configChanged); | 31 | connect(offerShutdownCheck,&QAbstractButton::toggled,this, &SMServerConfigImpl::configChanged); | ||
32 | | ||||
33 | firmwareSetupCheck->setIcon(QIcon::fromTheme(QStringLiteral("system-reboot-setup-firmware"))); | ||||
34 | firmwareSetupBox->hide(); | ||||
35 | connect(firmwareSetupCheck, &QCheckBox::clicked, this, &SMServerConfigImpl::firmwareSetupRequested); | ||||
36 | | ||||
37 | firmwareSetupMessageWidget->hide(); | ||||
30 | } | 38 | } | ||
31 | SMServerConfigImpl::~SMServerConfigImpl(){ | 39 | SMServerConfigImpl::~SMServerConfigImpl(){ | ||
32 | } | 40 | } | ||
33 | /** No descriptions */ | 41 | /** No descriptions */ | ||
34 | void SMServerConfigImpl::configChanged(){ | 42 | void SMServerConfigImpl::configChanged(){ | ||
35 | 43 | | |||
36 | emit changed(); | 44 | emit changed(); | ||
37 | 45 | | |||
38 | } | 46 | } | ||
47 | | ||||
48 | bool SMServerConfigImpl::firmwareSetupSupported() const | ||||
49 | { | ||||
50 | return firmwareSetupBox->isVisible(); | ||||
51 | } | ||||
52 | | ||||
53 | void SMServerConfigImpl::setFirmwareSetupSupported(bool supported) | ||||
54 | { | ||||
55 | firmwareSetupBox->setVisible(supported); | ||||
56 | } | ||||
57 | | ||||
58 | bool SMServerConfigImpl::firmwareSetupChecked() const | ||||
59 | { | ||||
60 | return firmwareSetupCheck->isChecked(); | ||||
61 | } | ||||
62 | | ||||
63 | void SMServerConfigImpl::setFirmwareSetupChecked(bool checked) | ||||
64 | { | ||||
65 | firmwareSetupCheck->setChecked(checked); | ||||
66 | } | ||||
67 | | ||||
68 | QString SMServerConfigImpl::firmwareSetupTitle() const | ||||
69 | { | ||||
70 | return firmwareSetupBox->title(); | ||||
71 | } | ||||
72 | | ||||
73 | void SMServerConfigImpl::setFirmwareSetupTitle(const QString &title) | ||||
74 | { | ||||
75 | firmwareSetupBox->setTitle(title); | ||||
76 | } | ||||
77 | | ||||
78 | QString SMServerConfigImpl::firmwareSetupLabel() const | ||||
79 | { | ||||
80 | return firmwareSetupCheck->text(); | ||||
81 | } | ||||
82 | | ||||
83 | void SMServerConfigImpl::setFirmwareSetupLabel(const QString &label) | ||||
84 | { | ||||
85 | firmwareSetupCheck->setText(label); | ||||
86 | } | ||||
87 | | ||||
88 | void SMServerConfigImpl::showFirmwareSetupMessage(KMessageWidget::MessageType type, const QString &text) | ||||
89 | { | ||||
90 | firmwareSetupMessageWidget->setMessageType(type); | ||||
91 | firmwareSetupMessageWidget->setText(text); | ||||
92 | firmwareSetupMessageWidget->animatedShow(); | ||||
93 | } | ||||
94 | | ||||
95 | void SMServerConfigImpl::hideFirmwareSetupMessage() | ||||
96 | { | ||||
97 | firmwareSetupMessageWidget->animatedHide(); | ||||
98 | } |
Not needed? .h includes ui_.h and that would include kmessagewidget.h