diff options
Diffstat (limited to 'src/modules/srfile/fileopts.cpp')
-rw-r--r-- | src/modules/srfile/fileopts.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/src/modules/srfile/fileopts.cpp b/src/modules/srfile/fileopts.cpp index ca22961ece..e0189fc56f 100644 --- a/src/modules/srfile/fileopts.cpp +++ b/src/modules/srfile/fileopts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -36,16 +36,16 @@ struct virusscannerinfo { };
static const struct virusscannerinfo virusScanners[]={
- {_T("Network Associates/McAfee VirusScan"),_T("SOFTWARE\\McAfee\\VirusScan"),_T("Scan32EXE"),_T("\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot")},
- {_T("Dr Solomon's VirusScan (Network Associates)"),_T("SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General"),_T("szScannerExe"),_T("\"%s\" %%f /uinone /noboot /comp /prompt /autoexit")},
- {_T("Norton AntiVirus"),_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe"),NULL,_T("\"%s\" %%f /b- /m- /s+ /noresults")},
- {_T("Computer Associates/Inoculate IT"),_T("Software\\Antivirus"),_T("ImageFilename"),_T("\"%s\" %%f /display=progress /exit")},
- {_T("Computer Associates eTrust"),_T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"),_T("VetPath"),_T("\"%s\" %%f /display=progress /exit")},
- {_T("Kaspersky Anti-Virus"),_T("SOFTWARE\\KasperskyLab\\Components\\101"),_T("EXEName"),_T("\"%s\" /S /Q %%f")},
- {_T("Kaspersky Anti-Virus"),_T("SOFTWARE\\KasperskyLab\\SetupFolders"),_T("KAV8"),_T("\"%savp.exe\" SCAN %%f")},
- {_T("Kaspersky Anti-Virus"),_T("SOFTWARE\\KasperskyLab\\SetupFolders"),_T("KAV9"),_T("\"%savp.exe\" SCAN %%f")},
- {_T("AntiVir PersonalEdition Classic"),_T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"),_T("Path"),_T("\"%savscan.exe\" /GUIMODE=2 /PATH=\"%%f\"")},
- {_T("ESET NOD32 Antivirus"),_T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"),_T("InstallDir"),_T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action=clean \"%%f\"")},
+ {_T("Network Associates/McAfee VirusScan"), _T("SOFTWARE\\McAfee\\VirusScan"), _T("Scan32EXE"), _T("\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot")},
+ {_T("Dr Solomon's VirusScan (Network Associates)"), _T("SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General"), _T("szScannerExe"), _T("\"%s\" %%f /uinone /noboot /comp /prompt /autoexit")},
+ {_T("Norton AntiVirus"), _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe"), NULL, _T("\"%s\" %%f /b- /m- /s+ /noresults")},
+ {_T("Computer Associates/Inoculate IT"), _T("Software\\Antivirus"), _T("ImageFilename"), _T("\"%s\" %%f /display=progress /exit")},
+ {_T("Computer Associates eTrust"), _T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"), _T("VetPath"), _T("\"%s\" %%f /display=progress /exit")},
+ {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\Components\\101"), _T("EXEName"), _T("\"%s\" /S /Q %%f")},
+ {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV8"), _T("\"%savp.exe\" SCAN %%f")},
+ {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV9"), _T("\"%savp.exe\" SCAN %%f")},
+ {_T("AntiVir PersonalEdition Classic"), _T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"), _T("Path"), _T("\"%savscan.exe\" /GUIMODE=2 /PATH=\"%%f\"")},
+ {_T("ESET NOD32 Antivirus"), _T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"), _T("InstallDir"), _T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action=clean \"%%f\"")},
};
#define M_UPDATEENABLING (WM_USER+100)
@@ -67,74 +67,74 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
TCHAR str[MAX_PATH];
- GetContactReceivedFilesDir(NULL,str,SIZEOF(str),FALSE);
- SetDlgItemText(hwndDlg,IDC_FILEDIR,str);
+ GetContactReceivedFilesDir(NULL, str, SIZEOF(str), FALSE);
+ SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
}
- CheckDlgButton(hwndDlg, IDC_AUTOACCEPT, DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOMIN, DBGetContactSettingByte(NULL,"SRFile","AutoMin",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, DBGetContactSettingByte(NULL,"SRFile","AutoClose",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOCLEAR, DBGetContactSettingByte(NULL,"SRFile","AutoClear",1) ? BST_CHECKED : BST_UNCHECKED);
- switch(DBGetContactSettingByte(NULL,"SRFile","UseScanner",VIRUSSCAN_DISABLE)) {
+ CheckDlgButton(hwndDlg, IDC_AUTOACCEPT, DBGetContactSettingByte(NULL, "SRFile", "AutoAccept", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOMIN, DBGetContactSettingByte(NULL, "SRFile", "AutoMin", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, DBGetContactSettingByte(NULL, "SRFile", "AutoClose", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLEAR, DBGetContactSettingByte(NULL, "SRFile", "AutoClear", 1) ? BST_CHECKED : BST_UNCHECKED);
+ switch(DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE)) {
case VIRUSSCAN_AFTERDL: CheckDlgButton(hwndDlg, IDC_SCANAFTERDL, BST_CHECKED); break;
case VIRUSSCAN_DURINGDL: CheckDlgButton(hwndDlg, IDC_SCANDURINGDL, BST_CHECKED); break;
default: CheckDlgButton(hwndDlg, IDC_NOSCANNER, BST_CHECKED); break;
}
- CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, DBGetContactSettingByte(NULL,"SRFile","WarnBeforeOpening",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, DBGetContactSettingByte(NULL, "SRFile", "WarnBeforeOpening", 1) ? BST_CHECKED : BST_UNCHECKED);
{ TCHAR szScanExe[MAX_PATH];
- int i,iItem;
+ int i, iItem;
for ( i=0; i < SIZEOF(virusScanners); i++ ) {
- if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[i].szExeRegPath,virusScanners[i].szExeRegValue,szScanExe,SIZEOF(szScanExe))) {
- iItem=SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_ADDSTRING,0,(LPARAM)virusScanners[i].szProductName);
- SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETITEMDATA,iItem,i);
+ if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[i].szExeRegPath, virusScanners[i].szExeRegValue, szScanExe, SIZEOF(szScanExe))) {
+ iItem=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName);
+ SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, i);
}
}
- if ( SendDlgItemMessageA(hwndDlg,IDC_SCANCMDLINE,CB_GETCOUNT,0,0) == 0 )
+ if ( SendDlgItemMessageA(hwndDlg, IDC_SCANCMDLINE, CB_GETCOUNT, 0, 0) == 0 )
{
- iItem = SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_ADDSTRING,0,(LPARAM)_T("") );
- SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETITEMDATA,iItem, (LPARAM)-1);
+ iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)_T("") );
+ SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, (LPARAM)-1);
}
}
DBVARIANT dbv;
- if (DBGetContactSettingTString(NULL,"SRFile","ScanCmdLine",&dbv) == 0) {
- SetDlgItemText(hwndDlg,IDC_SCANCMDLINE,dbv.ptszVal);
+ if (DBGetContactSettingTString(NULL, "SRFile", "ScanCmdLine", &dbv) == 0) {
+ SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.ptszVal);
DBFreeVariant(&dbv);
}
else {
- if (SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETCOUNT,0,0)) {
- SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_SETCURSEL,0,0);
- PostMessage(hwndDlg,M_SCANCMDLINESELCHANGE,0,0);
+ if (SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCOUNT, 0, 0)) {
+ SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETCURSEL, 0, 0);
+ PostMessage(hwndDlg, M_SCANCMDLINESELCHANGE, 0, 0);
}
}
- switch(DBGetContactSettingByte(NULL,"SRFile","IfExists",FILERESUME_ASK)) {
+ switch(DBGetContactSettingByte(NULL, "SRFile", "IfExists", FILERESUME_ASK)) {
case FILERESUME_RESUMEALL: CheckDlgButton(hwndDlg, IDC_RESUME, BST_CHECKED); break;
case FILERESUME_OVERWRITEALL: CheckDlgButton(hwndDlg, IDC_OVERWRITE, BST_CHECKED); break;
case FILERESUME_RENAMEALL: CheckDlgButton(hwndDlg, IDC_RENAME, BST_CHECKED); break;
default: CheckDlgButton(hwndDlg, IDC_ASK, BST_CHECKED); break;
}
- SendMessage(hwndDlg,M_UPDATEENABLING,0,0);
+ SendMessage(hwndDlg, M_UPDATEENABLING, 0, 0);
return TRUE;
}
case M_UPDATEENABLING:
- { int on=!IsDlgButtonChecked(hwndDlg,IDC_NOSCANNER);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ST_CMDLINE),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SCANCMDLINE),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SCANCMDLINEBROWSE),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ST_CMDLINEHELP),on);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOMIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOACCEPT));
+ { int on=!IsDlgButtonChecked(hwndDlg, IDC_NOSCANNER);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ST_CMDLINE), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINE), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINEBROWSE), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ST_CMDLINEHELP), on);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOMIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
break;
}
case M_SCANCMDLINESELCHANGE:
{ TCHAR str[512];
TCHAR szScanExe[MAX_PATH];
- int iScanner=SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_SCANCMDLINE,CB_GETCURSEL,0,0),0);
+ int iScanner=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0);
if (iScanner >= SIZEOF(virusScanners) || iScanner<0) break;
str[0]='\0';
- if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE,virusScanners[iScanner].szExeRegPath,virusScanners[iScanner].szExeRegValue,szScanExe,SIZEOF(szScanExe)))
- mir_sntprintf(str, SIZEOF(str), virusScanners[iScanner].szCommandLine,szScanExe);
- SetDlgItemText(hwndDlg,IDC_SCANCMDLINE,str);
+ if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[iScanner].szExeRegPath, virusScanners[iScanner].szExeRegValue, szScanExe, SIZEOF(szScanExe)))
+ mir_sntprintf(str, SIZEOF(str), virusScanners[iScanner].szCommandLine, szScanExe);
+ SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str);
break;
}
case WM_COMMAND:
@@ -144,19 +144,19 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case IDC_FILEDIRBROWSE:
{ TCHAR str[MAX_PATH];
- GetDlgItemText(hwndDlg,IDC_FILEDIR,str,SIZEOF(str));
- if (BrowseForFolder(hwndDlg,str))
- SetDlgItemText(hwndDlg,IDC_FILEDIR,str);
+ GetDlgItemText(hwndDlg, IDC_FILEDIR, str, SIZEOF(str));
+ if (BrowseForFolder(hwndDlg, str))
+ SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
break;
}
case IDC_AUTOACCEPT:
case IDC_NOSCANNER:
case IDC_SCANAFTERDL:
case IDC_SCANDURINGDL:
- SendMessage(hwndDlg,M_UPDATEENABLING,0,0);
+ SendMessage(hwndDlg, M_UPDATEENABLING, 0, 0);
break;
case IDC_SCANCMDLINE:
- if (HIWORD(wParam) == CBN_SELCHANGE) PostMessage(hwndDlg,M_SCANCMDLINESELCHANGE,0,0);
+ if (HIWORD(wParam) == CBN_SELCHANGE) PostMessage(hwndDlg, M_SCANCMDLINESELCHANGE, 0, 0);
else if (HIWORD(wParam) != CBN_EDITCHANGE) return 0;
break;
case IDC_SCANCMDLINEBROWSE:
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
- _tcscpy(filter,TranslateT("Executable Files"));
+ _tcscpy(filter, TranslateT("Executable Files"));
_tcscat(filter, _T(" (*.exe)"));
pfilter = filter + _tcslen(filter) + 1;
_tcscpy(pfilter, _T("*.exe"));
@@ -211,16 +211,16 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L { TCHAR str[512];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, SIZEOF(str));
RemoveInvalidPathChars(str);
- DBWriteContactSettingTString(NULL,"SRFile","RecvFilesDirAdv",str);
- DBWriteContactSettingByte(NULL,"SRFile","AutoAccept",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOACCEPT));
- DBWriteContactSettingByte(NULL,"SRFile","AutoMin",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOMIN));
- DBWriteContactSettingByte(NULL,"SRFile","AutoClose",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOCLOSE));
- DBWriteContactSettingByte(NULL,"SRFile","AutoClear",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOCLEAR));
- DBWriteContactSettingByte(NULL,"SRFile","UseScanner",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_SCANAFTERDL)?VIRUSSCAN_AFTERDL:(IsDlgButtonChecked(hwndDlg,IDC_SCANDURINGDL)?VIRUSSCAN_DURINGDL:VIRUSSCAN_DISABLE)));
+ DBWriteContactSettingTString(NULL, "SRFile", "RecvFilesDirAdv", str);
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoAccept", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoMin", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOMIN));
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLOSE));
+ DBWriteContactSettingByte(NULL, "SRFile", "AutoClear", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAR));
+ DBWriteContactSettingByte(NULL, "SRFile", "UseScanner", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCANAFTERDL)?VIRUSSCAN_AFTERDL:(IsDlgButtonChecked(hwndDlg, IDC_SCANDURINGDL)?VIRUSSCAN_DURINGDL:VIRUSSCAN_DISABLE)));
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, SIZEOF(str));
- DBWriteContactSettingTString(NULL,"SRFile","ScanCmdLine",str);
- DBWriteContactSettingByte(NULL,"SRFile","WarnBeforeOpening",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_WARNBEFOREOPENING));
- DBWriteContactSettingByte(NULL,"SRFile","IfExists",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_ASK)?FILERESUME_ASK:(IsDlgButtonChecked(hwndDlg,IDC_RESUME)?FILERESUME_RESUMEALL:(IsDlgButtonChecked(hwndDlg,IDC_OVERWRITE)?FILERESUME_OVERWRITEALL:FILERESUME_RENAMEALL))));
+ DBWriteContactSettingTString(NULL, "SRFile", "ScanCmdLine", str);
+ DBWriteContactSettingByte(NULL, "SRFile", "WarnBeforeOpening", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WARNBEFOREOPENING));
+ DBWriteContactSettingByte(NULL, "SRFile", "IfExists", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ASK)?FILERESUME_ASK:(IsDlgButtonChecked(hwndDlg, IDC_RESUME)?FILERESUME_RESUMEALL:(IsDlgButtonChecked(hwndDlg, IDC_OVERWRITE)?FILERESUME_OVERWRITEALL:FILERESUME_RENAMEALL))));
return TRUE;
}
}
|