Skip to content

Commit

Permalink
Added "Remove Group" button to Group Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ousnius committed Jul 18, 2015
1 parent a6f14a7 commit 69d2e2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions GroupManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ GroupManager::GroupManager(wxWindow* parent, vector<string> 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);
Expand All @@ -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())
Expand All @@ -73,6 +76,7 @@ void GroupManager::OnLoadGroup(wxFileDirPickerEvent& event) {

groupMembers.clear();
btAddGroup->Enable();
btRemoveGroup->Enable();

// Fill group member map
vector<string> groupNames;
Expand Down
1 change: 1 addition & 0 deletions GroupManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GroupManager : public wxDialog {
wxListBox* listGroups;
wxTextCtrl* groupName;
wxButton* btAddGroup;
wxButton* btRemoveGroup;
wxButton* btSave;
wxButton* btSaveAs;
wxButton* btRemoveMember;
Expand Down
2 changes: 2 additions & 0 deletions res/BodyslideFrame.xrc
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
<flag>wxALL</flag>
<border>5</border>
<object class="wxButton" name="btAddGroup">
<enabled>0</enabled>
<label>Add Group</label>
<default>0</default>
</object>
Expand All @@ -555,6 +556,7 @@
<flag>wxALL</flag>
<border>5</border>
<object class="wxButton" name="btRemoveGroup">
<enabled>0</enabled>
<label>Remove Group</label>
<default>0</default>
</object>
Expand Down

0 comments on commit 69d2e2f

Please sign in to comment.