Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
libksieve
Commits
5b886b02
Commit
5b886b02
authored
Jul 14, 2021
by
Laurent Montel
😁
Browse files
Don't change text if we cancel dialog box
parent
d5804b45
Pipeline
#70694
skipped
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/ksieveui/autocreatescripts/sievescriptlistbox.cpp
View file @
5b886b02
...
...
@@ -247,8 +247,9 @@ SieveScriptPage *SieveScriptListBox::createNewScript(const QString &newName, con
void
SieveScriptListBox
::
slotNew
()
{
const
QString
newName
=
QInputDialog
::
getText
(
this
,
i18nc
(
"@title:window"
,
"New Script"
),
i18n
(
"New script name:"
));
if
(
!
newName
.
trimmed
().
isEmpty
())
{
bool
ok
;
const
QString
newName
=
QInputDialog
::
getText
(
this
,
i18nc
(
"@title:window"
,
"New Script"
),
i18n
(
"New script name:"
),
{},
{},
&
ok
);
if
(
!
newName
.
trimmed
().
isEmpty
()
&&
ok
)
{
createNewScript
(
newName
);
Q_EMIT
valueChanged
();
}
...
...
@@ -274,12 +275,15 @@ void SieveScriptListBox::slotRename()
{
QListWidgetItem
*
item
=
mSieveListScript
->
currentItem
();
if
(
item
)
{
bool
ok
=
false
;
QString
newName
=
QInputDialog
::
getText
(
this
,
i18nc
(
"@title:window"
,
"Rename Script"
),
i18n
(
"New name for the script:"
),
QLineEdit
::
Normal
,
item
->
text
());
newName
=
newName
.
trimmed
();
if
(
!
newName
.
isEmpty
())
{
item
->
setText
(
newName
);
Q_EMIT
valueChanged
();
QInputDialog
::
getText
(
this
,
i18nc
(
"@title:window"
,
"Rename Script"
),
i18n
(
"New name for the script:"
),
QLineEdit
::
Normal
,
item
->
text
(),
&
ok
);
if
(
ok
)
{
newName
=
newName
.
trimmed
();
if
(
!
newName
.
isEmpty
())
{
item
->
setText
(
newName
);
Q_EMIT
valueChanged
();
}
}
}
}
...
...
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