#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#include <time.h>
#include "ssh.h"
#include "putty.h"
switch (msg) {
case WM_INITDIALOG:
+ {
+ static const int tabs[4] = {78, 108};
+ SendDlgItemMessage (hwnd, IDN_LIST, LB_SETTABSTOPS, 2,
+ (LPARAM) tabs);
+ }
for (i=0; i<nevents; i++)
SendDlgItemMessage (hwnd, IDN_LIST, LB_ADDSTRING,
0, (LPARAM)events[i]);
IDC_SESSDEL,
IDC_CLOSEEXIT,
IDC_COEALWAYS,
- IDC_COENORMAL,
IDC_COENEVER,
+ IDC_COENORMAL,
sessionpanelend,
loggingpanelstart,
CheckDlgButton (hwnd, IDC_BLINKCUR, cfg.blink_cur);
CheckDlgButton (hwnd, IDC_SCROLLBAR, cfg.scrollbar);
CheckDlgButton (hwnd, IDC_LOCKSIZE, cfg.locksize);
- CheckRadioButton (hwnd, IDC_COEALWAYS, IDC_COENEVER,
- cfg.close_on_exit==COE_NEVER ? IDC_COENEVER :
- cfg.close_on_exit==COE_NORMAL ? IDC_COENORMAL : IDC_COEALWAYS);
+ CheckRadioButton (hwnd, IDC_COEALWAYS, IDC_COENORMAL,
+ cfg.close_on_exit==COE_NORMAL ? IDC_COENORMAL :
+ cfg.close_on_exit==COE_NEVER ? IDC_COENEVER : IDC_COEALWAYS);
CheckDlgButton (hwnd, IDC_CLOSEWARN, cfg.warn_on_close);
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
endbox(&cp);
}
beginbox(&cp, NULL, IDC_BOX_SESSION3);
- radioline(&cp, "At session end, close &window:", IDC_CLOSEEXIT, 3,
+ radioline(&cp, "Close &window on exit:", IDC_CLOSEEXIT, 4,
"Always", IDC_COEALWAYS,
- "On clean exit", IDC_COENORMAL,
- "Never", IDC_COENEVER, NULL);
+ "Never", IDC_COENEVER,
+ "Only on clean exit", IDC_COENORMAL, NULL);
endbox(&cp);
}
sizeof(cfg.wintitle)-1);
break;
case IDC_COEALWAYS:
- case IDC_COENORMAL:
case IDC_COENEVER:
+ case IDC_COENORMAL:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
cfg.close_on_exit = IsDlgButtonChecked (hwnd, IDC_COEALWAYS) ? COE_ALWAYS :
- IsDlgButtonChecked (hwnd, IDC_COENORMAL) ? COE_NORMAL :
- COE_NEVER;
+ IsDlgButtonChecked (hwnd, IDC_COENEVER) ? COE_NEVER :
+ COE_NORMAL;
}
break;
case IDC_CLOSEWARN:
}
void logevent (char *string) {
+ char timebuf[40];
+ time_t t;
+
if (nevents >= negsize) {
negsize += 64;
events = srealloc (events, negsize * sizeof(*events));
}
- events[nevents] = smalloc(1+strlen(string));
- strcpy (events[nevents], string);
+
+ time(&t);
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S\t", localtime(&t));
+
+ events[nevents] = smalloc(strlen(timebuf)+strlen(string)+1);
+ strcpy(events[nevents], timebuf);
+ strcat(events[nevents], string);
nevents++;
if (logbox) {
int count;