| 44 |
|
////@end XPM images |
| 45 |
|
|
| 46 |
|
bool busy = false; |
| 47 |
+ |
int updateStatus; |
| 48 |
+ |
bool installerJustUpdated = false; |
| 49 |
|
vector<string> globalInstalledMods; |
| 50 |
|
vector<ModPackage> globalPackages; |
| 51 |
|
// Variable declarations |
| 52 |
|
#ifdef WIN32 |
| 53 |
< |
bool splitInstances = true; |
| 53 |
> |
bool splitInstances = false; |
| 54 |
|
string strImportOption = "-import:nosep"; |
| 55 |
|
string strOniSplit = "Onisplit.exe"; |
| 56 |
|
#else |
| 104 |
|
|
| 105 |
|
EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick ) |
| 106 |
|
|
| 107 |
+ |
EVT_BUTTON( Dir_Button, MainWindow::OnDirButtonClick ) |
| 108 |
|
////@end MainWindow event table entries |
| 109 |
|
|
| 110 |
|
END_EVENT_TABLE() |
| 115 |
|
*/ |
| 116 |
|
|
| 117 |
|
MainWindow::MainWindow() |
| 118 |
< |
{ |
| 118 |
> |
{ |
| 119 |
|
Init(); |
| 120 |
|
} |
| 121 |
|
|
| 175 |
|
SeperatedRadio = NULL; |
| 176 |
|
CompleteRadio = NULL; |
| 177 |
|
ReglobalizeButton = NULL; |
| 178 |
+ |
|
| 179 |
+ |
ChangeDirectoryButton = NULL; |
| 180 |
|
////@end MainWindow member initialisation |
| 181 |
|
} |
| 182 |
|
|
| 216 |
|
wxMenu* itemMenu42 = new wxMenu; |
| 217 |
|
itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK); |
| 218 |
|
menuBar->Append(itemMenu42, _("Options")); |
| 219 |
< |
#ifdef WIN32 |
| 220 |
< |
itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 221 |
< |
menuBar->Append(itemMenu44, _("Help")); |
| 222 |
< |
#else |
| 219 |
> |
//#ifdef WIN32 |
| 220 |
> |
// itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 221 |
> |
// menuBar->Append(itemMenu44, _("Help")); |
| 222 |
> |
//#else |
| 223 |
|
itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 224 |
< |
#endif |
| 224 |
> |
//#endif |
| 225 |
|
|
| 226 |
|
itemFrame1->SetMenuBar(menuBar); |
| 227 |
|
|
| 288 |
|
StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 ); |
| 289 |
|
StatusArea->SetName(_T("StatusArea")); |
| 290 |
|
StatusArea->SetFieldsCount(1); |
| 291 |
< |
string versionText = "AE Installer v" + (string)INSTALLER_VERSION; |
| 291 |
> |
string versionText = "AE Installer v" + gInstallerVersion; |
| 292 |
|
StatusArea->SetStatusText(versionText.c_str(), 0); |
| 293 |
|
itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0); |
| 294 |
|
|
| 352 |
|
ReglobalizeButton->SetName(_T("Reglobalize_Button")); |
| 353 |
|
itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5); |
| 354 |
|
|
| 355 |
< |
// Connect events and objects |
| 355 |
> |
wxStaticLine* itemStaticLine100 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 356 |
> |
itemBoxSizer25->Add(itemStaticLine100, 0, wxGROW|wxALL, 5); |
| 357 |
> |
|
| 358 |
> |
ChangeDirectoryButton = new wxButton( OptionsPanel, Dir_Button, _("Change Dir"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 359 |
> |
ChangeDirectoryButton->SetName(_T("Dir_Button")); |
| 360 |
> |
itemBoxSizer34->Add(ChangeDirectoryButton, 0, wxGROW|wxALL, 5); |
| 361 |
> |
|
| 362 |
> |
// Connect events and objects |
| 363 |
|
Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); |
| 364 |
|
////@end MainWindow content construction |
| 365 |
|
#ifdef WIN32 |
| 366 |
|
Handle = (HWND)GetHWND(); |
| 367 |
|
::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList); |
| 368 |
|
#endif |
| 369 |
+ |
|
| 370 |
+ |
updateStatus = GetUpdateStatus(¤tAE, &updateAE, &installerJustUpdated); |
| 371 |
|
|
| 372 |
|
globalPackages = getPackages(); |
| 373 |
|
globalInstalledMods = getInstallString(); |
| 374 |
< |
for (unsigned int i = 0; i < globalPackages.size(); i++) { |
| 374 |
> |
for (unsigned int i = 0; i < globalPackages.size(); i++) |
| 375 |
> |
{ |
| 376 |
|
Mods_CheckboxList->Append(globalPackages[i].name.c_str()); |
| 377 |
< |
if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i); |
| 377 |
> |
if (binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName)) Mods_CheckboxList->Check(i); |
| 378 |
|
} |
| 379 |
|
|
| 380 |
|
TheStatusBar = &StatusArea; |
| 624 |
|
{ |
| 625 |
|
////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. |
| 626 |
|
// Before editing this code, remove the block markers. |
| 612 |
– |
// TODO: Make About window work again! |
| 627 |
|
About* window = new About(this); |
| 628 |
+ |
window->ShowModal(); |
| 629 |
|
window->Destroy(); |
| 630 |
|
////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. |
| 631 |
|
} |
| 633 |
|
/* |
| 634 |
|
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for NoSep_RadioButton |
| 635 |
|
*/ |
| 636 |
< |
|
| 636 |
> |
|
| 637 |
|
void MainWindow::OnNoSepRadioButtonSelected( wxCommandEvent& event ) |
| 638 |
|
{ |
| 639 |
|
static_cast<string>("-import:nosep"); |
| 667 |
|
|
| 668 |
|
void MainWindow::OnRefreshButtonClick( wxCommandEvent& event ) |
| 669 |
|
{ |
| 670 |
+ |
globalPackages = getPackages(); |
| 671 |
|
refreshMods(globalInstalledMods); |
| 672 |
|
} |
| 673 |
|
|
| 675 |
|
* wxEVT_COMMAND_MENU_SELECTED event handler for wxID_LOAD |
| 676 |
|
*/ |
| 677 |
|
|
| 662 |
– |
// 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 |
| 678 |
|
void MainWindow::refreshMods (vector<string> s) |
| 679 |
|
{ |
| 680 |
|
Mods_CheckboxList->Clear(); |
| 787 |
|
{ |
| 788 |
|
splitInstances = true; |
| 789 |
|
} |
| 790 |
+ |
|
| 791 |
+ |
void MainWindow::OnDirButtonClick( wxCommandEvent& event ) |
| 792 |
+ |
{ |
| 793 |
+ |
wxDirDialog* newDir = new wxDirDialog(this, "Set current directory", "", wxDD_DEFAULT_STYLE, |
| 794 |
+ |
wxDefaultPosition, wxDefaultSize, "wxDirCtrl"); |
| 795 |
+ |
newDir->ShowModal(); |
| 796 |
+ |
if(newDir->GetPath()[0]) current_path( (path)newDir->GetPath() ); |
| 797 |
+ |
OnRefreshButtonClick(event); |
| 798 |
+ |
} |