From 0cf53e993edfcac66fe7144dbfaed27e51094e50 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 27 Jan 2012 18:51:27 +0000 Subject: [PATCH] Added doubleclick to join a lobby. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4857 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 22 +++++++--------------- retroshare-gui/src/gui/ChatLobbyWidget.ui | 6 ++++-- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 740842420..9dc0ee260 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -95,7 +95,6 @@ void ChatLobbyWidget::lobbyTreeWidgetCostumPopupMenu() contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe"), this, SLOT(subscribeItem())); } } - contextMnu.exec(QCursor::pos()); } @@ -273,9 +272,8 @@ void ChatLobbyWidget::createChatLobby() CreateLobbyDialog(friends).exec(); } -void ChatLobbyWidget::subscribeItem() +static void subscribeLobby(QTreeWidgetItem *item) { - QTreeWidgetItem *item = lobbyTreeWidget->currentItem(); if (item == NULL && item->type() != TYPE_LOBBY) { return; } @@ -289,6 +287,11 @@ void ChatLobbyWidget::subscribeItem() } } +void ChatLobbyWidget::subscribeItem() +{ + subscribeLobby(lobbyTreeWidget->currentItem()); +} + void ChatLobbyWidget::unsubscribeItem() { QTreeWidgetItem *item = lobbyTreeWidget->currentItem(); @@ -308,18 +311,7 @@ void ChatLobbyWidget::unsubscribeItem() void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int column) { - // Each lobby can be joined directly, by calling - // 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) + subscribeLobby(item); } void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& nickname, const QString& str) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.ui b/retroshare-gui/src/gui/ChatLobbyWidget.ui index 6b6574dc1..4ddaffe3a 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.ui +++ b/retroshare-gui/src/gui/ChatLobbyWidget.ui @@ -163,6 +163,9 @@ p, li { white-space: pre-wrap; } false + + true + false @@ -174,8 +177,7 @@ p, li { white-space: pre-wrap; } - - +