Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KMailTransport
Commits
5cafbed1
Commit
5cafbed1
authored
Jul 07, 2017
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not necessary to create private class here as it's on plugin
parent
76c96e7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
44 deletions
+24
-44
src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp
src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp
+18
-39
src/kmailtransport/plugins/smtp/smtpconfigdialog.h
src/kmailtransport/plugins/smtp/smtpconfigdialog.h
+6
-5
No files found.
src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp
View file @
5cafbed1
...
...
@@ -31,61 +31,40 @@
using
namespace
MailTransport
;
class
MailTransport
::
SmtpConfigDialog
::
Private
{
public:
Private
(
SmtpConfigDialog
*
qq
)
:
transport
(
nullptr
)
,
configWidget
(
nullptr
)
,
q
(
qq
)
,
okButton
(
nullptr
)
{
}
Transport
*
transport
;
SMTPConfigWidget
*
configWidget
;
SmtpConfigDialog
*
q
;
QPushButton
*
okButton
;
void
okClicked
();
void
slotTextChanged
(
const
QString
&
text
);
};
void
SmtpConfigDialog
::
Private
::
okClicked
()
{
configWidget
->
apply
();
transport
->
save
();
}
void
SmtpConfigDialog
::
Private
::
slotTextChanged
(
const
QString
&
text
)
{
okButton
->
setEnabled
(
!
text
.
isEmpty
());
}
SmtpConfigDialog
::
SmtpConfigDialog
(
Transport
*
transport
,
QWidget
*
parent
)
:
QDialog
(
parent
)
,
d
(
new
Private
(
this
))
{
Q_ASSERT
(
transport
);
d
->
t
ransport
=
transport
;
mT
ransport
=
transport
;
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
d
->
c
onfigWidget
=
new
SMTPConfigWidget
(
transport
,
this
);
d
->
c
onfigWidget
->
setObjectName
(
QStringLiteral
(
"smtpconfigwidget"
));
mainLayout
->
addWidget
(
d
->
c
onfigWidget
);
mC
onfigWidget
=
new
SMTPConfigWidget
(
transport
,
this
);
mC
onfigWidget
->
setObjectName
(
QStringLiteral
(
"smtpconfigwidget"
));
mainLayout
->
addWidget
(
mC
onfigWidget
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
buttonBox
->
setObjectName
(
QStringLiteral
(
"buttons"
));
d
->
o
kButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
d
->
o
kButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
mO
kButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
mO
kButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
mainLayout
->
addWidget
(
buttonBox
);
connect
(
d
->
o
kButton
,
SIGNAL
(
clicked
())
,
this
,
SLOT
(
okClicked
())
);
connect
(
mO
kButton
,
&
QAbstractButton
::
clicked
,
this
,
&
SmtpConfigDialog
::
okClicked
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
SmtpConfigDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
SmtpConfigDialog
::
reject
);
}
SmtpConfigDialog
::~
SmtpConfigDialog
()
{
delete
d
;
}
void
SmtpConfigDialog
::
okClicked
()
{
mConfigWidget
->
apply
();
mTransport
->
save
();
}
void
SmtpConfigDialog
::
slotTextChanged
(
const
QString
&
text
)
{
mOkButton
->
setEnabled
(
!
text
.
isEmpty
());
}
#include "moc_smtpconfigdialog.cpp"
src/kmailtransport/plugins/smtp/smtpconfigdialog.h
View file @
5cafbed1
...
...
@@ -24,7 +24,7 @@
namespace
MailTransport
{
class
Transport
;
class
SMTPConfigWidget
;
class
SmtpConfigDialog
:
public
QDialog
{
Q_OBJECT
...
...
@@ -33,11 +33,12 @@ public:
virtual
~
SmtpConfigDialog
();
private:
class
Private
;
Private
*
const
d
;
void
okClicked
()
;
void
slotTextChanged
(
const
QString
&
text
)
;
Q_PRIVATE_SLOT
(
d
,
void
okClicked
())
Q_PRIVATE_SLOT
(
d
,
void
slotTextChanged
(
const
QString
&
))
Transport
*
mTransport
;
SMTPConfigWidget
*
mConfigWidget
;
QPushButton
*
mOkButton
;
};
}
// namespace MailTransport
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment