diff --git a/GroupManager.cpp b/GroupManager.cpp index 1e6dc77d..3e181271 100644 --- a/GroupManager.cpp +++ b/GroupManager.cpp @@ -23,6 +23,7 @@ GroupManager::GroupManager(wxWindow* parent, vector outfits) { listGroups = XRCCTRL(*this, "listGroups", wxListBox); groupName = XRCCTRL(*this, "groupName", wxTextCtrl); btAddGroup = XRCCTRL(*this, "btAddGroup", wxButton); + btRemoveGroup = XRCCTRL(*this, "btRemoveGroup", wxButton); btSave = XRCCTRL(*this, "btSave", wxButton); btSaveAs = XRCCTRL(*this, "btSaveAs", wxButton); btRemoveMember = XRCCTRL(*this, "btRemoveMember", wxButton); @@ -43,15 +44,17 @@ void GroupManager::RefreshUI(const bool& clearGroups) { btSave->Enable(dirty & !fileName.empty()); - // Get group selection if existing - string selectedGroup = listGroups->GetStringSelection().ToStdString(); - + string selectedGroup; if (clearGroups) { // Add groups to list listGroups->Clear(); for (auto group : groupMembers) listGroups->Append(group.first); } + else { + // Get group selection if existing + selectedGroup = listGroups->GetStringSelection().ToStdString(); + } // Add members of selected group to list if (!selectedGroup.empty()) @@ -73,6 +76,7 @@ void GroupManager::OnLoadGroup(wxFileDirPickerEvent& event) { groupMembers.clear(); btAddGroup->Enable(); + btRemoveGroup->Enable(); // Fill group member map vector groupNames; diff --git a/GroupManager.h b/GroupManager.h index 83c25359..4d53d359 100644 --- a/GroupManager.h +++ b/GroupManager.h @@ -17,6 +17,7 @@ class GroupManager : public wxDialog { wxListBox* listGroups; wxTextCtrl* groupName; wxButton* btAddGroup; + wxButton* btRemoveGroup; wxButton* btSave; wxButton* btSaveAs; wxButton* btRemoveMember; diff --git a/res/BodyslideFrame.xrc b/res/BodyslideFrame.xrc index 1b63000f..b105c3e8 100644 --- a/res/BodyslideFrame.xrc +++ b/res/BodyslideFrame.xrc @@ -546,6 +546,7 @@ wxALL 5 + 0 0 @@ -555,6 +556,7 @@ wxALL 5 + 0 0