while doing some work for AnalyZZUL, I noticed that the official eMule's menu structure could be improved in some way:
Affected files:
ClientListCtrl.cpp, QueueListCtrl.cpp, DownloadListCtrl.cpp, UploadListCtrl.cpp
Problem:
It's quite useless to have both "add to friends" and "remove from friends" entries for one single client. In fact, that client either is a friend or is not a friend.
So I'd propose to merge these entries into one:
::oncontextmenu:
(...) ClientMenu.AddMenuTitle(GetResString(IDS_CLIENTS), true); ClientMenu.AppendMenu(MF_STRING | (client ? MF_ENABLED : MF_GRAYED), MP_DETAIL, GetResString(IDS_SHOWDETAILS), _T("CLIENTDETAILS")); ClientMenu.SetDefaultItem(MP_DETAIL); // ---- [toggle friends] // ClientMenu.AppendMenu(MF_STRING | ((client && client->IsEd2kClient() && !client->IsFriend()) ? MF_ENABLED : MF_GRAYED), MP_ADDFRIEND, GetResString(IDS_ADDFRIEND), _T("ADDFRIEND")); if (client && client->IsEd2kClient()) { if (!client->IsFriend()) ClientMenu.AppendMenu(MF_STRING, MP_ADDFRIEND, GetResString(IDS_ADDFRIEND), _T("ADDFRIEND")); else ClientMenu.AppendMenu(MF_STRING, MP_REMOVEFRIEND, GetResString(IDS_REMOVEFRIEND), _T("DELETEFRIEND")); } // ---- [/toggle friends] ClientMenu.AppendMenu(MF_STRING | ((client && client->IsEd2kClient()) ? MF_ENABLED : MF_GRAYED), MP_MESSAGE, GetResString(IDS_SEND_MSG), _T("SENDMESSAGE")); ClientMenu.AppendMenu(MF_STRING | ((client && client->IsEd2kClient() && client->GetViewSharedFilesSupport()) ? MF_ENABLED : MF_GRAYED), MP_SHOWLIST, GetResString(IDS_VIEWFILES), _T("VIEWFILES")); (...)
::OnCommand:
(...) case MP_ADDFRIEND: if (theApp.friendlist->AddFriend(client)) Update(iSel); break; // ---- [toggle friends] case MP_REMOVEFRIEND: theApp.friendlist->RemoveFriend(client->m_Friend); Update(iSel); break; // ---- [/toggle friends] case MP_DETAIL: case MPG_ALTENTER: case IDA_ENTER: (...)
Of course this doesn't apply to the FriendsListCtrl which actually needs both entries.
Any comments?
This post has been edited by Tuxman: 06 September 2008 - 04:48 PM