added unsubscribe protocol, updated GUI

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ChatLobby@4738 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-12-27 13:47:37 +00:00
parent cc57ab2462
commit 3addb36e4c
12 changed files with 213 additions and 19 deletions

View file

@ -62,16 +62,8 @@ ChatLobbyDialog::~ChatLobbyDialog()
{
// announce leaving of lobby
rsMsgs->unsubscribeChatLobby(lobby_id) ;
}
void ChatLobbyDialog::closeEvent(QCloseEvent* e)
{
std::cerr << "In close event!" << std::endl;
if(QMessageBox::Yes == QMessageBox::question(NULL,tr("Unsubsribe to lobby?"),tr("Do you want to unsubscribe to this chat lobby?"),QMessageBox::Yes, QMessageBox::No))
if(QMessageBox::Yes == QMessageBox::question(NULL,tr("Unsubscribe to lobby?"),tr("Do you want to unsubscribe to this chat lobby?"),QMessageBox::Yes | QMessageBox::No))
rsMsgs->unsubscribeChatLobby(lobby_id) ;
PopupChatDialog::closeEvent(e) ;
}
void ChatLobbyDialog::setNickName(const QString& nick)

View file

@ -55,7 +55,6 @@ class ChatLobbyDialog: public PopupChatDialog
// The following methods are differentfrom those of the parent:
//
virtual void updateStatus(const QString &peer_id, int status) ; // needs grouped status. Not yet implemented.
virtual void closeEvent(QCloseEvent*) ;
protected slots:
void setNickName(const QString&) ;

View file

@ -40,7 +40,7 @@ CreateLobbyDialog::CreateLobbyDialog(const std::list<std::string>& peer_list,QWi
rsMsgs->getDefaultNickNameForChatLobby(default_nick) ;
ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible lobby name here")) ;
ui->nickName_LE->setPlaceholderText(tr("Your nickname for this lobby")) ;
ui->nickName_LE->setPlaceholderText(tr("Your nickname for this lobby (Change default name in options->chat)")) ;
ui->nickName_LE->setText(QString::fromStdString(default_nick)) ;
connect( ui->shareButton, SIGNAL( clicked ( bool ) ), this, SLOT( createLobby( ) ) );

View file

@ -88,6 +88,17 @@ p, li { white-space: pre-wrap; }
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTextEdit" name="textEdit">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A chat lobby is a decentralized and anonymous chat group. All participants receive all messages. Once the lobby is created you can invite other friends from the Friends tab.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>

View file

@ -359,6 +359,14 @@ void PopupChatDialog::processSettings(bool bLoad)
}
}
void PopupChatDialog::closeChat(const std::string& id)
{
PopupChatDialog *popupchatdialog = getExistingInstance(id);
if(popupchatdialog != NULL)
popupchatdialog->hide() ;
}
void PopupChatDialog::chatFriend(const std::string &id)
{
if (id.empty()){

View file

@ -47,6 +47,7 @@ public:
static PopupChatDialog *getPrivateChat(const std::string &id, uint chatflags);
static void cleanupChat();
static void chatFriend(const std::string &id);
static void closeChat(const std::string &id);
static void privateChatChanged(int list, int type);
void updateStatusString(const QString& peer_id, const QString& statusString);