Changeset 214
- Timestamp:
- 02/07/08 17:45:26 (4 years ago)
- Files:
-
- branches/2.3.2beta3/src/include/preferencesDialog.h (modified) (3 diffs)
- branches/2.3.2beta3/src/preferencesDialog.cpp (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.3.2beta3/src/include/preferencesDialog.h
r122 r214 15 15 */ 16 16 17 /** 18 * \file preferencesDialog.h 19 * The preferences dialog. 20 * Creates the dialog to reconfigure FahMon. 21 * \author François Ingelrest 22 * \author Andrew Schofield 23 **/ 24 17 25 #ifndef _PREFERENCESDIALOG_H 18 26 #define _PREFERENCESDIALOG_H … … 31 39 32 40 /** 33 * This dialog box allows the user to change 'public' preferences 34 * It's a singleton 35 **/41 * This dialog box allows the user to change 'public' preferences. 42 * This class can only be instanciated once. 43 **/ 36 44 class PreferencesDialog : public wxDialog 37 45 { 38 46 protected: 39 static PreferencesDialog *mInstance; 47 static PreferencesDialog *mInstance; /**< The single instance of the PreferencesDialog */ 40 48 41 49 // Widgets for the general tab 42 wxCheckBox *mGeneralEnableTrayIcon; 43 wxCheckBox *mGeneralAutoUpdateProjectsDatabase; 44 wxCheckBox *mGeneralCollectXYZFiles; 45 wxCheckBox *mGeneralKeepInaccessibleClientsLast; 46 wxCheckBox *mGeneralStartMinimised; 47 wxCheckBox *mGeneralUpdateCheck; 50 wxCheckBox *mGeneralEnableTrayIcon; /**< Checkbox for tray icon option */ 51 wxCheckBox *mGeneralAutoUpdateProjectsDatabase; /**< Checkbox for auto updating projects database */ 52 wxCheckBox *mGeneralCollectXYZFiles; /**< Checkbox for collecting xyz files */ 53 wxCheckBox *mGeneralKeepInaccessibleClientsLast; /**< Checkbox for listing dead clients last */ 54 wxCheckBox *mGeneralStartMinimised; /**< Checkbox for starting minimised */ 55 wxCheckBox *mGeneralUpdateCheck; /**< Checkbox for update checking */ 48 56 49 57 // Widgets for the monitoring tab 50 wxChoice *mMonitoringETADisplayStyle; 51 wxCheckBox *mMonitoringAdvancedReload; 52 wxCheckBox *mMonitoringAutoReload; 53 wxStaticText *mMonitoringAutoReloadInt; 54 wxSpinCtrl *mMonitoringAutoReloadFrequency; 55 wxChoice *mMonitoringPPDType; 56 wxCheckBox *mMonitoringIgnoreAsynchrony; 58 wxChoice *mMonitoringETADisplayStyle; /**< Select box for ETA style */ 59 wxCheckBox *mMonitoringAdvancedReload; /**< Checkbox for advanced reload system */ 60 wxCheckBox *mMonitoringAutoReload; /**< Checkbox for auto reload */ 61 wxStaticText *mMonitoringAutoReloadInt; /**< Text control for reload interval */ 62 wxSpinCtrl *mMonitoringAutoReloadFrequency; /**< Spin control for reload interval */ 63 wxChoice *mMonitoringPPDType; /**< Select box for PPD calculation method */ 64 wxCheckBox *mMonitoringIgnoreAsynchrony; /**< Checkbox for ignoring asynchronous clocks */ 57 65 58 66 // Widgets for the networking tab 59 wxCheckBox *mNetworkingUseProxy; 60 wxTextCtrl *mNetworkingProxyAddress; 61 wxTextCtrl *mNetworkingProxyPort; 62 wxCheckBox *mNetworkingUseProxyAuthentication; 63 wxTextCtrl *mNetworkingProxyUsername; 64 wxTextCtrl *mNetworkingProxyPassword; 65 wxStaticText *mNetworkingLabelAddress; 66 wxStaticText *mNetworkingLabelPort; 67 wxStaticText *mNetworkingLabelUsername; 68 wxStaticText *mNetworkingLabelPassword; 67 wxCheckBox *mNetworkingUseProxy; /**< Checkbox for use of proxy */ 68 wxTextCtrl *mNetworkingProxyAddress; /**< Input box for proxy address */ 69 wxTextCtrl *mNetworkingProxyPort; /**< Input box for proxy port */ 70 wxCheckBox *mNetworkingUseProxyAuthentication; /**< Checkbox for use of proxy authentication */ 71 wxTextCtrl *mNetworkingProxyUsername; /**< Input box for proxy username */ 72 wxTextCtrl *mNetworkingProxyPassword; /**< Input box for proxy password */ 73 wxStaticText *mNetworkingLabelAddress; /**< Text control for proxy address */ 74 wxStaticText *mNetworkingLabelPort; /**< Text control for proxy port */ 75 wxStaticText *mNetworkingLabelUsername; /**< Text control for proxy username */ 76 wxStaticText *mNetworkingLabelPassword; /**< Text control for proxy password */ 69 77 70 78 // Widgets for the advanced tab 71 wxCheckBox *mAdvancedUseAlternateProjectSource; 72 wxTextCtrl *mAdvancedAlternateProjectSourceLocationAddress; 73 wxStaticText *mAdvancedLabelLocationAddress; 74 wxCheckBox *mAdvancedUseLocalFile; 75 wxTextCtrl *mAdvancedLocalFileLocation; 76 wxStaticText *mAdvancedLabelLocalFile; 77 wxButton *mAdvancedLocationChooser; 79 wxCheckBox *mAdvancedUseAlternateProjectSource; /**< Checkbox for use of alternative update source */ 80 wxTextCtrl *mAdvancedAlternateProjectSourceLocationAddress; /**< Input box for alternative update source location */ 81 wxStaticText *mAdvancedLabelLocationAddress; /**< Text control for alternative address location */ 82 wxCheckBox *mAdvancedUseLocalFile; /**< Checkbox for use of local file as update source */ 83 wxTextCtrl *mAdvancedLocalFileLocation; /**< Input box for local file location */ 84 wxStaticText *mAdvancedLabelLocalFile; /**< Text control for local file location */ 85 wxButton *mAdvancedLocationChooser; /**< Button to open file chooser for local file */ 78 86 79 87 // Widgets for the system tab 80 wxTextCtrl *mSystemBrowser; 81 wxStaticText *mSystemBrowserLabel; 82 wxChoice *mSystemFileManager; 83 wxStaticText *mSystemFileManagerLabel; 84 wxTextCtrl *mSystemOtherFM; 85 wxStaticText *mSystemOtherFMLabel; 86 wxCheckBox *mSystemOverrideTimezone; 87 wxSpinCtrl *mSystemTZ; 88 wxTextCtrl *mSystemBrowser; /**< Input box for web browser */ 89 wxStaticText *mSystemBrowserLabel; /**< Text control for web browser */ 90 wxChoice *mSystemFileManager; /**< Select box for file manager */ 91 wxStaticText *mSystemFileManagerLabel; /**< Text control for file manager */ 92 wxTextCtrl *mSystemOtherFM; /**< Text control for alternative file manager */ 93 wxStaticText *mSystemOtherFMLabel; /**< Input box for alternative file manager */ 94 wxCheckBox *mSystemOverrideTimezone; /**< Checkbox for overriding timezone */ 95 wxSpinCtrl *mSystemTZ; /**< Spin control for timezone offset */ 88 96 89 97 // Widgets for the webapp tab 90 wxTextCtrl *mWebAppWebAppLocation; 91 wxStaticText *mWebAppWebAppLabel; 92 wxButton *mWebAppWebAppLocationChooser; 93 wxCheckBox *mWebAppUseWebApp; 94 wxTextCtrl *mWebAppSimpleWebLocation; 95 wxStaticText *mWebAppSimpleWebLabel; 96 wxButton *mWebAppSimpleWebLocationChooser; 97 wxCheckBox *mWebAppUseSimpleWeb; 98 wxTextCtrl *mWebAppSimpleTextLocation; 99 wxStaticText *mWebAppSimpleTextLabel; 100 wxButton *mWebAppSimpleTextLocationChooser; 101 wxCheckBox *mWebAppUseSimpleText; 98 wxTextCtrl *mWebAppWebAppLocation; /**< Input box for fancy web output location */ 99 wxStaticText *mWebAppWebAppLabel; /**< Text control for fancy web output location */ 100 wxButton *mWebAppWebAppLocationChooser; /**< Button to open file chooser for fancy web output location */ 101 wxCheckBox *mWebAppUseWebApp; /**< Checkbox for use of fancy web output */ 102 wxTextCtrl *mWebAppSimpleWebLocation; /**< Input box for simple web output location */ 103 wxStaticText *mWebAppSimpleWebLabel; /**< Text control for simple web output location */ 104 wxButton *mWebAppSimpleWebLocationChooser; /**< Button to open file chooser for simple web output location */ 105 wxCheckBox *mWebAppUseSimpleWeb; /**< Checkbox for use of simple web output */ 106 wxTextCtrl *mWebAppSimpleTextLocation; /**< Input box for simple text output location */ 107 wxStaticText *mWebAppSimpleTextLabel; /**< Text control for simple text output location */ 108 wxButton *mWebAppSimpleTextLocationChooser; /**< Button to open file chooser for simple text output location */ 109 wxCheckBox *mWebAppUseSimpleText; /**< Checkbox for use of simple text output */ 102 110 103 111 // Storage for the initial value of some important preferences 104 112 // This is needed to detect when one of them has changed, so that the concerned component can be warned 105 bool mInitAdvancedReload; 106 bool mInitAutoReload; 107 bool mInitEnableTrayIcon; 108 bool mInstantFrames; 109 bool mInitOverrideTz; 110 bool mInitIgnoreAsynchronousClocks; 111 wxInt32 mInitTimezone; 112 wxUint32 mInitAutoReloadFrequency; 113 wxUint32 mInitETADisplayStyle; 114 wxUint32 mInitPPDDisplayStyle; 115 116 113 bool mInitAdvancedReload; /**< Initial value for advanced reload option */ 114 bool mInitAutoReload; /**< Inititial value for auto reload option */ 115 bool mInitEnableTrayIcon; /**< Initial value for tray icon option */ 116 bool mInstantFrames; /**< Initial value for instant frames option */ 117 bool mInitOverrideTz; /**< Initial value for overriding of timezone */ 118 bool mInitIgnoreAsynchronousClocks; /**< Initial value for ignoring asynchronous clocks */ 119 wxInt32 mInitTimezone; /**< Initial value for timezone */ 120 wxUint32 mInitAutoReloadFrequency; /**< Initial value for auto reload frequency */ 121 wxUint32 mInitETADisplayStyle; /**< Initial value for ETA display style */ 122 wxUint32 mInitPPDDisplayStyle; /**< Initial value for PPD display style */ 123 124 /** 125 * Constructor. 126 * Contructs a Preferences Dialog of type wxDialog with a title of "Preferences". 127 * @param parent The parent window of type wxWindow 128 **/ 117 129 PreferencesDialog(wxWindow* parent); 130 131 /** 132 * Destructor. 133 **/ 118 134 ~PreferencesDialog(void); 119 135 136 /** 137 * Create the tab containing general preferences. 138 * @param parent The notebook object. 139 * @return A wxPanel object. 140 **/ 120 141 wxPanel* CreateGeneralTab(wxNotebook* parent); 142 143 /** 144 * Create the tab containing monitoring preferences. 145 * @param parent The notebook object. 146 * @return A wxPanel object. 147 **/ 121 148 wxPanel* CreateMonitoringTab(wxNotebook* parent); 149 150 /** 151 * Create the tab containing networking preferences. 152 * @param parent The notebook object. 153 * @return A wxPanel object. 154 **/ 122 155 wxPanel* CreateNetworkingTab(wxNotebook* parent); 156 157 /** 158 * Create the tab containing advanced preferences. 159 * @param parent The notebook object. 160 * @return A wxPanel object. 161 **/ 123 162 wxPanel* CreateAdvancedTab(wxNotebook* parent); 163 164 /** 165 * Create the tab containing system preferences. 166 * @param parent The notebook object. 167 * @return A wxPanel object. 168 **/ 124 169 wxPanel* CreateSystemTab(wxNotebook* parent); 125 170 //wxPanel* CreateFahinfoTab(wxNotebook* parent); 171 172 /** 173 * Create the tab containing web application preferences. 174 * @param parent The notebook object. 175 * @return A wxPanel object. 176 **/ 126 177 wxPanel* CreateWebAppTab(wxNotebook* parent); 127 178 179 /** 180 * Give the correct value to each controls using the preferences. 181 **/ 128 182 void LoadPreferences(void); 183 184 /** 185 * Save the value of each control using the preferences. 186 **/ 129 187 void SavePreferences(void); 130 188 189 /** 190 * Event: Manages the 'ok' button 191 * Save preferences before exiting the dialog box. 192 * @param event The event itself. This is sent automatically. 193 **/ 131 194 void OnOkButton(wxCommandEvent& event); 195 196 /** 197 * Event: Manages the 'browse' button for local data file. 198 * Show file chooser dialog box. 199 * @param event The event itself. This is sent automatically. 200 **/ 132 201 void OnBrowseButton(wxCommandEvent& event); 202 203 /** 204 * Event: Manages the 'browse' button for web application output. 205 * Show file chooser dialog box. 206 * @param event The event itself. This is sent automatically. 207 **/ 133 208 void OnWebAppBrowseButton(wxCommandEvent& event); 209 210 /** 211 * Event: Manages the 'browse' button for simple web output. 212 * Show file chooser dialog box. 213 * @param event The event itself. This is sent automatically. 214 **/ 134 215 void OnSimpleWebBrowseButton(wxCommandEvent& event); 216 217 /** 218 * Event: Manages the 'browse' button for simple text output. 219 * Show file chooser dialog box. 220 * @param event The event itself. This is sent automatically. 221 **/ 135 222 void OnSimpleTextBrowseButton(wxCommandEvent& event); 223 224 /** 225 * Event: Manages the checkbox clicks. 226 * Enable/Disable fields associated with some checkboxes. 227 * @param event The event itself. This is sent automatically. 228 **/ 136 229 void OnCheckboxes(wxCommandEvent& event); 230 231 /** 232 * Event: Manages the choicebox alterations. 233 * Alter fields when choicebox values are changed. 234 * @param event The event itself. This is sent automatically. 235 **/ 137 236 void OnChoices(wxCommandEvent& event); 138 237 … … 140 239 public: 141 240 // Singleton pattern 241 /** 242 * Retrieve the instance of PreferencessDialog. 243 * If an instance doesn't already exist, create it. 244 * @param parent The parent windows of type wxWindow. 245 * @return An instance of class PreferencesDialog. 246 **/ 142 247 static PreferencesDialog* GetInstance(wxWindow* parent); 248 249 /** 250 * Destroy the instance of PreferencesDialog. 251 * Only if an instance exists. 252 **/ 143 253 static void DestroyInstance(void); 144 254 255 /** 256 * Show the Preferences Dialog. 257 * Opens a modal window and centres it. 258 **/ 145 259 int ShowModal(void); 146 260 branches/2.3.2beta3/src/preferencesDialog.cpp
r148 r214 14 14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 15 */ 16 17 /** 18 * \file preferencesDialog.cpp 19 * The preferences dialog. 20 * Creates the dialog to reconfigure FahMon. 21 * \author François Ingelrest 22 * \author Andrew Schofield 23 **/ 16 24 17 25 #include "fahmon.h" … … 83 91 84 92 85 /**86 * Constructor87 **/88 93 PreferencesDialog::PreferencesDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, wxString::Format(_("Preferences / %s"), wxT(FMC_PRODUCT))) 89 94 { … … 127 132 128 133 129 /**130 * Destructor131 **/132 134 PreferencesDialog::~PreferencesDialog(void) 133 135 { … … 135 137 136 138 137 /**138 * Retrieve the instance of PreferencesDialog, create it if needed139 **/140 139 PreferencesDialog* PreferencesDialog::GetInstance(wxWindow* parent) 141 140 { … … 149 148 150 149 151 /**152 * Destroy the instance of PreferencesDialog, if any153 **/154 150 void PreferencesDialog::DestroyInstance(void) 155 151 { … … 162 158 163 159 164 /**165 * Create the tab containing general preferences166 **/167 160 inline wxPanel* PreferencesDialog::CreateGeneralTab(wxNotebook* parent) 168 161 { … … 202 195 203 196 204 /**205 * Create the tab containing monitoring preferences206 **/207 197 inline wxPanel* PreferencesDialog::CreateMonitoringTab(wxNotebook* parent) 208 198 { … … 265 255 266 256 267 /**268 * Create the tab containing networking preferences269 **/270 257 inline wxPanel* PreferencesDialog::CreateNetworkingTab(wxNotebook* parent) 271 258 { … … 321 308 } 322 309 323 /** 324 * Create the tab containing advanced preferences 325 **/ 310 326 311 inline wxPanel* PreferencesDialog::CreateAdvancedTab(wxNotebook* parent) 327 312 { … … 371 356 } 372 357 373 /** 374 * Create the tab containing system preferences 375 **/ 358 376 359 inline wxPanel* PreferencesDialog::CreateSystemTab(wxNotebook* parent) 377 360 { … … 458 441 459 442 460 /**461 * Create the tab containing web application preferences462 **/463 443 inline wxPanel* PreferencesDialog::CreateWebAppTab(wxNotebook* parent) 464 444 { … … 534 514 535 515 536 /**537 * Give the correct state to each control before displaying the dialog538 **/539 516 int PreferencesDialog::ShowModal(void) 540 517 { … … 546 523 547 524 548 /**549 * Give the correct value to each controls using the preferences550 **/551 525 inline void PreferencesDialog::LoadPreferences(void) 552 526 { … … 785 759 } 786 760 787 /** 788 * Save the value of each control using the preferences 789 **/ 761 790 762 inline void PreferencesDialog::SavePreferences(void) 791 763 { … … 882 854 883 855 884 /**885 * Save preferences before exiting the dialog box886 **/887 856 void PreferencesDialog::OnOkButton(wxCommandEvent& event) 888 857 { … … 893 862 894 863 895 /**896 * Show file chooser dialog box897 **/898 864 void PreferencesDialog::OnBrowseButton(wxCommandEvent& event) 899 865 { … … 910 876 911 877 912 /**913 * Show file chooser dialog box914 **/915 878 void PreferencesDialog::OnWebAppBrowseButton(wxCommandEvent& event) 916 879 { … … 927 890 928 891 929 /**930 * Show file chooser dialog box931 **/932 892 void PreferencesDialog::OnSimpleWebBrowseButton(wxCommandEvent& event) 933 893 { … … 944 904 945 905 946 /**947 * Show file chooser dialog box948 **/949 906 void PreferencesDialog::OnSimpleTextBrowseButton(wxCommandEvent& event) 950 907 { … … 961 918 962 919 963 /**964 * Enable/Disable fields associated with some checkboxes965 **/966 920 void PreferencesDialog::OnCheckboxes(wxCommandEvent& event) 967 921 { … … 1076 1030 1077 1031 1078 /**1079 * Alter fields when choicebox values are changed1080 **/1081 1032 void PreferencesDialog::OnChoices(wxCommandEvent& event) 1082 1033 {
