Changeset 232
- Timestamp:
- 02/14/08 13:40:02 (4 years ago)
- Files:
-
- branches/osx/FahMon-Info.plist (added)
- branches/osx/FahMon.xcodeproj (added)
- branches/osx/FahMon.xcodeproj/project.pbxproj (added)
- branches/osx/FahMon.xcodeproj/uncle_fungus.mode1 (added)
- branches/osx/FahMon.xcodeproj/uncle_fungus.pbxuser (added)
- branches/osx/mac (added)
- branches/osx/mac/FahMon-Info.plist (added)
- branches/osx/mac/fahmon.icns (added)
- branches/osx/src/benchmarksDialog.cpp (modified) (2 diffs)
- branches/osx/src/clientDialog.cpp (modified) (4 diffs)
- branches/osx/src/include/fahmonConsts.h (modified) (1 diff)
- branches/osx/src/include/mainDialog.h (modified) (1 diff)
- branches/osx/src/include/preferencesDialog.h (modified) (8 diffs)
- branches/osx/src/main.cpp (modified) (6 diffs)
- branches/osx/src/mainDialog.cpp (modified) (10 diffs)
- branches/osx/src/pathManager.cpp (modified) (2 diffs)
- branches/osx/src/preferencesDialog.cpp (modified) (24 diffs)
- branches/osx/src/preferencesManager.cpp (modified) (1 diff)
- branches/osx/src/queue.cpp (modified) (6 diffs)
- branches/osx/src/tools.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/osx/src/benchmarksDialog.cpp
r200 r232 80 80 mSplitter->SetMinimumPaneSize(20); 81 81 82 #ifndef __WXMAC__ 82 83 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 83 87 84 88 _PrefsGetUint(PREF_BENCHMARKSDIALOG_COLUMNWIDTH, columnWidth); … … 91 95 mainSizer->Add(mSplitter, 1, wxEXPAND); 92 96 mainSizer->AddSpacer(FMC_GUI_SPACING_HIGH); 97 #ifndef __WXMAC__ 93 98 mainSizer->Add(new wxButton(this, wxID_CLOSE), 0, wxALIGN_CENTER_HORIZONTAL); 99 #endif 94 100 95 101 // --- branches/osx/src/clientDialog.cpp
r200 r232 19 19 * The client edition dialog. 20 20 * Creates the dialog to add and edit new clients. 21 * \author Fran çois Ingelrest21 * \author FranÃois Ingelrest 22 22 * \author Andrew Schofield 23 23 **/ … … 58 58 ClientDialog::ClientDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, wxString::Format(_("Client Edition / %s"), wxT(FMC_PRODUCT))) 59 59 { 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; 66 70 67 71 // 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); 69 75 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 70 83 mClientNameCtrl = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(FMC_GUI_TEXTCTRL_MIN_LENGTH, -1)); 71 84 mClientLocationCtrl = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(FMC_GUI_TEXTCTRL_MIN_LENGTH, -1)); 72 85 86 locationLSizer->Add(new StaticBoldedText(this, wxID_ANY, _("Location:")),0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); 87 locationLSizer->AddSpacer(FMC_GUI_SPACING_LOW); 73 88 locationSizer->Add(mClientLocationCtrl, 1, wxALIGN_CENTER_VERTICAL); 74 89 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 77 102 // 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); 86 111 87 112 // The bottom part contains the Ok and Cancel buttons 88 buttonsSizer = new wxBoxSizer(wxHORIZONTAL);113 //buttonsSizer = new wxBoxSizer(wxHORIZONTAL); 89 114 90 115 buttonsSizer->Add(new wxButton(this, wxID_CANCEL), 0, wxALIGN_RIGHT); … … 93 118 94 119 // Construct the main sizer 95 mainSizer = new wxBoxSizer(wxVERTICAL);120 //mainSizer = new wxBoxSizer(wxVERTICAL); 96 121 97 122 mainSizer->Add(groupSizer, 1, wxEXPAND); … … 100 125 101 126 // And the top level sizer 102 topLevelSizer = new wxBoxSizer(wxVERTICAL);127 //topLevelSizer = new wxBoxSizer(wxVERTICAL); 103 128 104 129 topLevelSizer->Add(mainSizer, 1, wxEXPAND | wxALL, FMC_GUI_BORDER); branches/osx/src/include/fahmonConsts.h
r223 r232 89 89 #elif _FAHMON_WIN32_ 90 90 #define FMC_GUI_BORDER 5 // Windows does not have default borders, so we use ours 91 #elif __WXMAC__ 92 #define FMC_GUI_BORDER 5 91 93 #endif 92 94 branches/osx/src/include/mainDialog.h
r200 r232 97 97 #elif __WXGTK__ 98 98 #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"); 99 101 #endif 100 102 branches/osx/src/include/preferencesDialog.h
r218 r232 30 30 #include "wx/dialog.h" 31 31 #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 33 37 #include "wx/textctrl.h" 34 38 #include "wx/checkbox.h" … … 139 143 * @return A wxPanel object. 140 144 **/ 141 wxPanel* CreateGeneralTab(wx Notebook* parent);145 wxPanel* CreateGeneralTab(wxBookCtrlBase* parent); 142 146 143 147 /** … … 146 150 * @return A wxPanel object. 147 151 **/ 148 wxPanel* CreateMonitoringTab(wx Notebook* parent);152 wxPanel* CreateMonitoringTab(wxBookCtrlBase* parent); 149 153 150 154 /** … … 153 157 * @return A wxPanel object. 154 158 **/ 155 wxPanel* CreateNetworkingTab(wx Notebook* parent);159 wxPanel* CreateNetworkingTab(wxBookCtrlBase* parent); 156 160 157 161 /** … … 160 164 * @return A wxPanel object. 161 165 **/ 162 wxPanel* CreateAdvancedTab(wx Notebook* parent);166 wxPanel* CreateAdvancedTab(wxBookCtrlBase* parent); 163 167 164 168 /** … … 167 171 * @return A wxPanel object. 168 172 **/ 169 wxPanel* CreateSystemTab(wx Notebook* parent);170 //wxPanel* CreateFahinfoTab(wx Notebook* parent);173 wxPanel* CreateSystemTab(wxBookCtrlBase* parent); 174 //wxPanel* CreateFahinfoTab(wxBookCtrlBase* parent); 171 175 172 176 /** … … 175 179 * @return A wxPanel object. 176 180 **/ 177 wxPanel* CreateWebAppTab(wx Notebook* parent);181 wxPanel* CreateWebAppTab(wxBookCtrlBase* parent); 178 182 179 183 /** … … 236 240 void OnChoices(wxCommandEvent& event); 237 241 242 #ifdef __WXMAC__ 243 void OnClose(wxCloseEvent& event); 244 #endif 238 245 239 246 public: branches/osx/src/main.cpp
r200 r232 29 29 #include "wx/image.h" 30 30 #include "wx/intl.h" 31 #include "wx/filename.h" 31 32 #include "mainDialog.h" 32 33 #include "pathManager.h" … … 60 61 61 62 // Check for another instance 63 #ifndef __WXMAC__ 62 64 mInstanceChecker = new wxSingleInstanceChecker(wxT(FMC_UID)); 63 65 if(mInstanceChecker->IsAnotherRunning() == true) … … 87 89 Tools::ErrorMsgBox(wxString::Format(_T("Could create socket, auto-raising will not function!"))); 88 90 } 91 #endif 89 92 90 93 if ( !m_locale.Init(wxLANGUAGE_DEFAULT, wxLOCALE_CONV_ENCODING) ) … … 105 108 { 106 109 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); 107 122 } 108 123 #endif … … 136 151 if(!wxDirExists(PathManager::GetCfgPath())) { 137 152 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 138 164 if(!wxMkdir(PathManager::GetCfgPath())) 139 165 { … … 193 219 PreferencesManager::DestroyInstance(); // MUST be destroyed last, so that other managers can save their preferences when they are destroyed 194 220 MessagesManager::DestroyInstance(); 195 196 delete mInstanceChecker; 221 222 #ifndef __WXMAC__ 223 if (mInstanceChecker) 224 delete mInstanceChecker; 225 #endif 197 226 198 227 return 0; branches/osx/src/mainDialog.cpp
r223 r232 46 46 #include "preferencesManager.h" 47 47 #include "listViewClients.h" 48 #ifdef __WXMAC__ 49 #include "wx/sysopt.h" 50 #endif 48 51 49 52 … … 59 62 MID_TOGGLE_ETADATE, 60 63 MID_BENCHMARKS, 61 MID_PREFERENCES,62 64 MID_WWWJMOL, 63 65 MID_WWWMYSTATS, … … 109 111 EVT_MENU (MID_TOGGLE_ETADATE, MainDialog::OnMenuToggleETADate) 110 112 EVT_MENU (MID_BENCHMARKS, MainDialog::OnMenuBenchmarks) 111 EVT_MENU ( MID_PREFERENCES,MainDialog::OnMenuPreferences)113 EVT_MENU (wxID_PREFERENCES, MainDialog::OnMenuPreferences) 112 114 EVT_MENU (MID_WWWJMOL, MainDialog::OnMenuWeb) 113 115 EVT_MENU (MID_WWWFAHINFO, MainDialog::OnMenuWeb) … … 608 610 // Create the menubar 609 611 menuBar = new wxMenuBar(); 610 SetMenuBar(menuBar);611 612 612 613 // The 'Main' menu … … 618 619 menu->AppendSeparator(); 619 620 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")); 621 622 menu->AppendSeparator(); 622 623 #ifdef _FAHMON_WIN32_ … … 628 629 menu->Append(wxID_EXIT, _("&Quit\tCtrl+Q"), wxString::Format(_T("%s "FMC_APPNAME), _("Quit"))); 629 630 #endif 631 #ifndef __WXMAC__ 630 632 menuBar->Append(menu, wxString::Format(wxT("&%s"), wxT(FMC_APPNAME))); 633 #else 634 menuBar->Append(menu, _("&Tools")); 635 #endif 631 636 632 637 // The 'Monitoring' menu 633 638 menu = new wxMenu(); 639 #ifndef __WXMAC__ 634 640 menu->Append(MID_RELOAD, _("Reload &Selection\tF5"), _("Reload the selected client")); 635 641 menu->Append(MID_RELOAD_ALL, _("Reload &All\tF6"), _("Reload all the clients")); … … 638 644 menu->AppendSeparator(); 639 645 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 640 654 menuBar->Append(menu, _("&Monitoring")); 641 655 642 656 // The 'Web' menu 643 657 menu = new wxMenu(); 658 #ifndef __WXMAC__ 644 659 menu->Append(MID_WWWMYSTATS, _("&My Stats\tF2"), _("View the personal statistics for the selected client")); 645 660 menu->Append(MID_WWWJMOL, _("&Jmol\tF3"), _("View the current project on the Jmol website")); 646 661 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 647 667 menu->AppendSeparator(); 648 668 menu->Append(MID_WWWFOLDING, _("F@H &Website"), _("Open to the official Stanford website")); … … 654 674 // The 'Help' menu 655 675 menu = new wxMenu(); 676 #ifndef __WXMAC__ 656 677 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 657 681 #ifdef _FAHMON_WIN32_ 658 682 // MSVC stupidity … … 663 687 menu->Append(wxID_ABOUT, _("&About"), wxString::Format(_T("%s "FMC_APPNAME), _("About"))); 664 688 #endif 689 #ifdef __WXMAC__ 690 { 691 //wxApp::s_macHelpMenuTitleName = _("&Help"); 692 wxApp::s_macAboutMenuItemId = wxID_ABOUT; 693 } 694 #endif 665 695 menuBar->Append(menu, _("&Help")); 696 697 SetMenuBar(menuBar); 666 698 } 667 699 … … 677 709 wxGridSizer *infoSizer; 678 710 wxStaticBoxSizer *topRightSizer; 679 711 #ifdef __WXMAC__ 712 wxSystemOptions::SetOption(_T("mac.listctrl.always_use_generic"), 1); 713 #endif 680 714 // We need to use a panel as a top level component in our frame 681 715 // Without that, the frame looks ugly under Windows (dark grey background) branches/osx/src/pathManager.cpp
r200 r232 26 26 27 27 #include "wx/utils.h" 28 #include "wx/filename.h" 29 #include "wx/app.h" 28 30 29 31 … … 64 66 mUserTplPath = wxT("./templates/"); 65 67 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/"); 66 93 67 94 #endif branches/osx/src/preferencesDialog.cpp
r218 r232 83 83 EVT_CHOICE(CHC_FILEMANAGER, PreferencesDialog::OnChoices) 84 84 // EVT_CHOICE(CHK_PPDTYPE, PreferencesDialog::OnChoices) 85 #ifdef __WXMAC__ 86 EVT_CLOSE(PreferencesDialog::OnClose) 87 #endif 85 88 86 89 END_EVENT_TABLE() … … 95 98 wxBoxSizer *topLevelSizer; 96 99 wxBoxSizer *mainSizer; 100 #ifndef __WXMAC__ 97 101 wxBoxSizer *buttonsSizer; 98 102 wxNotebook *noteBook; 103 #else 104 wxChoicebook *noteBook; 105 #endif 99 106 100 107 // Preferences are divided into groups, thanks to a wxNoteBook (tabbed control) 108 #ifndef __WXMAC__ 101 109 noteBook = new wxNotebook(this, wxID_ANY); 110 #else 111 noteBook = new wxChoicebook(this, wxID_ANY); 112 #endif 102 113 103 114 noteBook->AddPage(CreateGeneralTab(noteBook), _("General")); … … 110 121 111 122 // Buttons 'Ok' and 'Cancel' are right-aligned 123 #ifndef __WXMAC__ 112 124 buttonsSizer = new wxBoxSizer(wxHORIZONTAL); 113 125 … … 115 127 buttonsSizer->AddSpacer(FMC_GUI_SPACING_LOW); 116 128 buttonsSizer->Add(new wxButton(this, wxID_OK), 0, wxALIGN_RIGHT); 129 #endif 117 130 118 131 // Construct the dialog … … 121 134 mainSizer->Add(noteBook, 1, wxEXPAND); 122 135 mainSizer->AddSpacer(FMC_GUI_SPACING_HIGH); 136 #ifndef __WXMAC__ 123 137 mainSizer->Add(buttonsSizer, 0, wxALIGN_RIGHT); 138 #endif 124 139 125 140 // The final sizer … … 158 173 159 174 160 inline wxPanel* PreferencesDialog::CreateGeneralTab(wx Notebook* parent)175 inline wxPanel* PreferencesDialog::CreateGeneralTab(wxBookCtrlBase* parent) 161 176 { 162 177 wxPanel *panel; … … 167 182 sizer = new wxBoxSizer(wxVERTICAL); 168 183 topLevelSizer = new wxBoxSizer(wxVERTICAL); 184 #ifndef __WXMAC__ 169 185 mGeneralEnableTrayIcon = new wxCheckBox(panel, wxID_ANY, _("Enable system tray icon")); 186 #endif 170 187 mGeneralStartMinimised = new wxCheckBox(panel, wxID_ANY, _("Start minimized")); 171 188 mGeneralCollectXYZFiles = new wxCheckBox(panel, wxID_ANY, _("Collect .xyz files")); … … 174 191 mGeneralUpdateCheck = new wxCheckBox(panel, wxID_ANY, _("Check for FahMon updates on startup")); 175 192 193 #ifndef __WXMAC__ 176 194 sizer->AddStretchSpacer(); 177 195 sizer->Add(mGeneralEnableTrayIcon, 0, wxALIGN_LEFT); 196 #endif 178 197 sizer->AddStretchSpacer(); 179 198 sizer->Add(mGeneralCollectXYZFiles, 0, wxALIGN_LEFT); … … 195 214 196 215 197 inline wxPanel* PreferencesDialog::CreateMonitoringTab(wx Notebook* parent)216 inline wxPanel* PreferencesDialog::CreateMonitoringTab(wxBookCtrlBase* parent) 198 217 { 199 218 wxPanel *panel; … … 255 274 256 275 257 inline wxPanel* PreferencesDialog::CreateNetworkingTab(wx Notebook* parent)276 inline wxPanel* PreferencesDialog::CreateNetworkingTab(wxBookCtrlBase* parent) 258 277 { 259 278 wxPanel *panel; … … 309 328 310 329 311 inline wxPanel* PreferencesDialog::CreateAdvancedTab(wx Notebook* parent)330 inline wxPanel* PreferencesDialog::CreateAdvancedTab(wxBookCtrlBase* parent) 312 331 { 313 332 wxPanel *panel; … … 331 350 mAdvancedLocalFileLocation = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 332 351 mAdvancedLabelLocalFile = new wxStaticText(panel, wxID_ANY, _("Filename:")); 352 #ifndef __WXMAC__ 333 353 mAdvancedLocationChooser = new wxButton(panel, BTN_BROWSE, wxT("..."), wxDefaultPosition, wxSize(26, 26)); 354 #else 355 mAdvancedLocationChooser = new wxButton(panel, BTN_BROWSE, _("Choose"), wxDefaultPosition); 356 #endif 334 357 335 358 LocalFileSizer->Add(mAdvancedLabelLocalFile, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); … … 357 380 358 381 359 inline wxPanel* PreferencesDialog::CreateSystemTab(wx Notebook* parent)382 inline wxPanel* PreferencesDialog::CreateSystemTab(wxBookCtrlBase* parent) 360 383 { 361 384 wxPanel *panel; … … 388 411 const wxString fileManagers[5] = {wxT("Konqueror (KDE 3)"), wxT("Dolphin (KDE 4)"), wxT("Nautilus (Gnome)"), wxT("Thunar (Xfce 4.4)"), _("Other")}; 389 412 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); 390 416 #endif 391 417 … … 431 457 * Create the tab containing fahinfo.org integration preferences 432 458 **/ 433 /*inline wxPanel* PreferencesDialog::CreateFahinfoTab(wx Notebook* parent)459 /*inline wxPanel* PreferencesDialog::CreateFahinfoTab(wxBookCtrlBase* parent) 434 460 { 435 461 wxPanel *panel; … … 441 467 442 468 443 inline wxPanel* PreferencesDialog::CreateWebAppTab(wx Notebook* parent)469 inline wxPanel* PreferencesDialog::CreateWebAppTab(wxBookCtrlBase* parent) 444 470 { 445 471 wxPanel *panel; … … 466 492 mWebAppWebAppLocation = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 467 493 mWebAppWebAppLabel = new wxStaticText(panel, wxID_ANY, _("Filename:")); 494 #ifndef __WXMAC__ 468 495 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 469 499 470 500 mWebAppUseSimpleWeb = new wxCheckBox(panel, CHK_USESIMPLEWEB, _("Export Simple Web page")); 471 501 mWebAppSimpleWebLocation = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 472 502 mWebAppSimpleWebLabel = new wxStaticText(panel, wxID_ANY, _("Filename:")); 503 #ifndef __WXMAC__ 473 504 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 474 508 475 509 mWebAppUseSimpleText = new wxCheckBox(panel, CHK_USESIMPLETEXT, _("Export Simple Text file")); 476 510 mWebAppSimpleTextLocation = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition); 477 511 mWebAppSimpleTextLabel = new wxStaticText(panel, wxID_ANY, _("Filename:")); 512 #ifndef __WXMAC__ 478 513 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 479 517 480 518 webAppSizer->Add(mWebAppUseWebApp, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); … … 552 590 _PrefsGetBool(PREF_FAHCLIENT_COLLECTXYZFILES, isCollectingXYZFiles); 553 591 _PrefsGetBool(PREF_MAINDIALOG_AUTOUPDATEPROJECTS, autoUpdateProjects); 592 #ifndef __WXMAC__ 554 593 _PrefsGetBool(PREF_MAINDIALOG_ENABLE_TRAY_ICON, mInitEnableTrayIcon); 594 #endif 555 595 _PrefsGetBool(PREF_LISTCLIENTS_KEEP_DEAD_LAST, keepInaccessibleLast); 556 596 _PrefsGetBool(PREF_MAINDIALOG_START_MINIMISED, startMinimised); … … 559 599 560 600 mGeneralCollectXYZFiles->SetValue(isCollectingXYZFiles); 601 #ifndef __WXMAC__ 561 602 mGeneralEnableTrayIcon->SetValue(mInitEnableTrayIcon); 603 #endif 562 604 mGeneralAutoUpdateProjectsDatabase->SetValue(autoUpdateProjects); 563 605 mGeneralKeepInaccessibleClientsLast->SetValue(keepInaccessibleLast); … … 745 787 mSystemFileManager->Select(4); 746 788 } 789 #elif __WXMAC__ 790 if(filemanager == wxT("open")) 791 { 792 mSystemFileManager->Select(0); 793 } 794 else // other filemanager 795 { 796 mSystemFileManager->Select(1); 797 } 747 798 #endif 748 749 799 if (mInitOverrideTz == true) 750 800 { … … 767 817 _PrefsSetBool(PREF_FAHCLIENT_COLLECTXYZFILES, mGeneralCollectXYZFiles->GetValue()); 768 818 _PrefsSetBool(PREF_MAINDIALOG_START_MINIMISED, mGeneralStartMinimised->GetValue()); 819 #ifndef __WXMAC__ 769 820 _PrefsSetBool(PREF_MAINDIALOG_ENABLE_TRAY_ICON, mGeneralEnableTrayIcon->GetValue()); 821 #endif 770 822 _PrefsSetBool(PREF_MAINDIALOG_AUTOUPDATEPROJECTS, mGeneralAutoUpdateProjectsDatabase->GetValue()); 771 823 _PrefsSetBool(PREF_LISTCLIENTS_KEEP_DEAD_LAST, mGeneralKeepInaccessibleClientsLast->GetValue()); … … 812 864 813 865 // -----===== Alert components when important prefs have changed =====----- 866 #ifndef __WXMAC__ 814 867 if(mGeneralEnableTrayIcon->GetValue() != mInitEnableTrayIcon) 815 868 { 816 869 MainDialog::GetInstance()->OnTrayIconPrefChanged(); 817 870 } 871 #endif 818 872 819 873 if(mMonitoringAdvancedReload->GetValue() != mInitAdvancedReload || (wxUint32)mMonitoringAutoReloadFrequency->GetValue() != mInitAutoReloadFrequency) … … 1078 1132 break; 1079 1133 } 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 } 1081 1149 #endif 1082 1150 break; … … 1087 1155 } 1088 1156 } 1157 1158 #ifdef __WXMAC__ 1159 /** 1160 * Mac Specific close routine to save the preferences: no close button 1161 **/ 1162 void PreferencesDialog::OnClose(wxCloseEvent& event) 1163 { 1164 SavePreferences(); 1165 PreferencesManager::GetInstance()->Save(); 1166 event.Skip(); 1167 } 1168 #endif branches/osx/src/preferencesManager.cpp
r218 r232 225 225 226 226 227 inlinevoid PreferencesManager::Save(void)227 void PreferencesManager::Save(void) 228 228 { 229 229 DataOutputStream out(PathManager::GetCfgPath() + wxT(FMC_FILE_PREFS)); branches/osx/src/queue.cpp
r229 r232 65 65 #elif _FAHMON_WIN32_ 66 66 systype = 1; 67 #elif __WXMAC_PPC__67 #elif defined(__ppc__) && defined(__WXMAC__) 68 68 systype = 2; 69 #elif __WXMAC__69 #elif defined(__i386__) && defined(__WXMAC__) 70 70 systype = 3; 71 71 #endif … … 115 115 queueversion = 324; 116 116 tl: if (genome) 117 #if def __WXMAC_PPC__117 #if defined(__ppc__) && defined(__WXMAC__) 118 118 q = "0Linux"; 119 119 #else … … 129 129 queueversion = 500; 130 130 tt: if (genome) 131 #if def __WXMAC_PPC__131 #if defined(__ppc__) && defined(__WXMAC__) 132 132 q = "1Linux, Windows or Mac/x86"; 133 133 #else … … 142 142 //endian swap for PPC machines and queues 143 143 endianswap = FALSE; 144 #if def __WXMAC_PPC__144 #if defined(__ppc__) && defined(__WXMAC__) 145 145 if (systype != 2) 146 146 endianswap = TRUE; … … 249 249 u32 Queue::es32(u32 i) 250 250 { 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)); 253 252 } 254 253 … … 258 257 int i, n; 259 258 struct queueformat::qs *p; 259 260 260 bp->version = es32(bp->version); 261 261 bp->current = es32(bp->current); branches/osx/src/tools.cpp
r200 r232 63 63 } 64 64 65 #elif __WXMAC__ 66 67 wxLaunchDefaultBrowser(url); 68 65 69 #else 66 70
