| 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) |
| 939 |
|
|
| 940 |
|
EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected ) |
| 941 |
|
|
| 942 |
< |
EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected ) |
| 942 |
> |
EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected ) |
| 943 |
|
|
| 944 |
|
EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected ) |
| 945 |
|
|
| 1024 |
|
OptionsPanel = NULL; |
| 1025 |
|
SepRadio = NULL; |
| 1026 |
|
NoSepRadio = NULL; |
| 1027 |
< |
SeperatedRadio = NULL; |
| 1027 |
> |
SeparatedRadio = NULL; |
| 1028 |
|
CompleteRadio = NULL; |
| 1029 |
|
ReglobalizeButton = NULL; |
| 1030 |
|
////@end MainWindow member initialisation |
| 1035 |
|
/* |
| 1036 |
|
* Control creation for MainWindow |
| 1037 |
|
*/ |
| 1038 |
< |
wxStatusBar* TheStatusBar; |
| 1038 |
> |
wxStatusBar **TheStatusBar; |
| 1039 |
|
wxButton* TheInstallButton; |
| 1040 |
|
wxGauge* TheProgressBar; |
| 1041 |
|
void MainWindow::CreateControls() |
| 1182 |
|
wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL); |
| 1183 |
|
itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5); |
| 1184 |
|
|
| 1185 |
< |
SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1186 |
< |
SeperatedRadio->SetValue(false); |
| 1187 |
< |
SeperatedRadio->SetName(_T("Seperated_RadioButton")); |
| 1188 |
< |
itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1185 |
> |
SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1186 |
> |
SeparatedRadio->SetValue(false); |
| 1187 |
> |
SeparatedRadio->SetName(_T("Separated_RadioButton")); |
| 1188 |
> |
itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1189 |
|
|
| 1190 |
|
CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1191 |
|
CompleteRadio->SetValue(false); |
| 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( |
| 1647 |
|
|
| 1648 |
|
|
| 1649 |
|
/* |
| 1650 |
< |
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton |
| 1650 |
> |
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton |
| 1651 |
|
*/ |
| 1652 |
|
|
| 1653 |
< |
void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event ) |
| 1653 |
> |
/*void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event ) |
| 1654 |
|
{ |
| 1655 |
< |
////@begin wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton in MainWindow. |
| 1655 |
> |
////@begin wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow. |
| 1656 |
|
// Before editing this code, remove the block markers. |
| 1657 |
|
event.Skip(); |
| 1658 |
< |
////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton in MainWindow. |
| 1659 |
< |
} |
| 1658 |
> |
////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow. |
| 1659 |
> |
}*/ |
| 1660 |
|
|