forked from qt-creator/qt-creator
Annotation Editor question dialog
Change-Id: I4c278abf34bd6c33fe989a5aa80006f1d88f687b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Aleksei German <aleksei.german@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -78,28 +78,15 @@ void AnnotationEditor::removeFullAnnotation()
|
||||
if (!node.isValid())
|
||||
return;
|
||||
|
||||
QString dialogTitle = tr("Annotation");
|
||||
if (!node.customId().isNull()) {
|
||||
dialogTitle = node.customId();
|
||||
}
|
||||
QPointer<QMessageBox> deleteDialog = new QMessageBox(Core::ICore::dialogParent());
|
||||
deleteDialog->setWindowTitle(dialogTitle);
|
||||
deleteDialog->setText(tr("Delete this annotation?"));
|
||||
deleteDialog->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
deleteDialog->setDefaultButton(QMessageBox::Yes);
|
||||
|
||||
int result = deleteDialog->exec();
|
||||
|
||||
if (deleteDialog)
|
||||
deleteDialog->deleteLater();
|
||||
|
||||
if (result == QMessageBox::Yes) {
|
||||
if (QMessageBox::question(Core::ICore::dialogParent(),
|
||||
node.customId().isNull() ? tr("Annotation") : node.customId(),
|
||||
tr("Delete this annotation?"))
|
||||
== QMessageBox::Yes) {
|
||||
node.removeCustomId();
|
||||
node.removeAnnotation();
|
||||
emit customIdChanged();
|
||||
emit annotationChanged();
|
||||
}
|
||||
|
||||
emit customIdChanged();
|
||||
emit annotationChanged();
|
||||
}
|
||||
|
||||
void AnnotationEditor::acceptedClicked()
|
||||
|
||||
@@ -49,8 +49,8 @@ AnnotationTabWidget::AnnotationTabWidget(QWidget *parent)
|
||||
int currentIndex = this->currentIndex();
|
||||
QString currentTitle = tabText(currentIndex);
|
||||
if (QMessageBox::question(this,
|
||||
tr("Global Annotation"),
|
||||
tr("Do you want to delete this annotation?"))
|
||||
currentTitle,
|
||||
tr("Delete this comment?"))
|
||||
== QMessageBox::Yes) {
|
||||
removeTab(currentIndex);
|
||||
if (count() == 0) //lets be sure that tabWidget is never empty
|
||||
|
||||
@@ -62,21 +62,13 @@ void GlobalAnnotationEditor::removeFullAnnotation()
|
||||
return;
|
||||
|
||||
QString dialogTitle = tr("Global Annotation");
|
||||
QMessageBox *deleteDialog = new QMessageBox(Core::ICore::dialogParent());
|
||||
deleteDialog->setWindowTitle(dialogTitle);
|
||||
deleteDialog->setText(tr("Delete this annotation?"));
|
||||
deleteDialog->setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
deleteDialog->setDefaultButton(QMessageBox::Yes);
|
||||
|
||||
int result = deleteDialog->exec();
|
||||
if (deleteDialog)
|
||||
deleteDialog->deleteLater();
|
||||
|
||||
if (result == QMessageBox::Yes) {
|
||||
if (QMessageBox::question(Core::ICore::dialogParent(),
|
||||
tr("Global Annotation"),
|
||||
tr("Delete this annotation?"))
|
||||
== QMessageBox::Yes) {
|
||||
node.removeGlobalAnnotation();
|
||||
emit annotationChanged();
|
||||
}
|
||||
|
||||
emit annotationChanged();
|
||||
}
|
||||
|
||||
void GlobalAnnotationEditor::acceptedClicked()
|
||||
|
||||
Reference in New Issue
Block a user