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
Telemetry
KUserFeedback
Commits
ef245a63
Commit
ef245a63
authored
Jan 01, 2017
by
Volker Krause
Browse files
Add safety question before deleting a product
parent
3d47a21c
Changes
1
Hide whitespace changes
Inline
Side-by-side
analyzer/mainwindow.cpp
View file @
ef245a63
...
...
@@ -202,7 +202,12 @@ void MainWindow::deleteProduct()
if
(
sel
.
isEmpty
())
return
;
const
auto
product
=
sel
.
first
().
data
(
ProductModel
::
ProductRole
).
value
<
Product
>
();
// TODO saftey question
const
auto
mb
=
QMessageBox
::
critical
(
this
,
tr
(
"Delete Product"
),
tr
(
"Do you really want to delete product %1 with all its data?"
).
arg
(
product
.
name
()),
QMessageBox
::
Discard
|
QMessageBox
::
Cancel
,
QMessageBox
::
Cancel
);
if
(
mb
!=
QMessageBox
::
Discard
)
return
;
auto
reply
=
RESTApi
::
deleteProduct
(
m_restClient
,
product
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
]()
{
if
(
reply
->
error
()
==
QNetworkReply
::
NoError
)
{
...
...
Write
Preview
Supports
Markdown
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