| 1560 | } |
| 1561 | |
| 1562 | void MainWindow::deleteGroup() |
| 1563 | { |
| 1564 | QObject* obj = sender(); |
| 1565 | if(!obj) |
| 1566 | return; |
| 1567 | QAction *action = qobject_cast<QAction *>(obj); |
| 1568 | if(!action) |
| 1569 | return; |
| 1570 | auto map = action->data().toMap(); |
| 1571 | if(!map.contains("group")) |
| 1572 | return; |
| 1573 | QString groupName = map["group"].toString(); |
| 1574 | if(!groupName.isEmpty()) |
| 1575 | { |
| 1576 | auto reply = QMessageBox::question(this, tr("Delete group"), tr("Are you sure you want to delete the group %1") |
| 1577 | .arg(groupName), QMessageBox::Yes | QMessageBox::No); |
| 1578 | if(reply == QMessageBox::Yes) |
| 1579 | { |
| 1580 | APPLICATION->instances()->deleteGroup(groupName); |
| 1581 | } |
| 1582 | } |
| 1583 | } |
| 1584 | |
| 1585 | void MainWindow::on_actionViewInstanceFolder_triggered() |
| 1586 | { |