| 1578 | } |
| 1579 | |
| 1580 | void MainWindow::deleteGroup() |
| 1581 | { |
| 1582 | QObject* obj = sender(); |
| 1583 | if(!obj) |
| 1584 | return; |
| 1585 | QAction *action = qobject_cast<QAction *>(obj); |
| 1586 | if(!action) |
| 1587 | return; |
| 1588 | auto map = action->data().toMap(); |
| 1589 | if(!map.contains("group")) |
| 1590 | return; |
| 1591 | QString groupName = map["group"].toString(); |
| 1592 | if(!groupName.isEmpty()) |
| 1593 | { |
| 1594 | auto reply = QMessageBox::question(this, tr("Delete group"), tr("Are you sure you want to delete the group %1") |
| 1595 | .arg(groupName), QMessageBox::Yes | QMessageBox::No); |
| 1596 | if(reply == QMessageBox::Yes) |
| 1597 | { |
| 1598 | APPLICATION->instances()->deleteGroup(groupName); |
| 1599 | } |
| 1600 | } |
| 1601 | } |
| 1602 | |
| 1603 | void MainWindow::on_actionViewInstanceFolder_triggered() |
| 1604 | { |