ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/Installer/trunk/source/main_window.cpp
(Generate patch)

Comparing AE/Installer/trunk/source/main_window.cpp (file contents):
Revision 489 by gumby, Sun Jan 24 23:58:16 2010 UTC vs.
Revision 503 by gumby, Wed Mar 24 07:12:25 2010 UTC

# Line 44 | Line 44 | ITaskbarList3 *pTaskbarList3;
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
# Line 102 | Line 104 | BEGIN_EVENT_TABLE( MainWindow, wxFrame )
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()
# Line 112 | Line 115 | END_EVENT_TABLE()
115   */
116  
117   MainWindow::MainWindow()
118 < {
118 > {  
119          Init();
120   }
121  
# Line 172 | Line 175 | void MainWindow::Init()
175      SeperatedRadio = NULL;
176      CompleteRadio = NULL;
177      ReglobalizeButton = NULL;
178 +
179 +        ChangeDirectoryButton = NULL;
180          ////@end MainWindow member initialisation
181   }
182  
# Line 347 | Line 352 | void MainWindow::CreateControls()
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(&currentAE, &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;
# Line 611 | Line 626 | void MainWindow::OnAboutClick( wxCommand
626      // Before editing this code, remove the block markers.
627          // TODO: Make About window work again!
628      About* window = new About(this);
629 +        window->ShowModal();
630      window->Destroy();
631          ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
632   }
# Line 618 | Line 634 | void MainWindow::OnAboutClick( wxCommand
634   /*
635   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for NoSep_RadioButton
636   */
637 <
637 >
638   void MainWindow::OnNoSepRadioButtonSelected( wxCommandEvent& event )
639   {
640          static_cast<string>("-import:nosep");
# Line 652 | Line 668 | void MainWindow::OnCompleteRadioButtonSe
668  
669   void MainWindow::OnRefreshButtonClick( wxCommandEvent& event )
670   {
671 +        globalPackages = getPackages();
672          refreshMods(globalInstalledMods);
673   }
674  
# Line 772 | Line 789 | void MainWindow::OnSeperatedRadioButtonS
789   {
790          splitInstances = true;
791   }
792 +
793 + void MainWindow::OnDirButtonClick( wxCommandEvent& event )
794 + {
795 +        wxDirDialog* newDir = new wxDirDialog(this, "Set current directory", "", wxDD_DEFAULT_STYLE,
796 +                wxDefaultPosition, wxDefaultSize, "wxDirCtrl");
797 +        newDir->ShowModal();
798 +        if(newDir->GetPath()[0]) current_path( (path)newDir->GetPath() );
799 +        OnRefreshButtonClick(event);
800 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)