Official eMule-Board: Toggle Friends - Official eMule-Board

Jump to content


Page 1 of 1

Toggle Friends Don't waste menu space

#1 User is offline   Tuxman 

  • lizzie and prog-rock fanatic
  • PipPipPipPipPipPipPip
  • Group: Validating
  • Posts: 2707
  • Joined: 26-July 04

Post icon  Posted 06 September 2008 - 03:33 PM

Hi,

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

[ eMule beba ] :: v2.72 released, v3.00 in the works ...
- feel the lightweight! - featuring Snarl support, the Client Analyzer and tits!
Coded by a Golden eMule Award winner and most people's favorite modder!
..........................................
Music, not muzak:
Progressive Rock :: my last.fm profile
..........................................
eMule user since 0.28 ...
-[ ... and thanks for all the fish! ]-
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users