jkollss

Member
  • Content count

    9
  • Joined

  • Last visited

Everything posted by jkollss

  1. Note to this patch: You have to create some NewChatMessage.ico file in the res\ directory. I did this just painted the standard Apex icon to the red. You can create that icon as you wish. Also, this patch is quick and can be optimized to prevent copy-paste of the code. Take this just as an idea. And setup settings also maybe has to be implemented about that feature. I used this on my own not so active hub, and found it very usable. diff --git a/StrongDC.rc b/StrongDC.rc index 2f7574e..ed7bbcb 100644 IDD_LINE DIALOGEX 0, 0, 239, 46 @@ -1449,6 +1449,7 @@ IDR_NET_STATS ICON "res\\netstats.ico" IDR_UPLOAD_QUEUE ICON "res\\uqueue.ico" IDR_PRIVATE_OFF ICON "res\\UserOff.ico" IDR_HUB_OFF ICON "res\\HubOff.ico" +IDR_NEW_CHAT_MESSAGE ICON "res\\NewChatMessage.ico" #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// diff --git a/res/NewChatMessage.ico b/res/NewChatMessage.ico new file mode 100644 index 0000000..be60bd0 Binary files /dev/null and b/res/NewChatMessage.ico differ diff --git a/strongdc.vcproj b/strongdc.vcproj index 4926588..c607ec3 100644 --- a/strongdc.vcproj +++ b/strongdc.vcproj @@ -308,6 +308,10 @@ > </File> <File + RelativePath=".\res\NewChatMessage.ico" + > + </File> + <File RelativePath=".\res\notepad.ico" > </File> diff --git a/windows/HubFrame.cpp b/windows/HubFrame.cpp index f68101d..33d40e7 100644 --- a/windows/HubFrame.cpp +++ b/windows/HubFrame.cpp @@ -714,6 +714,10 @@ LRESULT HubFrame::onSpeaker(UINT /*uMsg*/, WPARAM /* wParam */, LPARAM /* lParam (msg.from.isOp() && !client->isOp())) { addLine(msg.from, Text::toT(msg.str), WinUtil::m_ChatTextGeneral); } + if((BOOLSETTING(OLD_TRAY_BEHAV) && BOOLSETTING(MINIMIZE_TRAY)) || !BOOLSETTING(OLD_TRAY_BEHAV)) { + HWND hMainWnd = MainFrame::getMainFrame()->m_hWnd;//GetTopLevelWindow(); + ::PostMessage(hMainWnd, WM_SPEAKER, MainFrame::SET_NEWCHATMSG_ICON, NULL); + } } else if(i->first == ADD_STATUS_LINE) { addClientLine(Text::toT(static_cast<StringTask*>(i->second)->str), WinUtil::m_ChatTextServer ); } else if(i->first == ADD_SILENT_STATUS_LINE) { diff --git a/windows/MainFrm.cpp b/windows/MainFrm.cpp index 28025d3..70a044b 100644 --- a/windows/MainFrm.cpp +++ b/windows/MainFrm.cpp @@ -79,7 +79,7 @@ bool MainFrame::m_bDisableAutoComplete = false; MainFrame::MainFrame() : trayMessage(0), maximized(false), lastUpload(-1), lastUpdate(0), lastUp(0), lastDown(0), oldshutdown(false), stopperThread(NULL), c(new HttpConnection()), au(NULL), closing(false), awaybyminimize(false), missedAutoConnect(false), lastTTHdir(Util::emptyStringT), tabsontop(false), -bTrayIcon(false), bAppMinimized(false), bIsPM(false), UPnP_TCPConnection(NULL), UPnP_UDPConnection(NULL), +bTrayIcon(false), bAppMinimized(false), bIsPM(false), bIsNewChatMsg(false), UPnP_TCPConnection(NULL), UPnP_UDPConnection(NULL), QuickSearchBoxContainer(WC_COMBOBOX, this, QUICK_SEARCH_MAP), QuickSearchEditContainer(WC_EDIT ,this, QUICK_SEARCH_MAP) { memzero(statusSizes, sizeof(statusSizes)); anyMF = this; @@ -409,6 +409,7 @@ LRESULT MainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, normalicon.hIcon = (HICON)::LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); pmicon.hIcon = (HICON)::LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_TRAY_PM), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + newchatmsgicon.hIcon = (HICON)::LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_NEW_CHAT_MESSAGE), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); updateTray((BOOLSETTING(OLD_TRAY_BEHAV) && BOOLSETTING(MINIMIZE_TRAY)) || !BOOLSETTING(OLD_TRAY_BEHAV)); @@ -822,7 +823,18 @@ LRESULT MainFrame::onSpeaker(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& ::Shell_NotifyIcon(NIM_MODIFY, &nid); bIsPM = true; } - } + } else if (wParam == SET_NEWCHATMSG_ICON) { + if (bIsNewChatMsg == false && (!WinUtil::isAppActive || bAppMinimized) && bTrayIcon == true) { + NOTIFYICONDATA nid; + nid.cbSize = sizeof(NOTIFYICONDATA); + nid.hWnd = m_hWnd; + nid.uID = 0; + nid.uFlags = NIF_ICON; + nid.hIcon = newchatmsgicon.hIcon; + ::Shell_NotifyIcon(NIM_MODIFY, &nid); + bIsNewChatMsg = true; + } + } return 0; } @@ -1214,6 +1226,16 @@ LRESULT MainFrame::onSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& ::Shell_NotifyIcon(NIM_MODIFY, &nid); bIsPM = false; } + if (bIsNewChatMsg && bTrayIcon == true) { + NOTIFYICONDATA nid; + nid.cbSize = sizeof(NOTIFYICONDATA); + nid.hWnd = m_hWnd; + nid.uID = 0; + nid.uFlags = NIF_ICON; + nid.hIcon = normalicon.hIcon; + ::Shell_NotifyIcon(NIM_MODIFY, &nid); + bIsNewChatMsg = false; + } bAppMinimized = false; } @@ -1340,6 +1362,7 @@ LRESULT MainFrame::OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, DestroyIcon(hIconStatusDown); DestroyIcon(hIconStatusUp); DestroyIcon(pmicon.hIcon); + DestroyIcon(newchatmsgicon.hIcon); bHandled = FALSE; } @@ -1776,6 +1799,16 @@ LRESULT MainFrame::onActivateApp(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/ ::Shell_NotifyIcon(NIM_MODIFY, &nid); bIsPM = false; } + if(bIsNewChatMsg && bTrayIcon == true) { + NOTIFYICONDATA nid; + nid.cbSize = sizeof(NOTIFYICONDATA); + nid.hWnd = m_hWnd; + nid.uID = 0; + nid.uFlags = NIF_ICON; + nid.hIcon = normalicon.hIcon; + ::Shell_NotifyIcon(NIM_MODIFY, &nid); + bIsNewChatMsg = false; + } } return 0; } diff --git a/windows/MainFrm.h b/windows/MainFrm.h index d2c24db..8c58c77 100644 --- a/windows/MainFrm.h +++ b/windows/MainFrm.h @@ -81,7 +81,8 @@ public: STATUS_MESSAGE, SHOW_POPUP, REMOVE_POPUP, - SET_PM_TRAY_ICON + SET_PM_TRAY_ICON, + SET_NEWCHATMSG_ICON }; BOOL PreTranslateMessage(MSG* pMsg) @@ -421,6 +422,7 @@ public: private: NOTIFYICONDATA normalicon; NOTIFYICONDATA pmicon; + NOTIFYICONDATA newchatmsgicon; class DirectoryListInfo { public: @@ -488,6 +490,7 @@ private: bool bTrayIcon; bool bAppMinimized; bool bIsPM; + bool bIsNewChatMsg; static bool bShutdown; static uint64_t iCurrentShutdownTime; diff --git a/windows/resource.h b/windows/resource.h index 37e3662..f477169 100644 --- a/windows/resource.h +++ b/windows/resource.h @@ -982,6 +982,7 @@ #define IDC_CHATDBLCLICKACTION 10194 #define IDC_CHAT_DBLCLICK 10195 #define IDC_HEADER_MENU 10196 +#define IDR_NEW_CHAT_MESSAGE 10197 #define ID_SHELLCONTEXTMENU_MIN 12000 #define ID_SHELLCONTEXTMENU_MAX 14000 #define IDC_BITZI_LOOKUP 20000
  2. Short magnet links [patch solution]

    I dunno about leech that client or not. I don't care. I just take useful idea and adapted it to Apex. I have no relations to flylink group. I pointed to their website only it because I took some code from their client. That's it. So, please get your paranoia back and just look at the code. Thanks.
  3. I don't know what the mess about the subject. Here is the source patch to enable "short" human readable magnet links in the chat. Part of the code was taken from FlyLinDC++. It's distributed with source and I found nothing about copyright restrictions, in particular they based on ApexDC++ code. And there is nothing hard to implement such feature anyway. diff --git a/client/Util.h b/client/Util.h index 71bce1e..1181ece 100644 --- a/client/Util.h +++ b/client/Util.h @@ -544,6 +544,24 @@ struct noCaseStringEq { } }; +template<typename T> +class AutoArray { + typedef T* TPtr; +public: + explicit AutoArray(TPtr t) : p(t) { } + explicit AutoArray(size_t size) : p(new T[size]) { } + ~AutoArray() { delete[] p; } + operator TPtr() { return p; } + TPtr get() { return p; } + AutoArray& operator=(TPtr t) { delete[] p; p = t; return *this; } +private: + AutoArray(const AutoArray&); + AutoArray& operator=(const AutoArray&); + + TPtr p; +}; + + } // namespace dcpp #endif // !defined(UTIL_H) diff --git a/windows/ChatCtrl.cpp b/windows/ChatCtrl.cpp index fb8cb15..6284423 100644 --- a/windows/ChatCtrl.cpp +++ b/windows/ChatCtrl.cpp @@ -59,8 +59,19 @@ ChatCtrl::~ChatCtrl() { void ChatCtrl::AdjustTextSize() { if(GetWindowTextLength() > SETTING(CHATBUFFERSIZE)) { - // After 25000 charecters, w95 becomes sad... + // After 25000 characters, w95 becomes sad... SetRedraw(FALSE); + // [jkollss] + int g = LineIndex(LineFromChar(2000)); + for (TURLMap::iterator i = lURLMap.begin(); i != lURLMap.end();) + { + i->first -= g; + if (i->first < 0) + lURLMap.erase(i++); + else + i++; + } + // SetSel(0, LineIndex(LineFromChar(2000))); ReplaceSel(_T("")); SetRedraw(TRUE); @@ -267,6 +278,7 @@ void ChatCtrl::AppendTextOnly(const tstring& sMyNick, const TCHAR* sText, CHARFO // Zvyrazneni vsech URL a nastaveni "klikatelnosti" long lSearchFrom = 0; + tstring ls; for(size_t i = 0; i < (sizeof(Links) / sizeof(Links[0])); i++) { long linkStart = sMsgLower.Find(Links[i], lSearchFrom); while(linkStart > 0) { @@ -281,6 +293,32 @@ void ChatCtrl::AppendTextOnly(const tstring& sMyNick, const TCHAR* sText, CHARFO linkEnd = _tcslen(sMsgLower); } SetSel(lSelBegin + linkStart, lSelBegin + linkEnd); + // [jkolls] Shorten magnet link + AutoArray<TCHAR> cURL(linkEnd - linkStart + 1); + GetTextRange(lSelBegin + linkStart, lSelBegin + linkEnd, cURL); + ls = cURL; + if (_strnicmp(Text::fromT(cURL.get()).c_str(), "magnet:?", 8) == 0) + { + string sFileName = Text::fromT(cURL.get()); + int dn = sFileName.find("dn="); + if (dn == string::npos) + sFileName = "Unnamed magnet-link"; + else + sFileName = sFileName.substr(dn + 3); + sFileName = Util::encodeURI(sFileName, true); + tstring sFileSize = cURL; + int64_t filesize = Util::toInt64(Text::fromT(sFileSize.substr(sFileSize.find(_T("xl=")) + 3, sFileSize.find(_T("&")) - sFileSize.find(_T("xl="))))); + ls = Text::toT(sFileName) + _T(" (") + Util::formatBytesW(filesize) + _T(")"); + ReplaceSel(ls.c_str()); + tstring tmp = sMsgLower.Left(linkStart); + tmp += ls; + tmp += sMsgLower.Mid(linkEnd); + sMsgLower = tmp.c_str(); + linkEnd = linkStart + ls.length(); + SetSel(lSelBegin + linkStart, lSelBegin + linkEnd); + lURLMap.push_back(make_pair(lSelBegin + linkStart, cURL.get())); + } + // SetSelectionCharFormat(WinUtil::m_TextStyleURL); linkStart = sMsgLower.Find(Links[i], linkEnd); } diff --git a/windows/ChatCtrl.h b/windows/ChatCtrl.h index 14951ad..680b2f8 100644 --- a/windows/ChatCtrl.h +++ b/windows/ChatCtrl.h @@ -34,6 +34,7 @@ #endif class UserInfo; +typedef list<pair<int, tstring>> TURLMap; class ChatCtrl: public CRichEditCtrl, public CMessageMap, public UCHandler<ChatCtrl> { @@ -129,6 +130,22 @@ public: // We wanna control the scrolling... } + // [jkollss] + TURLMap lURLMap; + tstring get_URL(ENLINK* p_EL) const + { + const long lBegin = p_EL->chrg.cpMin, lEnd = p_EL->chrg.cpMax; + for (TURLMap::const_iterator i = lURLMap.begin(); i != lURLMap.end(); ++i) + if (i->first == lBegin) + return i->second; + AutoArray<TCHAR> sURLTemp(lEnd - lBegin+1); + sURLTemp[0] = 0; + GetTextRange(lBegin, lEnd, sURLTemp); + return tstring(sURLTemp); + } + // + static tstring sSelectedURL; + private: bool HitNick(const POINT& p, tstring& sNick, int& iBegin , int& iEnd); bool HitIP(const POINT& p, tstring& sIP, int& iBegin, int& iEnd); @@ -147,7 +164,6 @@ private: static tstring sSelectedLine; static tstring sSelectedIP; static tstring sSelectedUser; - static tstring sSelectedURL; }; diff --git a/windows/HubFrame.cpp b/windows/HubFrame.cpp index 449ad9c..b8d8960 100644 --- a/windows/HubFrame.cpp +++ b/windows/HubFrame.cpp @@ -55,6 +55,7 @@ ResourceManager::Strings HubFrame::columnNames[] = { ResourceManager::NICK, Reso ResourceManager::VERSION, ResourceManager::MODE, ResourceManager::HUBS, ResourceManager::SLOTS }; extern CAGEmotionSetup* g_pEmotionsSetup; +//tstring sSelectedURL = Util::emptyStringT; LRESULT HubFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { @@ -2438,6 +2439,57 @@ LRESULT HubFrame::onEmoPackChange(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl return 0; } +// [jkollss] +LRESULT HubFrame::onClientEnLink(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + ENLINK* pEL = (ENLINK*)pnmh; + + if (pEL->msg == WM_LBUTTONUP) + { + tstring sURL = ctrlClient.get_URL(pEL); + WinUtil::openLink(sURL); + } + else if(pEL->msg == WM_RBUTTONUP) + { + ctrlClient.sSelectedURL = ctrlClient.get_URL(pEL); + ctrlClient.SetSel(pEL->chrg.cpMin, pEL->chrg.cpMax); + ctrlClient.InvalidateRect(NULL); + return 0; + } + return 0; +} + +LRESULT HubFrame::onMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) +{ + RECT rc; + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; // location of mouse click + // Get the bounding rectangle of the client area. + ctrlClient.GetClientRect(&rc); + ctrlClient.ScreenToClient(&pt); + if (PtInRect(&rc, pt)) + { + ctrlClient.sSelectedURL = _T(""); + return TRUE; + } + return 1; +} + +LRESULT HubFrame::onRButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) +{ + RECT rc; + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; // location of mouse click + + // Get the bounding rectangle of the client area. + ctrlClient.GetClientRect(&rc); + ctrlClient.ScreenToClient(&pt); + if (PtInRect(&rc, pt)) + { + ctrlClient.sSelectedURL = _T(""); + } + return 1; +} + + /** * @file * $Id: HubFrame.cpp 382 2008-03-09 10:40:22Z BigMuscle $ diff --git a/windows/HubFrame.h b/windows/HubFrame.h index 7da4749..be816f3 100644 --- a/windows/HubFrame.h +++ b/windows/HubFrame.h @@ -136,7 +136,9 @@ public: LRESULT onSelChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onCtlColor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); LRESULT onFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); - LRESULT onClientEnLink(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) { return ctrlClient.onClientEnLink(idCtrl, pnmh, bHandled); } + LRESULT onRButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); + LRESULT onMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); + LRESULT onClientEnLink(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); // [jkollss] { return ctrlClient.onClientEnLink(idCtrl, pnmh, bHandled); } LRESULT onSelectUser(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onPrivateMessage(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onPublicMessage(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); diff --git a/windows/PrivateFrame.cpp b/windows/PrivateFrame.cpp index 2dfaa29..f78a7cd 100644 --- a/windows/PrivateFrame.cpp +++ b/windows/PrivateFrame.cpp @@ -809,6 +809,24 @@ LRESULT PrivateFrame::onEmoticons(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndC return 0; } +LRESULT PrivateFrame::onClientEnLink(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + //return ctrlClient.onClientEnLink(idCtrl, pnmh, bHandled); + ENLINK* pEL = (ENLINK*)pnmh; + + if ( pEL->msg == WM_LBUTTONUP ) { + tstring sURL = ctrlClient.get_URL(pEL); + WinUtil::openLink(sURL); + + } else if(pEL->msg == WM_RBUTTONUP) { + pSelectedURL = ctrlClient.get_URL(pEL); + ctrlClient.SetSel(pEL->chrg.cpMin, pEL->chrg.cpMax); + ctrlClient.InvalidateRect(NULL); + return 0; + } + return 0; +} + /** * @file * $Id: PrivateFrame.cpp 382 2008-03-09 10:40:22Z BigMuscle $ diff --git a/windows/PrivateFrame.h b/windows/PrivateFrame.h index 57635f8..6fc98aa 100644 --- a/windows/PrivateFrame.h +++ b/windows/PrivateFrame.h @@ -98,7 +98,7 @@ public: LRESULT onAddToFavorites(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onTabContextMenu(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/); LRESULT onContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT onClientEnLink(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) { return ctrlClient.onClientEnLink(idCtrl, pnmh, bHandled); } + LRESULT onClientEnLink(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);// { return ctrlClient.onClientEnLink(idCtrl, pnmh, bHandled); } LRESULT onOpenUserLog(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onEmoPackChange(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); LRESULT onEmoticons(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& bHandled);
  4. file lists of users with colers

    This feature will reduce the search performance a lot. It has to be experts only configurable in my opinion.
  5. Short magnet links [patch solution]

    OK guys, I just want to get our favorite client better =)
  6. Sorry, maybe I put this to wrong topic, please move this to the proper one. Thanks. Here is a git patch which adds a feature to save user list column sort order between the sessions: I wrote it and found quite useful. diff --git a/client/SettingsManager.cpp b/client/SettingsManager.cpp index f77f72f..f5af4f7 100644 --- a/client/SettingsManager.cpp +++ b/client/SettingsManager.cpp @@ -143,7 +143,7 @@ const string SettingsManager::settingTags[] = "ShowQSearch", "SearchDetectHash", "ZionTabs", "NonHubsFront", "GlobalMiniTabs", "BlendOffline", "MaxResizeLines", "CheckClientBeforeFileList", "MaxTestSURs", "MaxFileLists", "CheckDelay", "SleepTime", "DelayedRawSending", "NatSort", "DontShareEmptyDirs", "OnlyShareFullDirs", "UseCustomListBackground", "ProtectedColour", "UseFavNames", - "EnableIpGuard", "DefaultPolicy", + "EnableIpGuard", "DefaultPolicy", "UserlistSortColumn", "UserlistSortAscending", "SENTRY", // Int64 "TotalUpload", "TotalDownload", @@ -536,6 +536,8 @@ SettingsManager::SettingsManager() setDefault(USE_FAV_NAMES, false); setDefault(ENABLE_IPGUARD, false); setDefault(DEFAULT_POLICY, false); + setDefault(USERLIST_SORTCOLUMN, -1); + setDefault(USERLIST_SORTASCENDING, true); setDefault(MAIN_WINDOW_STATE, SW_SHOWNORMAL); setDefault(MAIN_WINDOW_SIZE_X, CW_USEDEFAULT); diff --git a/client/SettingsManager.h b/client/SettingsManager.h index 13e5879..f1fd25d 100644 --- a/client/SettingsManager.h +++ b/client/SettingsManager.h @@ -154,7 +154,7 @@ public: SHOW_QUICK_SEARCH, SEARCH_DETECT_TTH, ZION_TABS, NON_HUBS_FRONT, GLOBAL_MINI_TABS, BLEND_OFFLINE_SEARCH, MAX_RESIZE_LINES, CHECK_CLIENT_BEFORE_FILELIST, MAX_TESTSURS, MAX_FILELISTS, CHECK_DELAY, SLEEP_TIME, DELAYED_RAW_SENDING, NAT_SORT, DONT_SHARE_EMPTY_DIRS, ONLY_SHARE_FULL_DIRS, USE_CUSTOM_LIST_BACKGROUND, PROTECTED_COLOUR, USE_FAV_NAMES, - ENABLE_IPGUARD, DEFAULT_POLICY, + ENABLE_IPGUARD, DEFAULT_POLICY, USERLIST_SORTCOLUMN, USERLIST_SORTASCENDING, INT_LAST }; enum Int64Setting { INT64_FIRST = INT_LAST + 1, diff --git a/windows/HubFrame.cpp b/windows/HubFrame.cpp index b8d8960..f68101d 100644 --- a/windows/HubFrame.cpp +++ b/windows/HubFrame.cpp @@ -151,7 +151,14 @@ LRESULT HubFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, ctrlUsers.setFlickerFree(WinUtil::bgBrush); ctrlClient.SetBackgroundColor(WinUtil::bgColor); - ctrlUsers.setSortColumn(OnlineUser::COLUMN_NICK); + bool bSortAsc = SETTING(USERLIST_SORTASCENDING); + ctrlUsers.setAscending(bSortAsc); + int nSortColumn = SETTING(USERLIST_SORTCOLUMN); + if (nSortColumn >= OnlineUser::COLUMN_FIRST && nSortColumn < OnlineUser::COLUMN_LAST) + ctrlUsers.setSortColumn(nSortColumn); + else + ctrlUsers.setSortColumn(OnlineUser::COLUMN_NICK); + ctrlUsers.SetImageList(WinUtil::userImages, LVSIL_SMALL); @@ -936,6 +943,11 @@ LRESULT HubFrame::onClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, B clearUserList(); clearTaskList(); + int nSortColumn = ctrlUsers.getSortColumn(); + SettingsManager::getInstance()->set(SettingsManager::USERLIST_SORTCOLUMN, nSortColumn); + bool bAscend = ctrlUsers.isAscending(); + SettingsManager::getInstance()->set(SettingsManager::USERLIST_SORTASCENDING, bAscend); + string tmp, tmp2, tmp3; ctrlUsers.saveHeaderOrder(tmp, tmp2, tmp3); With best regards, Sergey.
  7. Plugins

    I have tryed plugins new feature. What can I say. 1) Plugin documentation is absent, at least I tried to follow the link on the page http://www.apexdc.net/changelog/ - it is Feature: Plugin API (view documentation) (view documentation - points to nowhere) Or maybe points to the forum topic which is unavailable to me. 2) Plugin API is very RAW. For instance, I wants to develop a plugin which will be sows me some last chat messages, and be on the top always. I have wrote such plugin, but that was not so easy. Because there is no any interface to the existing features of Apex, there is no interface to some utilites, such of convertion from UTF or into to UTF etc. So. currently the plugin API is complete unusaable, in my point of view. But it is very high step forward? anyway. Looking for more improvement plugin API. With best regads, Sergey.
  8. Plugins

    Hi, It is me again Plugin has no access to specific Apex classes. For example: I want to overlap the ::onChat event and the parameters in that evens are in UTF8 format. So the rich edit control understands only plain ascii format, so I have to convert UTF8 to ansi. But I cannot, because the text.h and text.cpp are depending of too much of sources to include into plugin. getCallBack()->.. function aren't provide UTF-ansi conversion. And even more - the callback onChat(ClientInterface *client, string& text) - will provide the limited functionality. Why you don't provide the full chat callback with the timestamp and so other maybe in some special function like onCompleteChat( or whatever. Thanks, for your attention, With best regards, Sergey
  9. Plugins

    I understand any risks, and I tried plugin IP in spite of there was no docs, just looking for source. The Idea is very great! Nobody has sush feature in the their own clone based on Apex I very liked Apex project and I can help the project for example, to develop some plugins. I'm a Russian, so I already have a lot of plugins features specially to Russian users, and not only related to them. So it because I very interested in good plugin API. Of course I can give you some free help to improve it. Thanks for your attention!