ReactOS 0.4.15-dev-8241-g63935f8
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 90 of file settingsdlg.cpp.

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

Referenced by SettingsDlgProc().

◆ IsCheckedDlgItem()

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

Definition at line 84 of file settingsdlg.cpp.

85{
86 return (SendDlgItemMessageW(hDlg, nIDDlgItem, BM_GETCHECK, 0, 0) == BST_CHECKED) ? TRUE : FALSE;
87}
_In_ int nIDDlgItem
Definition: winuser.h:4619
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1918

Referenced by SettingsDlgProc().

◆ SettingsDlgProc()

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

Definition at line 122 of file settingsdlg.cpp.

123{
124 switch (Msg)
125 {
126 case WM_INITDIALOG:
127 {
130 }
131 break;
132
133 case WM_COMMAND:
134 {
135 switch (LOWORD(wParam))
136 {
137 case IDC_CHOOSE:
138 ChooseFolder(hDlg);
139 break;
140
143 break;
144
147 break;
148
149 case IDC_LOG_ENABLED:
151 break;
152
155 break;
156
160 break;
161
162 case IDC_USE_SOURCE:
165 break;
166
171 break;
172
173 case IDC_NO_PROXY:
177 break;
178
179 case IDC_USE_PROXY:
183 break;
184
188 break;
189
190 case IDOK:
191 {
192 CStringW szDir;
193 CStringW szSource;
194 CStringW szProxy;
195 CStringW szNoProxy;
196 DWORD dwAttr;
197
199 szDir.ReleaseBuffer();
200
204 szSource.ReleaseBuffer();
205
207 szProxy.ReleaseBuffer();
210 szProxy.GetLength() + 1);
211
213 szNoProxy.ReleaseBuffer();
216 szNoProxy.GetLength() + 1);
217
218 dwAttr = GetFileAttributesW(szDir);
219 if (dwAttr != INVALID_FILE_ATTRIBUTES && (dwAttr & FILE_ATTRIBUTE_DIRECTORY))
220 {
223 szDir.GetLength() + 1);
224 }
225 else
226 {
227 CStringW szMsgText;
228 szMsgText.LoadStringW(IDS_CHOOSE_FOLDER_ERROR);
229
230 if (MessageBoxW(hDlg, szMsgText, NULL, MB_YESNO) == IDYES)
231 {
232 if (CreateDirectoryW(szDir, NULL))
233 {
234 EndDialog(hDlg, LOWORD(wParam));
235 }
236 }
237 else
238 {
240 break;
241 }
242 }
243
244 if (NewSettingsInfo.bUseSource && !IsUrlValid(szSource))
245 {
246 CStringW szMsgText;
247 szMsgText.LoadStringW(IDS_URL_INVALID);
248
249 MessageBoxW(hDlg, szMsgText, NULL, MB_OK);
251 break;
252 }
253 else
254 {
257 szSource.GetLength() + 1);
258 }
259
262 EndDialog(hDlg, LOWORD(wParam));
263 }
264 break;
265
266 case IDCANCEL:
267 EndDialog(hDlg, LOWORD(wParam));
268 break;
269 }
270 }
271 break;
272 }
273
274 return FALSE;
275}
void SaveSettings(void)
Definition: settings.c:115
#define IDC_NO_PROXY
Definition: resource.h:54
#define IDS_URL_INVALID
Definition: resource.h:104
#define IDC_CHOOSE
Definition: resource.h:48
#define IDC_DEFAULT_SETTINGS
Definition: resource.h:49
#define IDS_CHOOSE_FOLDER_ERROR
Definition: resource.h:103
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
Definition: settings.cpp:179
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) noexcept
Definition: atlsimpstr.h:438
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
int GetLength() const noexcept
Definition: atlsimpstr.h:362
WPARAM wParam
Definition: combotst.c:138
struct @1643 Msg[]
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL IsCheckedDlgItem(HWND hDlg, INT nIDDlgItem)
Definition: settingsdlg.cpp:84
VOID InitSettingsControls(HWND hDlg, PSETTINGS_INFO Info)
Definition: settingsdlg.cpp:90
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define LOWORD(l)
Definition: pedump.c:82
SETTINGS_INFO NewSettingsInfo
Definition: settingsdlg.cpp:10
BOOL IsUrlValid(const WCHAR *Url)
Definition: settingsdlg.cpp:55
BOOL ChooseFolder(HWND hwnd)
Definition: settingsdlg.cpp:13
#define _countof(array)
Definition: sndvol32.h:70
WCHAR szDownloadDir[MAX_PATH]
Definition: settings.h:10
BOOL bUseSource
Definition: settings.h:23
BOOL bLogEnabled
Definition: settings.h:9
BOOL bDelInstaller
Definition: settings.h:11
WCHAR szSourceURL[INTERNET_MAX_URL_LENGTH]
Definition: settings.h:24
WCHAR szNoProxyFor[MAX_PATH]
Definition: settings.h:21
BOOL bUpdateAtStart
Definition: settings.h:8
WCHAR szProxyServer[MAX_PATH]
Definition: settings.h:20
BOOL bSaveWndPos
Definition: settings.h:7
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define MB_YESNO
Definition: winuser.h:817
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define IDOK
Definition: winuser.h:830
HWND WINAPI SetFocus(_In_opt_ HWND)
#define MB_OK
Definition: winuser.h:790
HWND WINAPI GetParent(_In_ HWND)
#define IDYES
Definition: winuser.h:835
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by CreateSettingsDlg().