FFFTPのソースコードです。
Revision | d72c4b40d4e2bff0ed25d2fb37ddbf27ab46ddc7 (tree) |
---|---|
Zeit | 2013-09-27 00:19:02 |
Autor | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Add options for removing old logs.
@@ -1459,6 +1459,7 @@ FONT 9, "MS Shell Dlg" | ||
1459 | 1459 | BEGIN |
1460 | 1460 | CONTROL "ファイルの属性を数字で表示する(&P)",DISP2_PERMIT_NUM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,196,10 |
1461 | 1461 | CONTROL "ファイル一覧を自動で更新する(&R)",DISP2_AUTO_REFRESH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,21,196,10 |
1462 | + CONTROL "古い処理内容を表示しない(&L)",DISP2_REMOVE_OLD_LOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,35,196,10 | |
1462 | 1463 | END |
1463 | 1464 | |
1464 | 1465 |
@@ -234,6 +234,7 @@ | ||
234 | 234 | #define PERM_G_EXEC 1017 |
235 | 235 | #define TOOL_EDITOR3_BR 1017 |
236 | 236 | #define CONNECT_SENDQUIT 1017 |
237 | +#define DISP2_REMOVE_OLD_LOG 1017 | |
237 | 238 | #define PERM_A_WRITE 1018 |
238 | 239 | #define CONNECT_NORAS 1018 |
239 | 240 | #define PERM_A_EXEC 1019 |
@@ -1495,6 +1495,7 @@ BEGIN | ||
1495 | 1495 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,196,10 |
1496 | 1496 | CONTROL "&Refresh the file list automatically",DISP2_AUTO_REFRESH, |
1497 | 1497 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,21,196,10 |
1498 | + CONTROL "Do not show old &logs",DISP2_REMOVE_OLD_LOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,35,196,10 | |
1498 | 1499 | END |
1499 | 1500 | |
1500 | 1501 |
@@ -234,6 +234,7 @@ | ||
234 | 234 | #define PERM_G_EXEC 1017 |
235 | 235 | #define TOOL_EDITOR3_BR 1017 |
236 | 236 | #define CONNECT_SENDQUIT 1017 |
237 | +#define DISP2_REMOVE_OLD_LOG 1017 | |
237 | 238 | #define PERM_A_WRITE 1018 |
238 | 239 | #define CONNECT_NORAS 1018 |
239 | 240 | #define PERM_A_EXEC 1019 |
@@ -263,6 +263,8 @@ time_t LastDataConnectionTime = 0; | ||
263 | 263 | int EncryptAllSettings = NO; |
264 | 264 | // ローカル側自動更新 |
265 | 265 | int AutoRefreshFileList = YES; |
266 | +// 古い処理内容を消去 | |
267 | +int RemoveOldLog = NO; | |
266 | 268 | |
267 | 269 | |
268 | 270 |
@@ -184,6 +184,8 @@ extern int UPnPEnabled; | ||
184 | 184 | extern int EncryptAllSettings; |
185 | 185 | // ローカル側自動更新 |
186 | 186 | extern int AutoRefreshFileList; |
187 | +// 古い処理内容を消去 | |
188 | +extern int RemoveOldLog; | |
187 | 189 | |
188 | 190 | |
189 | 191 | /*----- オプションのプロパティシート ------------------------------------------ |
@@ -1204,6 +1206,7 @@ static INT_PTR CALLBACK Disp2SettingProc(HWND hDlg, UINT message, WPARAM wParam, | ||
1204 | 1206 | case WM_INITDIALOG : |
1205 | 1207 | SendDlgItemMessage(hDlg, DISP2_PERMIT_NUM, BM_SETCHECK, DispPermissionsNumber, 0); |
1206 | 1208 | SendDlgItemMessage(hDlg, DISP2_AUTO_REFRESH, BM_SETCHECK, AutoRefreshFileList, 0); |
1209 | + SendDlgItemMessage(hDlg, DISP2_REMOVE_OLD_LOG, BM_SETCHECK, RemoveOldLog, 0); | |
1207 | 1210 | return(TRUE); |
1208 | 1211 | |
1209 | 1212 | case WM_NOTIFY: |
@@ -1213,6 +1216,7 @@ static INT_PTR CALLBACK Disp2SettingProc(HWND hDlg, UINT message, WPARAM wParam, | ||
1213 | 1216 | case PSN_APPLY : |
1214 | 1217 | DispPermissionsNumber = SendDlgItemMessage(hDlg, DISP2_PERMIT_NUM, BM_GETCHECK, 0, 0); |
1215 | 1218 | AutoRefreshFileList = SendDlgItemMessage(hDlg, DISP2_AUTO_REFRESH, BM_GETCHECK, 0, 0); |
1219 | + RemoveOldLog = SendDlgItemMessage(hDlg, DISP2_REMOVE_OLD_LOG, BM_GETCHECK, 0, 0); | |
1216 | 1220 | break; |
1217 | 1221 | |
1218 | 1222 | case PSN_RESET : |
@@ -219,6 +219,8 @@ extern int UPnPEnabled; | ||
219 | 219 | extern int EncryptAllSettings; |
220 | 220 | // ローカル側自動更新 |
221 | 221 | extern int AutoRefreshFileList; |
222 | +// 古い処理内容を消去 | |
223 | +extern int RemoveOldLog; | |
222 | 224 | |
223 | 225 | /*----- マスタパスワードの設定 ---------------------------------------------- |
224 | 226 | * |
@@ -673,6 +675,8 @@ void SaveRegistry(void) | ||
673 | 675 | WriteIntValueToReg(hKey4, "UPnP", UPnPEnabled); |
674 | 676 | // ローカル側自動更新 |
675 | 677 | WriteIntValueToReg(hKey4, "ListRefresh", AutoRefreshFileList); |
678 | + // 古い処理内容を消去 | |
679 | + WriteIntValueToReg(hKey4, "OldLog", RemoveOldLog); | |
676 | 680 | } |
677 | 681 | CloseSubKey(hKey4); |
678 | 682 | } |
@@ -1124,6 +1128,8 @@ int LoadRegistry(void) | ||
1124 | 1128 | ReadIntValueFromReg(hKey4, "UPnP", &UPnPEnabled); |
1125 | 1129 | // ローカル側自動更新 |
1126 | 1130 | ReadIntValueFromReg(hKey4, "ListRefresh", &AutoRefreshFileList); |
1131 | + // 古い処理内容を消去 | |
1132 | + ReadIntValueFromReg(hKey4, "OldLog", &RemoveOldLog); | |
1127 | 1133 | |
1128 | 1134 | CloseSubKey(hKey4); |
1129 | 1135 | } |
@@ -45,8 +45,7 @@ | ||
45 | 45 | #include "common.h" |
46 | 46 | #include "resource.h" |
47 | 47 | |
48 | -// Windows 9x系をサポートしないため不要 | |
49 | -//#define TASK_BUFSIZE (16*1024) | |
48 | +#define TASK_BUFSIZE (16*1024) | |
50 | 49 | |
51 | 50 | |
52 | 51 |
@@ -61,6 +60,8 @@ extern int ListHeight; | ||
61 | 60 | extern int TaskHeight; |
62 | 61 | extern HFONT ListFont; |
63 | 62 | extern int DebugConsole; |
63 | +// 古い処理内容を消去 | |
64 | +extern int RemoveOldLog; | |
64 | 65 | |
65 | 66 | /*===== ローカルなワーク =====*/ |
66 | 67 |
@@ -184,6 +185,7 @@ void SetTaskMsg(char *szFormat, ...) | ||
184 | 185 | |
185 | 186 | /* テキストサイズのリミット値をチェック */ |
186 | 187 | // Windows 9x系をサポートしないため不要 |
188 | + // 古い処理内容を消去 | |
187 | 189 | // if((Pos + strlen(szBuf)) >= TASK_BUFSIZE) |
188 | 190 | // { |
189 | 191 | // /* リミットを越えそうなら、先頭部分を切り捨てる */ |
@@ -194,6 +196,16 @@ void SetTaskMsg(char *szFormat, ...) | ||
194 | 196 | // |
195 | 197 | // Pos = SendMessage(GetTaskWnd(), WM_GETTEXTLENGTH, 0, 0); |
196 | 198 | // } |
199 | + if(RemoveOldLog == YES) | |
200 | + { | |
201 | + if((Pos + strlen(szBuf)) >= TASK_BUFSIZE) | |
202 | + { | |
203 | + Pos = SendMessage(GetTaskWnd(), EM_LINEINDEX, 1, 0); | |
204 | + SendMessage(GetTaskWnd(), EM_SETSEL, 0, Pos); | |
205 | + SendMessage(GetTaskWnd(), EM_REPLACESEL, FALSE, (LPARAM)""); | |
206 | + Pos = SendMessage(GetTaskWnd(), WM_GETTEXTLENGTH, 0, 0); | |
207 | + } | |
208 | + } | |
197 | 209 | |
198 | 210 | SendMessage(GetTaskWnd(), EM_SETSEL, Pos, Pos); |
199 | 211 | SendMessage(GetTaskWnd(), EM_REPLACESEL, FALSE, (LPARAM)szBuf); |