From: <arn...@us...> - 2007-12-13 22:28:48
|
Revision: 939 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=939&view=rev Author: arnetheduck Date: 2007-12-13 14:28:47 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Remove some cruft Modified Paths: -------------- dcplusplus/trunk/changelog.txt dcplusplus/trunk/win32/HubFrame.cpp dcplusplus/trunk/win32/MainWindow.h dcplusplus/trunk/win32/WaitingUsersFrame.cpp dcplusplus/trunk/win32/WaitingUsersFrame.h Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/changelog.txt 2007-12-13 22:28:47 UTC (rev 939) @@ -29,6 +29,7 @@ * Fixed state checks for uploads (an invalid sequence could possibly crash client from remote) * Page up/down in private chat scrolls chat log just as in hub chat * Fixed crash on right-click in the download queue (poy) +* Readded waiting users frame keyboard shortcut -- 0.703 2007-11-08 -- * Fixed invalid strings (thanks james ross) Modified: dcplusplus/trunk/win32/HubFrame.cpp =================================================================== --- dcplusplus/trunk/win32/HubFrame.cpp 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/HubFrame.cpp 2007-12-13 22:28:47 UTC (rev 939) @@ -1198,17 +1198,6 @@ layout(); } -#ifdef PORT_ME - -LRESULT HubFrame::OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) { - LPMSG pMsg = (LPMSG)lParam; - if((pMsg->message >= WM_MOUSEFIRST) && (pMsg->message <= WM_MOUSELAST)) - ctrlLastLines.RelayEvent(pMsg); - return 0; -} - -#endif - void HubFrame::handleCopyNick() { int i=-1; string nicks; @@ -1234,64 +1223,6 @@ } } -#ifdef PORT_ME -static const COLORREF RED = RGB(255, 0, 0); -static const COLORREF GREEN = RGB(0, 255, 0); - -LRESULT HubFrame::onLButton(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - HWND focus = GetFocus(); - bHandled = false; - if(focus == ctrlClient.m_hWnd) { - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; - tstring x; - tstring::size_type start = (tstring::size_type)WinUtil::textUnderCursor(pt, ctrlClient, x); - tstring::size_type end = x.find(_T(" "), start); - - if(end == tstring::npos) - end = x.length(); - - bHandled = WinUtil::parseDBLClick(x, start, end); - if (!bHandled) { - string::size_type end = x.find_first_of(_T(" >\t"), start+1); - - if(end == tstring::npos) // get EOL as well - end = x.length(); - else if(end == start + 1) - return 0; - - // Nickname click, let's see if we can find one like it in the name list... - tstring nick = x.substr(start, end - start); - UserInfo* ui = findUser(nick); - if(ui) { - bHandled = true; - if (wParam & MK_CONTROL) { // MK_CONTROL = 0x0008 - PrivateFrame::openWindow(ui->user); - } else if (wParam & MK_SHIFT) { - try { - QueueManager::getInstance()->addList(ui->user, QueueItem::FLAG_CLIENT_VIEW); - } catch(const Exception& e) { - addClientLine(Text::toT(e.getError())); - } - } else if(showUsers->getChecked()) { - int items = ctrlUsers.GetItemCount(); - int pos = -1; - ctrlUsers.SetRedraw(FALSE); - for(int i = 0; i < items; ++i) { - if(ctrlUsers.getData(i) == ui) - pos = i; - ctrlUsers.SetItemState(i, (i == pos) ? LVIS_SELECTED | LVIS_FOCUSED : 0, LVIS_SELECTED | LVIS_FOCUSED); - } - ctrlUsers.SetRedraw(TRUE); - ctrlUsers.EnsureVisible(pos, FALSE); - } - } - } - } - return 0; -} - -#endif - void HubFrame::runUserCommand(const UserCommand& uc) { if(!WinUtil::getUCParams(this, uc, ucLineParams)) return; @@ -1448,23 +1379,6 @@ } } -#ifdef PORT_ME -LRESULT HubFrame::onGetToolTip(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { - NMTTDISPINFO* nm = (NMTTDISPINFO*)pnmh; - lastLines.clear(); - for(TStringIter i = lastLinesList.begin(); i != lastLinesList.end(); ++i) { - lastLines += *i; - lastLines += _T("\r\n"); - } - if(lastLines.size() > 2) { - lastLines.erase(lastLines.size() - 2); - } - nm->lpszText = const_cast<TCHAR*>(lastLines.c_str()); - return 0; -} - -#endif - void HubFrame::resortUsers() { for(FrameIter i = frames.begin(); i != frames.end(); ++i) (*i)->resortForFavsFirst(true); Modified: dcplusplus/trunk/win32/MainWindow.h =================================================================== --- dcplusplus/trunk/win32/MainWindow.h 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/MainWindow.h 2007-12-13 22:28:47 UTC (rev 939) @@ -200,46 +200,6 @@ virtual void on(QueueManagerListener::Finished, QueueItem* qi, const string& dir, int64_t speed) throw(); virtual void on(PartialList, const UserPtr&, const string& text) throw(); -#ifdef PORT_ME - - virtual BOOL PreTranslateMessage(MSG* pMsg) - { - if((pMsg->message >= WM_MOUSEFIRST) && (pMsg->message <= WM_MOUSELAST)) - ctrlLastLines.RelayEvent(pMsg); - - if(CMDIFrameWindowImpl<MainFrame>::PreTranslateMessage(pMsg)) - return TRUE; - - HWND hWnd = MDIGetActive(); - if(hWnd != NULL) - return (BOOL)::SendMessage(hWnd, WM_FORWARDMSG, 0, (LPARAM)pMsg); - - return FALSE; - } - - BEGIN_MSG_MAP(MainFrame) - NOTIFY_CODE_HANDLER(TTN_GETDISPINFO, onGetToolTip) - END_MSG_MAP() - - LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT OnViewTransferView(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT onCloseWindows(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT onServerSocket(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); - - LRESULT onTrayQuit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - PostMessage(WM_CLOSE); - return 0; - } - - LRESULT onTrayShow(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - ShowWindow(SW_SHOW); - ShowWindow(maximized ? SW_MAXIMIZE : SW_RESTORE); - return 0; - } - -#endif - }; #endif // !defined(MAIN_FRM_H) Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2007-12-13 22:28:47 UTC (rev 939) @@ -40,6 +40,7 @@ addWidget(queued); queued->setColor(WinUtil::textColor, WinUtil::bgColor); queued->onContextMenu(std::tr1::bind(&WaitingUsersFrame::handleContextMenu, this, _1)); + queued->onChar(std::tr1::bind(&WaitingUsersFrame::handleChar, this, _1)); } initStatus(); @@ -190,24 +191,15 @@ speak(SPEAK_ADD_FILE, (LPARAM)new pair<UserPtr, string>(aUser, aFilename)); } -#ifdef PORT_ME - // Keyboard shortcuts -LRESULT WaitingUsersFrame::onChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) -{ - switch(wParam) - { - case VK_DELETE: +bool WaitingUsersFrame::onChar(int c) { + if(c == VK_DELETE) { onRemove(0, 0, 0, bHandled); - break; - default: - bHandled = FALSE; + return true; } - return 0; + return false; } -#endif - void WaitingUsersFrame::onRemoveUser(const UserPtr& aUser) { HTREEITEM userNode = queued->getRoot(); Modified: dcplusplus/trunk/win32/WaitingUsersFrame.h =================================================================== --- dcplusplus/trunk/win32/WaitingUsersFrame.h 2007-12-13 20:32:16 UTC (rev 938) +++ dcplusplus/trunk/win32/WaitingUsersFrame.h 2007-12-13 22:28:47 UTC (rev 939) @@ -58,7 +58,7 @@ void onRemove(); bool handleContextMenu(SmartWin::ScreenCoordinate pt); HRESULT handleSpeaker(WPARAM wParam, LPARAM lParam); - //LRESULT onChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled); + bool handleChar(int c); void onPrivateMessage(); void onGrantSlot(); void onAddToFavorites(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |