1 // Emacs style mode select -*- C++ -*- 2 //----------------------------------------------------------------------------- 3 // 4 // $Id: dlg_config.h 3174 2012-05-11 01:03:43Z mike $ 5 // 6 // Copyright (C) 2006-2012 by The Odamex Team. 7 // 8 // This program is free software; you can redistribute it and/or 9 // modify it under the terms of the GNU General Public License 10 // as published by the Free Software Foundation; either version 2 11 // of the License, or (at your option) any later version. 12 // 13 // This program is distributed in the hope that it will be useful, 14 // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 // GNU General Public License for more details. 17 // 18 // DESCRIPTION: 19 // Config dialog 20 // AUTHOR: Russell Rice, John D Corrado 21 // 22 //----------------------------------------------------------------------------- 23 24 25 #ifndef DLG_CONFIG_H 26 #define DLG_CONFIG_H 27 28 #include <wx/dialog.h> 29 #include <wx/intl.h> 30 #include <wx/settings.h> 31 #include <wx/stattext.h> 32 #include <wx/xrc/xmlres.h> 33 #include <wx/listctrl.h> 34 #include <wx/fileconf.h> 35 #include <wx/checkbox.h> 36 #include <wx/listbox.h> 37 #include <wx/sizer.h> 38 #include <wx/textctrl.h> 39 #include <wx/filepicker.h> 40 #include <wx/spinctrl.h> 41 #include <wx/statbmp.h> 42 43 // config file value names 44 #define GETLISTONSTART "GET_LIST_ON_START" 45 #define SHOWBLOCKEDSERVERS "SHOW_BLOCKED_SERVERS" 46 #define DELIMWADPATHS "DELIMITED_WAD_PATHS" 47 #define ODAMEX_DIRECTORY "ODAMEX_DIRECTORY" 48 #define EXTRACMDLINEARGS "ExtraCommandLineArguments" 49 #define MASTERTIMEOUT "MasterTimeout" 50 #define SERVERTIMEOUT "ServerTimeout" 51 #define USEBROADCAST "UseBroadcast" 52 #define RETRYCOUNT "RetryCount" 53 54 #ifdef __WXMSW__ 55 #define PATH_DELIMITER ';' 56 #else 57 #define PATH_DELIMITER ':' 58 #endif 59 60 // configuration file structure 61 struct launchercfg_t 62 { 63 bool get_list_on_start; 64 bool show_blocked_servers; 65 wxString wad_paths; 66 wxString odamex_directory; 67 }; 68 69 // a more dynamic way of adding environment variables, even if they are 70 // hardcoded. 71 #define NUM_ENVVARS 2 72 const wxString env_vars[NUM_ENVVARS] = { _T("DOOMWADDIR"), _T("DOOMWADPATH") }; 73 74 class dlgConfig: public wxDialog 75 { 76 public: 77 78 dlgConfig(launchercfg_t *cfg, wxWindow* parent, wxWindowID id = -1); 79 virtual ~dlgConfig(); 80 81 void LoadSettings(); 82 void SaveSettings(); 83 84 void Show(); 85 86 protected: 87 void OnOK(wxCommandEvent &event); 88 89 void OnChooseDir(wxFileDirPickerEvent &event); 90 void OnAddDir(wxCommandEvent &event); 91 void OnReplaceDir(wxCommandEvent &event); 92 void OnDeleteDir(wxCommandEvent &event); 93 94 void OnUpClick(wxCommandEvent &event); 95 void OnDownClick(wxCommandEvent &event); 96 97 void OnGetEnvClick(wxCommandEvent &event); 98 99 void OnCheckedBox(wxCommandEvent &event); 100 101 void OnChooseOdamexPath(wxFileDirPickerEvent &event); 102 103 void OnTextChange(wxCommandEvent &event); 104 105 void OnSpinValChange(wxSpinEvent &event); 106 107 wxCheckBox *m_ChkCtrlGetListOnStart; 108 wxCheckBox *m_ChkCtrlShowBlockedServers; 109 wxCheckBox *m_ChkCtrlEnableBroadcasts; 110 111 wxListBox *m_LstCtrlWadDirectories; 112 113 wxDirPickerCtrl *m_DirCtrlChooseOdamexPath; 114 115 wxSpinCtrl *m_SpnCtrlMasterTimeout; 116 wxSpinCtrl *m_SpnCtrlServerTimeout; 117 wxSpinCtrl *m_SpnCtrlRetry; 118 wxTextCtrl *m_TxtCtrlExtraCmdLineArgs; 119 120 wxSpinCtrl *m_SpnCtrlPQGood; 121 wxSpinCtrl *m_SpnCtrlPQPlayable; 122 wxSpinCtrl *m_SpnCtrlPQLaggy; 123 124 wxStaticBitmap *m_StcBmpPQGood; 125 wxStaticBitmap *m_StcBmpPQPlayable; 126 wxStaticBitmap *m_StcBmpPQLaggy; 127 wxStaticBitmap *m_StcBmpPQBad; 128 129 wxFileConfig ConfigInfo; 130 131 launchercfg_t *cfg_file; 132 133 bool UserChangedSetting; 134 135 private: 136 137 DECLARE_EVENT_TABLE() 138 }; 139 140 #endif 141