Changeset 353 for AE/Installer/trunk


Ignore:
Timestamp:
Jun 15, 2009, 1:28:58 AM (16 years ago)
Author:
iritscen
Message:

Mac fixes -- status bar and sleep code.

Location:
AE/Installer/trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • AE/Installer/trunk/source/main.cpp

    r324 r353  
    11/////////////////////////////////////////////////////////////////////////////
    2 // Name:        main.cpp
     2// Name:        aeinstallerapp.cpp
    33// Purpose:     
    44// Author:     
     
    2525
    2626#include "main.h"
     27#include <string>
    2728
    2829////@begin XPM images
     
    7475void AEInstallerApp::Init()
    7576{
    76 ////@begin AEInstallerApp member initialisation
    77 ////@end AEInstallerApp member initialisation
     77        ////@begin AEInstallerApp member initialisation
     78        ////@end AEInstallerApp member initialisation
    7879}
    7980
     
    8182 * Initialisation for AEInstallerApp
    8283 */
    83 
     84MainWindow* TheWindow;
    8485bool AEInstallerApp::OnInit()
    8586{   
    86 ////@begin AEInstallerApp initialisation
     87        ////@begin AEInstallerApp initialisation
    8788        // Remove the comment markers above and below this block
    8889        // to make permanent changes to the code.
    89 
     90       
    9091#if wxUSE_XPM
    9192        wxImage::AddHandler(new wxXPMHandler);
     
    102103        MainWindow* mainWindow = new MainWindow( NULL );
    103104        mainWindow->Show(true);
    104 ////@end AEInstallerApp initialisation
     105        ////@end AEInstallerApp initialisation
     106        TheWindow = mainWindow;
     107       
     108        return true;
     109}
    105110
    106     return true;
     111
     112void setStatusArea( string s ) {
     113        wxString wxs(s.c_str(), wxConvUTF8);
     114       
     115        TheWindow->StatusArea->SetStatusText(  wxs );
     116        //TheWindow->StatusArea->SetStatusText(s.c_str());
     117        //StatusArea->SetStatusText(_(s.c_str()));
     118        //(*TheStatusBar)->SetStatusText(_(s.c_str()));
     119        //AEInstallerApp::
     120        //      TheWindow->StatusArea->SetStatusText("hi");
     121        //mainWindow
     122        //itemFrame1->StatusArea->SetStatusText(_"lol");
     123        //MainWindow.StatusArea->SetStatusText("hi");
     124        // class AbstractStatusNotifier { public: virtual void NotifyStatus(const wxString &statusString) = 0; };
     125        //class StatusBarStatusNotifier : public AbstractStatusNotifier { wxStatusBar *statusbar; StatusBarStatusNotifier(wxStatusBar *bar) : statusbar(bar) { } ;
     126        //void NotifyStatus(const wxString &status) { statusbar->SetStatus(status); } }
     127       
     128       
     129        //MainWindow::StatusArea->
     130        //MainWindow::MainWindow().SetSize(MainWindow::MainWindow().GetRect().GetWidth(), MainWindow::MainWindow().GetRect().GetHeight()+1);
     131       
     132        //MainWindow::StatusBar->SetLabel("Importing Files...");
     133        //StatusBar->SetLabel(s);
     134        //->SetLabel(s);
     135       
    107136}
    108137
     
    114143int AEInstallerApp::OnExit()
    115144{   
    116 ////@begin AEInstallerApp cleanup
     145        ////@begin AEInstallerApp cleanup
    117146        return wxApp::OnExit();
    118 ////@end AEInstallerApp cleanup
     147        ////@end AEInstallerApp cleanup
    119148}
    120149
  • AE/Installer/trunk/source/main_window.cpp

    r331 r353  
    11/*
    22 AE/Mod Installer
    3  v1.0
    43 by Gumby and Iritscen
    54 */
     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
    69
    710#define DEBUG
     
    4346const char* strClsCmd = "clear";
    4447const char* strPauseCmd = "read -n 1 -p \"Press any key to continue\"";
     48void Sleep(int ms) { sleep( ms / 1000 ); }
    4549#endif
    4650
     
    779783        setProgressBar(1000);
    780784        setStatusArea("Done!");
    781         sleep(1000);
     785        Sleep(1000);
    782786        setProgressBar(0);
    783        
    784787}
    785788
     
    10331036 * Control creation for MainWindow
    10341037 */
    1035 wxStatusBar* TheStatusBar;
     1038wxStatusBar **TheStatusBar;
    10361039wxButton* TheInstallButton;
    10371040wxGauge* TheProgressBar;
     
    12191222                        if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i);
    12201223        }
    1221                 TheStatusBar = StatusArea;
     1224                TheStatusBar = &StatusArea;
    12221225                TheInstallButton = InstallButton;
    12231226                TheProgressBar = ProgressBar;
     
    13431346        descriptionText->SetValue(globalPackages[event.GetSelection()].readme.c_str());
    13441347
    1345         creatorText->Refresh();
     1348        //creatorText->Refresh();
    13461349}
    13471350
     
    14251428        //      boost::thread thrd2(recompileAll(localPackages) );
    14261429                //MainWindow::MainWindow().Show();
    1427     recompile packages(localPackages);
    1428     boost::thread thrd(packages);
    1429 
    1430         }
    1431        
    1432        
    1433 }
    1434 
    1435 void setStatusArea( string s ) {
    1436         TheStatusBar->SetStatusText(_(s.c_str()));
     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 = MainWindow::StatusArea;
     1446        (**TheStatusBar).SetStatusText(_(s.c_str()), 0);
    14371447       
    14381448                //MainWindow::MainWindow().SetSize(MainWindow::MainWindow().GetRect().GetWidth(), MainWindow::MainWindow().GetRect().GetHeight()+1);
     
    14421452//->SetLabel(s);
    14431453       
    1444 }
     1454}*/
    14451455
    14461456void setProgressBar( int i ) {
Note: See TracChangeset for help on using the changeset viewer.