| 1923 | } |
| 1924 | |
| 1925 | void MainWindow::deleteGroup() |
| 1926 | { |
| 1927 | QObject* obj = sender(); |
| 1928 | if(!obj) |
| 1929 | return; |
| 1930 | QAction *action = qobject_cast<QAction *>(obj); |
| 1931 | if(!action) |
| 1932 | return; |
| 1933 | auto map = action->data().toMap(); |
| 1934 | if(!map.contains("group")) |
| 1935 | return; |
| 1936 | QString groupName = map["group"].toString(); |
| 1937 | if(!groupName.isEmpty()) |
| 1938 | { |
| 1939 | auto reply = QMessageBox::question(this, tr("Delete group"), tr("Are you sure you want to delete the group %1?") |
| 1940 | .arg(groupName), QMessageBox::Yes | QMessageBox::No); |
| 1941 | if(reply == QMessageBox::Yes) |
| 1942 | { |
| 1943 | APPLICATION->instances()->deleteGroup(groupName); |
| 1944 | } |
| 1945 | } |
| 1946 | } |
| 1947 | |
| 1948 | void MainWindow::undoTrashInstance() |
| 1949 | { |