Skip to content

Commit

Permalink
Cleanup SelectionSetManager class
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 21, 2020
1 parent 487cce7 commit 757d98c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 49 deletions.
42 changes: 1 addition & 41 deletions radiant/selection/selectionset/SelectionSetManager.cpp
@@ -1,30 +1,10 @@
#include "SelectionSetManager.h"

#include "itextstream.h"
#include "i18n.h"
#include "iselection.h"
#include "idialogmanager.h"
#include "imapinfofile.h"
#include "iuimanager.h"
#include "ieventmanager.h"
#include "imainframe.h"
#include "modulesystem/StaticModule.h"
#include "SelectionSetToolmenu.h"
#include "SelectionSetInfoFileModule.h"

#include <wx/toolbar.h>
#include <wx/frame.h>
#include <wx/artprov.h>
#include <wx/stattext.h>

#include <functional>

namespace selection
{

SelectionSetManager::SelectionSetManager()
{}

sigc::signal<void> SelectionSetManager::signal_selectionSetsChanged() const
{
return _sigSelectionSetsChanged;
Expand Down Expand Up @@ -58,13 +38,6 @@ ISelectionSetPtr SelectionSetManager::createSelectionSet(const std::string& name
i = result.first;

_sigSelectionSetsChanged();

#if 0 // TODO: move to separate class
if (_clearAllButton)
{
_clearAllButton->GetToolBar()->EnableTool(_clearAllButton->GetId(), !_selectionSets.empty());
}
#endif
}

return i->second;
Expand All @@ -79,27 +52,14 @@ void SelectionSetManager::deleteSelectionSet(const std::string& name)
_selectionSets.erase(i);

_sigSelectionSetsChanged();

#if 0 // TODO: move to separate class
if (_clearAllButton)
{
_clearAllButton->GetToolBar()->EnableTool(_clearAllButton->GetId(), !_selectionSets.empty());
}
#endif
}
}

void SelectionSetManager::deleteAllSelectionSets()
{
_selectionSets.clear();
_sigSelectionSetsChanged();

#if 0 // TODO: move to separate class
if (_clearAllButton)
{
_clearAllButton->GetToolBar()->EnableTool(_clearAllButton->GetId(), false);
}
#endif
_sigSelectionSetsChanged();
}

ISelectionSetPtr SelectionSetManager::findSelectionSet(const std::string& name)
Expand Down
9 changes: 1 addition & 8 deletions radiant/selection/selectionset/SelectionSetManager.h
@@ -1,13 +1,11 @@
#pragma once

#include "iselectionset.h"
#include "iradiant.h"
#include "imap.h"
#include "icommandsystem.h"

#include <map>
#include "SelectionSet.h"

#include <sigc++/signal.h>
#include <wx/event.h>

namespace selection
Expand All @@ -27,8 +25,6 @@ class SelectionSetManager :
SelectionSets _selectionSets;

public:
SelectionSetManager();

// ISelectionSetManager implementation
sigc::signal<void> signal_selectionSetsChanged() const override;
void foreachSelectionSet(Visitor& visitor) override;
Expand All @@ -37,9 +33,6 @@ class SelectionSetManager :
void deleteSelectionSet(const std::string& name) override;
void deleteAllSelectionSets() override;
ISelectionSetPtr findSelectionSet(const std::string& name) override;

// Command target
void deleteAllSelectionSetsCmd(const cmd::ArgumentList& args);
};

} // namespace
Expand Down

0 comments on commit 757d98c

Please sign in to comment.