forked from qt-creator/qt-creator
CorePlugin: Add ok and cancel button to plugin dialog
Change-Id: I842be8fe3521026b98177e44925669fc5e67c83f Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -439,6 +439,8 @@ bool PluginView::setPluginsEnabled(const QSet<PluginSpec *> &plugins, bool enabl
|
||||
return item->m_spec == spec;
|
||||
});
|
||||
QTC_ASSERT(item, continue);
|
||||
if (m_affectedPlugins.find(spec) == m_affectedPlugins.end())
|
||||
m_affectedPlugins[spec] = spec->d->enabledBySettings;
|
||||
spec->d->setEnabledBySettings(enable);
|
||||
item->updateColumn(LoadedColumn);
|
||||
item->parent()->updateColumn(LoadedColumn);
|
||||
@@ -447,4 +449,10 @@ bool PluginView::setPluginsEnabled(const QSet<PluginSpec *> &plugins, bool enabl
|
||||
return true;
|
||||
}
|
||||
|
||||
void PluginView::cancelChanges()
|
||||
{
|
||||
for (auto element : m_affectedPlugins)
|
||||
element.first->d->setEnabledBySettings(element.second);
|
||||
}
|
||||
|
||||
} // namespace ExtensionSystem
|
||||
|
||||
Reference in New Issue
Block a user