Changeset 232

Show
Ignore:
Timestamp:
02/14/08 13:40:02 (4 years ago)
Author:
uncle_fungus
Message:

Fixed osx build, added xcode project

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/osx/src/benchmarksDialog.cpp

    r200 r232  
    8080        mSplitter->SetMinimumPaneSize(20); 
    8181 
     82#ifndef __WXMAC__ 
    8283        mBenchmarksInformation->SetFont(wxFont(8, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); 
     84#else 
     85        mBenchmarksInformation->SetFont(wxFont(9, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); 
     86#endif 
    8387 
    8488        _PrefsGetUint(PREF_BENCHMARKSDIALOG_COLUMNWIDTH, columnWidth); 
     
    9195        mainSizer->Add(mSplitter, 1, wxEXPAND); 
    9296        mainSizer->AddSpacer(FMC_GUI_SPACING_HIGH); 
     97#ifndef __WXMAC__ 
    9398        mainSizer->Add(new wxButton(this, wxID_CLOSE), 0, wxALIGN_CENTER_HORIZONTAL); 
     99#endif 
    94100 
    95101        // --- 
  • branches/osx/src/clientDialog.cpp

    r200 r232  
    1919 * The client edition dialog. 
    2020 * Creates the dialog to add and edit new clients. 
    21  * \author François Ingelrest 
     21 * \author FranÁois Ingelrest 
    2222 * \author Andrew Schofield 
    2323 **/ 
     
    5858ClientDialog::ClientDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, wxString::Format(_("Client Edition / %s"), wxT(FMC_PRODUCT))) 
    5959{ 
    60         wxBoxSizer       *topLevelSizer; 
    61         wxBoxSizer       *mainSizer; 
    62         wxBoxSizer       *buttonsSizer; 
    63         wxBoxSizer       *locationSizer; 
    64         wxFlexGridSizer  *clientInfoSizer; 
    65         wxStaticBoxSizer *groupSizer; 
     60        wxBoxSizer             *topLevelSizer; 
     61        wxBoxSizer             *mainSizer; 
     62        wxBoxSizer             *buttonsSizer; 
     63        wxBoxSizer             *locationSizer; 
     64        wxBoxSizer             *nameSizer; 
     65        wxBoxSizer             *nameLSizer; 
     66        wxBoxSizer             *locationLSizer; 
     67        wxFlexGridSizer        *clientInfoSizer; 
     68        wxBoxSizer             *groupSizer; 
     69        wxButton                chooseButton; 
    6670 
    6771        // The wxTextCtrl used for the location has an associated button to show the directory chooser 
    68         // Beware of the cration order, it implicitly defines the tab order 
     72        // Beware of the creation order, it implicitly defines the tab order 
     73        topLevelSizer       = new wxBoxSizer(wxVERTICAL); 
     74        mainSizer           = new wxBoxSizer(wxVERTICAL); 
    6975        locationSizer       = new wxBoxSizer(wxHORIZONTAL); 
     76        buttonsSizer        = new wxBoxSizer(wxHORIZONTAL); 
     77        nameSizer           = new wxBoxSizer(wxHORIZONTAL); 
     78        locationLSizer      = new wxBoxSizer(wxHORIZONTAL); 
     79        nameLSizer          = new wxBoxSizer(wxHORIZONTAL); 
     80        groupSizer          = new wxStaticBoxSizer(wxVERTICAL, this, _("Client information")); 
     81        clientInfoSizer     = new wxFlexGridSizer(2, FMC_GUI_SPACING_LOW, FMC_GUI_SPACING_LOW); 
     82         
    7083        mClientNameCtrl     = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(FMC_GUI_TEXTCTRL_MIN_LENGTH, -1)); 
    7184        mClientLocationCtrl = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(FMC_GUI_TEXTCTRL_MIN_LENGTH, -1)); 
    7285 
     86        locationLSizer->Add(new StaticBoldedText(this, wxID_ANY, _("Location:")),0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     87        locationLSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
    7388        locationSizer->Add(mClientLocationCtrl, 1, wxALIGN_CENTER_VERTICAL); 
    7489        locationSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
    75         locationSizer->Add(new wxButton(this, BTN_BROWSE, wxT("..."), wxDefaultPosition, wxSize(26, 26)), 0, wxALIGN_CENTER_VERTICAL); 
    76  
     90#ifndef __WXMAC__ 
     91    locationSizer->Add(new wxButton(this, BTN_BROWSE, wxT("..."), wxDefaultPosition, wxSize(26, 26))); 
     92#else 
     93        locationSizer->Add(new wxButton(this, BTN_BROWSE, _("Choose"), wxDefaultPosition)); 
     94#endif 
     95        locationSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
     96         
     97        nameLSizer->Add(new StaticBoldedText(this, wxID_ANY, _("Name:")), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     98        nameLSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
     99        nameSizer->Add(mClientNameCtrl, 1, wxALIGN_CENTER_VERTICAL); 
     100        nameSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
     101         
    77102        // The top part: it contains the two wxTextCtrl and their labels 
    78         groupSizer      = new wxStaticBoxSizer(wxVERTICAL, this, _("Client information")); 
    79         clientInfoSizer = new wxFlexGridSizer(2, FMC_GUI_SPACING_LOW, FMC_GUI_SPACING_LOW); 
    80  
    81         clientInfoSizer->Add(new StaticBoldedText(this, wxID_ANY, _("Name:")), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
    82         clientInfoSizer->Add(mClientNameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND); 
    83         clientInfoSizer->Add(new StaticBoldedText(this, wxID_ANY, _("Location:")), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
    84         clientInfoSizer->Add(locationSizer, 0, wxALIGN_CENTER_VERTICAL); 
    85         groupSizer->Add(clientInfoSizer, 1, wxEXPAND | wxALL, FMC_GUI_BORDER); 
     103 
     104        clientInfoSizer->Add(nameLSizer, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     105        clientInfoSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND); 
     106        clientInfoSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
     107        clientInfoSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
     108        clientInfoSizer->Add(locationLSizer, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     109        clientInfoSizer->Add(locationSizer, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND); 
     110        groupSizer->Add(clientInfoSizer); 
    86111 
    87112        // The bottom part contains the Ok and Cancel buttons 
    88         buttonsSizer = new wxBoxSizer(wxHORIZONTAL); 
     113        //buttonsSizer = new wxBoxSizer(wxHORIZONTAL); 
    89114 
    90115        buttonsSizer->Add(new wxButton(this, wxID_CANCEL), 0, wxALIGN_RIGHT); 
     
    93118 
    94119        // Construct the main sizer 
    95         mainSizer = new wxBoxSizer(wxVERTICAL); 
     120        //mainSizer = new wxBoxSizer(wxVERTICAL); 
    96121 
    97122        mainSizer->Add(groupSizer, 1, wxEXPAND); 
     
    100125 
    101126        // And the top level sizer 
    102         topLevelSizer = new wxBoxSizer(wxVERTICAL); 
     127        //topLevelSizer = new wxBoxSizer(wxVERTICAL); 
    103128 
    104129        topLevelSizer->Add(mainSizer, 1, wxEXPAND | wxALL, FMC_GUI_BORDER); 
  • branches/osx/src/include/fahmonConsts.h

    r223 r232  
    8989#elif _FAHMON_WIN32_ 
    9090#define FMC_GUI_BORDER 5     // Windows does not have default borders, so we use ours 
     91#elif __WXMAC__ 
     92#define FMC_GUI_BORDER 5 
    9193#endif 
    9294 
  • branches/osx/src/include/mainDialog.h

    r200 r232  
    9797#elif __WXGTK__ 
    9898#define PREF_TOOLS_FILEMANAGER_DV wxT("konqueror --profile filemanagement"); /**< Default value for Linux filemanager */ 
     99#elif __WXMAC__ 
     100#define PREF_TOOLS_FILEMANAGER_DV wxT("open"); 
    99101#endif 
    100102 
  • branches/osx/src/include/preferencesDialog.h

    r218 r232  
    3030#include "wx/dialog.h" 
    3131#include "wx/choice.h" 
    32 #include "wx/notebook.h" 
     32#ifndef __WXMAC__  
     33#include "wx/notebook.h"  
     34#else  
     35#include "wx/choicebk.h"  
     36#endif  
    3337#include "wx/textctrl.h" 
    3438#include "wx/checkbox.h" 
     
    139143         * @return A wxPanel object. 
    140144         **/ 
    141         wxPanel* CreateGeneralTab(wxNotebook* parent); 
     145        wxPanel* CreateGeneralTab(wxBookCtrlBase* parent); 
    142146 
    143147        /** 
     
    146150         * @return A wxPanel object. 
    147151         **/ 
    148         wxPanel* CreateMonitoringTab(wxNotebook* parent); 
     152        wxPanel* CreateMonitoringTab(wxBookCtrlBase* parent); 
    149153 
    150154        /** 
     
    153157         * @return A wxPanel object. 
    154158         **/ 
    155         wxPanel* CreateNetworkingTab(wxNotebook* parent); 
     159        wxPanel* CreateNetworkingTab(wxBookCtrlBase* parent); 
    156160 
    157161        /** 
     
    160164         * @return A wxPanel object. 
    161165         **/ 
    162         wxPanel* CreateAdvancedTab(wxNotebook* parent); 
     166        wxPanel* CreateAdvancedTab(wxBookCtrlBase* parent); 
    163167 
    164168        /** 
     
    167171         * @return A wxPanel object. 
    168172         **/ 
    169         wxPanel* CreateSystemTab(wxNotebook* parent); 
    170         //wxPanel* CreateFahinfoTab(wxNotebook* parent); 
     173        wxPanel* CreateSystemTab(wxBookCtrlBase* parent); 
     174        //wxPanel* CreateFahinfoTab(wxBookCtrlBase* parent); 
    171175 
    172176        /** 
     
    175179         * @return A wxPanel object. 
    176180         **/ 
    177         wxPanel* CreateWebAppTab(wxNotebook* parent); 
     181        wxPanel* CreateWebAppTab(wxBookCtrlBase* parent); 
    178182 
    179183        /** 
     
    236240        void OnChoices(wxCommandEvent& event); 
    237241 
     242        #ifdef __WXMAC__  
     243        void OnClose(wxCloseEvent& event);  
     244        #endif  
    238245 
    239246public: 
  • branches/osx/src/main.cpp

    r200 r232  
    2929#include "wx/image.h" 
    3030#include "wx/intl.h" 
     31#include "wx/filename.h" 
    3132#include "mainDialog.h" 
    3233#include "pathManager.h" 
     
    6061 
    6162        // Check for another instance 
     63        #ifndef __WXMAC__ 
    6264        mInstanceChecker = new wxSingleInstanceChecker(wxT(FMC_UID)); 
    6365        if(mInstanceChecker->IsAnotherRunning() == true) 
     
    8789                Tools::ErrorMsgBox(wxString::Format(_T("Could create socket, auto-raising will not function!"))); 
    8890        } 
     91        #endif 
    8992 
    9093        if ( !m_locale.Init(wxLANGUAGE_DEFAULT, wxLOCALE_CONV_ENCODING) ) 
     
    105108        { 
    106109                wxLocale::AddCatalogLookupPathPrefix(wxT(DATADIR)); 
     110        } 
     111#endif 
     112#ifdef __WXMAC__ 
     113        { 
     114                wxFileName appPath = wxFileName(wxTheApp->argv[0]).GetPath (wxPATH_GET_VOLUME); 
     115                appPath.RemoveLastDir(); 
     116         
     117                wxString resourcesPath = appPath.GetPath(); 
     118         
     119                resourcesPath += _T("/Contents/SharedSupport/lang/"); 
     120                 
     121                wxLocale::AddCatalogLookupPathPrefix(resourcesPath); 
    107122        } 
    108123#endif 
     
    136151        if(!wxDirExists(PathManager::GetCfgPath())) { 
    137152                requiresFirstRunDialog = true; 
     153                // The following is necessary on OSX as the wxMkDir function doesn't seem to be able to create folders with more 
     154                // than one level at once. Therefore we need to create the "~/Library/Application Support/FahMon" folder first. 
     155                #ifdef __WXMAC__ 
     156                wxFileName topPath = PathManager::GetCfgPath(); 
     157                topPath.RemoveLastDir(); 
     158                if(!wxMkdir(topPath.GetPath())) 
     159                { 
     160                        Tools::ErrorMsgBox(wxString::Format(_("Could not create directory <%s>"), topPath.GetPath().c_str())); 
     161                        return false; 
     162                } 
     163                #endif 
    138164                if(!wxMkdir(PathManager::GetCfgPath())) 
    139165                { 
     
    193219        PreferencesManager::DestroyInstance();        // MUST be destroyed last, so that other managers can save their preferences when they are destroyed 
    194220        MessagesManager::DestroyInstance(); 
    195  
    196         delete mInstanceChecker; 
     221         
     222#ifndef __WXMAC__ 
     223        if (mInstanceChecker) 
     224                delete mInstanceChecker; 
     225#endif 
    197226 
    198227        return 0; 
  • branches/osx/src/mainDialog.cpp

    r223 r232  
    4646#include "preferencesManager.h" 
    4747#include "listViewClients.h" 
     48#ifdef __WXMAC__ 
     49#include "wx/sysopt.h" 
     50#endif 
    4851 
    4952 
     
    5962        MID_TOGGLE_ETADATE, 
    6063        MID_BENCHMARKS, 
    61         MID_PREFERENCES, 
    6264        MID_WWWJMOL, 
    6365        MID_WWWMYSTATS, 
     
    109111        EVT_MENU    (MID_TOGGLE_ETADATE,        MainDialog::OnMenuToggleETADate) 
    110112        EVT_MENU    (MID_BENCHMARKS,            MainDialog::OnMenuBenchmarks) 
    111         EVT_MENU    (MID_PREFERENCES,           MainDialog::OnMenuPreferences) 
     113        EVT_MENU    (wxID_PREFERENCES,          MainDialog::OnMenuPreferences) 
    112114        EVT_MENU    (MID_WWWJMOL,               MainDialog::OnMenuWeb) 
    113115        EVT_MENU    (MID_WWWFAHINFO,            MainDialog::OnMenuWeb) 
     
    608610        // Create the menubar 
    609611        menuBar = new wxMenuBar(); 
    610         SetMenuBar(menuBar); 
    611612 
    612613        // The 'Main' menu 
     
    618619        menu->AppendSeparator(); 
    619620        menu->Append(MID_BENCHMARKS, _("&Benchmarks...\tCTRL+B"), _("Open the benchmarks dialog")); 
    620         menu->Append(MID_PREFERENCES, _("&Preferences...\tCTRL+P"), _("Open the preferences dialog")); 
     621        menu->Append(wxID_PREFERENCES, _("&Preferences...\tCTRL+P"), _("Open the preferences dialog")); 
    621622        menu->AppendSeparator(); 
    622623#ifdef _FAHMON_WIN32_ 
     
    628629        menu->Append(wxID_EXIT, _("&Quit\tCtrl+Q"), wxString::Format(_T("%s "FMC_APPNAME), _("Quit"))); 
    629630#endif 
     631#ifndef __WXMAC__ 
    630632        menuBar->Append(menu, wxString::Format(wxT("&%s"), wxT(FMC_APPNAME))); 
     633#else 
     634        menuBar->Append(menu, _("&Tools")); 
     635#endif 
    631636 
    632637        // The 'Monitoring' menu 
    633638        menu = new wxMenu(); 
     639        #ifndef __WXMAC__ 
    634640        menu->Append(MID_RELOAD, _("Reload &Selection\tF5"), _("Reload the selected client")); 
    635641        menu->Append(MID_RELOAD_ALL, _("Reload &All\tF6"), _("Reload all the clients")); 
     
    638644        menu->AppendSeparator(); 
    639645        menu->Append(MID_TOGGLE_ETADATE, _("&Cycle ETA Style\tF9"), _("Cycle through the different ETA display styles")); 
     646        #else 
     647        menu->Append(MID_RELOAD, _("Reload &Selection\tCtrl+R"), _("Reload the selected client")); 
     648        menu->Append(MID_RELOAD_ALL, _("Reload &All\tCtrl+Shift+R"), _("Reload all the clients")); 
     649        menu->AppendSeparator(); 
     650        menu->Append(MID_TOGGLELOG, _("&Show/Hide FAHLog\tCtrl+L"), _("Toggle the log file")); 
     651        menu->AppendSeparator(); 
     652        menu->Append(MID_TOGGLE_ETADATE, _("&Cycle ETA Style\tCtrl+E"), _("Cycle through the different ETA display styles")); 
     653        #endif 
    640654        menuBar->Append(menu, _("&Monitoring")); 
    641655 
    642656        // The 'Web' menu 
    643657        menu = new wxMenu(); 
     658        #ifndef __WXMAC__ 
    644659        menu->Append(MID_WWWMYSTATS, _("&My Stats\tF2"), _("View the personal statistics for the selected client")); 
    645660        menu->Append(MID_WWWJMOL, _("&Jmol\tF3"), _("View the current project on the Jmol website")); 
    646661        menu->Append(MID_WWWFAHINFO, _("&fahinfo\tF4"), _("View the current project on fahinfo.org")); 
     662        #else 
     663        menu->Append(MID_WWWMYSTATS, _("&My Stats\tCtrl+Shift+M"), _("View the personal statistics for the selected client")); 
     664        menu->Append(MID_WWWJMOL, _("&Jmol\tCtrl+J"), _("View the current project on the Jmol website")); 
     665        menu->Append(MID_WWWFAHINFO, _("&fahinfo\tCtrl+F"), _("View the current project on fahinfo.org")); 
     666        #endif 
    647667        menu->AppendSeparator(); 
    648668        menu->Append(MID_WWWFOLDING, _("F@H &Website"), _("Open to the official Stanford website")); 
     
    654674        // The 'Help' menu 
    655675        menu = new wxMenu(); 
     676        #ifndef __WXMAC__ 
    656677        menu->Append(wxID_HELP_CONTENTS, _("&Help Contents\tF1"), _("See help contents")); 
     678        #else 
     679        menu->Append(wxID_HELP_CONTENTS, _("&Help Contents\tCtrl+?"), _("See help contents")); 
     680        #endif 
    657681#ifdef _FAHMON_WIN32_ 
    658682        // MSVC stupidity 
     
    663687        menu->Append(wxID_ABOUT, _("&About"), wxString::Format(_T("%s "FMC_APPNAME),  _("About"))); 
    664688#endif 
     689#ifdef __WXMAC__ 
     690        { 
     691                //wxApp::s_macHelpMenuTitleName = _("&Help"); 
     692            wxApp::s_macAboutMenuItemId = wxID_ABOUT; 
     693        } 
     694#endif 
    665695        menuBar->Append(menu, _("&Help")); 
     696         
     697        SetMenuBar(menuBar); 
    666698} 
    667699 
     
    677709        wxGridSizer      *infoSizer; 
    678710        wxStaticBoxSizer *topRightSizer; 
    679  
     711#ifdef __WXMAC__  
     712        wxSystemOptions::SetOption(_T("mac.listctrl.always_use_generic"), 1);  
     713#endif 
    680714        // We need to use a panel as a top level component in our frame 
    681715        // Without that, the frame looks ugly under Windows (dark grey background) 
  • branches/osx/src/pathManager.cpp

    r200 r232  
    2626 
    2727#include "wx/utils.h" 
     28#include "wx/filename.h" 
     29#include "wx/app.h" 
    2830 
    2931 
     
    6466        mUserTplPath = wxT("./templates/"); 
    6567        mMsgPath = wxT("./"); 
     68         
     69#elif __WXMAC__ 
     70 
     71        // On OSX systems, the preferences are stored in ~/Library/Application Support 
     72        // by convention 
     73         
     74        wxFileName appPath = wxFileName(wxTheApp->argv[0]).GetPath (wxPATH_GET_VOLUME); 
     75        appPath.RemoveLastDir(); 
     76         
     77        wxString resourcesPath = appPath.GetPath(); 
     78         
     79        resourcesPath += _T("/Contents/Resources/"); 
     80 
     81        wxString homeDir; 
     82         
     83        homeDir = wxGetHomeDir(); 
     84        if(homeDir.Last() != '/') 
     85                homeDir += wxT("/"); 
     86         
     87        mImgPath = resourcesPath; 
     88        mCfgPath = homeDir + wxT("Library/Application Support/FahMon/config/"); 
     89        mXYZPath = homeDir + wxT("Library/Application Support/FahMon/xyz/"); 
     90        mMsgPath = homeDir + wxT("Library/Application Support/FahMon/"); 
     91        mGlobalTplPath = resourcesPath; 
     92        mUserTplPath = homeDir + wxT("Library/Application Support/FahMon/templates/"); 
    6693 
    6794#endif 
  • branches/osx/src/preferencesDialog.cpp

    r218 r232  
    8383        EVT_CHOICE(CHC_FILEMANAGER,                 PreferencesDialog::OnChoices) 
    8484        // EVT_CHOICE(CHK_PPDTYPE, PreferencesDialog::OnChoices) 
     85        #ifdef __WXMAC__  
     86        EVT_CLOSE(PreferencesDialog::OnClose)  
     87        #endif  
    8588 
    8689END_EVENT_TABLE() 
     
    9598        wxBoxSizer *topLevelSizer; 
    9699        wxBoxSizer *mainSizer; 
     100#ifndef __WXMAC__ 
    97101        wxBoxSizer *buttonsSizer; 
    98102        wxNotebook *noteBook; 
     103#else 
     104        wxChoicebook *noteBook; 
     105#endif 
    99106 
    100107        // Preferences are divided into groups, thanks to a wxNoteBook (tabbed control) 
     108#ifndef __WXMAC__ 
    101109        noteBook = new wxNotebook(this, wxID_ANY); 
     110#else 
     111        noteBook = new wxChoicebook(this, wxID_ANY); 
     112#endif 
    102113 
    103114        noteBook->AddPage(CreateGeneralTab(noteBook),    _("General")); 
     
    110121 
    111122        // Buttons 'Ok' and 'Cancel' are right-aligned 
     123#ifndef __WXMAC__ 
    112124        buttonsSizer = new wxBoxSizer(wxHORIZONTAL); 
    113125 
     
    115127        buttonsSizer->AddSpacer(FMC_GUI_SPACING_LOW); 
    116128        buttonsSizer->Add(new wxButton(this, wxID_OK), 0, wxALIGN_RIGHT); 
     129#endif 
    117130 
    118131        // Construct the dialog 
     
    121134        mainSizer->Add(noteBook, 1, wxEXPAND); 
    122135        mainSizer->AddSpacer(FMC_GUI_SPACING_HIGH); 
     136#ifndef __WXMAC__ 
    123137        mainSizer->Add(buttonsSizer, 0, wxALIGN_RIGHT); 
     138#endif 
    124139 
    125140        // The final sizer 
     
    158173 
    159174 
    160 inline wxPanel* PreferencesDialog::CreateGeneralTab(wxNotebook* parent) 
     175inline wxPanel* PreferencesDialog::CreateGeneralTab(wxBookCtrlBase* parent) 
    161176{ 
    162177        wxPanel    *panel; 
     
    167182        sizer                               = new wxBoxSizer(wxVERTICAL); 
    168183        topLevelSizer                       = new wxBoxSizer(wxVERTICAL); 
     184        #ifndef __WXMAC__ 
    169185        mGeneralEnableTrayIcon              = new wxCheckBox(panel, wxID_ANY, _("Enable system tray icon")); 
     186        #endif 
    170187        mGeneralStartMinimised              = new wxCheckBox(panel, wxID_ANY, _("Start minimized")); 
    171188        mGeneralCollectXYZFiles             = new wxCheckBox(panel, wxID_ANY, _("Collect .xyz files")); 
     
    174191        mGeneralUpdateCheck                 = new wxCheckBox(panel, wxID_ANY, _("Check for FahMon updates on startup")); 
    175192 
     193        #ifndef __WXMAC__ 
    176194        sizer->AddStretchSpacer(); 
    177195        sizer->Add(mGeneralEnableTrayIcon, 0, wxALIGN_LEFT); 
     196        #endif 
    178197        sizer->AddStretchSpacer(); 
    179198        sizer->Add(mGeneralCollectXYZFiles, 0, wxALIGN_LEFT); 
     
    195214 
    196215 
    197 inline wxPanel* PreferencesDialog::CreateMonitoringTab(wxNotebook* parent) 
     216inline wxPanel* PreferencesDialog::CreateMonitoringTab(wxBookCtrlBase* parent) 
    198217{ 
    199218        wxPanel    *panel; 
     
    255274 
    256275 
    257 inline wxPanel* PreferencesDialog::CreateNetworkingTab(wxNotebook* parent) 
     276inline wxPanel* PreferencesDialog::CreateNetworkingTab(wxBookCtrlBase* parent) 
    258277{ 
    259278        wxPanel    *panel; 
     
    309328 
    310329 
    311 inline wxPanel* PreferencesDialog::CreateAdvancedTab(wxNotebook* parent) 
     330inline wxPanel* PreferencesDialog::CreateAdvancedTab(wxBookCtrlBase* parent) 
    312331{ 
    313332        wxPanel    *panel; 
     
    331350        mAdvancedLocalFileLocation                      = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 
    332351        mAdvancedLabelLocalFile                         = new wxStaticText(panel, wxID_ANY, _("Filename:")); 
     352#ifndef __WXMAC__ 
    333353        mAdvancedLocationChooser                        = new wxButton(panel, BTN_BROWSE, wxT("..."), wxDefaultPosition, wxSize(26, 26)); 
     354#else 
     355        mAdvancedLocationChooser                        = new wxButton(panel, BTN_BROWSE, _("Choose"), wxDefaultPosition); 
     356#endif 
    334357 
    335358        LocalFileSizer->Add(mAdvancedLabelLocalFile, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     
    357380 
    358381 
    359 inline wxPanel* PreferencesDialog::CreateSystemTab(wxNotebook* parent) 
     382inline wxPanel* PreferencesDialog::CreateSystemTab(wxBookCtrlBase* parent) 
    360383{ 
    361384        wxPanel    *panel; 
     
    388411        const wxString    fileManagers[5] = {wxT("Konqueror (KDE 3)"), wxT("Dolphin (KDE 4)"), wxT("Nautilus (Gnome)"), wxT("Thunar (Xfce 4.4)"), _("Other")}; 
    389412        mSystemFileManager     = new wxChoice(panel, CHC_FILEMANAGER, wxDefaultPosition, wxDefaultSize, 5, fileManagers); 
     413        #elif __WXMAC__ 
     414        const wxString fileManagers[2] = {_("Finder"), _("Other")}; 
     415        mSystemFileManager     = new wxChoice(panel, CHC_FILEMANAGER, wxDefaultPosition, wxDefaultSize, 2, fileManagers); 
    390416        #endif 
    391417 
     
    431457* Create the tab containing fahinfo.org integration preferences 
    432458**/ 
    433 /*inline wxPanel* PreferencesDialog::CreateFahinfoTab(wxNotebook* parent) 
     459/*inline wxPanel* PreferencesDialog::CreateFahinfoTab(wxBookCtrlBase* parent) 
    434460{ 
    435461        wxPanel    *panel; 
     
    441467 
    442468 
    443 inline wxPanel* PreferencesDialog::CreateWebAppTab(wxNotebook* parent) 
     469inline wxPanel* PreferencesDialog::CreateWebAppTab(wxBookCtrlBase* parent) 
    444470{ 
    445471        wxPanel    *panel; 
     
    466492        mWebAppWebAppLocation            = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 
    467493        mWebAppWebAppLabel               = new wxStaticText(panel, wxID_ANY, _("Filename:")); 
     494#ifndef __WXMAC__ 
    468495        mWebAppWebAppLocationChooser     = new wxButton(panel, BTN_BROWSE_WEBAPP, wxT("..."), wxDefaultPosition, wxSize(26, 26)); 
     496#else 
     497        mWebAppWebAppLocationChooser     = new wxButton(panel, BTN_BROWSE_WEBAPP, _("Choose"), wxDefaultPosition); 
     498#endif 
    469499 
    470500        mWebAppUseSimpleWeb              = new wxCheckBox(panel, CHK_USESIMPLEWEB, _("Export Simple Web page")); 
    471501        mWebAppSimpleWebLocation         = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 
    472502        mWebAppSimpleWebLabel            = new wxStaticText(panel, wxID_ANY, _("Filename:")); 
     503#ifndef __WXMAC__ 
    473504        mWebAppSimpleWebLocationChooser  = new wxButton(panel, BTN_BROWSE_SIMPLEWEB, wxT("..."), wxDefaultPosition, wxSize(26, 26)); 
     505#else 
     506        mWebAppSimpleWebLocationChooser  = new wxButton(panel, BTN_BROWSE_SIMPLEWEB, _("Choose"), wxDefaultPosition); 
     507#endif 
    474508 
    475509        mWebAppUseSimpleText             = new wxCheckBox(panel, CHK_USESIMPLETEXT, _("Export Simple Text file")); 
    476510        mWebAppSimpleTextLocation        = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 
    477511        mWebAppSimpleTextLabel           = new wxStaticText(panel, wxID_ANY, _("Filename:")); 
     512#ifndef __WXMAC__ 
    478513        mWebAppSimpleTextLocationChooser = new wxButton(panel, BTN_BROWSE_SIMPLETEXT, wxT("..."), wxDefaultPosition, wxSize(26, 26)); 
     514#else 
     515        mWebAppSimpleTextLocationChooser = new wxButton(panel, BTN_BROWSE_SIMPLETEXT, _("Choose"), wxDefaultPosition); 
     516#endif 
    479517 
    480518        webAppSizer->Add(mWebAppUseWebApp, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 
     
    552590        _PrefsGetBool(PREF_FAHCLIENT_COLLECTXYZFILES,     isCollectingXYZFiles); 
    553591        _PrefsGetBool(PREF_MAINDIALOG_AUTOUPDATEPROJECTS, autoUpdateProjects); 
     592        #ifndef __WXMAC__ 
    554593        _PrefsGetBool(PREF_MAINDIALOG_ENABLE_TRAY_ICON,   mInitEnableTrayIcon); 
     594        #endif 
    555595        _PrefsGetBool(PREF_LISTCLIENTS_KEEP_DEAD_LAST,    keepInaccessibleLast); 
    556596        _PrefsGetBool(PREF_MAINDIALOG_START_MINIMISED,    startMinimised); 
     
    559599 
    560600        mGeneralCollectXYZFiles->SetValue(isCollectingXYZFiles); 
     601        #ifndef __WXMAC__ 
    561602        mGeneralEnableTrayIcon->SetValue(mInitEnableTrayIcon); 
     603        #endif 
    562604        mGeneralAutoUpdateProjectsDatabase->SetValue(autoUpdateProjects); 
    563605        mGeneralKeepInaccessibleClientsLast->SetValue(keepInaccessibleLast); 
     
    745787                mSystemFileManager->Select(4); 
    746788        } 
     789        #elif __WXMAC__  
     790        if(filemanager == wxT("open"))  
     791        {  
     792                mSystemFileManager->Select(0);  
     793        }  
     794        else // other filemanager  
     795        {  
     796                mSystemFileManager->Select(1);  
     797        } 
    747798        #endif 
    748  
    749799        if (mInitOverrideTz == true) 
    750800        { 
     
    767817        _PrefsSetBool(PREF_FAHCLIENT_COLLECTXYZFILES,     mGeneralCollectXYZFiles->GetValue()); 
    768818        _PrefsSetBool(PREF_MAINDIALOG_START_MINIMISED,    mGeneralStartMinimised->GetValue()); 
     819        #ifndef __WXMAC__ 
    769820        _PrefsSetBool(PREF_MAINDIALOG_ENABLE_TRAY_ICON,   mGeneralEnableTrayIcon->GetValue()); 
     821        #endif 
    770822        _PrefsSetBool(PREF_MAINDIALOG_AUTOUPDATEPROJECTS, mGeneralAutoUpdateProjectsDatabase->GetValue()); 
    771823        _PrefsSetBool(PREF_LISTCLIENTS_KEEP_DEAD_LAST,    mGeneralKeepInaccessibleClientsLast->GetValue()); 
     
    812864 
    813865        // -----===== Alert components when important prefs have changed =====----- 
     866        #ifndef __WXMAC__ 
    814867        if(mGeneralEnableTrayIcon->GetValue() != mInitEnableTrayIcon) 
    815868        { 
    816869                MainDialog::GetInstance()->OnTrayIconPrefChanged(); 
    817870        } 
     871        #endif 
    818872 
    819873        if(mMonitoringAdvancedReload->GetValue() != mInitAdvancedReload || (wxUint32)mMonitoringAutoReloadFrequency->GetValue() != mInitAutoReloadFrequency) 
     
    10781132                                        break; 
    10791133                        } 
    1080  
     1134                        #elif __WXMAC__  
     1135                        switch(mSystemFileManager->GetSelection())  
     1136                        {  
     1137                                // ---  
     1138                                case 0: //Finder  
     1139                                        mSystemOtherFM->SetValue(wxT("open"));  
     1140                                        break; 
     1141 
     1142                                case 1: //Other  
     1143                                        mSystemOtherFM->SetValue(wxT(""));  
     1144                                        break;  
     1145 
     1146                                default:  
     1147                                        break;  
     1148                        } 
    10811149                        #endif 
    10821150                        break; 
     
    10871155        } 
    10881156} 
     1157 
     1158#ifdef __WXMAC__  
     1159/**  
     1160 * Mac Specific close routine to save the preferences: no close button  
     1161 **/  
     1162void PreferencesDialog::OnClose(wxCloseEvent& event)  
     1163{  
     1164        SavePreferences();  
     1165        PreferencesManager::GetInstance()->Save();  
     1166        event.Skip();  
     1167}  
     1168#endif  
  • branches/osx/src/preferencesManager.cpp

    r218 r232  
    225225 
    226226 
    227 inline void PreferencesManager::Save(void) 
     227void PreferencesManager::Save(void) 
    228228{ 
    229229        DataOutputStream             out(PathManager::GetCfgPath() + wxT(FMC_FILE_PREFS)); 
  • branches/osx/src/queue.cpp

    r229 r232  
    6565#elif _FAHMON_WIN32_ 
    6666        systype = 1; 
    67 #elif __WXMAC_PPC__ 
     67#elif defined(__ppc__) && defined(__WXMAC__) 
    6868        systype = 2; 
    69 #elif __WXMAC__ 
     69#elif defined(__i386__) && defined(__WXMAC__) 
    7070        systype = 3; 
    7171#endif 
     
    115115                                queueversion = 324; 
    116116tl:                             if (genome) 
    117 #ifdef __WXMAC_PPC__ 
     117#if defined(__ppc__) && defined(__WXMAC__) 
    118118                                        q = "0Linux"; 
    119119#else 
     
    129129                                queueversion = 500; 
    130130tt:                             if (genome) 
    131 #ifdef __WXMAC_PPC__ 
     131#if defined(__ppc__) && defined(__WXMAC__) 
    132132                                        q = "1Linux, Windows or Mac/x86"; 
    133133#else 
     
    142142                //endian swap for PPC machines and queues 
    143143                endianswap = FALSE; 
    144 #ifdef __WXMAC_PPC__ 
     144#if defined(__ppc__) && defined(__WXMAC__) 
    145145                if (systype != 2) 
    146146                        endianswap = TRUE; 
     
    249249u32 Queue::es32(u32 i) 
    250250{ 
    251         //return ((i << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i & 0xFF000000) >> 24)); 
    252         return (i>>24) | ((i<<8) & 0x00FF0000) | ((i>>8) & 0x0000FF00) | (i<<24); 
     251        return ((i << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i & 0xFF000000) >> 24)); 
    253252} 
    254253 
     
    258257        int                     i, n; 
    259258        struct queueformat::qs *p; 
     259 
    260260        bp->version = es32(bp->version); 
    261261        bp->current = es32(bp->current); 
  • branches/osx/src/tools.cpp

    r200 r232  
    6363        } 
    6464 
     65#elif __WXMAC__ 
     66 
     67        wxLaunchDefaultBrowser(url); 
     68 
    6569#else 
    6670