| 106 | } |
| 107 | |
| 108 | bool checkLinkedInstances(const QString& id, QWidget* parent, const QString& verb) |
| 109 | { |
| 110 | auto linkedInstances = APPLICATION->instances()->getLinkedInstancesById(id); |
| 111 | if (!linkedInstances.empty()) { |
| 112 | auto response = CustomMessageBox::selectable(parent, QObject::tr("There are linked instances"), |
| 113 | QObject::tr("The following instance(s) might reference files in this instance:\n\n" |
| 114 | "%1\n\n" |
| 115 | "%2 it could break the other instance(s), \n\n" |
| 116 | "Do you wish to proceed?", |
| 117 | nullptr, linkedInstances.count()) |
| 118 | .arg(linkedInstances.join("\n")) |
| 119 | .arg(verb), |
| 120 | QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) |
| 121 | ->exec(); |
| 122 | if (response != QMessageBox::Yes) |
| 123 | return false; |
| 124 | } |
| 125 | return true; |
| 126 | } |
no test coverage detected