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 500 by iritscen, Sun Mar 14 23:31:14 2010 UTC vs.
Revision 526 by gumby, Sat May 22 22:07:58 2010 UTC

# Line 50 | Line 50 | 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
# Line 104 | 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 114 | Line 115 | END_EVENT_TABLE()
115   */
116  
117   MainWindow::MainWindow()
118 < {
118 > {  
119          Init();
120   }
121  
# Line 174 | 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 349 | 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
# Line 614 | Line 624 | void MainWindow::OnAboutClick( wxCommand
624   {
625          ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
626      // Before editing this code, remove the block markers.
617        // 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   }
# Line 623 | Line 633 | void MainWindow::OnAboutClick( wxCommand
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");
# Line 657 | Line 667 | void MainWindow::OnCompleteRadioButtonSe
667  
668   void MainWindow::OnRefreshButtonClick( wxCommandEvent& event )
669   {
670 +        globalPackages = getPackages();
671          refreshMods(globalInstalledMods);
672   }
673  
# Line 664 | Line 675 | void MainWindow::OnRefreshButtonClick( w
675   * wxEVT_COMMAND_MENU_SELECTED event handler for wxID_LOAD
676   */
677  
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
678   void MainWindow::refreshMods (vector<string> s)
679   {
680          Mods_CheckboxList->Clear();
# Line 777 | Line 787 | void MainWindow::OnSeperatedRadioButtonS
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 + }

Diff Legend

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