Added doubleclick to join a lobby.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4857 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-01-27 18:51:27 +00:00
parent cf5d88ab8b
commit 0cf53e993e
2 changed files with 11 additions and 17 deletions

View file

@ -96,7 +96,6 @@ void ChatLobbyWidget::lobbyTreeWidgetCostumPopupMenu()
} }
} }
contextMnu.exec(QCursor::pos()); contextMnu.exec(QCursor::pos());
} }
@ -273,9 +272,8 @@ void ChatLobbyWidget::createChatLobby()
CreateLobbyDialog(friends).exec(); CreateLobbyDialog(friends).exec();
} }
void ChatLobbyWidget::subscribeItem() static void subscribeLobby(QTreeWidgetItem *item)
{ {
QTreeWidgetItem *item = lobbyTreeWidget->currentItem();
if (item == NULL && item->type() != TYPE_LOBBY) { if (item == NULL && item->type() != TYPE_LOBBY) {
return; return;
} }
@ -289,6 +287,11 @@ void ChatLobbyWidget::subscribeItem()
} }
} }
void ChatLobbyWidget::subscribeItem()
{
subscribeLobby(lobbyTreeWidget->currentItem());
}
void ChatLobbyWidget::unsubscribeItem() void ChatLobbyWidget::unsubscribeItem()
{ {
QTreeWidgetItem *item = lobbyTreeWidget->currentItem(); QTreeWidgetItem *item = lobbyTreeWidget->currentItem();
@ -308,18 +311,7 @@ void ChatLobbyWidget::unsubscribeItem()
void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int column) void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int column)
{ {
// Each lobby can be joined directly, by calling subscribeLobby(item);
// rsMsgs->joinPublicLobby(chatLobbyId) ;
// e.g. fill a list of public lobbies
// also maintain a list of active chat lobbies. Each active (subscribed) lobby has a lobby tab in the gui.
// Each tab knows its lobby id and its virtual peer id (the one to send private chat messages to)
//
// One possibility is to convert ChatLobbyDialog to be used at a chat lobby tab.
// then the lobby can be accessed using the virtual peer id through
// rsMsgs->getVirtualPeerId(ChatLobbyId,std::string& virtual_peer_id)
} }
void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& nickname, const QString& str) void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& nickname, const QString& str)

View file

@ -163,6 +163,9 @@ p, li { white-space: pre-wrap; }
<property name="itemsExpandable"> <property name="itemsExpandable">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="expandsOnDoubleClick"> <property name="expandsOnDoubleClick">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -174,8 +177,7 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QWidget" name="lobbyInfo"> <widget class="QWidget" name="lobbyInfo" native="true"/>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>