X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=gui.cpp;fp=gui.cpp;h=9c4d71247ed6f1f8a1da668ee3be42f89fc2db76;hb=cc956aacde93d93f5810ca4c0df7775d1bfe3458;hp=0fa11f4ca4df446b65823bd340786d108074eba9;hpb=ee9a86c8408feaf173733aea12a80211e5d74483;p=nssm.git diff --git a/gui.cpp b/gui.cpp index 0fa11f4..9c4d712 100644 --- a/gui.cpp +++ b/gui.cpp @@ -180,6 +180,7 @@ int nssm_gui(int resource, nssm_service_t *service) { SetDlgItemText(tablist[NSSM_TAB_IO], IDC_STDIN, service->stdin_path); SetDlgItemText(tablist[NSSM_TAB_IO], IDC_STDOUT, service->stdout_path); SetDlgItemText(tablist[NSSM_TAB_IO], IDC_STDERR, service->stderr_path); + if (service->timestamp_log) SendDlgItemMessage(tablist[NSSM_TAB_IO], IDC_TIMESTAMP, BM_SETCHECK, BST_CHECKED, 0); /* Rotation tab. */ if (service->stdout_disposition == CREATE_ALWAYS) SendDlgItemMessage(tablist[NSSM_TAB_ROTATION], IDC_TRUNCATE, BM_SETCHECK, BST_CHECKED, 0); @@ -676,6 +677,8 @@ int configure(HWND window, nssm_service_t *service, nssm_service_t *orig_service check_io(window, _T("stdin"), service->stdin_path, _countof(service->stdin_path), IDC_STDIN); check_io(window, _T("stdout"), service->stdout_path, _countof(service->stdout_path), IDC_STDOUT); check_io(window, _T("stderr"), service->stderr_path, _countof(service->stderr_path), IDC_STDERR); + if (SendDlgItemMessage(tablist[NSSM_TAB_IO], IDC_TIMESTAMP, BM_GETCHECK, 0, 0) & BST_CHECKED) service->timestamp_log = true; + else service->timestamp_log = false; /* Override stdout and/or stderr. */ if (SendDlgItemMessage(tablist[NSSM_TAB_ROTATION], IDC_TRUNCATE, BM_GETCHECK, 0, 0) & BST_CHECKED) { @@ -1248,6 +1251,9 @@ INT_PTR CALLBACK nssm_dlg(HWND window, UINT message, WPARAM w, LPARAM l) { tablist[NSSM_TAB_IO] = dialog(MAKEINTRESOURCE(IDD_IO), window, tab_dlg); ShowWindow(tablist[NSSM_TAB_IO], SW_HIDE); + /* Set defaults. */ + SendDlgItemMessage(tablist[NSSM_TAB_IO], IDC_TIMESTAMP, BM_SETCHECK, BST_UNCHECKED, 0); + /* Rotation tab. */ tab.pszText = message_string(NSSM_GUI_TAB_ROTATION); tab.cchTextMax = (int) _tcslen(tab.pszText) + 1;