From 6a1a045e620dba38a7a64070af59d1a91b104921 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 26 Aug 2015 17:25:14 +0000 Subject: massive code cleaning due to numerous name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@15036 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FTPFileYM/src/dialog.cpp | 471 ++++++++++++++++++--------------------- 1 file changed, 220 insertions(+), 251 deletions(-) (limited to 'plugins/FTPFileYM/src/dialog.cpp') diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 61fec363ed..b6004ad18d 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -27,28 +27,27 @@ extern Options &opt; UploadDialog::UploadDialog() { - this->hwnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DLG_UPLOAD), 0, UploadDlgProc); - this->hwndTabs = GetDlgItem(this->hwnd, IDC_TAB); - EnableThemeDialogTexture(this->hwnd, ETDT_ENABLETAB); + m_hwnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DLG_UPLOAD), 0, UploadDlgProc); + m_hwndTabs = GetDlgItem(m_hwnd, IDC_TAB); + EnableThemeDialogTexture(m_hwnd, ETDT_ENABLETAB); - MONITORINFO mi = {0}; + MONITORINFO mi = { 0 }; mi.cbSize = sizeof(mi); - HMONITOR hMonitor = MonitorFromWindow(this->hwnd, MONITOR_DEFAULTTONEAREST); + HMONITOR hMonitor = MonitorFromWindow(m_hwnd, MONITOR_DEFAULTTONEAREST); GetMonitorInfo(hMonitor, &mi); RECT rc; - GetWindowRect(this->hwnd, &rc); - rc.left = mi.rcWork.left + ((mi.rcWork.right - mi.rcWork.left) - (rc.right-rc.left)) / 2; - rc.top = mi.rcWork.top + ((mi.rcWork.bottom - mi.rcWork.top) - (rc.bottom-rc.top)) / 2; - SetWindowPos(this->hwnd, 0, rc.left, rc.top, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE); + GetWindowRect(m_hwnd, &rc); + rc.left = mi.rcWork.left + ((mi.rcWork.right - mi.rcWork.left) - (rc.right - rc.left)) / 2; + rc.top = mi.rcWork.top + ((mi.rcWork.bottom - mi.rcWork.top) - (rc.bottom - rc.top)) / 2; + SetWindowPos(m_hwnd, 0, rc.left, rc.top, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE); } UploadDialog::~UploadDialog() { - if (this->hwnd) - { - ShowWindow(this->hwnd, SW_HIDE); - SendMessage(this->hwnd, WMU_DESTROY, 0, 0); + if (m_hwnd) { + ShowWindow(m_hwnd, SW_HIDE); + SendMessage(m_hwnd, WMU_DESTROY, 0, 0); } instance = NULL; @@ -57,91 +56,90 @@ UploadDialog::~UploadDialog() void UploadDialog::selectTab(int index) { - if (tabs[index] != NULL) - tabs[index]->select(); + if (m_tabs[index] != NULL) + m_tabs[index]->select(); } void UploadDialog::show() { - ShowWindow(this->hwnd, SW_SHOWNORMAL); + ShowWindow(m_hwnd, SW_SHOWNORMAL); } -UploadDialog::Tab::Tab(GenericJob *Job) - : job(Job), - bOptCloseDlg(opt.bCloseDlg), - bOptCopyLink(opt.bCopyLink), - bOptAutosend(opt.bAutosend), - iOptAutoDelete(-1) -{ +UploadDialog::Tab::Tab(GenericJob *Job) : + m_job(Job), + m_bOptCloseDlg(opt.bCloseDlg), + m_bOptCopyLink(opt.bCopyLink), + m_bOptAutosend(opt.bAutosend), + m_iOptAutoDelete(-1) +{ if (opt.bAutoDelete) - this->iOptAutoDelete = Utils::getDeleteTimeMin(); + m_iOptAutoDelete = Utils::getDeleteTimeMin(); - this->stzSpeed[0] = 0; - this->stzComplet[0] = 0; - this->stzRemain[0] = 0; + m_stzSpeed[0] = 0; + m_stzComplet[0] = 0; + m_stzRemain[0] = 0; TCHAR buff[256]; - TCITEM tab = {0}; + TCITEM tab = { 0 }; tab.mask = TCIF_TEXT; - tab.pszText = Utils::getTextFragment(job->stzFileName, 20, buff); - TabCtrl_InsertItem(uDlg->hwndTabs, uDlg->tabs.size(), &tab); + tab.pszText = Utils::getTextFragment(m_job->m_tszFileName, 20, buff); + TabCtrl_InsertItem(uDlg->m_hwndTabs, uDlg->m_tabs.size(), &tab); { mir_cslock lock(mutexTabs); - uDlg->tabs.push_back(this); + uDlg->m_tabs.push_back(this); } - this->select(); + select(); } UploadDialog::Tab::~Tab() -{ - { mir_cslock lock(mutexTabs); - TabCtrl_DeleteItem(uDlg->hwndTabs, this->index()); - uDlg->tabs.erase(uDlg->tabs.begin() + this->index()); +{ + { + mir_cslock lock(mutexTabs); + TabCtrl_DeleteItem(uDlg->m_hwndTabs, index()); + uDlg->m_tabs.erase(uDlg->m_tabs.begin() + index()); } - if (this->job->isCompleted()) - delete this->job; + if (m_job->isCompleted()) + delete m_job; - if (uDlg->tabs.size() == 0) + if (uDlg->m_tabs.size() == 0) delete uDlg; - else + else uDlg->selectTab(0); } int UploadDialog::Tab::index() { - for (UINT i = 0; i < uDlg->tabs.size(); i++) - { - if (uDlg->tabs[i] == this) + for (UINT i = 0; i < uDlg->m_tabs.size(); i++) + if (uDlg->m_tabs[i] == this) return i; - } return -1; } void UploadDialog::Tab::select() -{ - TabCtrl_SetCurSel(uDlg->hwndTabs, this->index()); +{ + TabCtrl_SetCurSel(uDlg->m_hwndTabs, index()); { mir_cslock lock(mutexTabs); - uDlg->activeTab = this->index(); + uDlg->m_activeTab = index(); } - this->job->refreshTab(true); - InvalidateRect(uDlg->hwnd, NULL, TRUE); + m_job->refreshTab(true); + InvalidateRect(uDlg->m_hwnd, NULL, TRUE); } void UploadDialog::Tab::labelCompleted() -{ +{ TCHAR buff[64], buff2[256]; - mir_sntprintf(buff2, _countof(buff2), _T("* %s"), Utils::getTextFragment(this->job->stzFileName, 20, buff)); + mir_sntprintf(buff2, _countof(buff2), _T("* %s"), Utils::getTextFragment(m_job->m_tszFileName, 20, buff)); - TCITEM tab = {0}; + TCITEM tab = { 0 }; tab.mask = TCIF_TEXT; tab.pszText = buff2; - TabCtrl_SetItem(uDlg->hwndTabs, this->index(), &tab); + TabCtrl_SetItem(uDlg->m_hwndTabs, index(), &tab); } -LRESULT CALLBACK UploadDialog::TabControlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK UploadDialog::TabControlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_LBUTTONDBLCLK: @@ -149,15 +147,15 @@ LRESULT CALLBACK UploadDialog::TabControlProc(HWND hwnd, UINT msg, WPARAM wParam { POINT pt; GetCursorPos(&pt); - ScreenToClient(uDlg->hwndTabs, &pt); + ScreenToClient(uDlg->m_hwndTabs, &pt); TCHITTESTINFO tch; tch.pt = pt; tch.flags = 0; - int index = TabCtrl_HitTest(uDlg->hwndTabs, &tch); + int index = TabCtrl_HitTest(uDlg->m_hwndTabs, &tch); if (index != -1) - uDlg->tabs[index]->job->closeTab(); + uDlg->m_tabs[index]->m_job->closeTab(); } break; } @@ -165,18 +163,16 @@ LRESULT CALLBACK UploadDialog::TabControlProc(HWND hwnd, UINT msg, WPARAM wParam return mir_callNextSubclass(hwnd, UploadDialog::TabControlProc, msg, wParam, lParam); } -INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - switch (msg) - { - case WM_INITDIALOG: - { - TranslateDialogDefault(hwndDlg); - SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Utils::loadIconEx("main")); - - mir_subclassWindow(GetDlgItem(hwndDlg, IDC_TAB), TabControlProc); + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Utils::loadIconEx("main")); - LOGFONT logFont = {0}; + mir_subclassWindow(GetDlgItem(hwndDlg, IDC_TAB), TabControlProc); + { + LOGFONT logFont = { 0 }; HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_ST_FILE, WM_GETFONT, 0, 0); GetObject(hFont, sizeof(logFont), &logFont); logFont.lfWeight = FW_BOLD; @@ -218,232 +214,205 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONSETASFLATBTN, 0, 0); SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_DELETE)); SendDlgItemMessage(hwndDlg, IDC_BTN_CLOSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close"), BATF_TCHAR); - - break; } - case WM_MEASUREITEM: - return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); + break; + + case WM_MEASUREITEM: + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); - case WM_DRAWITEM: - return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); + case WM_DRAWITEM: + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); - case WM_COMMAND: + case WM_COMMAND: { - MCONTACT hContact = uDlg->tabs[uDlg->activeTab]->job->hContact; + MCONTACT hContact = uDlg->m_tabs[uDlg->m_activeTab]->m_job->m_hContact; if (hContact != NULL) - { - if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU), hContact)) + if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), hContact)) break; - } - if (HIWORD(wParam) == BN_CLICKED) - { - switch (LOWORD(wParam)) - { - case IDC_BTN_PROTO: - { - if (hContact != NULL) - { - RECT rc; - GetWindowRect((HWND)lParam, &rc); - HMENU hMenu = Menu_BuildContactMenu(hContact); - TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL); - DestroyMenu(hMenu); - } - - break; - } - case IDC_BTN_PAUSE: - { - uDlg->tabs[uDlg->activeTab]->job->pauseHandler(); - return TRUE; - } - case IDC_BTN_CLIPBOARD: - { - UploadJob *job = (UploadJob *)uDlg->tabs[uDlg->activeTab]->job; - Utils::copyToClipboard(job->szFileLink); - return TRUE; + if (HIWORD(wParam) == BN_CLICKED) { + switch (LOWORD(wParam)) { + case IDC_BTN_PROTO: + if (hContact != NULL) { + RECT rc; + GetWindowRect((HWND)lParam, &rc); + HMENU hMenu = Menu_BuildContactMenu(hContact); + TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL); + DestroyMenu(hMenu); } - case IDC_BTN_DOWNLOAD: + break; + + case IDC_BTN_PAUSE: + uDlg->m_tabs[uDlg->m_activeTab]->m_job->pauseHandler(); + return TRUE; + + case IDC_BTN_CLIPBOARD: { - UploadJob *job = (UploadJob *)uDlg->tabs[uDlg->activeTab]->job; - ShellExecuteA(NULL, "open", job->szFileLink, NULL, NULL, SW_SHOWNORMAL); - return TRUE; + UploadJob *job = (UploadJob *)uDlg->m_tabs[uDlg->m_activeTab]->m_job; + Utils::copyToClipboard(job->m_szFileLink); } - case IDC_BTN_FILEMANAGER: + return TRUE; + + case IDC_BTN_DOWNLOAD: { - CallService(MS_FTPFILE_SHOWMANAGER, 0, 0); - return TRUE; + UploadJob *job = (UploadJob *)uDlg->m_tabs[uDlg->m_activeTab]->m_job; + ShellExecuteA(NULL, "open", job->m_szFileLink, NULL, NULL, SW_SHOWNORMAL); } - case IDC_BTN_OPTIONS: - { - Tab *tab = uDlg->tabs[uDlg->activeTab]; - - POINT pt; - GetCursorPos(&pt); - SetForegroundWindow(uDlg->hwndTabs); - - HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU_UPLOAD)); - if (hMenu) - { - HMENU hPopupMenu = GetSubMenu(hMenu, 0); - TranslateMenu(hPopupMenu); - CheckMenuItem(hPopupMenu, IDM_CLOSEDLG, MF_BYCOMMAND | tab->bOptCloseDlg ? MF_CHECKED : 0); - CheckMenuItem(hPopupMenu, IDM_COPYLINK, MF_BYCOMMAND | tab->bOptCopyLink ? MF_CHECKED : 0); - CheckMenuItem(hPopupMenu, IDM_AUTOSEND, MF_BYCOMMAND | tab->bOptAutosend ? MF_CHECKED : 0); - - HMENU hTimeMenu = GetSubMenu(hPopupMenu, 3); - CheckMenuItem(hTimeMenu, IDM_DISABLED, MF_BYCOMMAND | (tab->iOptAutoDelete == -1) ? MF_CHECKED : MF_UNCHECKED); - - int times[10] = {5, 15, 30, 1 * 60, 2 * 60, 5 * 60, 10 * 60, 1 * 24 * 60, 2 * 24 * 60, 7 * 24 * 60}; - bool bChecked = (tab->iOptAutoDelete == -1) ? true : false; - TCHAR buff[256]; - - for (int i = 0; i < _countof(times); i++) - { - if (i == 3 || i == 7) - AppendMenu(hTimeMenu, MF_SEPARATOR, 0, 0); - - if (i < 3) - mir_sntprintf(buff, TranslateT("%d minutes"), times[i]); - else if (i < 7) - mir_sntprintf(buff, TranslateT("%d hours"), times[i] / 60); - else - mir_sntprintf(buff, TranslateT("%d days"), times[i] / 60 / 24); - - UINT check = MF_UNCHECKED; - if (!bChecked && tab->iOptAutoDelete == times[i]) - { - check = MF_CHECKED; - bChecked = true; - } - - AppendMenu(hTimeMenu, MF_STRING | check, times[i], buff); - } + return TRUE; + + case IDC_BTN_FILEMANAGER: + CallService(MS_FTPFILE_SHOWMANAGER, 0, 0); + return TRUE; + + case IDC_BTN_CLOSE: + uDlg->m_tabs[uDlg->m_activeTab]->m_job->closeTab(); + return TRUE; + + case IDC_BTN_OPTIONS: + Tab *tab = uDlg->m_tabs[uDlg->m_activeTab]; + + POINT pt; + GetCursorPos(&pt); + SetForegroundWindow(uDlg->m_hwndTabs); + + HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU_UPLOAD)); + if (hMenu) { + HMENU hPopupMenu = GetSubMenu(hMenu, 0); + TranslateMenu(hPopupMenu); + CheckMenuItem(hPopupMenu, IDM_CLOSEDLG, MF_BYCOMMAND | tab->m_bOptCloseDlg ? MF_CHECKED : 0); + CheckMenuItem(hPopupMenu, IDM_COPYLINK, MF_BYCOMMAND | tab->m_bOptCopyLink ? MF_CHECKED : 0); + CheckMenuItem(hPopupMenu, IDM_AUTOSEND, MF_BYCOMMAND | tab->m_bOptAutosend ? MF_CHECKED : 0); - if (opt.bAutoDelete) - { - switch (opt.timeRange) - { - case Options::TR_MINUTES: mir_sntprintf(buff, TranslateT("%d minutes"), opt.iDeleteTime); break; - case Options::TR_HOURS: mir_sntprintf(buff, TranslateT("%d hours"), opt.iDeleteTime); break; - case Options::TR_DAYS: mir_sntprintf(buff, TranslateT("%d days"), opt.iDeleteTime); break; - } + HMENU hTimeMenu = GetSubMenu(hPopupMenu, 3); + CheckMenuItem(hTimeMenu, IDM_DISABLED, MF_BYCOMMAND | (tab->m_iOptAutoDelete == -1) ? MF_CHECKED : MF_UNCHECKED); + int times[10] = { 5, 15, 30, 1 * 60, 2 * 60, 5 * 60, 10 * 60, 1 * 24 * 60, 2 * 24 * 60, 7 * 24 * 60 }; + bool bChecked = (tab->m_iOptAutoDelete == -1); + TCHAR buff[256]; + + for (int i = 0; i < _countof(times); i++) { + if (i == 3 || i == 7) AppendMenu(hTimeMenu, MF_SEPARATOR, 0, 0); - AppendMenu(hTimeMenu, MF_STRING | bChecked ? MF_UNCHECKED : MF_CHECKED, IDM_CUSTOM, buff); + + if (i < 3) + mir_sntprintf(buff, TranslateT("%d minutes"), times[i]); + else if (i < 7) + mir_sntprintf(buff, TranslateT("%d hours"), times[i] / 60); + else + mir_sntprintf(buff, TranslateT("%d days"), times[i] / 60 / 24); + + UINT check = MF_UNCHECKED; + if (!bChecked && tab->m_iOptAutoDelete == times[i]) { + check = MF_CHECKED; + bChecked = true; } - int command = TrackPopupMenu(hPopupMenu, TPM_LEFTALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, uDlg->hwndTabs, NULL); - switch (command) - { - case IDM_CLOSEDLG: - tab->bOptCloseDlg = !tab->bOptCloseDlg; break; - case IDM_COPYLINK: - tab->bOptCopyLink = !tab->bOptCopyLink; break; - case IDM_AUTOSEND: - tab->bOptAutosend = !tab->bOptAutosend; break; - case IDM_DISABLED: - tab->iOptAutoDelete = -1; break; - case IDM_CUSTOM: - switch (opt.timeRange) - { - case Options::TR_MINUTES: tab->iOptAutoDelete = opt.iDeleteTime; break; - case Options::TR_HOURS: tab->iOptAutoDelete = opt.iDeleteTime * 60; break; - case Options::TR_DAYS: tab->iOptAutoDelete = opt.iDeleteTime * 60 * 24; break; - } - break; - default: - tab->iOptAutoDelete = command; - break; + AppendMenu(hTimeMenu, MF_STRING | check, times[i], buff); + } + + if (opt.bAutoDelete) { + switch (opt.timeRange) { + case Options::TR_MINUTES: mir_sntprintf(buff, TranslateT("%d minutes"), opt.iDeleteTime); break; + case Options::TR_HOURS: mir_sntprintf(buff, TranslateT("%d hours"), opt.iDeleteTime); break; + case Options::TR_DAYS: mir_sntprintf(buff, TranslateT("%d days"), opt.iDeleteTime); break; } - if (command && ((UploadJob *)tab->job)->isCompleted()) - DBEntry::setDeleteTS(tab->job); + AppendMenu(hTimeMenu, MF_SEPARATOR, 0, 0); + AppendMenu(hTimeMenu, MF_STRING | bChecked ? MF_UNCHECKED : MF_CHECKED, IDM_CUSTOM, buff); + } - DestroyMenu(hMenu); + int command = TrackPopupMenu(hPopupMenu, TPM_LEFTALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, uDlg->m_hwndTabs, NULL); + switch (command) { + case IDM_CLOSEDLG: + tab->m_bOptCloseDlg = !tab->m_bOptCloseDlg; break; + case IDM_COPYLINK: + tab->m_bOptCopyLink = !tab->m_bOptCopyLink; break; + case IDM_AUTOSEND: + tab->m_bOptAutosend = !tab->m_bOptAutosend; break; + case IDM_DISABLED: + tab->m_iOptAutoDelete = -1; break; + case IDM_CUSTOM: + switch (opt.timeRange) { + case Options::TR_MINUTES: tab->m_iOptAutoDelete = opt.iDeleteTime; break; + case Options::TR_HOURS: tab->m_iOptAutoDelete = opt.iDeleteTime * 60; break; + case Options::TR_DAYS: tab->m_iOptAutoDelete = opt.iDeleteTime * 60 * 24; break; + } + break; + default: + tab->m_iOptAutoDelete = command; + break; } - return TRUE; - } - case IDC_BTN_CLOSE: - { - uDlg->tabs[uDlg->activeTab]->job->closeTab(); - return TRUE; + + if (command && ((UploadJob *)tab->m_job)->isCompleted()) + DBEntry::setDeleteTS(tab->m_job); + + DestroyMenu(hMenu); } + return TRUE; } } break; } - case WM_NOTIFY: - { - switch (((LPNMHDR)lParam)->code) - { - case TCN_SELCHANGE: - { - uDlg->selectTab(TabCtrl_GetCurSel(uDlg->hwndTabs)); - break; - } - case TTN_GETDISPINFO: - { - LPNMTTDISPINFO pInfo = (LPNMTTDISPINFO)lParam; - POINT pt; - GetCursorPos(&pt); - ScreenToClient(hwndDlg, &pt); + case WM_NOTIFY: + switch (((LPNMHDR)lParam)->code) { + case TCN_SELCHANGE: + uDlg->selectTab(TabCtrl_GetCurSel(uDlg->m_hwndTabs)); + break; - UINT i; RECT rc; - for (i = 0; i < uDlg->tabs.size(); i++) - { - if (uDlg->tabs[i] != NULL) - { - TabCtrl_GetItemRect(uDlg->hwndTabs, i, &rc); - if (PtInRect(&rc, pt)) break; - } - } + case TTN_GETDISPINFO: + LPNMTTDISPINFO pInfo = (LPNMTTDISPINFO)lParam; - if (i < uDlg->tabs.size()) - { - uDlg->tabs[i]->job->createToolTip(); - HWND hToolTip = TabCtrl_GetToolTips(uDlg->hwndTabs); - SendMessage(hToolTip, TTM_SETMAXTIPWIDTH, 0, (LPARAM)500); - pInfo->lpszText = uDlg->stzToolTipText; - } + POINT pt; + GetCursorPos(&pt); + ScreenToClient(hwndDlg, &pt); - break; + UINT i; RECT rc; + for (i = 0; i < uDlg->m_tabs.size(); i++) { + if (uDlg->m_tabs[i] != NULL) { + TabCtrl_GetItemRect(uDlg->m_hwndTabs, i, &rc); + if (PtInRect(&rc, pt)) + break; } } + + if (i < uDlg->m_tabs.size()) { + uDlg->m_tabs[i]->m_job->createToolTip(); + HWND hToolTip = TabCtrl_GetToolTips(uDlg->m_hwndTabs); + SendMessage(hToolTip, TTM_SETMAXTIPWIDTH, 0, (LPARAM)500); + pInfo->lpszText = uDlg->m_tszToolTipText; + } + break; } - case WM_CLOSE: + break; + + case WM_CLOSE: { - for (UINT i = 0; i < uDlg->tabs.size(); i++) - uDlg->tabs[i]->job->pause(); + for (UINT i = 0; i < uDlg->m_tabs.size(); i++) + uDlg->m_tabs[i]->m_job->pause(); - int result = IDYES; + int result = IDYES; if (!Miranda_Terminated() && UploadJob::iRunningJobCount > 0) result = Utils::msgBox(TranslateT("Do you really want to cancel all running jobs?"), MB_YESNO | MB_ICONQUESTION); - if (result == IDYES) - { + if (result == IDYES) { SkinPlaySound(SOUND_CANCEL); - size_t count = uDlg->tabs.size(); - for (UINT i = 0; i < count; i++) - uDlg->tabs[0]->job->closeAllTabs(); + size_t count = uDlg->m_tabs.size(); + for (UINT i = 0; i < count; i++) + uDlg->m_tabs[0]->m_job->closeAllTabs(); + } + else { + for (UINT i = 0; i < uDlg->m_tabs.size(); i++) + uDlg->m_tabs[i]->m_job->resume(); } - else - { - for (UINT i = 0; i < uDlg->tabs.size(); i++) - uDlg->tabs[i]->job->resume(); - } - - break; - } - case WMU_DESTROY: - { - DestroyWindow(hwndDlg); - break; } + break; + + case WMU_DESTROY: + DestroyWindow(hwndDlg); + break; } return FALSE; -} \ No newline at end of file +} -- cgit v1.2.3