GH-1404 allow deleting groups and creating instances in groups directly using context menu
This commit is contained in:
parent
b795ad5209
commit
432ec74174
8 changed files with 131 additions and 22 deletions
|
@ -133,8 +133,43 @@ QStringList InstanceList::getGroups()
|
|||
return m_groups.toList();
|
||||
}
|
||||
|
||||
void InstanceList::suspendGroupSaving()
|
||||
{
|
||||
suspendedGroupSave = true;
|
||||
}
|
||||
|
||||
void InstanceList::resumeGroupSaving()
|
||||
{
|
||||
if(suspendedGroupSave)
|
||||
{
|
||||
suspendedGroupSave = false;
|
||||
if(queuedGroupSave)
|
||||
{
|
||||
saveGroupList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceList::deleteGroup(const QString& name)
|
||||
{
|
||||
for(auto & instance: m_instances)
|
||||
{
|
||||
auto instGroupName = instance->group();
|
||||
if(instGroupName == name)
|
||||
{
|
||||
instance->setGroupPost(QString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceList::saveGroupList()
|
||||
{
|
||||
if(suspendedGroupSave)
|
||||
{
|
||||
queuedGroupSave = true;
|
||||
return;
|
||||
}
|
||||
|
||||
QString groupFileName = m_instDir + "/instgroups.json";
|
||||
QMap<QString, QSet<QString>> groupMap;
|
||||
for (auto instance : m_instances)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue