Naming behaviour for "Join with tab"

You've found a bug in PopMan? Tell me about it!

Moderator: Christian

Post Reply
Darkbee
Posts: 37
Joined: 02 Mar 2005, 15:30

Naming behaviour for "Join with tab"

Post by Darkbee » 22 Mar 2005, 23:46

Not really a bug as such but something you might want to change.

When I use the "join with tab" option, the parent tab gets renamed. This is kind of annoying since if I have a tab set up already with several accounts and then add a new tab I have to rename the tab with several accounts.

I think it would be better if the child tab just gets merged with the parent tab and the name of the parent tab stays the same.

(hope this makes sense, not sure if I explained it very well)

User avatar
Christian
Site Admin
Posts: 315
Joined: 11 Jan 2004, 13:04
Location: Magdeburg, Germany
Contact:

Post by Christian » 23 Mar 2005, 01:51

When I use the "join with tab" option, the parent tab gets renamed. This is kind of annoying since if I have a tab set up already with several accounts and then add a new tab I have to rename the tab with several accounts.
The parent tab gets renamed only if its caption has not been changed by the user. So when you have a special named multi-account tab and want to join it with a default named single-account tab, make the multi-account tab the parent and use the menu item "join with tab" > the single-acc tab (or left-click the tab while pressing Ctrl). Because the parent tab has a user defined caption, it will not be renamed. This is what you want, right?
Christian Hübner

Darkbee
Posts: 37
Joined: 02 Mar 2005, 15:30

Post by Darkbee » 23 Mar 2005, 19:43

Yes, you are correct but it seems that what you describe is ONLY true if I use CTRL + Tab Click. However, If I select a tab and then use the menu method "join with tab" then the parent tab gets renamed.

In a nutshell, it sounds like you have the behaviour coded correctly but you are not linking it with the menu action, only the keyboard action.

User avatar
Christian
Site Admin
Posts: 315
Joined: 11 Jan 2004, 13:04
Location: Magdeburg, Germany
Contact:

Post by Christian » 23 Mar 2005, 20:06

Sorry, I can't reproduce the problem. I can't even imagine that the behaviour is different for menu and mouse because in either case a common "JoinTabs(master, slave)" routine is called that does the job:

Code: Select all

void CPopManView::JoinTabs(int Master, int Slave)
{
	if(Master == Slave) return;
	if(Master < 0 || Master >= m_TabArray.GetSize()) return;
	if(Slave < 0  || Slave >= m_TabArray.GetSize()) return;


	CAccounts& Accounts = m_TabArray[Slave].Accounts;
	POSITION pos = Accounts.GetHeadPosition();
	while(pos != NULL)
	{
		CAccount* pAcc = Accounts.GetNext(pos);
		m_TabArray[Master].Accounts.AddTail(pAcc);
	}

	if(m_TabArray[Master].bAutoCaption) // rename tab only if not user defined
		m_Tab.SetItemCaption(Master, GetAutoTabCaption(m_TabArray[Master].Accounts));
	
	m_TabArray.RemoveAt(Slave);
	m_Tab.DeleteItem(Slave);

	SetActiveTab(Master  - (Slave < Master ? 1 : 0));
	UpdateTabIcon(Master - (Slave < Master ? 1 : 0));
}
:?:
Christian Hübner

Darkbee
Posts: 37
Joined: 02 Mar 2005, 15:30

Post by Darkbee » 24 Mar 2005, 06:29

I think I have figured it out...

If I have two tabs A and B with A having a custom name and B having default name then:

When I select tab A and use the "join with tab" on tab B, tab A does not get renamed. However, if I do it the other way around and select tab B and use the "join with tab" on tab A, then tab B gets renamed. I realize now that the first tab that I select is always considered the master tab.

In my mind I had fixed tab A as being the master and tab B as being the slave regardless of which one I selected first (because only tab A has a custom name). I am sorry for the confusion, this was my mistake of not understanding the tab system more clearly.

Perhaps the menu label would be better of saying "Add to tab" as this would imply a direction from slave to master. I think my confusion is because "join" implies merging two tabs together without one being precedent over the other (which I now know isn't true).

Hope this clears up the mystery and once again, sorry for the confusion.

User avatar
Christian
Site Admin
Posts: 315
Joined: 11 Jan 2004, 13:04
Location: Magdeburg, Germany
Contact:

Post by Christian » 25 Mar 2005, 15:04

I think I will keep Join with tab because this label makes clear what the command is supposed to do (although not exactly how). The label Add to tab implies that the operation is asymmetric, but it does not express the direction! There are 2 different interpretations:

1) Add the current tab to the selected tab of the popup menu
2) Add the selected tab of the popup menu to the current tab (this what you mean)
Christian Hübner

Post Reply