| 1 |
|
/* |
| 2 |
|
AE/Mod Installer |
| 3 |
– |
v1.0 |
| 3 |
|
by Gumby and Iritscen |
| 4 |
|
*/ |
| 5 |
|
|
| 6 |
+ |
// To-do: - Disable Install button when nothing (new) is selected |
| 7 |
+ |
// - Institute lots of checks into file-handling |
| 8 |
+ |
// - Clear mod info fields when mod is de-selected |
| 9 |
+ |
|
| 10 |
|
#define DEBUG |
| 11 |
|
#include <stdio.h> |
| 12 |
|
//#include <conio.h> |
| 45 |
|
string strImportOption = "-import:sep"; |
| 46 |
|
const char* strClsCmd = "clear"; |
| 47 |
|
const char* strPauseCmd = "read -n 1 -p \"Press any key to continue\""; |
| 48 |
+ |
void Sleep(int ms) { sleep( ms / 1000 ); } |
| 49 |
|
#endif |
| 50 |
|
|
| 51 |
|
using namespace boost::filesystem; |
| 782 |
|
writeInstalledMods(installedMods); |
| 783 |
|
setProgressBar(1000); |
| 784 |
|
setStatusArea("Done!"); |
| 785 |
< |
sleep(1000); |
| 785 |
> |
Sleep(1000); |
| 786 |
|
setProgressBar(0); |
| 783 |
– |
|
| 787 |
|
} |
| 788 |
|
|
| 789 |
|
void writeInstalledMods(vector<string> installedMods) |
| 1035 |
|
/* |
| 1036 |
|
* Control creation for MainWindow |
| 1037 |
|
*/ |
| 1038 |
< |
wxStatusBar* TheStatusBar; |
| 1038 |
> |
wxStatusBar **TheStatusBar; |
| 1039 |
|
wxButton* TheInstallButton; |
| 1040 |
|
wxGauge* TheProgressBar; |
| 1041 |
|
void MainWindow::CreateControls() |
| 1221 |
|
Mods_CheckboxList->Append(globalPackages[i].name.c_str()); |
| 1222 |
|
if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i); |
| 1223 |
|
} |
| 1224 |
< |
TheStatusBar = StatusArea; |
| 1224 |
> |
TheStatusBar = &StatusArea; |
| 1225 |
|
TheInstallButton = InstallButton; |
| 1226 |
|
TheProgressBar = ProgressBar; |
| 1227 |
|
OptionsPanel->Hide(); |
| 1345 |
|
creatorText->SetValue(globalPackages[event.GetSelection()].creator.c_str()); |
| 1346 |
|
descriptionText->SetValue(globalPackages[event.GetSelection()].readme.c_str()); |
| 1347 |
|
|
| 1348 |
< |
creatorText->Refresh(); |
| 1348 |
> |
//creatorText->Refresh(); |
| 1349 |
|
} |
| 1350 |
|
|
| 1351 |
|
|
| 1427 |
|
//MainWindow::MainWindow().Hide(); |
| 1428 |
|
// boost::thread thrd2(recompileAll(localPackages) ); |
| 1429 |
|
//MainWindow::MainWindow().Show(); |
| 1430 |
< |
recompile packages(localPackages); |
| 1431 |
< |
boost::thread thrd(packages); |
| 1430 |
> |
#ifdef WIN32 |
| 1431 |
> |
recompile packages(localPackages); |
| 1432 |
> |
boost::thread thrd(packages); |
| 1433 |
> |
#else |
| 1434 |
> |
this->Disable(); |
| 1435 |
> |
recompileAll(localPackages); |
| 1436 |
> |
this->Enable(); |
| 1437 |
> |
#endif |
| 1438 |
|
|
| 1439 |
|
} |
| 1440 |
|
|
| 1441 |
|
|
| 1442 |
|
} |
| 1443 |
|
|
| 1444 |
< |
void setStatusArea( string s ) { |
| 1445 |
< |
TheStatusBar->SetStatusText(_(s.c_str())); |
| 1444 |
> |
/*void setStatusArea( string s ) { |
| 1445 |
> |
//TheStatusBar = MainWindow::StatusArea; |
| 1446 |
> |
(**TheStatusBar).SetStatusText(_(s.c_str()), 0); |
| 1447 |
|
|
| 1448 |
|
//MainWindow::MainWindow().SetSize(MainWindow::MainWindow().GetRect().GetWidth(), MainWindow::MainWindow().GetRect().GetHeight()+1); |
| 1449 |
|
|
| 1451 |
|
//StatusBar->SetLabel(s); |
| 1452 |
|
//->SetLabel(s); |
| 1453 |
|
|
| 1454 |
< |
} |
| 1454 |
> |
}*/ |
| 1455 |
|
|
| 1456 |
|
void setProgressBar( int i ) { |
| 1457 |
|
//TheProgressBar->SetValue( |