--- AE/Installer/trunk/source/main_window.cpp 2010/03/14 23:31:14 500 +++ AE/Installer/trunk/source/main_window.cpp 2010/04/28 10:40:52 516 @@ -104,6 +104,7 @@ BEGIN_EVENT_TABLE( MainWindow, wxFrame ) EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick ) + EVT_BUTTON( Dir_Button, MainWindow::OnDirButtonClick ) ////@end MainWindow event table entries END_EVENT_TABLE() @@ -114,7 +115,7 @@ END_EVENT_TABLE() */ MainWindow::MainWindow() -{ +{ Init(); } @@ -174,6 +175,8 @@ void MainWindow::Init() SeperatedRadio = NULL; CompleteRadio = NULL; ReglobalizeButton = NULL; + + ChangeDirectoryButton = NULL; ////@end MainWindow member initialisation } @@ -349,7 +352,14 @@ void MainWindow::CreateControls() ReglobalizeButton->SetName(_T("Reglobalize_Button")); itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5); - // Connect events and objects + wxStaticLine* itemStaticLine100 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + itemBoxSizer25->Add(itemStaticLine100, 0, wxGROW|wxALL, 5); + + ChangeDirectoryButton = new wxButton( OptionsPanel, Dir_Button, _("Change Dir"), wxDefaultPosition, wxDefaultSize, 0 ); + ChangeDirectoryButton->SetName(_T("Dir_Button")); + itemBoxSizer34->Add(ChangeDirectoryButton, 0, wxGROW|wxALL, 5); + + // Connect events and objects Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); ////@end MainWindow content construction #ifdef WIN32 @@ -614,8 +624,8 @@ void MainWindow::OnAboutClick( wxCommand { ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. // Before editing this code, remove the block markers. - // TODO: Make About window work again! About* window = new About(this); + window->ShowModal(); window->Destroy(); ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. } @@ -623,7 +633,7 @@ void MainWindow::OnAboutClick( wxCommand /* * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for NoSep_RadioButton */ - + void MainWindow::OnNoSepRadioButtonSelected( wxCommandEvent& event ) { static_cast("-import:nosep"); @@ -657,6 +667,7 @@ void MainWindow::OnCompleteRadioButtonSe void MainWindow::OnRefreshButtonClick( wxCommandEvent& event ) { + globalPackages = getPackages(); refreshMods(globalInstalledMods); } @@ -664,7 +675,6 @@ void MainWindow::OnRefreshButtonClick( w * wxEVT_COMMAND_MENU_SELECTED event handler for wxID_LOAD */ -// TODO: Make refreshMods actually refresh the list in the window of available mods so we can see any new package info and deleted mods are removed from the list void MainWindow::refreshMods (vector s) { Mods_CheckboxList->Clear(); @@ -777,3 +787,12 @@ void MainWindow::OnSeperatedRadioButtonS { splitInstances = true; } + +void MainWindow::OnDirButtonClick( wxCommandEvent& event ) +{ + wxDirDialog* newDir = new wxDirDialog(this, "Set current directory", "", wxDD_DEFAULT_STYLE, + wxDefaultPosition, wxDefaultSize, "wxDirCtrl"); + newDir->ShowModal(); + if(newDir->GetPath()[0]) current_path( (path)newDir->GetPath() ); + OnRefreshButtonClick(event); +} \ No newline at end of file