From fb3d5ca9ac2c720eb5b17292c584369b41c6bbf1 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 7 Mar 2015 14:49:33 +0000 Subject: [PATCH] removed auto-subscribe when no identity is available. Added warnign for the need to create an identity git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7993 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 42d2e067c..898dfd3f1 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -257,7 +257,10 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint) if (item->data(COLUMN_DATA, ROLE_AUTOSUBSCRIBE).toBool()) contextMnu.addAction(QIcon(IMAGE_AUTOSUBSCRIBE), tr("Remove Auto Subscribe"), this, SLOT(autoSubscribeItem())); else - contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem())); + { + if(!own_identities.empty()) + contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem())); + } } } @@ -667,7 +670,10 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id) // Update information std::vector lobbies; - rsMsgs->getListOfNearbyChatLobbies(lobbies); + rsMsgs->getListOfNearbyChatLobbies(lobbies); + + std::list my_ids ; + rsIdentity->getOwnIds(my_ids) ; for(std::vector::const_iterator it(lobbies.begin());it!=lobbies.end();++it) if( (*it).lobby_id == id) @@ -678,7 +684,11 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id) ui.lobbytype_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC)?tr("Public"):tr("Private")) ); ui.lobbypeers_lineEdit->setText( QString::number((*it).total_number_of_peers) ); - ui.lobbyInfoLabel->setText(tr("You're not subscribed to this lobby; Double click-it to enter and chat.") ); + QString text = tr("You're not subscribed to this lobby; Double click-it to enter and chat.") ; + if(my_ids.empty()) + text += "\n\n"+tr("You will need to create an identity in order to join chat lobbies.") ; + + ui.lobbyInfoLabel->setText(text); return ; }