ReactOS  0.4.15-dev-1397-g19779b3
anonymous_namespace{settingsdlg.cpp} Namespace Reference

Functions

BOOL IsCheckedDlgItem (HWND hDlg, INT nIDDlgItem)
 
VOID InitSettingsControls (HWND hDlg, PSETTINGS_INFO Info)
 
INT_PTR CALLBACK SettingsDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ InitSettingsControls()

VOID anonymous_namespace{settingsdlg.cpp}::InitSettingsControls ( HWND  hDlg,
PSETTINGS_INFO  Info 
)

Definition at line 85 of file settingsdlg.cpp.

86  {
88  SendDlgItemMessageW(hDlg, IDC_UPDATE_AVLIST, BM_SETCHECK, Info->bUpdateAtStart, 0);
89  SendDlgItemMessageW(hDlg, IDC_LOG_ENABLED, BM_SETCHECK, Info->bLogEnabled, 0);
90  SendDlgItemMessageW(hDlg, IDC_DEL_AFTER_INSTALL, BM_SETCHECK, Info->bDelInstaller, 0);
91 
93  Info->szDownloadDir);
94 
96 
97  if (Info->Proxy == 2)
98  {
101  }
102  else
103  {
106  }
107 
109 
110  EnableWindow(GetDlgItem(hDlg, IDC_SOURCE_URL), Info->bUseSource);
111 
112  SetWindowTextW(GetDlgItem(hDlg, IDC_SOURCE_URL), Info->szSourceURL);
113  SetWindowTextW(GetDlgItem(hDlg, IDC_PROXY_SERVER), Info->szProxyServer);
114  SetWindowTextW(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), Info->szNoProxyFor);
115  }
#define IDC_USE_PROXY
Definition: resource.h:55
#define IDC_USE_SOURCE
Definition: resource.h:59
#define TRUE
Definition: types.h:120
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:45
#define IDC_SOURCE_URL
Definition: resource.h:60
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define IDC_UPDATE_AVLIST
Definition: resource.h:44
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define IDC_LOG_ENABLED
Definition: resource.h:47
#define FALSE
Definition: types.h:117
#define IDC_PROXY_DEFAULT
Definition: resource.h:53
#define IDC_DEL_AFTER_INSTALL
Definition: resource.h:46
#define BM_SETCHECK
Definition: winuser.h:1903
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_NO_PROXY_FOR
Definition: resource.h:57
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_SAVE_WINDOW_POS
Definition: resource.h:43
#define IDC_PROXY_SERVER
Definition: resource.h:56
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define IDC_SOURCE_DEFAULT
Definition: resource.h:58

Referenced by SettingsDlgProc().

◆ IsCheckedDlgItem()

BOOL anonymous_namespace{settingsdlg.cpp}::IsCheckedDlgItem ( HWND  hDlg,
INT  nIDDlgItem 
)
inline

Definition at line 80 of file settingsdlg.cpp.

81  {
82  return (SendDlgItemMessageW(hDlg, nIDDlgItem, BM_GETCHECK, 0, 0) == BST_CHECKED) ? TRUE : FALSE;
83  }
#define TRUE
Definition: types.h:120
_In_ int nIDDlgItem
Definition: winuser.h:4594
#define FALSE
Definition: types.h:117
#define BM_GETCHECK
Definition: winuser.h:1900
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197

Referenced by SettingsDlgProc().

◆ SettingsDlgProc()

INT_PTR CALLBACK anonymous_namespace{settingsdlg.cpp}::SettingsDlgProc ( HWND  hDlg,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 117 of file settingsdlg.cpp.

118  {
119  switch (Msg)
120  {
121  case WM_INITDIALOG:
122  {
125  }
126  break;
127 
128  case WM_COMMAND:
129  {
130  switch (LOWORD(wParam))
131  {
132  case IDC_CHOOSE:
133  ChooseFolder(hDlg);
134  break;
135 
136  case IDC_SAVE_WINDOW_POS:
138  break;
139 
140  case IDC_UPDATE_AVLIST:
142  break;
143 
144  case IDC_LOG_ENABLED:
146  break;
147 
150  break;
151 
152  case IDC_SOURCE_DEFAULT:
155  break;
156 
157  case IDC_USE_SOURCE:
160  break;
161 
162  case IDC_PROXY_DEFAULT:
166  break;
167 
168  case IDC_NO_PROXY:
172  break;
173 
174  case IDC_USE_PROXY:
178  break;
179 
183  break;
184 
185  case IDOK:
186  {
187  ATL::CStringW szDir;
189  ATL::CStringW szProxy;
190  ATL::CStringW szNoProxy;
191  DWORD dwAttr;
192 
194  szDir.GetBuffer(MAX_PATH), MAX_PATH);
195  szDir.ReleaseBuffer();
196 
199  szSource.ReleaseBuffer();
200 
202  szProxy.GetBuffer(MAX_PATH), MAX_PATH);
203  szProxy.ReleaseBuffer();
206  szProxy.GetString(),
207  szProxy.GetLength() + 1);
208 
210  szNoProxy.GetBuffer(MAX_PATH), MAX_PATH);
211  szNoProxy.ReleaseBuffer();
214  szNoProxy.GetString(),
215  szNoProxy.GetLength() + 1);
216 
217  dwAttr = GetFileAttributesW(szDir.GetString());
218  if (dwAttr != INVALID_FILE_ATTRIBUTES &&
219  (dwAttr & FILE_ATTRIBUTE_DIRECTORY))
220  {
223  szDir.GetString(),
224  szDir.GetLength() + 1);
225  }
226  else
227  {
228  ATL::CStringW szMsgText;
229  szMsgText.LoadStringW(IDS_CHOOSE_FOLDER_ERROR);
230 
231  if (MessageBoxW(hDlg, szMsgText.GetString(), NULL, MB_YESNO) == IDYES)
232  {
233  if (CreateDirectoryW(szDir.GetString(), NULL))
234  {
235  EndDialog(hDlg, LOWORD(wParam));
236  }
237  }
238  else
239  {
241  break;
242  }
243  }
244 
245 
246  if(NewSettingsInfo.bUseSource && !IsUrlValid(szSource.GetString()))
247  {
248  ATL::CStringW szMsgText;
249  szMsgText.LoadStringW(IDS_URL_INVALID);
250 
251  MessageBoxW(hDlg, szMsgText.GetString(), NULL, 0);
253  break;
254  }
255  else
256  {
259  szSource.GetString(),
260  szSource.GetLength() + 1);
261  }
262 
265  EndDialog(hDlg, LOWORD(wParam));
266  }
267  break;
268 
269  case IDCANCEL:
270  EndDialog(hDlg, LOWORD(wParam));
271  break;
272  }
273  }
274  break;
275  }
276 
277  return FALSE;
278  }
int GetLength() const
Definition: atlsimpstr.h:356
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL bUpdateAtStart
Definition: settings.h:8
#define IDC_USE_PROXY
Definition: resource.h:55
#define IDOK
Definition: winuser.h:824
#define IDC_USE_SOURCE
Definition: resource.h:59
#define IDYES
Definition: winuser.h:829
#define TRUE
Definition: types.h:120
VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
Definition: settings.cpp:167
#define IDC_DOWNLOAD_DIR_EDIT
Definition: resource.h:45
#define IDC_SOURCE_URL
Definition: resource.h:60
BOOL IsUrlValid(const WCHAR *Url)
Definition: settingsdlg.cpp:52
HWND WINAPI SetFocus(_In_opt_ HWND)
#define IDS_URL_INVALID
Definition: resource.h:105
SETTINGS_INFO NewSettingsInfo
Definition: settingsdlg.cpp:10
#define IDC_UPDATE_AVLIST
Definition: resource.h:44
#define IDS_CHOOSE_FOLDER_ERROR
Definition: resource.h:104
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
WCHAR szSourceURL[INTERNET_MAX_URL_LENGTH]
Definition: settings.h:24
WCHAR szDownloadDir[MAX_PATH]
Definition: settings.h:10
void SaveSettings(void)
Definition: settings.c:115
#define IDC_CHOOSE
Definition: resource.h:48
BOOL bUseSource
Definition: settings.h:23
#define IDC_LOG_ENABLED
Definition: resource.h:47
struct @1620 Msg[]
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
#define IDC_PROXY_DEFAULT
Definition: resource.h:53
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define IDC_DEL_AFTER_INSTALL
Definition: resource.h:46
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL IsCheckedDlgItem(HWND hDlg, INT nIDDlgItem)
Definition: settingsdlg.cpp:80
#define _countof(array)
Definition: sndvol32.h:68
#define IDC_NO_PROXY_FOR
Definition: resource.h:57
#define IDC_DEFAULT_SETTINGS
Definition: resource.h:49
#define MAX_PATH
Definition: compat.h:34
PCXSTR GetString() const
Definition: atlsimpstr.h:361
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static const WCHAR szSource[]
Definition: automation.c:501
#define WM_COMMAND
Definition: winuser.h:1722
VOID InitSettingsControls(HWND hDlg, PSETTINGS_INFO Info)
Definition: settingsdlg.cpp:85
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL ChooseFolder(HWND hwnd)
Definition: settingsdlg.cpp:12
HWND WINAPI GetParent(_In_ HWND)
WCHAR szProxyServer[MAX_PATH]
Definition: settings.h:20
BOOL bLogEnabled
Definition: settings.h:9
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define IDC_SAVE_WINDOW_POS
Definition: resource.h:43
#define IDC_NO_PROXY
Definition: resource.h:54
static void __cdecl CopyChars(_Out_writes_to_(nDestLen, nChars) XCHAR *pchDest, _In_ size_t nDestLen, _In_reads_opt_(nChars) const XCHAR *pchSrc, _In_ int nChars)
Definition: atlsimpstr.h:423
#define NULL
Definition: types.h:112
BOOL bDelInstaller
Definition: settings.h:11
#define IDC_PROXY_SERVER
Definition: resource.h:56
BOOL bSaveWndPos
Definition: settings.h:7
WCHAR szNoProxyFor[MAX_PATH]
Definition: settings.h:21
#define IDCANCEL
Definition: winuser.h:825
#define IDC_SOURCE_DEFAULT
Definition: resource.h:58
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82

Referenced by CreateSettingsDlg().