There is already a confirmation MessageBox when you try to remove all plugins.
It works on my mac just now. If your mac skips it, then that is a bug in Qt 6.5.2 that is fixed in Qt 6.5.3
Code:
void PluginWidget::removeAllPlugins()
{
PluginDB *pdb = PluginDB::instance();
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setWindowFlags(Qt::Window | Qt::WindowStaysOnTopHint);
msgBox.setWindowTitle(tr("Remove All Plugins"));
msgBox.setText(tr("Are you sure sure you want to remove all of your plugins?"));
QPushButton *yesButton = msgBox.addButton(QMessageBox::Yes);
QPushButton *noButton = msgBox.addButton(QMessageBox::No);
msgBox.setDefaultButton(noButton);
msgBox.exec();
if (msgBox.clickedButton() == yesButton) {
ui.pluginTable->setSortingEnabled(false);
while (ui.pluginTable->rowCount() > 0) {
ui.pluginTable->removeRow(0);
}
pdb->remove_all_plugins();
ui.pluginTable->resizeColumnsToContents();
ui.pluginTable->setSortingEnabled(true);
}
foreach(QComboBox* cb, m_qlcbxs) {
cb->clear();
cb->setCurrentIndex(-1);
}
}