From c4a4d10f023ced1fdab492f1b92d0aa0a39ebc3b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 10 Aug 2013 16:26:46 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@5635 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Msg_Export/src/options.cpp | 298 ++++++++++++++++++------------------- 1 file changed, 149 insertions(+), 149 deletions(-) (limited to 'plugins/Msg_Export/src/options.cpp') diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 8b2dea52b3..9b76303565 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -100,7 +100,7 @@ int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) { return _DBGetString( (HANDLE)lParam1, "Protocol", "p", _T("")).compare( _DBGetString( (HANDLE)lParam2, "Protocol", "p", _T("")) - ); + ); } if (lParamSort == 3 ) { @@ -175,13 +175,13 @@ INT_PTR CALLBACK __stdcall DialogProc( int nExportCompleatList(HWND hParent, bool bOnlySelected ) { - HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST ); + HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST); - int nTotalContacts = ListView_GetItemCount( hMapUser ); + int nTotalContacts = ListView_GetItemCount( hMapUser); int nContacts; if (bOnlySelected ) - nContacts = ListView_GetSelectedCount( hMapUser ); + nContacts = ListView_GetSelectedCount( hMapUser); else nContacts = nTotalContacts; @@ -192,8 +192,8 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) } HWND hDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXPORT_ALL_DLG), hParent, DialogProc); - HWND hProg = GetDlgItem(hDlg, IDC_EXPORT_PROGRESS ); - HWND hStatus = GetDlgItem(hDlg, IDC_EXP_ALL_STATUS ); + HWND hProg = GetDlgItem(hDlg, IDC_EXPORT_PROGRESS); + HWND hStatus = GetDlgItem(hDlg, IDC_EXP_ALL_STATUS); SendMessage(hProg, PBM_SETRANGE, 0, MAKELPARAM(0, nContacts)); @@ -205,12 +205,12 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) RECT rDlg; if (GetWindowRect( hParent, &rParrent) && GetWindowRect( hDlg, &rDlg)) { - int x = ( (rParrent.right + rParrent.left) / 2) - ( (rDlg.right - rDlg.left) / 2 ); - int y = ( (rParrent.bottom + rParrent.top) / 2) - ( (rDlg.bottom - rDlg.top) / 2 ); - SetWindowPos( hDlg, 0, x, y, 0,0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW ); + int x = ( (rParrent.right + rParrent.left) / 2) - ( (rDlg.right - rDlg.left) / 2); + int y = ( (rParrent.bottom + rParrent.top) / 2) - ( (rDlg.bottom - rDlg.top) / 2); + SetWindowPos( hDlg, 0, x, y, 0,0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW); } else - ShowWindow( hDlg, SW_SHOWNORMAL ); + ShowWindow( hDlg, SW_SHOWNORMAL); } // map with list to stored all DB history before it is exported @@ -220,7 +220,7 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) LVITEM sItem = { 0 }; sItem.mask = LVIF_PARAM; - for( int nCur = 0 ; nCur < nTotalContacts ; nCur++ ) + for (int nCur = 0 ; nCur < nTotalContacts ; nCur++ ) { if (bOnlySelected ) { @@ -246,12 +246,12 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) } SendMessage( hProg, PBM_SETPOS, nCur, 0); - RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW ); + RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW); } /* if (hContact ) - MessageBox( hParent, LPGENT("Failed to export at least one contact"),MSG_BOX_TITEL,MB_OK ); + MessageBox( hParent, LPGENT("Failed to export at least one contact"),MSG_BOX_TITEL,MB_OK); */ } @@ -267,24 +267,24 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) map, less >::iterator FileIterator; int nCur=0; - for( FileIterator = AllEvents.begin() ; FileIterator != AllEvents.end() ; ++FileIterator ) + for (FileIterator = AllEvents.begin() ; FileIterator != AllEvents.end() ; ++FileIterator ) { (FileIterator->second).sort(); // Sort is preformed here !! // events with same time will not be swaped, they will // remain in there original order list< CLDBEvent >::const_iterator iterator; - for( iterator = FileIterator->second.begin() ; iterator != FileIterator->second.end() ; ++iterator ) + for (iterator = FileIterator->second.begin() ; iterator != FileIterator->second.end() ; ++iterator ) { HANDLE hDbEvent = (*iterator).hDbEvent; - nExportEvent( (WPARAM) (*iterator).hUser, (LPARAM) hDbEvent ); + nExportEvent( (WPARAM) (*iterator).hUser, (LPARAM)hDbEvent); } SendMessage( hProg, PBM_SETPOS, ++nCur, 0); - RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW ); + RedrawWindow( hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW); } } - DestroyWindow( hDlg ); + DestroyWindow( hDlg); return 0; } @@ -303,9 +303,9 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) void SetToDefault( HWND hParent ) { - HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST ); + HWND hMapUser = GetDlgItem( hParent, IDC_MAP_USER_LIST); - int nContacts = ListView_GetItemCount( hMapUser ); + int nContacts = ListView_GetItemCount( hMapUser); if (!hMapUser || nContacts <= 0 ) { @@ -318,7 +318,7 @@ void SetToDefault( HWND hParent ) LVITEM sItem = { 0 }; - for( int nCur = 0 ; nCur < nContacts ; nCur++ ) + for (int nCur = 0 ; nCur < nContacts ; nCur++ ) { if ( !(ListView_GetItemState( hMapUser, nCur, LVIS_SELECTED) & LVIS_SELECTED)) continue; @@ -329,12 +329,12 @@ void SetToDefault( HWND hParent ) continue; tstring sFileName = szTemp; - ReplaceDefines( (HANDLE)sItem.lParam, sFileName ); - ReplaceTimeVariables( sFileName ); + ReplaceDefines( (HANDLE)sItem.lParam, sFileName); + ReplaceTimeVariables( sFileName); sItem.mask = LVIF_TEXT; sItem.pszText = (TCHAR*)sFileName.c_str(); - ListView_SetItem( hMapUser, &sItem ); + ListView_SetItem( hMapUser, &sItem); if ( !bUnaplyedChanges ) { @@ -363,7 +363,7 @@ BOOL bApplyChanges( HWND hwndDlg ) BOOL bRet = true; TCHAR szTemp[500]; - int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE ); + int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE); if ( !bTrans || nTmp < 5 ) { mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Max line width must be at least %d"), 5); @@ -375,53 +375,53 @@ BOOL bApplyChanges( HWND hwndDlg ) nMaxLineWidth = nTmp; } - GetDlgItemText( hwndDlg, IDC_EXPORT_TIMEFORMAT, szTemp, sizeof( szTemp)); + GetDlgItemText(hwndDlg, IDC_EXPORT_TIMEFORMAT, szTemp, sizeof( szTemp)); sTimeFormat = szTemp; - GetDlgItemText( hwndDlg, IDC_EXPORT_DIR, szTemp, sizeof( szTemp)); + GetDlgItemText(hwndDlg, IDC_EXPORT_DIR, szTemp, sizeof( szTemp)); sExportDir = szTemp; - GetDlgItemText( hwndDlg, IDC_DEFAULT_FILE, szTemp, sizeof( szTemp)); + GetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, szTemp, sizeof( szTemp)); sDefaultFile = szTemp; - GetDlgItemText( hwndDlg, IDC_FILE_VIEWER, szTemp, sizeof( szTemp)); + GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szTemp, sizeof( szTemp)); sFileViewerPrg = szTemp; - bUseInternalViewer( IsDlgButtonChecked( hwndDlg, IDC_USE_INTERNAL_VIEWER ) == BST_CHECKED ); + bUseInternalViewer( IsDlgButtonChecked(hwndDlg, IDC_USE_INTERNAL_VIEWER ) == BST_CHECKED); - bool bNewRp = IsDlgButtonChecked( hwndDlg, IDC_REPLACE_MIRANDA_HISTORY) == BST_CHECKED; + bool bNewRp = IsDlgButtonChecked(hwndDlg, IDC_REPLACE_MIRANDA_HISTORY) == BST_CHECKED; if (bReplaceHistory != bNewRp ) { bReplaceHistory = bNewRp; - MessageBox(hwndDlg, TranslateT("You need to restart miranda to change the history function"), MSG_BOX_TITEL, MB_OK ); + MessageBox(hwndDlg, TranslateT("You need to restart miranda to change the history function"), MSG_BOX_TITEL, MB_OK); } - bAppendNewLine = IsDlgButtonChecked( hwndDlg, IDC_APPEND_NEWLINE) == BST_CHECKED; - bUseUtf8InNewFiles = IsDlgButtonChecked( hwndDlg, IDC_USE_UTF8_IN_NEW_FILES) == BST_CHECKED; + bAppendNewLine = IsDlgButtonChecked(hwndDlg, IDC_APPEND_NEWLINE) == BST_CHECKED; + bUseUtf8InNewFiles = IsDlgButtonChecked(hwndDlg, IDC_USE_UTF8_IN_NEW_FILES) == BST_CHECKED; - bUseLessAndGreaterInExport = IsDlgButtonChecked( hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT) == BST_CHECKED; + bUseLessAndGreaterInExport = IsDlgButtonChecked(hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT) == BST_CHECKED; - HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST ); - int nCount = ListView_GetItemCount( hMapUser ); - for( int nCur = 0 ; nCur < nCount ; nCur++ ) + HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST); + int nCount = ListView_GetItemCount( hMapUser); + for (int nCur = 0 ; nCur < nCount ; nCur++ ) { LVITEM sItem = { 0 }; sItem.iItem = nCur; sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; sItem.pszText = szTemp; - sItem.cchTextMax = sizeof( szTemp ); + sItem.cchTextMax = sizeof( szTemp); if (ListView_GetItem( hMapUser, &sItem)) { HANDLE hUser = (HANDLE)sItem.lParam; if (_tcslen( szTemp) > 0 ) - db_set_ts( hUser, MODULE, "FileName", szTemp ); + db_set_ts( hUser, MODULE, "FileName", szTemp); else - db_unset( hUser, MODULE, "FileName" ); + db_unset( hUser, MODULE, "FileName"); if (sItem.iImage ) - db_unset( hUser, MODULE, "EnableLog" ); // default is Enabled !! + db_unset( hUser, MODULE, "EnableLog"); // default is Enabled !! else db_set_b( hUser, MODULE, "EnableLog",0); } @@ -454,12 +454,12 @@ void ClearAllFileNames(HWND hwndDlg) sItem.mask = LVIF_TEXT; sItem.pszText = _T(""); - HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST ); - int nCount = ListView_GetItemCount( hMapUser ); - for( int nCur = 0 ; nCur < nCount ; nCur++ ) + HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST); + int nCount = ListView_GetItemCount( hMapUser); + for (int nCur = 0 ; nCur < nCount ; nCur++ ) { sItem.iItem = nCur; - ListView_SetItem( hMapUser, &sItem ); + ListView_SetItem( hMapUser, &sItem); } if ( !bUnaplyedChanges ) { @@ -485,13 +485,13 @@ void AutoFindeFileNames(HWND hwndDlg) { TCHAR szDefaultFile[500]; - GetDlgItemText( hwndDlg, IDC_DEFAULT_FILE, szDefaultFile, sizeof( szDefaultFile)); + GetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, szDefaultFile, sizeof( szDefaultFile)); LVITEM sItem = { 0 }; - HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST ); - int nCount = ListView_GetItemCount( hMapUser ); - for( int nCur = 0 ; nCur < nCount ; nCur++ ) + HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST); + int nCount = ListView_GetItemCount( hMapUser); + for (int nCur = 0 ; nCur < nCount ; nCur++ ) { TCHAR szSearch[ 100 ]; @@ -499,7 +499,7 @@ void AutoFindeFileNames(HWND hwndDlg) sItem.iItem = nCur; sItem.iSubItem = 1; sItem.pszText = szSearch; - sItem.cchTextMax = sizeof( szSearch ); + sItem.cchTextMax = sizeof( szSearch); if ( !ListView_GetItem( hMapUser, &sItem)) { @@ -509,7 +509,7 @@ void AutoFindeFileNames(HWND hwndDlg) int nShortestMatch = 0xFFFF; HANDLE hStortest = 0; int nStortestIndex = -1; - for( int nSubCur = 0 ; nSubCur < nCount ; nSubCur++ ) + for (int nSubCur = 0 ; nSubCur < nCount ; nSubCur++ ) { if (nSubCur == nCur ) continue; @@ -518,10 +518,10 @@ void AutoFindeFileNames(HWND hwndDlg) sItem.iItem = nSubCur; sItem.iSubItem = 1; sItem.pszText = szSubCur; - sItem.cchTextMax = sizeof( szSubCur ); + sItem.cchTextMax = sizeof( szSubCur); if (ListView_GetItem( hMapUser, &sItem)) { - size_t nLen = _tcslen( szSubCur ); + size_t nLen = _tcslen( szSubCur); if (_tcsncicmp( szSubCur, szSearch, nLen) == 0 ) { if (nLen < (size_t)nShortestMatch ) @@ -551,8 +551,8 @@ void AutoFindeFileNames(HWND hwndDlg) if (sFileName.empty()) { sFileName = szDefaultFile; - ReplaceDefines( hStortest, sFileName ); - ReplaceTimeVariables( sFileName ); + ReplaceDefines( hStortest, sFileName); + ReplaceTimeVariables( sFileName); } if (!bPriHasFileName ) @@ -589,7 +589,7 @@ void OpenHelp(HWND hwndDlg) TCHAR szPath[MAX_PATH]; if (GetModuleFileName( hInstance, szPath, sizeof( szPath)) ) { - size_t nLen = _tcslen( szPath ); + size_t nLen = _tcslen( szPath); if (nLen > 3 ) { szPath[nLen-1] = 't'; @@ -639,10 +639,10 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar { bWindowTextSet = FALSE; - HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST ); + HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST); { // init adv. win styles - DWORD dw = ListView_GetExtendedListViewStyle( hMapUser ); + DWORD dw = ListView_GetExtendedListViewStyle( hMapUser); dw |= LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT; ListView_SetExtendedListViewStyle( hMapUser, dw /*| LVS_EX_LABELTIP*/); } @@ -663,22 +663,22 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar cCol.mask = LVCF_TEXT | LVCF_WIDTH; cCol.cx = nColumnWidth; cCol.pszText = TranslateT("File"); - ListView_InsertColumn( hMapUser, 0, &cCol ); + ListView_InsertColumn( hMapUser, 0, &cCol); cCol.pszText = TranslateT("Nick"); - ListView_InsertColumn( hMapUser, 1, &cCol ); + ListView_InsertColumn( hMapUser, 1, &cCol); cCol.cx = nProtoColWitdh; cCol.pszText = TranslateT("Proto"); - ListView_InsertColumn( hMapUser, 2, &cCol ); + ListView_InsertColumn( hMapUser, 2, &cCol); cCol.cx = nUINColWitdh; cCol.mask |= LVCF_FMT; cCol.fmt = LVCFMT_RIGHT; cCol.pszText = TranslateT("UIN"); - ListView_InsertColumn( hMapUser, 3, &cCol ); + ListView_InsertColumn( hMapUser, 3, &cCol); /* int nOrder[3] = { 1, 2, 0 }; - ListView_SetColumnOrderArray( hMapUser, 3, nOrder );*/ + ListView_SetColumnOrderArray( hMapUser, 3, nOrder);*/ } { @@ -693,31 +693,31 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar tstring sTmp; LVITEM sItem = { 0 }; HANDLE hContact = db_find_first(); - for( int nUser = 0; /*hContact*/ ; nUser++ ) + for (int nUser = 0; /*hContact*/ ; nUser++ ) { sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; sItem.iItem = nUser; sItem.iSubItem = 0; sItem.iImage = db_get_b(hContact,MODULE, "EnableLog", 1); - sItem.lParam = (LPARAM) hContact; + sItem.lParam = (LPARAM)hContact; sTmp = _DBGetString( hContact, MODULE, "FileName", _T("")); sItem.pszText = (TCHAR*)sTmp.c_str(); - ListView_InsertItem( hMapUser, &sItem ); + ListView_InsertItem( hMapUser, &sItem); sItem.mask = LVIF_TEXT; sItem.iSubItem = 1; sItem.pszText = (TCHAR*)NickFromHandle(hContact); - ListView_SetItem( hMapUser, &sItem ); + ListView_SetItem( hMapUser, &sItem); sItem.iSubItem = 2; sTmp = _DBGetString( hContact, "Protocol", "p", _T("")); - string sTmpA = _DBGetStringA( hContact, "Protocol", "p", "" ); + string sTmpA = _DBGetStringA( hContact, "Protocol", "p", ""); sItem.pszText = (TCHAR*)sTmp.c_str(); - ListView_SetItem( hMapUser, &sItem ); + ListView_SetItem( hMapUser, &sItem); DWORD dwUIN = db_get_dw(hContact, sTmpA.c_str(), "UIN", 0); @@ -725,38 +725,38 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar mir_sntprintf(szTmp, SIZEOF(szTmp),_T("%d"), dwUIN); sItem.iSubItem = 3; sItem.pszText = szTmp; - ListView_SetItem( hMapUser, &sItem ); + ListView_SetItem( hMapUser, &sItem); if ( !hContact) // written like this to add the current user ( handle = 0 ) break; hContact = db_find_next(hContact); } - ListView_SortItems( hMapUser, CompareFunc, 1 ); + ListView_SortItems( hMapUser, CompareFunc, 1); sItem.mask = LVIF_STATE; sItem.iItem = 0; sItem.iSubItem = 0; sItem.state = LVIS_FOCUSED; sItem.stateMask = LVIS_FOCUSED; - ListView_SetItem( hMapUser, &sItem ); + ListView_SetItem( hMapUser, &sItem); } HWND hComboBox; - SetDlgItemInt( hwndDlg, IDC_MAX_CLOUMN_WIDTH, nMaxLineWidth, TRUE ); + SetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, nMaxLineWidth, TRUE); {// Export dir - SetDlgItemText( hwndDlg, IDC_EXPORT_DIR, sExportDir.c_str()); - hComboBox = GetDlgItem( hwndDlg, IDC_EXPORT_DIR ); + SetDlgItemText(hwndDlg, IDC_EXPORT_DIR, sExportDir.c_str()); + hComboBox = GetDlgItem(hwndDlg, IDC_EXPORT_DIR); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%dbpath%\\MsgExport\\")); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\Backup\\MsgExport\\")); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%dbpath%\\MsgExport\\%group% - ")); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%dbpath%\\MsgExport\\%group%\\")); } {// default file - SetDlgItemText( hwndDlg, IDC_DEFAULT_FILE, sDefaultFile.c_str()); - hComboBox = GetDlgItem( hwndDlg, IDC_DEFAULT_FILE ); + SetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, sDefaultFile.c_str()); + hComboBox = GetDlgItem(hwndDlg, IDC_DEFAULT_FILE); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%nick%.txt")); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%UIN%.txt")); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("%group%.txt")); @@ -770,29 +770,29 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("History.txt")); } {// time format - SetDlgItemText( hwndDlg, IDC_EXPORT_TIMEFORMAT, sTimeFormat.c_str()); - hComboBox = GetDlgItem( hwndDlg, IDC_EXPORT_TIMEFORMAT ); - SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d t") ); - SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d s") ); - SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d m") ); - SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("D s") ); + SetDlgItemText(hwndDlg, IDC_EXPORT_TIMEFORMAT, sTimeFormat.c_str()); + hComboBox = GetDlgItem(hwndDlg, IDC_EXPORT_TIMEFORMAT); + SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d t") ); + SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d s") ); + SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("d m") ); + SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("D s") ); SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("D m :")); } {// File viewer - SetDlgItemText( hwndDlg, IDC_FILE_VIEWER, sFileViewerPrg.c_str()); - hComboBox = GetDlgItem( hwndDlg, IDC_FILE_VIEWER ); - SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("") ); - SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\Windows\\Notepad.exe") ); - SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\WinNT\\Notepad.exe") ); - //EnableWindow( GetDlgItem( hwndDlg, IDC_FILE_VIEWER ), ! bUseInternalViewer()); + SetDlgItemText(hwndDlg, IDC_FILE_VIEWER, sFileViewerPrg.c_str()); + hComboBox = GetDlgItem(hwndDlg, IDC_FILE_VIEWER); + SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("") ); + SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\Windows\\Notepad.exe") ); + SendMessage( hComboBox, CB_ADDSTRING, 0, (LPARAM)_T("C:\\WinNT\\Notepad.exe") ); + //EnableWindow( GetDlgItem(hwndDlg, IDC_FILE_VIEWER ), ! bUseInternalViewer()); } - CheckDlgButton( hwndDlg, IDC_USE_INTERNAL_VIEWER , bUseInternalViewer() ? BST_CHECKED : BST_UNCHECKED ); - CheckDlgButton( hwndDlg, IDC_REPLACE_MIRANDA_HISTORY, bReplaceHistory ? BST_CHECKED : BST_UNCHECKED ); - CheckDlgButton( hwndDlg, IDC_APPEND_NEWLINE, bAppendNewLine ? BST_CHECKED : BST_UNCHECKED ); - CheckDlgButton( hwndDlg, IDC_USE_UTF8_IN_NEW_FILES, bUseUtf8InNewFiles ? BST_CHECKED : BST_UNCHECKED ); - CheckDlgButton( hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT, bUseLessAndGreaterInExport ? BST_CHECKED : BST_UNCHECKED ); + CheckDlgButton(hwndDlg, IDC_USE_INTERNAL_VIEWER , bUseInternalViewer() ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_REPLACE_MIRANDA_HISTORY, bReplaceHistory ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_APPEND_NEWLINE, bAppendNewLine ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_USE_UTF8_IN_NEW_FILES, bUseUtf8InNewFiles ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_USE_LESS_AND_GREATER_IN_EXPORT, bUseLessAndGreaterInExport ? BST_CHECKED : BST_UNCHECKED); TranslateDialogDefault(hwndDlg); @@ -814,13 +814,13 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar return TRUE; if (res == IDYES ) { - if ( !bApplyChanges( hwndDlg)) + if ( !bApplyChanges(hwndDlg)) { return TRUE; } } } - nExportCompleatList( hwndDlg, LOWORD(wParam) == ID_EXPORTSELECTED ); + nExportCompleatList(hwndDlg, LOWORD(wParam) == ID_EXPORTSELECTED); return TRUE; } case IDC_EXPORT_DIR: @@ -853,8 +853,8 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_USE_INTERNAL_VIEWER: /* { EnableWindow( - GetDlgItem( hwndDlg, IDC_FILE_VIEWER ), - !IsDlgButtonChecked( hwndDlg, IDC_USE_INTERNAL_VIEWER ) + GetDlgItem(hwndDlg, IDC_FILE_VIEWER ), + !IsDlgButtonChecked(hwndDlg, IDC_USE_INTERNAL_VIEWER ) ); }// fall thru here !!*/ case IDC_REPLACE_MIRANDA_HISTORY: @@ -873,8 +873,8 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar { LVITEM sItem = { 0 }; sItem.mask = LVIF_PARAM; - HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST ); - sItem.iItem = ListView_GetNextItem( hMapUser, -1, LVIS_SELECTED ); + HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST); + sItem.iItem = ListView_GetNextItem( hMapUser, -1, LVIS_SELECTED); if (sItem.iItem >= 0 && ListView_GetItem( hMapUser, &sItem )) { CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)sItem.lParam,0); @@ -899,7 +899,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar } case ID_SET_TO_DEFAULT: { - SetToDefault( hwndDlg ); + SetToDefault(hwndDlg); return TRUE; } case IDC_FILE_VIEWER_BROWSE: @@ -907,7 +907,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar OPENFILENAME ofn = { 0 }; // common dialog box structure TCHAR szFile[260]; // buffer for file name - GetDlgItemText( hwndDlg, IDC_FILE_VIEWER, szFile, sizeof(szFile)); + GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile, sizeof(szFile)); // Initialize OPENFILENAME //ZeroMemory(&ofn, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof(OPENFILENAME); @@ -927,7 +927,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar if (GetOpenFileName(&ofn)) { - SetDlgItemText( hwndDlg, IDC_FILE_VIEWER, szFile ); + SetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile); bUnaplyedChanges = TRUE; SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } @@ -939,7 +939,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar { LPMALLOC pMalloc; - //CoInitializeEx(NULL,COINIT_APARTMENTTHREADED ); + //CoInitializeEx(NULL,COINIT_APARTMENTTHREADED); // Get the shells allocator if (FAILED(SHGetMalloc(&pMalloc))) // we need to use this to support old Windows versions { @@ -970,19 +970,19 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar if (psItemIDList ) { SHGetPathFromIDList(psItemIDList, lpDestDir); - size_t n = _tcslen( lpDestDir ); + size_t n = _tcslen( lpDestDir); if (n > 0 && lpDestDir[n] != '\\' ) { lpDestDir[n] = '\\' ; lpDestDir[n+1] = 0; } - SetDlgItemText( hwndDlg, IDC_EXPORT_DIR, lpDestDir ); + SetDlgItemText(hwndDlg, IDC_EXPORT_DIR, lpDestDir); bUnaplyedChanges = TRUE; SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); // Clean up - pMalloc->Free( psItemIDList ); + pMalloc->Free( psItemIDList); } - pMalloc->Free( lpDestDir ); + pMalloc->Free( lpDestDir); pMalloc->Release(); return TRUE; } @@ -991,7 +991,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar } case WM_CONTEXTMENU: { - if (wParam != (WPARAM)GetDlgItem( hwndDlg, IDC_MAP_USER_LIST)) + if (wParam != (WPARAM)GetDlgItem(hwndDlg, IDC_MAP_USER_LIST)) return FALSE; HMENU hMainMenu = LoadMenu(hInstance,MAKEINTRESOURCE(IDR_MSG_EXPORT)); @@ -1004,11 +1004,11 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar pt.y=(short)HIWORD(lParam); if (pt.x == -1 && pt.y == -1 ) { - HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST ); - int nFirst = ListView_GetNextItem( hMapUser, -1, LVNI_FOCUSED ); + HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST); + int nFirst = ListView_GetNextItem( hMapUser, -1, LVNI_FOCUSED); if (nFirst >= 0 ) { - ListView_GetItemPosition( hMapUser, nFirst, &pt ); + ListView_GetItemPosition( hMapUser, nFirst, &pt); } if (pt.y < 16 ) @@ -1016,7 +1016,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar else { RECT rUserList; - GetClientRect( hMapUser, &rUserList ); + GetClientRect( hMapUser, &rUserList); if (pt.y > rUserList.bottom - 16 ) pt.y = rUserList.bottom - 16; else @@ -1064,7 +1064,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar if (pdi->item.mask & LVIF_TEXT ) { pdi->item.mask &= LVIF_TEXT; - ListView_SetItem( p->hwndFrom, &pdi->item ); + ListView_SetItem( p->hwndFrom, &pdi->item); bUnaplyedChanges = TRUE; SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); @@ -1077,10 +1077,10 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar if (lpnmk->wVKey == 'A' && (GetKeyState( VK_CONTROL) & 0x8000)) { // select all - int nCount = ListView_GetItemCount( p->hwndFrom ); - for( int nCur = 0 ; nCur < nCount ; nCur++ ) + int nCount = ListView_GetItemCount( p->hwndFrom ); + for (int nCur = 0 ; nCur < nCount ; nCur++ ) { - ListView_SetItemState( p->hwndFrom, nCur, LVIS_SELECTED, LVIS_SELECTED ); + ListView_SetItemState( p->hwndFrom, nCur, LVIS_SELECTED, LVIS_SELECTED); } return TRUE; } @@ -1096,9 +1096,9 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar if (hEdit && lpnmk->wVKey != VK_F2 ) { if (isupper( lpnmk->wVKey)) - SendMessage( hEdit, WM_CHAR, tolower( lpnmk->wVKey ), 0 ); + SendMessage( hEdit, WM_CHAR, tolower( lpnmk->wVKey ), 0); else - SendMessage( hEdit, WM_CHAR, lpnmk->wVKey, 0 ); + SendMessage( hEdit, WM_CHAR, lpnmk->wVKey, 0); } } return TRUE; @@ -1108,7 +1108,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar NMITEMACTIVATE * pdi = (NMITEMACTIVATE *) lParam; if (pdi->iItem >= 0 ) { - ListView_EditLabel( p->hwndFrom, pdi->iItem ); + ListView_EditLabel( p->hwndFrom, pdi->iItem); } return TRUE; } @@ -1126,7 +1126,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar { if (lplvcd->nmcd.lItemlParam == 0 ) { - lplvcd->clrText = RGB( 0, 0, 255 ); + lplvcd->clrText = RGB( 0, 0, 255); } SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_NEWFONT); return true; @@ -1142,7 +1142,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar { case PSN_APPLY: { - bApplyChanges( hwndDlg ); + bApplyChanges(hwndDlg); return TRUE; } case HDN_ITEMCLICK: @@ -1150,8 +1150,8 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar NMHEADER * phdr = (LPNMHEADER) p; if (phdr->iButton == 0 )// 0 => Left button { - HWND hMapUser = GetDlgItem( hwndDlg, IDC_MAP_USER_LIST ); - ListView_SortItems( hMapUser, CompareFunc, phdr->iItem ); + HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST); + ListView_SortItems( hMapUser, CompareFunc, phdr->iItem); return TRUE; } return FALSE; @@ -1179,26 +1179,26 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar BOOL bApplyChanges2( HWND hwndDlg ) { - if (IsDlgButtonChecked( hwndDlg, IDC_FC_PROMPT) == BST_CHECKED ) + if (IsDlgButtonChecked(hwndDlg, IDC_FC_PROMPT) == BST_CHECKED ) enRenameAction = eDAPromptUser; - else if (IsDlgButtonChecked( hwndDlg, IDC_FC_RENAME) == BST_CHECKED ) + else if (IsDlgButtonChecked(hwndDlg, IDC_FC_RENAME) == BST_CHECKED ) enRenameAction = eDAAutomatic; - else if (IsDlgButtonChecked( hwndDlg, IDC_FC_NOTHING) == BST_CHECKED ) + else if (IsDlgButtonChecked(hwndDlg, IDC_FC_NOTHING) == BST_CHECKED ) enRenameAction = eDANothing; - if (IsDlgButtonChecked( hwndDlg, IDC_FD_PROMPT) == BST_CHECKED ) + if (IsDlgButtonChecked(hwndDlg, IDC_FD_PROMPT) == BST_CHECKED ) enDeleteAction = eDAPromptUser; - else if (IsDlgButtonChecked( hwndDlg, IDC_FD_DELETE) == BST_CHECKED ) + else if (IsDlgButtonChecked(hwndDlg, IDC_FD_DELETE) == BST_CHECKED ) enDeleteAction = eDAAutomatic; - else if (IsDlgButtonChecked( hwndDlg, IDC_FD_NOTHING) == BST_CHECKED ) + else if (IsDlgButtonChecked(hwndDlg, IDC_FD_NOTHING) == BST_CHECKED ) enDeleteAction = eDANothing; char szTemp[ 500 ]; - strcpy( szTemp, "DisableProt_" ); + strcpy( szTemp, "DisableProt_"); - HWND hMapUser = GetDlgItem( hwndDlg, IDC_EXPORT_PROTOS ); - int nCount = ListView_GetItemCount( hMapUser ); - for( int nCur = 0 ; nCur < nCount ; nCur++ ) + HWND hMapUser = GetDlgItem(hwndDlg, IDC_EXPORT_PROTOS); + int nCount = ListView_GetItemCount( hMapUser); + for (int nCur = 0 ; nCur < nCount ; nCur++ ) { LVITEMA sItem = { 0 }; sItem.iItem = nCur; @@ -1208,9 +1208,9 @@ BOOL bApplyChanges2( HWND hwndDlg ) if (::SendMessage(hMapUser, LVM_GETITEMA, 0, (LPARAM)&sItem)) { if (sItem.iImage ) - db_unset( NULL, MODULE, szTemp ); // default is Enabled !! + db_unset(NULL, MODULE, szTemp); // default is Enabled !! else - db_set_b( NULL, MODULE, szTemp,0); + db_set_b(NULL, MODULE, szTemp,0); } } SaveSettings(); @@ -1245,31 +1245,31 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa switch( enRenameAction ) { case eDAPromptUser: - CheckDlgButton( hwndDlg, IDC_FC_PROMPT, true ); + CheckDlgButton(hwndDlg, IDC_FC_PROMPT, true); break; case eDAAutomatic: - CheckDlgButton( hwndDlg, IDC_FC_RENAME, true ); + CheckDlgButton(hwndDlg, IDC_FC_RENAME, true); break; case eDANothing: - CheckDlgButton( hwndDlg, IDC_FC_NOTHING, true ); + CheckDlgButton(hwndDlg, IDC_FC_NOTHING, true); break; } switch( enDeleteAction ) { case eDAPromptUser: - CheckDlgButton( hwndDlg, IDC_FD_PROMPT, true ); + CheckDlgButton(hwndDlg, IDC_FD_PROMPT, true); break; case eDAAutomatic: - CheckDlgButton( hwndDlg, IDC_FD_DELETE, true ); + CheckDlgButton(hwndDlg, IDC_FD_DELETE, true); break; case eDANothing: - CheckDlgButton( hwndDlg, IDC_FD_NOTHING, true ); + CheckDlgButton(hwndDlg, IDC_FD_NOTHING, true); break; } - HWND hMapUser = GetDlgItem( hwndDlg, IDC_EXPORT_PROTOS ); + HWND hMapUser = GetDlgItem(hwndDlg, IDC_EXPORT_PROTOS); /* { // init adv. win styles - DWORD dw = ListView_GetExtendedListViewStyle( hMapUser ); + DWORD dw = ListView_GetExtendedListViewStyle( hMapUser); dw |= LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT; ListView_SetExtendedListViewStyle( hMapUser, dw /); } @@ -1278,7 +1278,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa RECT rListSize; if (GetWindowRect( hMapUser, &rListSize)) { - nColumnWidth = (rListSize.right - rListSize.left- GetSystemMetrics(SM_CXVSCROLL) - 5 ); + nColumnWidth = (rListSize.right - rListSize.left- GetSystemMetrics(SM_CXVSCROLL) - 5); if (nColumnWidth < 10) nColumnWidth = 10; } @@ -1288,7 +1288,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa cCol.mask = LVCF_TEXT | LVCF_WIDTH; cCol.cx = nColumnWidth; cCol.pszText = TranslateT("Export Protocols"); - ListView_InsertColumn( hMapUser, 0, &cCol ); + ListView_InsertColumn( hMapUser, 0, &cCol); } { @@ -1308,12 +1308,12 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa ProtoEnumAccounts(&nCount, &proto); - for( int i=0 ; i < nCount ; i++) + for (int i=0 ; i < nCount ; i++) { mir_snprintf(szTemp, SIZEOF(szTemp), "DisableProt_%s", proto[i]->szModuleName); sItem.pszText = proto[i]->szModuleName; sItem.iImage = db_get_b(NULL,MODULE,szTemp,1); - ::SendMessage( hMapUser, LVM_INSERTITEMA, 0,(LPARAM)&sItem ); + ::SendMessage( hMapUser, LVM_INSERTITEMA, 0,(LPARAM)&sItem); sItem.iItem++; } } -- cgit v1.2.3