Fixed issue #46.

This commit is contained in:
WrinklyNinja
2013-08-15 12:02:58 +01:00
parent dd86be7083
commit 2b567f9d37
2 changed files with 15 additions and 4 deletions
+10
View File
@@ -1007,6 +1007,7 @@ LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const
//Set up event handling.
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadOrderPreview::OnMoveUp, this, BUTTON_MoveUp);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadOrderPreview::OnMoveDown, this, BUTTON_MoveDown);
Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, &LoadOrderPreview::OnPluginSelect, this, LIST_LoadOrder);
//Set up layout.
wxBoxSizer * bigBox = new wxBoxSizer(wxVERTICAL);
@@ -1027,12 +1028,21 @@ LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const
if (sizer != NULL)
bigBox->Add(sizer, 0, wxEXPAND|wxLEFT|wxBOTTOM|wxRIGHT, 15);
//Set initial up/down button states.
_moveUp->Enable(false);
_moveDown->Enable(false);
//Now set the layout and sizes.
SetBackgroundColour(wxColour(255,255,255));
SetIcon(wxIconLocation("BOSS.exe"));
SetSizerAndFit(bigBox);
}
void LoadOrderPreview::OnPluginSelect(wxListEvent& event) {
_moveUp->Enable(true);
_moveDown->Enable(true);
}
void LoadOrderPreview::OnMoveUp(wxCommandEvent& event) {
BOOST_LOG_TRIVIAL(debug) << "Moving plugin(s) up the load order.";
long selected = _loadOrder->GetFirstSelected();
+5 -4
View File
@@ -37,7 +37,7 @@ public:
bool OnInit(); //Load settings, apply logging and language settings, check if BOSS is already running, detect games, set game to last game or to first detected game if auto, create launcher window.
private:
wxLocale * wxLoc;
YAML::Node _settings;
std::vector<boss::Game> _games;
boss::Game _game;
@@ -46,11 +46,11 @@ private:
class Launcher : public wxFrame {
public:
Launcher(const wxChar *title, YAML::Node& settings, boss::Game& inGame, std::vector<boss::Game>& games);
void OnSortPlugins(wxCommandEvent& event);
void OnEditMetadata(wxCommandEvent& event);
void OnViewLastReport(wxCommandEvent& event);
void OnOpenSettings(wxCommandEvent& event);
void OnGameChange(wxCommandEvent& event);
void OnHelp(wxCommandEvent& event);
@@ -61,7 +61,7 @@ public:
private:
wxMenu * GameMenu;
wxButton * ViewButton;
boss::Game& _game;
YAML::Node& _settings; //BOSS Settings.
std::vector<boss::Game>& _games;
@@ -71,6 +71,7 @@ class LoadOrderPreview : public wxDialog {
public:
LoadOrderPreview(wxWindow *parent, const wxString title, const std::list<boss::Plugin>& plugins);
void OnPluginSelect(wxListEvent& event);
void OnMoveUp(wxCommandEvent& event);
void OnMoveDown(wxCommandEvent& event);