mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fixed new dialogs not closing.
This commit is contained in:
@@ -189,6 +189,7 @@ MiniEditor::MiniEditor(wxWindow *parent, const wxString& title, const std::list<
|
||||
Bind(wxEVT_BUTTON, &MiniEditor::OnRemoveRow, this, BUTTON_RemoveRow);
|
||||
Bind(wxEVT_TOGGLEBUTTON, &MiniEditor::OnAddRowToggle, this, BUTTON_AddRow);
|
||||
Bind(wxEVT_CHECKBOX, &MiniEditor::OnFilterToggle, this);
|
||||
Bind(wxEVT_BUTTON, &MiniEditor::OnApply, this, wxID_APPLY);
|
||||
|
||||
//Set up layout.
|
||||
wxBoxSizer * bigBox = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -400,6 +401,15 @@ void MiniEditor::OnDragStart(wxListEvent& event) {
|
||||
wxDragResult result = dropSource.DoDragDrop();
|
||||
}
|
||||
|
||||
void MiniEditor::OnApply(wxCommandEvent& event) {
|
||||
//Apply any current edits.
|
||||
wxString currentPlugin = pluginText->GetLabelText();
|
||||
if (!currentPlugin.empty())
|
||||
ApplyEdits(currentPlugin, pluginList);
|
||||
|
||||
EndModal(event.GetId());
|
||||
}
|
||||
|
||||
const std::list<boss::Plugin>& MiniEditor::GetEditedPlugins() const {
|
||||
return _editedPlugins;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ public:
|
||||
void OnAddRowToggle(wxCommandEvent& event);
|
||||
void OnFilterToggle(wxCommandEvent& event);
|
||||
void OnDragStart(wxListEvent& event);
|
||||
void OnApply(wxCommandEvent& event);
|
||||
|
||||
const std::list<boss::Plugin>& GetEditedPlugins() const;
|
||||
private:
|
||||
|
||||
@@ -498,6 +498,10 @@ LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const
|
||||
}
|
||||
_loadOrder->SetColumnWidth(0, wxLIST_AUTOSIZE);
|
||||
|
||||
//Set up event handling.
|
||||
Bind(wxEVT_BUTTON, &LoadOrderPreview::OnYesNo, this, wxID_YES);
|
||||
Bind(wxEVT_BUTTON, &LoadOrderPreview::OnYesNo, this, wxID_NO);
|
||||
|
||||
//Set up layout.
|
||||
wxBoxSizer * bigBox = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
@@ -517,3 +521,7 @@ LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const
|
||||
SetIcon(wxIconLocation("BOSS.exe"));
|
||||
SetSizerAndFit(bigBox);
|
||||
}
|
||||
|
||||
void LoadOrderPreview::OnYesNo(wxCommandEvent& event) {
|
||||
EndModal(event.GetId());
|
||||
}
|
||||
@@ -133,6 +133,8 @@ private:
|
||||
class LoadOrderPreview : public wxDialog {
|
||||
public:
|
||||
LoadOrderPreview(wxWindow *parent, const wxString title, const std::list<boss::Plugin>& plugins, const boss::Game& game);
|
||||
|
||||
void OnYesNo(wxCommandEvent& event);
|
||||
private:
|
||||
wxListView * _loadOrder;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user