[487] | 1 | /***************************************************************************\
|
---|
| 2 | | Project: AE Installer |
|
---|
| 3 | | By: Gumby & Iritscen |
|
---|
| 4 | | File: Main_Window.cpp |
|
---|
| 5 | | Function: Handles the GUI. |
|
---|
| 6 | | Created: 07/05/2009 20:38:25 |
|
---|
| 7 | \***************************************************************************/
|
---|
| 8 |
|
---|
[394] | 9 | #ifndef NTDDI_VERSION
|
---|
| 10 | #define NTDDI_VERSION NTDDI_WIN7
|
---|
| 11 | #endif
|
---|
| 12 | #ifdef WIN32
|
---|
[487] | 13 | #include <windows.h>
|
---|
[394] | 14 | #include <shobjidl.h>
|
---|
| 15 | HWND Handle;
|
---|
| 16 | ITaskbarList *pTaskbarList;
|
---|
| 17 | ITaskbarList3 *pTaskbarList3;
|
---|
| 18 | #endif
|
---|
| 19 |
|
---|
[328] | 20 | #include <boost/thread/mutex.hpp>
|
---|
| 21 | // For compilers that support precompilation, includes "wx/wx.h".
|
---|
| 22 | #include "wx/wxprec.h"
|
---|
| 23 |
|
---|
| 24 | #ifdef __BORLANDC__
|
---|
| 25 | #pragma hdrstop
|
---|
| 26 | #endif
|
---|
| 27 |
|
---|
| 28 | #ifndef WX_PRECOMP
|
---|
| 29 | #include "wx/wx.h"
|
---|
| 30 | #endif
|
---|
| 31 |
|
---|
| 32 | ////@begin includes
|
---|
[385] | 33 | #include "about.h"
|
---|
[487] | 34 | #include "main_window.h"
|
---|
| 35 | #include "installer.h"
|
---|
[328] | 36 | ////@end includes
|
---|
| 37 |
|
---|
| 38 | ////@begin XPM images
|
---|
[385] | 39 | #include "aelogosmall.xpm"
|
---|
| 40 | #include "undo.xpm"
|
---|
[328] | 41 | #include "fileopen.xpm"
|
---|
| 42 | #include "filesaveas.xpm"
|
---|
| 43 | #include "quit.xpm"
|
---|
| 44 | ////@end XPM images
|
---|
| 45 |
|
---|
[487] | 46 | bool busy = false;
|
---|
[500] | 47 | int updateStatus;
|
---|
| 48 | bool installerJustUpdated = false;
|
---|
[487] | 49 | vector<string> globalInstalledMods;
|
---|
| 50 | vector<ModPackage> globalPackages;
|
---|
| 51 | // Variable declarations
|
---|
| 52 | #ifdef WIN32
|
---|
| 53 | bool splitInstances = true;
|
---|
| 54 | string strImportOption = "-import:nosep";
|
---|
| 55 | string strOniSplit = "Onisplit.exe";
|
---|
| 56 | #else
|
---|
| 57 | bool splitInstances = false;
|
---|
| 58 | string strImportOption = "-import:sep";
|
---|
| 59 | string strOniSplit = "mono Onisplit.exe";
|
---|
| 60 | #endif
|
---|
[328] | 61 |
|
---|
| 62 | /*
|
---|
[355] | 63 | * MainWindow type definition
|
---|
| 64 | */
|
---|
[328] | 65 |
|
---|
| 66 | IMPLEMENT_CLASS( MainWindow, wxFrame )
|
---|
| 67 |
|
---|
| 68 |
|
---|
| 69 | /*
|
---|
[355] | 70 | * MainWindow event table definition
|
---|
| 71 | */
|
---|
[328] | 72 |
|
---|
| 73 | BEGIN_EVENT_TABLE( MainWindow, wxFrame )
|
---|
| 74 |
|
---|
| 75 | ////@begin MainWindow event table entries
|
---|
[385] | 76 | EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
|
---|
[328] | 77 |
|
---|
[385] | 78 | EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
|
---|
[328] | 79 |
|
---|
[385] | 80 | EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
|
---|
| 81 | EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
|
---|
[328] | 82 |
|
---|
[385] | 83 | EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
|
---|
[328] | 84 |
|
---|
[385] | 85 | EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
|
---|
[328] | 86 |
|
---|
[385] | 87 | EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
|
---|
[328] | 88 |
|
---|
[385] | 89 | EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
|
---|
[328] | 90 |
|
---|
[385] | 91 | EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
|
---|
[328] | 92 |
|
---|
[385] | 93 | EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
|
---|
[328] | 94 |
|
---|
[385] | 95 | EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
|
---|
[328] | 96 |
|
---|
[385] | 97 | EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
|
---|
[328] | 98 |
|
---|
[385] | 99 | EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
|
---|
[328] | 100 |
|
---|
[385] | 101 | EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
|
---|
[328] | 102 |
|
---|
[385] | 103 | EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
|
---|
[328] | 104 |
|
---|
[385] | 105 | EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
|
---|
[328] | 106 |
|
---|
| 107 | ////@end MainWindow event table entries
|
---|
| 108 |
|
---|
| 109 | END_EVENT_TABLE()
|
---|
| 110 |
|
---|
| 111 |
|
---|
| 112 | /*
|
---|
[355] | 113 | * MainWindow constructors
|
---|
| 114 | */
|
---|
[328] | 115 |
|
---|
| 116 | MainWindow::MainWindow()
|
---|
| 117 | {
|
---|
[355] | 118 | Init();
|
---|
[328] | 119 | }
|
---|
| 120 |
|
---|
| 121 | MainWindow::MainWindow( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
---|
| 122 | {
|
---|
[355] | 123 | Init();
|
---|
| 124 | Create( parent, id, caption, pos, size, style );
|
---|
[328] | 125 | }
|
---|
| 126 |
|
---|
| 127 |
|
---|
| 128 | /*
|
---|
[355] | 129 | * MainWindow creator
|
---|
| 130 | */
|
---|
[328] | 131 |
|
---|
| 132 | bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
---|
| 133 | {
|
---|
[355] | 134 | ////@begin MainWindow creation
|
---|
[385] | 135 | wxFrame::Create( parent, id, caption, pos, size, style );
|
---|
[328] | 136 |
|
---|
[385] | 137 | CreateControls();
|
---|
| 138 | SetIcon(GetIconResource(wxT("aelogosmall.png")));
|
---|
| 139 | Centre();
|
---|
[355] | 140 | ////@end MainWindow creation
|
---|
| 141 | return true;
|
---|
[328] | 142 | }
|
---|
| 143 |
|
---|
| 144 | /*
|
---|
[355] | 145 | * MainWindow destructor
|
---|
| 146 | */
|
---|
[328] | 147 |
|
---|
| 148 | MainWindow::~MainWindow()
|
---|
| 149 | {
|
---|
[355] | 150 | ////@begin MainWindow destruction
|
---|
| 151 | ////@end MainWindow destruction
|
---|
[328] | 152 | }
|
---|
| 153 |
|
---|
| 154 | /*
|
---|
[355] | 155 | * Member initialisation
|
---|
| 156 | */
|
---|
[328] | 157 |
|
---|
| 158 | void MainWindow::Init()
|
---|
| 159 | {
|
---|
[355] | 160 | ////@begin MainWindow member initialisation
|
---|
[385] | 161 | MainSplitter = NULL;
|
---|
| 162 | SelectAll = NULL;
|
---|
| 163 | RefreshButton = NULL;
|
---|
| 164 | Mods_CheckboxList = NULL;
|
---|
| 165 | titleText = NULL;
|
---|
| 166 | creatorText = NULL;
|
---|
| 167 | descriptionText = NULL;
|
---|
| 168 | StatusArea = NULL;
|
---|
| 169 | ProgressBar = NULL;
|
---|
| 170 | InstallButton = NULL;
|
---|
| 171 | OptionsPanel = NULL;
|
---|
| 172 | SepRadio = NULL;
|
---|
| 173 | NoSepRadio = NULL;
|
---|
| 174 | SeperatedRadio = NULL;
|
---|
| 175 | CompleteRadio = NULL;
|
---|
| 176 | ReglobalizeButton = NULL;
|
---|
[355] | 177 | ////@end MainWindow member initialisation
|
---|
[328] | 178 | }
|
---|
| 179 |
|
---|
| 180 | /*
|
---|
[355] | 181 | * Control creation for MainWindow
|
---|
| 182 | */
|
---|
[353] | 183 | wxStatusBar **TheStatusBar;
|
---|
[328] | 184 | wxButton* TheInstallButton;
|
---|
| 185 | wxGauge* TheProgressBar;
|
---|
| 186 | void MainWindow::CreateControls()
|
---|
| 187 | {
|
---|
[355] | 188 | ////@begin MainWindow content construction
|
---|
[385] | 189 | MainWindow* itemFrame1 = this;
|
---|
[328] | 190 |
|
---|
[385] | 191 | wxMenuBar* menuBar = new wxMenuBar;
|
---|
| 192 | wxMenu* itemMenu37 = new wxMenu;
|
---|
| 193 | {
|
---|
| 194 | wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
|
---|
| 195 | wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
|
---|
| 196 | menuItem->SetBitmap(bitmap);
|
---|
| 197 | itemMenu37->Append(menuItem);
|
---|
| 198 | }
|
---|
| 199 | {
|
---|
| 200 | wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
|
---|
| 201 | wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
|
---|
| 202 | menuItem->SetBitmap(bitmap);
|
---|
| 203 | itemMenu37->Append(menuItem);
|
---|
| 204 | }
|
---|
| 205 | itemMenu37->AppendSeparator();
|
---|
| 206 | {
|
---|
| 207 | wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
|
---|
| 208 | wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
|
---|
| 209 | menuItem->SetBitmap(bitmap);
|
---|
| 210 | itemMenu37->Append(menuItem);
|
---|
| 211 | }
|
---|
| 212 | menuBar->Append(itemMenu37, _("&File"));
|
---|
| 213 | wxMenu* itemMenu42 = new wxMenu;
|
---|
| 214 | itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
|
---|
| 215 | menuBar->Append(itemMenu42, _("Options"));
|
---|
[489] | 216 | //#ifdef WIN32
|
---|
| 217 | // itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
|
---|
| 218 | // menuBar->Append(itemMenu44, _("Help"));
|
---|
| 219 | //#else
|
---|
[390] | 220 | itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
|
---|
[489] | 221 | //#endif
|
---|
[390] | 222 |
|
---|
[385] | 223 | itemFrame1->SetMenuBar(menuBar);
|
---|
[328] | 224 |
|
---|
[385] | 225 | wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
|
---|
| 226 | itemFrame1->SetSizer(itemBoxSizer2);
|
---|
[328] | 227 |
|
---|
[385] | 228 | MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
|
---|
| 229 | MainSplitter->SetMinimumPaneSize(1);
|
---|
| 230 | MainSplitter->SetName(_T("MainSplitter"));
|
---|
[328] | 231 |
|
---|
[385] | 232 | wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
---|
| 233 | wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
|
---|
| 234 | itemPanel4->SetSizer(itemBoxSizer5);
|
---|
[328] | 235 |
|
---|
[385] | 236 | wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
|
---|
| 237 | itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
|
---|
| 238 | SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
|
---|
| 239 | SelectAll->SetValue(false);
|
---|
| 240 | SelectAll->SetName(_T("SelectAll_Checkbox"));
|
---|
| 241 | itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
---|
[328] | 242 |
|
---|
[385] | 243 | RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
|
---|
| 244 | RefreshButton->SetName(_T("RefreshButton"));
|
---|
| 245 | itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
|
---|
[328] | 246 |
|
---|
[385] | 247 | wxArrayString Mods_CheckboxListStrings;
|
---|
| 248 | Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
|
---|
| 249 | Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
|
---|
| 250 | itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
|
---|
[328] | 251 |
|
---|
[385] | 252 | wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
---|
| 253 | itemPanel10->SetName(_T("DescriptionHolder_Panel"));
|
---|
| 254 | wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
|
---|
| 255 | itemPanel10->SetSizer(itemBoxSizer11);
|
---|
[328] | 256 |
|
---|
[385] | 257 | wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
|
---|
| 258 | itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
|
---|
| 259 | wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
|
---|
| 260 | itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
|
---|
| 261 | titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
|
---|
| 262 | titleText->SetName(_T("Title_Text"));
|
---|
| 263 | titleText->SetBackgroundColour(wxColour(240, 240, 240));
|
---|
| 264 | itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
|
---|
[328] | 265 |
|
---|
[385] | 266 | wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
|
---|
| 267 | itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
|
---|
| 268 | creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
|
---|
| 269 | creatorText->SetName(_T("Author_Text"));
|
---|
| 270 | creatorText->SetBackgroundColour(wxColour(240, 240, 240));
|
---|
| 271 | itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
|
---|
[328] | 272 |
|
---|
[385] | 273 | wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
---|
| 274 | itemStaticLine17->Show(false);
|
---|
| 275 | itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
|
---|
[328] | 276 |
|
---|
[385] | 277 | descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
|
---|
| 278 | descriptionText->SetName(_T("DescriptionName"));
|
---|
| 279 | descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
|
---|
| 280 | itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
|
---|
[328] | 281 |
|
---|
[385] | 282 | MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
|
---|
| 283 | itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
|
---|
[328] | 284 |
|
---|
[385] | 285 | StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
|
---|
| 286 | StatusArea->SetName(_T("StatusArea"));
|
---|
| 287 | StatusArea->SetFieldsCount(1);
|
---|
[487] | 288 | string versionText = "AE Installer v" + (string)INSTALLER_VERSION;
|
---|
| 289 | StatusArea->SetStatusText(versionText.c_str(), 0);
|
---|
[385] | 290 | itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
|
---|
[328] | 291 |
|
---|
[385] | 292 | wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
|
---|
| 293 | itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
|
---|
[328] | 294 |
|
---|
[385] | 295 | ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
|
---|
| 296 | ProgressBar->SetValue(0);
|
---|
| 297 | itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
|
---|
[328] | 298 |
|
---|
[385] | 299 | InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
|
---|
| 300 | itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
|
---|
[328] | 301 |
|
---|
[385] | 302 | wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
|
---|
| 303 | itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
|
---|
[328] | 304 |
|
---|
[385] | 305 | OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
---|
| 306 | itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
|
---|
[328] | 307 |
|
---|
[385] | 308 | wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
|
---|
| 309 | OptionsPanel->SetSizer(itemBoxSizer25);
|
---|
[328] | 310 |
|
---|
[385] | 311 | wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
|
---|
| 312 | itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
|
---|
[328] | 313 |
|
---|
[385] | 314 | SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
---|
| 315 | SepRadio->SetValue(false);
|
---|
| 316 | if (MainWindow::ShowToolTips())
|
---|
| 317 | SepRadio->SetToolTip(_("For PC Demo and Mac"));
|
---|
| 318 | itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
|
---|
[328] | 319 |
|
---|
[385] | 320 | NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
|
---|
| 321 | NoSepRadio->SetValue(false);
|
---|
| 322 | if (MainWindow::ShowToolTips())
|
---|
| 323 | NoSepRadio->SetToolTip(_("For PC Retail"));
|
---|
| 324 | itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
|
---|
[328] | 325 |
|
---|
[385] | 326 | wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
|
---|
| 327 | itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
|
---|
[328] | 328 |
|
---|
[385] | 329 | wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
|
---|
| 330 | itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
|
---|
[328] | 331 |
|
---|
[385] | 332 | SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
---|
| 333 | SeperatedRadio->SetValue(false);
|
---|
| 334 | SeperatedRadio->SetName(_T("Seperated_RadioButton"));
|
---|
| 335 | itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
|
---|
[328] | 336 |
|
---|
[385] | 337 | CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
|
---|
| 338 | CompleteRadio->SetValue(false);
|
---|
| 339 | CompleteRadio->SetName(_T("Complete_RadioButton"));
|
---|
| 340 | itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
|
---|
[328] | 341 |
|
---|
[385] | 342 | wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
|
---|
| 343 | itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
|
---|
[328] | 344 |
|
---|
[385] | 345 | wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
|
---|
| 346 | itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
---|
[328] | 347 |
|
---|
[385] | 348 | ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
|
---|
| 349 | ReglobalizeButton->SetName(_T("Reglobalize_Button"));
|
---|
| 350 | itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
|
---|
[328] | 351 |
|
---|
[385] | 352 | // Connect events and objects
|
---|
| 353 | Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
|
---|
[355] | 354 | ////@end MainWindow content construction
|
---|
[403] | 355 | #ifdef WIN32
|
---|
[394] | 356 | Handle = (HWND)GetHWND();
|
---|
| 357 | ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList);
|
---|
[403] | 358 | #endif
|
---|
[500] | 359 |
|
---|
| 360 | updateStatus = GetUpdateStatus(¤tAE, &updateAE, &installerJustUpdated);
|
---|
[390] | 361 |
|
---|
[328] | 362 | globalPackages = getPackages();
|
---|
| 363 | globalInstalledMods = getInstallString();
|
---|
[500] | 364 | for (unsigned int i = 0; i < globalPackages.size(); i++)
|
---|
| 365 | {
|
---|
[355] | 366 | Mods_CheckboxList->Append(globalPackages[i].name.c_str());
|
---|
[500] | 367 | if (binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName)) Mods_CheckboxList->Check(i);
|
---|
[328] | 368 | }
|
---|
| 369 |
|
---|
[355] | 370 | TheStatusBar = &StatusArea;
|
---|
| 371 | TheInstallButton = InstallButton;
|
---|
| 372 | TheProgressBar = ProgressBar;
|
---|
| 373 | OptionsPanel->Hide();
|
---|
[390] | 374 |
|
---|
[487] | 375 | if(splitInstances) SeperatedRadio->SetValue(true);
|
---|
[355] | 376 | else CompleteRadio->SetValue(true);
|
---|
| 377 | if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
|
---|
| 378 | else SepRadio->SetValue(true);
|
---|
[357] | 379 |
|
---|
[355] | 380 | #ifdef WIN32
|
---|
| 381 | RedirectIOToConsole();
|
---|
| 382 | HWND hWnd = GetConsoleWindow();
|
---|
| 383 | ShowWindow( hWnd, SW_HIDE );
|
---|
| 384 | #endif
|
---|
[328] | 385 | }
|
---|
| 386 |
|
---|
| 387 | /*
|
---|
[355] | 388 | * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for SelectAll_Checkbox
|
---|
| 389 | */
|
---|
[328] | 390 |
|
---|
| 391 | void MainWindow::OnSelectAllCheckboxClick( wxCommandEvent& event )
|
---|
| 392 | {
|
---|
[355] | 393 | switch(SelectAll->Get3StateValue()) {
|
---|
[328] | 394 | case wxCHK_UNCHECKED:
|
---|
[461] | 395 | for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
|
---|
[328] | 396 | break;
|
---|
| 397 | case wxCHK_CHECKED:
|
---|
[461] | 398 | for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true);
|
---|
[328] | 399 | break;
|
---|
| 400 | case wxCHK_UNDETERMINED:
|
---|
[461] | 401 | for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
|
---|
[328] | 402 | break;
|
---|
| 403 | }
|
---|
| 404 | }
|
---|
| 405 |
|
---|
| 406 | /*
|
---|
[355] | 407 | * wxEVT_CREATE event handler for Mods_CheckboxList
|
---|
| 408 | */
|
---|
[328] | 409 |
|
---|
| 410 | void MainWindow::ModList_OnCreate( wxWindowCreateEvent& event )
|
---|
| 411 | {
|
---|
| 412 |
|
---|
| 413 | }
|
---|
| 414 |
|
---|
| 415 |
|
---|
| 416 | /*
|
---|
[355] | 417 | * Should we show tooltips?
|
---|
| 418 | */
|
---|
[328] | 419 |
|
---|
| 420 | bool MainWindow::ShowToolTips()
|
---|
| 421 | {
|
---|
[355] | 422 | return true;
|
---|
[328] | 423 | }
|
---|
| 424 |
|
---|
| 425 | /*
|
---|
[355] | 426 | * Get bitmap resources
|
---|
| 427 | */
|
---|
[328] | 428 |
|
---|
| 429 | wxBitmap MainWindow::GetBitmapResource( const wxString& name )
|
---|
| 430 | {
|
---|
[355] | 431 | // Bitmap retrieval
|
---|
| 432 | ////@begin MainWindow bitmap retrieval
|
---|
[385] | 433 | wxUnusedVar(name);
|
---|
| 434 | if (name == _T("undo.xpm"))
|
---|
| 435 | {
|
---|
| 436 | wxBitmap bitmap( undo_xpm);
|
---|
| 437 | return bitmap;
|
---|
| 438 | }
|
---|
| 439 | else if (name == _T("fileopen.xpm"))
|
---|
| 440 | {
|
---|
| 441 | wxBitmap bitmap( fileopen_xpm);
|
---|
| 442 | return bitmap;
|
---|
| 443 | }
|
---|
| 444 | else if (name == _T("filesaveas.xpm"))
|
---|
| 445 | {
|
---|
| 446 | wxBitmap bitmap( filesaveas_xpm);
|
---|
| 447 | return bitmap;
|
---|
| 448 | }
|
---|
| 449 | else if (name == _T("quit.xpm"))
|
---|
| 450 | {
|
---|
| 451 | wxBitmap bitmap( quit_xpm);
|
---|
| 452 | return bitmap;
|
---|
| 453 | }
|
---|
| 454 | return wxNullBitmap;
|
---|
[355] | 455 | ////@end MainWindow bitmap retrieval
|
---|
[328] | 456 | }
|
---|
| 457 |
|
---|
| 458 | /*
|
---|
[355] | 459 | * Get icon resources
|
---|
| 460 | */
|
---|
[328] | 461 |
|
---|
| 462 | wxIcon MainWindow::GetIconResource( const wxString& name )
|
---|
| 463 | {
|
---|
[355] | 464 | // Icon retrieval
|
---|
| 465 | ////@begin MainWindow icon retrieval
|
---|
[385] | 466 | wxUnusedVar(name);
|
---|
| 467 | if (name == _T("aelogosmall.png"))
|
---|
| 468 | {
|
---|
| 469 | wxIcon icon(aelogosmall_xpm);
|
---|
| 470 | return icon;
|
---|
| 471 | }
|
---|
| 472 | return wxNullIcon;
|
---|
[355] | 473 | ////@end MainWindow icon retrieval
|
---|
[328] | 474 | }
|
---|
| 475 |
|
---|
| 476 | /*
|
---|
[355] | 477 | * wxEVT_COMMAND_LISTBOX_SELECTED event handler for Mods_CheckboxList1
|
---|
| 478 | */
|
---|
[328] | 479 |
|
---|
| 480 | void MainWindow::OnModsCheckboxList1Selected( wxCommandEvent& event )
|
---|
| 481 | {
|
---|
| 482 | titleText->SetValue(globalPackages[event.GetSelection()].name.c_str());
|
---|
| 483 | creatorText->SetValue(globalPackages[event.GetSelection()].creator.c_str());
|
---|
| 484 | descriptionText->SetValue(globalPackages[event.GetSelection()].readme.c_str());
|
---|
| 485 | }
|
---|
| 486 |
|
---|
| 487 | /*
|
---|
[355] | 488 | * wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event handler for Mods_CheckboxList1
|
---|
| 489 | */
|
---|
[328] | 490 |
|
---|
| 491 | void MainWindow::OnModsCheckboxList1Toggled( wxCommandEvent& event )
|
---|
| 492 | {
|
---|
| 493 | SelectAll->Set3StateValue(wxCHK_UNDETERMINED);
|
---|
| 494 | if(event.GetInt()) {
|
---|
[355] | 495 | /*
|
---|
[328] | 496 | switch(SelectAll->Get3StateValue()) {
|
---|
[355] | 497 | case wxCHK_UNCHECKED:
|
---|
[328] | 498 | break;
|
---|
[355] | 499 | case wxCHK_CHECKED:
|
---|
[328] | 500 | break;
|
---|
[355] | 501 | case wxCHK_UNDETERMINED :
|
---|
[328] | 502 | break;
|
---|
[355] | 503 | }
|
---|
| 504 | */
|
---|
[328] | 505 | }
|
---|
| 506 | }
|
---|
| 507 |
|
---|
| 508 |
|
---|
| 509 | /*
|
---|
[355] | 510 | * wxEVT_COMMAND_MENU_SELECTED event handler for wxID_OPTIONS
|
---|
| 511 | */
|
---|
[328] | 512 |
|
---|
| 513 | void MainWindow::OnOptionsClick( wxCommandEvent& event )
|
---|
| 514 | {
|
---|
| 515 | if (!event.GetInt() ) {
|
---|
| 516 | OptionsPanel->Hide();
|
---|
[385] | 517 |
|
---|
[358] | 518 | this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
|
---|
[328] | 519 | else {
|
---|
[487] | 520 | wxMessageDialog* YesNoDialog = new wxMessageDialog(this, "WARNING: These options are for advanced users only, use with caution.",
|
---|
[373] | 521 | "AE Installer Alert", wxOK | wxICON_EXCLAMATION , wxDefaultPosition);
|
---|
[358] | 522 | YesNoDialog->ShowModal();
|
---|
[328] | 523 | OptionsPanel->Show();
|
---|
[379] | 524 | this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
|
---|
| 525 | this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
|
---|
[328] | 526 | }
|
---|
| 527 | }
|
---|
| 528 |
|
---|
| 529 | /*
|
---|
[355] | 530 | * wxEVT_COMMAND_MENU_SELECTED event handler for wxID_EXIT
|
---|
| 531 | */
|
---|
[328] | 532 |
|
---|
| 533 | void MainWindow::OnExitClick( wxCommandEvent& event )
|
---|
| 534 | {
|
---|
[355] | 535 | exit(0);
|
---|
[328] | 536 | }
|
---|
| 537 |
|
---|
| 538 | /*
|
---|
[355] | 539 | * wxEVT_COMMAND_BUTTON_CLICKED event handler for Install_Button
|
---|
| 540 | */
|
---|
[328] | 541 |
|
---|
| 542 | struct recompile
|
---|
| 543 | {
|
---|
[355] | 544 | recompile(vector<string> localPackages) : thePackages(localPackages) { }
|
---|
| 545 | void operator()()
|
---|
| 546 | {
|
---|
[328] | 547 | TheInstallButton->Disable();
|
---|
[355] | 548 | recompileAll(thePackages);
|
---|
| 549 | TheInstallButton->Enable();
|
---|
[423] | 550 |
|
---|
[355] | 551 | }
|
---|
| 552 | vector<string> thePackages;
|
---|
[328] | 553 | };
|
---|
| 554 |
|
---|
[423] | 555 | void globalize2(void) {
|
---|
| 556 | TheInstallButton->Disable();
|
---|
| 557 | globalizeData();
|
---|
| 558 | TheInstallButton->Enable();
|
---|
| 559 | }
|
---|
| 560 |
|
---|
[328] | 561 | void MainWindow::OnInstallButtonClick( wxCommandEvent& event )
|
---|
| 562 | {
|
---|
| 563 | vector<string> localPackages;
|
---|
[423] | 564 | localPackages.push_back("00000Globalize");
|
---|
[461] | 565 | for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
|
---|
[328] | 566 | if ( !localPackages.empty() ) {
|
---|
[423] | 567 | sort(localPackages.begin(), localPackages.end());
|
---|
| 568 | localPackages[0] = "Globalize";
|
---|
[357] | 569 | this->InstallButton->Disable();
|
---|
| 570 | this->ReglobalizeButton->Disable();
|
---|
[353] | 571 | #ifdef WIN32
|
---|
| 572 | recompile packages(localPackages);
|
---|
| 573 | boost::thread thrd(packages);
|
---|
| 574 | #else
|
---|
| 575 | recompileAll(localPackages);
|
---|
| 576 | #endif
|
---|
[357] | 577 | this->InstallButton->Enable();
|
---|
| 578 | this->ReglobalizeButton->Enable();
|
---|
[328] | 579 | }
|
---|
| 580 | }
|
---|
| 581 |
|
---|
[487] | 582 | void setProgressBar( int i )
|
---|
| 583 | {
|
---|
[394] | 584 | #ifdef WIN32
|
---|
| 585 | if (SUCCEEDED(pTaskbarList->QueryInterface(IID_ITaskbarList3, (void **)&pTaskbarList3)))
|
---|
| 586 | {
|
---|
| 587 | pTaskbarList3->SetProgressValue(Handle,i, 1000);
|
---|
[487] | 588 | if ( i == 0 )
|
---|
| 589 | {
|
---|
| 590 | pTaskbarList3->SetProgressState(Handle,TBPF_NOPROGRESS);
|
---|
[394] | 591 | }
|
---|
| 592 | }
|
---|
| 593 | #endif
|
---|
[328] | 594 | TheProgressBar->SetValue(i);
|
---|
| 595 | }
|
---|
| 596 |
|
---|
| 597 | /*
|
---|
[355] | 598 | * wxEVT_UPDATE_UI event handler for ID_STATUSBAR
|
---|
| 599 | */
|
---|
[328] | 600 |
|
---|
| 601 | void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
|
---|
| 602 | {
|
---|
[355] | 603 | ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
|
---|
[385] | 604 | // Before editing this code, remove the block markers.
|
---|
| 605 | event.Skip();
|
---|
[355] | 606 | ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
|
---|
[328] | 607 | }
|
---|
| 608 |
|
---|
| 609 | /*
|
---|
[355] | 610 | * wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT
|
---|
| 611 | */
|
---|
[328] | 612 |
|
---|
| 613 | void MainWindow::OnAboutClick( wxCommandEvent& event )
|
---|
| 614 | {
|
---|
[355] | 615 | ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
|
---|
[385] | 616 | // Before editing this code, remove the block markers.
|
---|
[487] | 617 | // TODO: Make About window work again!
|
---|
[385] | 618 | About* window = new About(this);
|
---|
| 619 | window->Destroy();
|
---|
[355] | 620 | ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
|
---|
[328] | 621 | }
|
---|
| 622 |
|
---|
| 623 | /*
|
---|
[355] | 624 | * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for NoSep_RadioButton
|
---|
| 625 | */
|
---|
[328] | 626 |
|
---|
| 627 | void MainWindow::OnNoSepRadioButtonSelected( wxCommandEvent& event )
|
---|
| 628 | {
|
---|
| 629 | static_cast<string>("-import:nosep");
|
---|
| 630 | }
|
---|
| 631 |
|
---|
| 632 | /*
|
---|
[355] | 633 | * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Sep_RadioButton
|
---|
| 634 | */
|
---|
[328] | 635 |
|
---|
| 636 | void MainWindow::OnSepRadioButtonSelected( wxCommandEvent& event )
|
---|
| 637 | {
|
---|
| 638 | static_cast<string>("-import:sep");
|
---|
| 639 | }
|
---|
| 640 |
|
---|
| 641 | /*
|
---|
[355] | 642 | * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
|
---|
| 643 | */
|
---|
[328] | 644 |
|
---|
| 645 | /*
|
---|
[355] | 646 | * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
|
---|
| 647 | */
|
---|
[328] | 648 |
|
---|
| 649 | void MainWindow::OnCompleteRadioButtonSelected( wxCommandEvent& event )
|
---|
| 650 | {
|
---|
[487] | 651 | splitInstances = false;
|
---|
[328] | 652 | }
|
---|
| 653 |
|
---|
| 654 | /*
|
---|
[355] | 655 | * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BITMAPBUTTON
|
---|
| 656 | */
|
---|
[328] | 657 |
|
---|
| 658 | void MainWindow::OnRefreshButtonClick( wxCommandEvent& event )
|
---|
| 659 | {
|
---|
| 660 | refreshMods(globalInstalledMods);
|
---|
| 661 | }
|
---|
| 662 |
|
---|
| 663 | /*
|
---|
[355] | 664 | * wxEVT_COMMAND_MENU_SELECTED event handler for wxID_LOAD
|
---|
| 665 | */
|
---|
[328] | 666 |
|
---|
[487] | 667 | // 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
|
---|
| 668 | void MainWindow::refreshMods (vector<string> s)
|
---|
| 669 | {
|
---|
[328] | 670 | Mods_CheckboxList->Clear();
|
---|
[461] | 671 | for (unsigned int i = 0; i < globalPackages.size(); i++) {
|
---|
[355] | 672 | Mods_CheckboxList->Append(globalPackages[i].name.c_str());
|
---|
[487] | 673 | if( binary_search(s.begin(), s.end(), globalPackages[i].modStringName ) )
|
---|
| 674 | Mods_CheckboxList->Check(i);
|
---|
[355] | 675 | }
|
---|
[328] | 676 | }
|
---|
| 677 |
|
---|
| 678 | void MainWindow::OnLoadClick( wxCommandEvent& event )
|
---|
| 679 | {
|
---|
[357] | 680 | if (busy == 1) return;
|
---|
[328] | 681 | static const wxChar *FILETYPES = _T(
|
---|
| 682 | "Mod Loadouts (*.cfg)|*.cfg|"
|
---|
| 683 | "All files (*.*)|*.*"
|
---|
[355] | 684 | );
|
---|
| 685 |
|
---|
[328] | 686 | wxFileDialog* openFileDialog =
|
---|
| 687 | new wxFileDialog( this, _("Open Mod Loadout"), "", "", FILETYPES,
|
---|
[355] | 688 | wxOPEN, wxDefaultPosition);
|
---|
| 689 |
|
---|
[328] | 690 | if ( openFileDialog->ShowModal() == wxID_OK )
|
---|
| 691 | {
|
---|
| 692 | refreshMods(getInstallString( string(openFileDialog->GetPath()) ));
|
---|
| 693 | }
|
---|
| 694 | }
|
---|
| 695 |
|
---|
| 696 | /*
|
---|
[355] | 697 | * wxEVT_COMMAND_MENU_SELECTED event handler for wxID_SAVE
|
---|
| 698 | */
|
---|
[328] | 699 |
|
---|
| 700 | void MainWindow::OnSaveClick( wxCommandEvent& event )
|
---|
| 701 | {
|
---|
[357] | 702 | if (busy == 1) return;
|
---|
[328] | 703 | static const wxChar *FILETYPES = _T(
|
---|
| 704 | "Mod Loadouts (*.cfg)|*.cfg|"
|
---|
| 705 | "All files (*.*)|*.*"
|
---|
[355] | 706 | );
|
---|
[328] | 707 |
|
---|
[355] | 708 | wxFileDialog* openFileDialog =
|
---|
[328] | 709 | new wxFileDialog( this, _("Open file"), "", "", FILETYPES,
|
---|
| 710 | wxSAVE, wxDefaultPosition);
|
---|
| 711 |
|
---|
| 712 | if ( openFileDialog->ShowModal() == wxID_OK )
|
---|
| 713 | {
|
---|
| 714 | if ( exists( openFileDialog->GetPath().c_str() ) )
|
---|
[355] | 715 | {
|
---|
| 716 | remove( openFileDialog->GetPath().c_str() );
|
---|
| 717 | }
|
---|
[328] | 718 |
|
---|
[355] | 719 | ofstream file(openFileDialog->GetPath().c_str());
|
---|
[328] | 720 |
|
---|
[355] | 721 | vector<string>list;
|
---|
[461] | 722 | for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName );
|
---|
[355] | 723 | vector<string>::iterator begin_iter = list.begin();
|
---|
| 724 | vector<string>::iterator end_iter = list.end();
|
---|
[328] | 725 |
|
---|
[355] | 726 | sort( list.begin(), list.end() );
|
---|
[328] | 727 |
|
---|
[355] | 728 | for( ; begin_iter != end_iter; ++begin_iter) {
|
---|
| 729 | file << *begin_iter << " ";
|
---|
| 730 | }
|
---|
| 731 |
|
---|
| 732 | file.close();
|
---|
| 733 | file.clear();
|
---|
[328] | 734 | }
|
---|
| 735 | }
|
---|
| 736 |
|
---|
| 737 | /*
|
---|
[355] | 738 | * wxEVT_COMMAND_BUTTON_CLICKED event handler for ReGlobalize_Button
|
---|
| 739 | */
|
---|
[328] | 740 |
|
---|
| 741 | void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event )
|
---|
| 742 | {
|
---|
[487] | 743 | string YesNoMsg = "WARNING: This will DELETE the Edition's GameDataFolder and recreate it from the vanilla Oni game data.\n";
|
---|
| 744 | YesNoMsg = YesNoMsg + "Are you SURE you want to do this?";
|
---|
| 745 | wxMessageDialog* YesNoDialog = new wxMessageDialog(this, YesNoMsg.c_str(), "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION , wxDefaultPosition);
|
---|
[355] | 746 |
|
---|
[487] | 747 | if (YesNoDialog->ShowModal() == wxID_NO)
|
---|
| 748 | {
|
---|
| 749 | //if the user said no...
|
---|
[355] | 750 | }
|
---|
[487] | 751 | else
|
---|
| 752 | {
|
---|
[357] | 753 | this->InstallButton->Disable();
|
---|
| 754 | this->ReglobalizeButton->Disable();
|
---|
[355] | 755 | #ifdef WIN32
|
---|
[357] | 756 | boost::thread thrd2(globalizeData);
|
---|
| 757 | //globalizeData();
|
---|
| 758 | //boost::thread::create_thread(&globalizeData);
|
---|
| 759 | // boost::thread_group Tg;
|
---|
| 760 | // Tg.create_thread( &globalizeData(), this );
|
---|
[355] | 761 | #else
|
---|
[357] | 762 | globalizeData();
|
---|
[355] | 763 | #endif
|
---|
[357] | 764 | this->InstallButton->Enable();
|
---|
| 765 | this->ReglobalizeButton->Enable();
|
---|
| 766 | }
|
---|
[355] | 767 | }
|
---|
[328] | 768 | /*
|
---|
[355] | 769 | * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
|
---|
| 770 | */
|
---|
[328] | 771 |
|
---|
[385] | 772 | /*
|
---|
| 773 | * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
|
---|
| 774 | */
|
---|
| 775 |
|
---|
| 776 | void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
|
---|
| 777 | {
|
---|
[487] | 778 | splitInstances = true;
|
---|
[385] | 779 | }
|
---|