--- AE/Installer/trunk/source/main_window.cpp 2009/06/04 12:05:26 331 +++ AE/Installer/trunk/source/main_window.cpp 2009/06/14 23:28:58 353 @@ -1,9 +1,12 @@ /* AE/Mod Installer - v1.0 by Gumby and Iritscen */ +// To-do: - Disable Install button when nothing (new) is selected +// - Institute lots of checks into file-handling +// - Clear mod info fields when mod is de-selected + #define DEBUG #include //#include @@ -42,6 +45,7 @@ const string strOniSplit = "mono Onispli string strImportOption = "-import:sep"; const char* strClsCmd = "clear"; const char* strPauseCmd = "read -n 1 -p \"Press any key to continue\""; +void Sleep(int ms) { sleep( ms / 1000 ); } #endif using namespace boost::filesystem; @@ -778,9 +782,8 @@ void recompileAll(vector install writeInstalledMods(installedMods); setProgressBar(1000); setStatusArea("Done!"); - sleep(1000); + Sleep(1000); setProgressBar(0); - } void writeInstalledMods(vector installedMods) @@ -1032,7 +1035,7 @@ void MainWindow::Init() /* * Control creation for MainWindow */ -wxStatusBar* TheStatusBar; +wxStatusBar **TheStatusBar; wxButton* TheInstallButton; wxGauge* TheProgressBar; void MainWindow::CreateControls() @@ -1218,7 +1221,7 @@ void MainWindow::CreateControls() Mods_CheckboxList->Append(globalPackages[i].name.c_str()); if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i); } - TheStatusBar = StatusArea; + TheStatusBar = &StatusArea; TheInstallButton = InstallButton; TheProgressBar = ProgressBar; OptionsPanel->Hide(); @@ -1342,7 +1345,7 @@ void MainWindow::OnModsCheckboxList1Sele creatorText->SetValue(globalPackages[event.GetSelection()].creator.c_str()); descriptionText->SetValue(globalPackages[event.GetSelection()].readme.c_str()); - creatorText->Refresh(); + //creatorText->Refresh(); } @@ -1424,16 +1427,23 @@ void MainWindow::OnInstallButtonClick( w //MainWindow::MainWindow().Hide(); // boost::thread thrd2(recompileAll(localPackages) ); //MainWindow::MainWindow().Show(); - recompile packages(localPackages); - boost::thread thrd(packages); +#ifdef WIN32 + recompile packages(localPackages); + boost::thread thrd(packages); +#else + this->Disable(); + recompileAll(localPackages); + this->Enable(); +#endif } } -void setStatusArea( string s ) { - TheStatusBar->SetStatusText(_(s.c_str())); +/*void setStatusArea( string s ) { + //TheStatusBar = MainWindow::StatusArea; + (**TheStatusBar).SetStatusText(_(s.c_str()), 0); //MainWindow::MainWindow().SetSize(MainWindow::MainWindow().GetRect().GetWidth(), MainWindow::MainWindow().GetRect().GetHeight()+1); @@ -1441,7 +1451,7 @@ void setStatusArea( string s ) { //StatusBar->SetLabel(s); //->SetLabel(s); -} +}*/ void setProgressBar( int i ) { //TheProgressBar->SetValue(