Imported chat lobby function from branch v0.5-ChatLobby (merged commits 4682-4739)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4740 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-12-27 16:32:19 +00:00
commit 60bb76e3df
26 changed files with 2445 additions and 188 deletions

View file

@ -270,6 +270,8 @@ HEADERS += rshare.h \
gui/profile/StatusMessage.h \
gui/chat/PopupChatWindow.h \
gui/chat/PopupChatDialog.h \
gui/chat/ChatLobbyDialog.h \
gui/chat/CreateLobbyDialog.h \
gui/chat/HandleRichText.h \
gui/chat/ChatStyle.h \
gui/channels/CreateChannel.h \
@ -407,6 +409,7 @@ FORMS += gui/StartDialog.ui \
gui/channels/ShareKey.ui \
gui/chat/PopupChatWindow.ui \
gui/chat/PopupChatDialog.ui \
gui/chat/CreateLobbyDialog.ui \
gui/connect/ConfCertDialog.ui \
gui/msgs/MessageComposer.ui \
gui/msgs/MessageWindow.ui\
@ -530,6 +533,8 @@ SOURCES += main.cpp \
gui/channels/ShareKey.cpp \
gui/chat/PopupChatWindow.cpp \
gui/chat/PopupChatDialog.cpp \
gui/chat/ChatLobbyDialog.cpp \
gui/chat/CreateLobbyDialog.cpp \
gui/chat/HandleRichText.cpp \
gui/chat/ChatStyle.cpp \
gui/connect/ConfCertDialog.cpp \

View file

@ -311,6 +311,28 @@ void FriendsDialog::updateStatusString(const QString& peer_id, const QString& st
QTimer::singleShot(5000,this,SLOT(resetStatusBar())) ;
}
void FriendsDialog::readChatLobbyInvites()
{
std::list<ChatLobbyInvite> invites ;
rsMsgs->getPendingChatLobbyInvites(invites) ;
for(std::list<ChatLobbyInvite>::const_iterator it(invites.begin());it!=invites.end();++it)
if(QMessageBox::Ok == QMessageBox::question(NULL,tr("Invitation to chat lobby"),QString::fromStdString((*it).peer_id)+QString(" invites you to chat lobby named ")+QString::fromUtf8((*it).lobby_name.c_str()),QMessageBox::Ok,QMessageBox::Ignore))
{
std::cerr << "Accepting invite to lobby " << (*it).lobby_name << std::endl;
rsMsgs->acceptLobbyInvite( (*it).lobby_id ) ;
std::string vpid ;
if(rsMsgs->getVirtualPeerId( (*it).lobby_id,vpid ) )
PopupChatDialog::chatFriend(vpid) ;
else
std::cerr << "No lobby known with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl;
}
else
rsMsgs->denyLobbyInvite( (*it).lobby_id ) ;
}
void FriendsDialog::updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat)
{
if(is_private_chat)

View file

@ -57,6 +57,7 @@ public slots:
void insertChat();
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
void resetStatusBar() ;
void readChatLobbyInvites() ;
void fileHashingFinished(QList<HashedFile> hashedFiles);

View file

@ -0,0 +1,79 @@
/****************************************************************
*
* RetroShare is distributed under the following license:
*
* Copyright (C) 2011, csoler
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include <QMessageBox>
#include <QTimer>
#include <QScrollBar>
#include <QCloseEvent>
#include <QColorDialog>
#include <QDateTime>
#include <QFontDialog>
#include <QDir>
#include <QBuffer>
#include <QTextCodec>
#include <QSound>
#include <sys/stat.h>
#include "util/misc.h"
#include "rshare.h"
#include <retroshare/rspeers.h>
#include <retroshare/rsmsgs.h>
#include <retroshare/rsstatus.h>
#include <time.h>
#include <algorithm>
#include "ChatLobbyDialog.h"
/** Default constructor */
ChatLobbyDialog::ChatLobbyDialog(const std::string& dialog_id,const ChatLobbyId& lid, const QString &name, QWidget *parent, Qt::WFlags flags)
: PopupChatDialog(dialog_id,name,parent,flags),lobby_id(lid)
{
// remove the avatar widget. Replace it with a friends list.
ui.avatarWidget->hide() ;
PopupChatDialog::updateStatus(QString::fromStdString(getPeerId()),RS_STATUS_ONLINE) ;
QObject::connect(this,SIGNAL(close()),this,SLOT(closeAndAsk())) ;
}
/** Destructor. */
ChatLobbyDialog::~ChatLobbyDialog()
{
// announce leaving of lobby
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) ;
}
void ChatLobbyDialog::setNickName(const QString& nick)
{
rsMsgs->setNickNameForChatLobby(lobby_id,nick.toStdString()) ;
}
void ChatLobbyDialog::updateStatus(const QString &peer_id, int status)
{
// For now. We need something more efficient to tell when the lobby is disconnected.
//
}

View file

@ -0,0 +1,66 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006, crypton
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _CHATLOBBYDIALOG_H
#define _CHATLOBBYDIALOG_H
#include "ui_PopupChatDialog.h"
class QAction;
class QTextEdit;
class QTextCharFormat;
class AttachFileItem;
class ChatInfo;
#include <retroshare/rsmsgs.h>
#include "ChatStyle.h"
#include "gui/style/RSStyle.h"
#include "PopupChatDialog.h"
class ChatLobbyDialog: public PopupChatDialog
{
Q_OBJECT
protected:
/** Default constructor */
ChatLobbyDialog(const std::string& id,const ChatLobbyId& lid, const QString &name, QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
virtual ~ChatLobbyDialog();
// virtual void addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, enumChatType chatType);
// virtual void sendChat();
friend class 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.
protected slots:
void setNickName(const QString&) ;
private:
ChatLobbyId lobby_id ;
};
#endif

View file

@ -0,0 +1,204 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2010 Christopher Evi-Parker
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include "CreateLobbyDialog.h"
#include <QMessageBox>
#include <algorithm>
#include <retroshare/rsmsgs.h>
#include <retroshare/rspeers.h>
#include "gui/common/PeerDefs.h"
#include "gui/chat/PopupChatDialog.h"
CreateLobbyDialog::CreateLobbyDialog(const std::list<std::string>& peer_list,QWidget *parent, Qt::WFlags flags, std::string grpId, int grpType) :
QDialog(parent, flags), mGrpId(grpId), mGrpType(grpType)
{
ui = new Ui::CreateLobbyDialog() ;
ui->setupUi(this);
std::string default_nick ;
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 (Change default name in options->chat)")) ;
ui->nickName_LE->setText(QString::fromStdString(default_nick)) ;
connect( ui->shareButton, SIGNAL( clicked ( bool ) ), this, SLOT( createLobby( ) ) );
connect( ui->cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancel( ) ) );
connect( ui->lobbyName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
connect( ui->nickName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
connect(ui->keyShareList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
this, SLOT(togglePersonItem( QTreeWidgetItem *, int ) ));
setShareList(peer_list);
checkTextFields() ;
}
CreateLobbyDialog::~CreateLobbyDialog()
{
delete ui;
}
void CreateLobbyDialog::closeEvent (QCloseEvent * event)
{
QWidget::closeEvent(event);
}
void CreateLobbyDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void CreateLobbyDialog::checkTextFields()
{
if(ui->lobbyName_LE->text() == "" || ui->nickName_LE->text() == "")
ui->shareButton->setEnabled(false) ;
else
ui->shareButton->setEnabled(true) ;
}
void CreateLobbyDialog::createLobby()
{
if(mShareList.empty())
{
QMessageBox::warning(this, tr("RetroShare"),tr("Please select at least one peer"),
QMessageBox::Ok, QMessageBox::Ok);
return;
}
// create chat lobby !!
std::string lobby_name = ui->lobbyName_LE->text().toStdString() ;
// add to group
ChatLobbyId id = rsMsgs->createChatLobby(lobby_name, mShareList);
std::cerr << "gui: Created chat lobby " << std::hex << id << std::endl ;
// set nick name !
rsMsgs->setNickNameForChatLobby(id,ui->nickName_LE->text().toStdString()) ;
// open chat window !!
std::string vpid ;
if(rsMsgs->getVirtualPeerId(id,vpid))
PopupChatDialog::chatFriend(vpid) ;
close();
}
void CreateLobbyDialog::cancel()
{
close();
}
void CreateLobbyDialog::setShareList(const std::list<std::string>& friend_list)
{
if (!rsPeers)
{
/* not ready yet! */
return;
}
std::list<std::string> peers;
std::list<std::string>::iterator it;
mShareList.clear() ;
rsPeers->getFriendList(peers);
/* get a link to the table */
QTreeWidget *shareWidget = ui->keyShareList;
QList<QTreeWidgetItem *> items;
for(it = peers.begin(); it != peers.end(); it++)
{
RsPeerDetails detail;
if (!rsPeers->getPeerDetails(*it, detail))
{
continue; /* BAD */
}
/* make a widget per friend */
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
item -> setText(0, PeerDefs::nameWithLocation(detail));
if (detail.state & RS_PEER_STATE_CONNECTED) {
item -> setTextColor(0,(Qt::darkBlue));
}
item -> setSizeHint(0, QSize( 17,17 ) );
item -> setText(1, QString::fromStdString(detail.id));
item -> setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
item -> setCheckState(0, Qt::Unchecked);
for(std::list<std::string>::const_iterator it2(friend_list.begin());it2!=friend_list.end();++it2)
if(*it == *it2)
{
item -> setCheckState(0, Qt::Checked);
mShareList.push_back(*it) ;
break ;
}
/* add to the list */
items.append(item);
}
/* remove old items */
shareWidget->clear();
shareWidget->setColumnCount(1);
/* add the items in! */
shareWidget->insertTopLevelItems(0, items);
shareWidget->update(); /* update display */
}
void CreateLobbyDialog::togglePersonItem( QTreeWidgetItem *item, int /*col*/ )
{
/* extract id */
std::string id = (item -> text(1)).toStdString();
/* get state */
bool checked = (Qt::Checked == item -> checkState(0)); /* alway column 0 */
/* call control fns */
std::list<std::string>::iterator lit = std::find(mShareList.begin(), mShareList.end(), id);
if(checked && (lit == mShareList.end()))
mShareList.push_back(id); // make sure ids not added already
else if(lit != mShareList.end())
mShareList.erase(lit);
return;
}

View file

@ -0,0 +1,41 @@
#ifndef SHAREKEY_H
#define SHAREKEY_H
#include <QDialog>
#include "ui_CreateLobbyDialog.h"
class CreateLobbyDialog : public QDialog {
Q_OBJECT
public:
/*
*@param chanId The channel id to send request for
*/
CreateLobbyDialog(const std::list<std::string>& friends_list,QWidget *parent = 0, Qt::WFlags flags = 0, std::string grpId = "", int grpType = 0);
~CreateLobbyDialog();
protected:
void changeEvent(QEvent *e);
void closeEvent (QCloseEvent * event);
private:
void setShareList(const std::list<std::string>&);
Ui::CreateLobbyDialog *ui;
std::string mGrpId;
std::list<std::string> mShareList;
int mGrpType;
private slots:
void createLobby();
void checkTextFields();
void cancel();
void togglePersonItem(QTreeWidgetItem* item, int col);
};
#endif // SHAREKEY_H

View file

@ -0,0 +1,300 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateLobbyDialog</class>
<widget class="QDialog" name="CreateLobbyDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>586</width>
<height>532</height>
</rect>
</property>
<property name="windowTitle">
<string>Create Chat Lobby</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="frame">
<property name="minimumSize">
<size>
<width>239</width>
<height>49</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{background-image: url(:/images/connect/connectFriendBanner.png);
}</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/user/agt_forum64.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="tlShareKey">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<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;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:18pt; font-weight:600; color:#ffffff;&quot;&gt;Create Chat Lobby&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<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>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Lobby name:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Your nick name:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLineEdit" name="lobbyName_LE"/>
</item>
<item>
<widget class="QLineEdit" name="nickName_LE"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<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;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Select the Friends with which you want to group chat.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QDockWidget" name="contactsdockWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>52487</width>
<height>524287</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>check peers you would like to share private publish key with</string>
</property>
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string>Invited friends</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="_2">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTreeWidget" name="keyShareList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>4</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1677215</width>
<height>16777215</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Contacts:</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="shareButton">
<property name="text">
<string>Create</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
<include location="../images.qrc"/>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -33,6 +33,7 @@
#include <sys/stat.h>
#include "PopupChatDialog.h"
#include "ChatLobbyDialog.h"
#include "PopupChatWindow.h"
#include "gui/RetroShareLink.h"
#include "util/misc.h"
@ -125,7 +126,7 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus_slot(const QString&, int)));
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
connect(ui.chattextEdit,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(contextMenu(QPoint)));
@ -261,16 +262,35 @@ void PopupChatDialog::processSettings(bool bLoad)
{
/* see if it exists already */
PopupChatDialog *popupchatdialog = getExistingInstance(id);
if (popupchatdialog == NULL) {
if (chatflags & RS_CHAT_OPEN) {
RsPeerDetails sslDetails;
if (rsPeers->getPeerDetails(id, sslDetails)) {
ChatLobbyId lobby_id ;
if (rsPeers->getPeerDetails(id, sslDetails))
{
popupchatdialog = new PopupChatDialog(id, PeerDefs::nameWithLocation(sslDetails));
chatDialogs[id] = popupchatdialog;
PopupChatWindow *window = PopupChatWindow::getWindow(false);
window->addDialog(popupchatdialog);
}
else if (rsMsgs->isLobbyId(id, lobby_id))
{
std::list<ChatLobbyInfo> linfos;
rsMsgs->getChatLobbyList(linfos) ;
for(std::list<ChatLobbyInfo>::const_iterator it(linfos.begin());it!=linfos.end();++it)
if( (*it).lobby_id == lobby_id)
{
popupchatdialog = new ChatLobbyDialog(id,lobby_id,QString::fromStdString((*it).lobby_name));
chatDialogs[id] = popupchatdialog;
PopupChatWindow *window = PopupChatWindow::getWindow(false);
window->addDialog(popupchatdialog);
}
}
}
}
@ -337,6 +357,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()){
@ -344,10 +372,16 @@ void PopupChatDialog::chatFriend(const std::string &id)
}
std::cerr<<" popup dialog chat friend 1"<<std::endl;
ChatLobbyId lid ;
if(rsMsgs->isLobbyId(id,lid))
{
getPrivateChat(id, RS_CHAT_OPEN | RS_CHAT_FOCUS);
return ;
}
RsPeerDetails detail;
if (!rsPeers->getPeerDetails(id, detail)) {
if (!rsPeers->getPeerDetails(id, detail))
return;
}
std::string firstId;
@ -682,7 +716,8 @@ void PopupChatDialog::sendChat()
std::cout << "PopupChatDialog:sendChat " << std::endl;
#endif
if (rsMsgs->sendPrivateChat(dialogId, msg)) {
if (sendPrivateChat(msg))
{
QDateTime currentTime = QDateTime::currentDateTime();
addChatMsg(false, QString::fromUtf8(rsPeers->getPeerName(ownId).c_str()), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL);
}
@ -695,6 +730,11 @@ void PopupChatDialog::sendChat()
setFont();
}
bool PopupChatDialog::sendPrivateChat(const std::wstring& msg)
{
return rsMsgs->sendPrivateChat(dialogId, msg) ;
}
/**
Toggles the ToolBox on and off, changes toggle button text
*/
@ -905,6 +945,11 @@ void PopupChatDialog::clearOfflineMessages()
manualDelete = false;
}
void PopupChatDialog::updateStatus_slot(const QString &peer_id, int status)
{
updateStatus(peer_id,status) ;
}
void PopupChatDialog::updateStatus(const QString &peer_id, int status)
{
std::string stdPeerId = peer_id.toStdString();

View file

@ -46,6 +46,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);
@ -58,9 +59,10 @@ public:
void activate();
bool setStyle();
const RSStyle &getStyle();
virtual void updateStatus(const QString &peer_id, int status);
public slots:
void updateStatus(const QString &peer_id, int status);
void updateStatus_slot(const QString &peer_id, int status);
protected:
/** Default constructor */
@ -142,6 +144,9 @@ private:
RSStyle style;
protected:
virtual bool sendPrivateChat(const std::wstring& msg) ; // can be derived to send chat to e.g. a chat lobby
/** Qt Designer generated object */
Ui::PopupChatDialog ui;
};

View file

@ -31,6 +31,7 @@
#include "GroupDefs.h"
#include "gui/chat/PopupChatDialog.h"
#include "gui/chat/CreateLobbyDialog.h"
#include "gui/common/AvatarDefs.h"
#include "gui/connect/ConfCertDialog.h"
#include "gui/connect/ConnectFriendWizard.h"
@ -292,143 +293,177 @@ void FriendList::peerTreeWidgetCostumPopupMenu()
contextMnu.addAction(widgetAction);
// create menu entries
if (c) { // if a peer is selected
int type = c->type();
if (c)
{ // if a peer is selected
int type = c->type();
// define header
switch (type) {
case TYPE_GROUP:
//this is a GPG key
textLabel->setText("<strong>" + tr("Group") + "</strong>");
break;
case TYPE_GPG:
//this is a GPG key
textLabel->setText("<strong>" + tr("Friend") + "</strong>");
break;
case TYPE_SSL:
//this is a SSL key
textLabel->setText("<strong>" + tr("Location") + "</strong>");
break;
}
// define header
switch (type) {
case TYPE_GROUP:
//this is a GPG key
textLabel->setText("<strong>" + tr("Group") + "</strong>");
break;
case TYPE_GPG:
//this is a GPG key
textLabel->setText("<strong>" + tr("Friend") + "</strong>");
break;
case TYPE_SSL:
//this is a SSL key
textLabel->setText("<strong>" + tr("Location") + "</strong>");
break;
}
switch (type) {
case TYPE_GROUP:
{
bool standard = c->data(COLUMN_DATA, ROLE_STANDARD).toBool();
switch (type) {
case TYPE_GROUP:
{
bool standard = c->data(COLUMN_DATA, ROLE_STANDARD).toBool();
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Message Group"), this, SLOT(msgfriend()));
contextMnu.addAction(QIcon(IMAGE_ADDFRIEND), tr("Add Friend"), this, SLOT(addFriend()));
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Message Group"), this, SLOT(msgfriend()));
contextMnu.addAction(QIcon(IMAGE_ADDFRIEND), tr("Add Friend"), this, SLOT(addFriend()));
contextMnu.addSeparator();
contextMnu.addSeparator();
QAction *action = contextMnu.addAction(QIcon(IMAGE_EDIT), tr("Edit Group"), this, SLOT(editGroup()));
action->setDisabled(standard);
QAction *action = contextMnu.addAction(QIcon(IMAGE_EDIT), tr("Edit Group"), this, SLOT(editGroup()));
action->setDisabled(standard);
action = contextMnu.addAction(QIcon(IMAGE_REMOVE), tr("Remove Group"), this, SLOT(removeGroup()));
action->setDisabled(standard);
}
break;
case TYPE_GPG:
case TYPE_SSL:
{
contextMnu.addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy()));
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Message Friend"), this, SLOT(msgfriend()));
action = contextMnu.addAction(QIcon(IMAGE_REMOVE), tr("Remove Group"), this, SLOT(removeGroup()));
action->setDisabled(standard);
contextMnu.addSeparator();
contextMnu.addAction(QIcon(IMAGE_CHAT), tr("Create chat lobby"), this, SLOT(createchatlobby()));
}
break;
case TYPE_GPG:
case TYPE_SSL:
{
contextMnu.addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy()));
QMenu *mnu = contextMnu.addMenu(QIcon(IMAGE_CHAT), tr("Chat lobbies")) ;
contextMnu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Friend Details"), this, SLOT(configurefriend()));
// contextMnu.addAction(QIcon(IMAGE_PEERINFO), tr("Profile View"), this, SLOT(viewprofile()));
// action = contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Export Friend"), this, SLOT(exportfriend()));
mnu->addAction(QIcon(IMAGE_ADDFRIEND),tr("create new"),this,SLOT(createchatlobby())) ;
if (type == TYPE_GPG) {
contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Recommend this Friend to..."), this, SLOT(recommendfriend()));
}
// Get existing lobbies
//
std::list<ChatLobbyInfo> cl_infos ;
rsMsgs->getChatLobbyList(cl_infos) ;
contextMnu.addAction(QIcon(IMAGE_CONNECT), tr("Connect To Friend"), this, SLOT(connectfriend()));
for(std::list<ChatLobbyInfo>::const_iterator it(cl_infos.begin());it!=cl_infos.end();++it)
{
std::cerr << "Adding meny entry with lobby id " << std::hex << (*it).lobby_id << std::dec << std::endl;
if (type == TYPE_GPG) {
contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyLink()));
}
QMenu *mnu2 = mnu->addMenu(QIcon(IMAGE_CHAT), QString::fromUtf8((*it).lobby_name.c_str())) ;
QAction *action = contextMnu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste Friend Link"), this, SLOT(pastePerson()));
if (RSLinkClipboard::empty(RetroShareLink::TYPE_PERSON)) {
action->setDisabled(true);
}
QAction* inviteToLobbyAction = new QAction(tr("Invite this friend"), mnu2);
inviteToLobbyAction->setData(QString::number((*it).lobby_id));
connect(inviteToLobbyAction, SIGNAL(triggered()), this, SLOT(inviteToLobby()));
mnu2->addAction(inviteToLobbyAction);
if (type == TYPE_GPG) {
contextMnu.addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny Friend"), this, SLOT(removefriend()));
} else {
//this is a SSL key
contextMnu.addAction(QIcon(IMAGE_REMOVEFRIEND), tr("Remove Friend Location"), this, SLOT(removefriend()));
}
QAction* showLobbyAction = new QAction(tr("Show"), mnu2);
showLobbyAction->setData(QString::number((*it).lobby_id));
connect(showLobbyAction, SIGNAL(triggered()), this, SLOT(showLobby()));
mnu2->addAction(showLobbyAction);
if (mShowGroups && type == TYPE_GPG) {
QMenu* addToGroupMenu = NULL;
QMenu* moveToGroupMenu = NULL;
QAction* unsubscribeToLobbyAction = new QAction(tr("Unsubscribe"), mnu2);
unsubscribeToLobbyAction->setData(QString::number((*it).lobby_id));
connect(unsubscribeToLobbyAction, SIGNAL(triggered()), this, SLOT(unsubscribeToLobby()));
mnu2->addAction(unsubscribeToLobbyAction);
}
std::list<RsGroupInfo> groupInfoList;
rsPeers->getGroupInfoList(groupInfoList);
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Message Friend"), this, SLOT(msgfriend()));
GroupDefs::sortByName(groupInfoList);
contextMnu.addSeparator();
std::string gpgId = getRsId(c);
contextMnu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Friend Details"), this, SLOT(configurefriend()));
// contextMnu.addAction(QIcon(IMAGE_PEERINFO), tr("Profile View"), this, SLOT(viewprofile()));
// action = contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Export Friend"), this, SLOT(exportfriend()));
QTreeWidgetItem *parent = c->parent();
if (type == TYPE_GPG) {
contextMnu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Recommend this Friend to..."), this, SLOT(recommendfriend()));
}
bool foundGroup = false;
// add action for all groups, except the own group
for (std::list<RsGroupInfo>::iterator groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
if (std::find(groupIt->peerIds.begin(), groupIt->peerIds.end(), gpgId) == groupIt->peerIds.end()) {
if (parent) {
if (addToGroupMenu == NULL) {
addToGroupMenu = new QMenu(tr("Add to group"), &contextMnu);
}
QAction* addToGroupAction = new QAction(GroupDefs::name(*groupIt), addToGroupMenu);
addToGroupAction->setData(QString::fromStdString(groupIt->id));
connect(addToGroupAction, SIGNAL(triggered()), this, SLOT(addToGroup()));
addToGroupMenu->addAction(addToGroupAction);
}
contextMnu.addAction(QIcon(IMAGE_CONNECT), tr("Connect To Friend"), this, SLOT(connectfriend()));
if (moveToGroupMenu == NULL) {
moveToGroupMenu = new QMenu(tr("Move to group"), &contextMnu);
}
QAction* moveToGroupAction = new QAction(GroupDefs::name(*groupIt), moveToGroupMenu);
moveToGroupAction->setData(QString::fromStdString(groupIt->id));
connect(moveToGroupAction, SIGNAL(triggered()), this, SLOT(moveToGroup()));
moveToGroupMenu->addAction(moveToGroupAction);
} else {
foundGroup = true;
}
}
if (type == TYPE_GPG) {
contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyLink()));
}
if (addToGroupMenu || moveToGroupMenu || foundGroup) {
QMenu *groupsMenu = contextMnu.addMenu(QIcon(IMAGE_GROUP16), tr("Groups"));
QAction *action = contextMnu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste Friend Link"), this, SLOT(pastePerson()));
if (RSLinkClipboard::empty(RetroShareLink::TYPE_PERSON)) {
action->setDisabled(true);
}
if (addToGroupMenu) {
groupsMenu->addMenu(addToGroupMenu);
}
if (type == TYPE_GPG) {
contextMnu.addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny Friend"), this, SLOT(removefriend()));
} else {
//this is a SSL key
contextMnu.addAction(QIcon(IMAGE_REMOVEFRIEND), tr("Remove Friend Location"), this, SLOT(removefriend()));
}
if (moveToGroupMenu) {
groupsMenu->addMenu(moveToGroupMenu);
}
if (mShowGroups && type == TYPE_GPG) {
QMenu* addToGroupMenu = NULL;
QMenu* moveToGroupMenu = NULL;
if (foundGroup) {
// add remove from group
if (parent && parent->type() == TYPE_GROUP) {
QAction *removeFromGroup = groupsMenu->addAction(tr("Remove from group"));
removeFromGroup->setData(parent->data(COLUMN_DATA, ROLE_ID));
connect(removeFromGroup, SIGNAL(triggered()), this, SLOT(removeFromGroup()));
}
std::list<RsGroupInfo> groupInfoList;
rsPeers->getGroupInfoList(groupInfoList);
QAction *removeFromAllGroups = groupsMenu->addAction(tr("Remove from all groups"));
removeFromAllGroups->setData("");
connect(removeFromAllGroups, SIGNAL(triggered()), this, SLOT(removeFromGroup()));
}
}
}
}
}
} else {
GroupDefs::sortByName(groupInfoList);
std::string gpgId = getRsId(c);
QTreeWidgetItem *parent = c->parent();
bool foundGroup = false;
// add action for all groups, except the own group
for (std::list<RsGroupInfo>::iterator groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
if (std::find(groupIt->peerIds.begin(), groupIt->peerIds.end(), gpgId) == groupIt->peerIds.end()) {
if (parent) {
if (addToGroupMenu == NULL) {
addToGroupMenu = new QMenu(tr("Add to group"), &contextMnu);
}
QAction* addToGroupAction = new QAction(GroupDefs::name(*groupIt), addToGroupMenu);
addToGroupAction->setData(QString::fromStdString(groupIt->id));
connect(addToGroupAction, SIGNAL(triggered()), this, SLOT(addToGroup()));
addToGroupMenu->addAction(addToGroupAction);
}
if (moveToGroupMenu == NULL) {
moveToGroupMenu = new QMenu(tr("Move to group"), &contextMnu);
}
QAction* moveToGroupAction = new QAction(GroupDefs::name(*groupIt), moveToGroupMenu);
moveToGroupAction->setData(QString::fromStdString(groupIt->id));
connect(moveToGroupAction, SIGNAL(triggered()), this, SLOT(moveToGroup()));
moveToGroupMenu->addAction(moveToGroupAction);
} else {
foundGroup = true;
}
}
if (addToGroupMenu || moveToGroupMenu || foundGroup) {
QMenu *groupsMenu = contextMnu.addMenu(QIcon(IMAGE_GROUP16), tr("Groups"));
if (addToGroupMenu) {
groupsMenu->addMenu(addToGroupMenu);
}
if (moveToGroupMenu) {
groupsMenu->addMenu(moveToGroupMenu);
}
if (foundGroup) {
// add remove from group
if (parent && parent->type() == TYPE_GROUP) {
QAction *removeFromGroup = groupsMenu->addAction(tr("Remove from group"));
removeFromGroup->setData(parent->data(COLUMN_DATA, ROLE_ID));
connect(removeFromGroup, SIGNAL(triggered()), this, SLOT(removeFromGroup()));
}
QAction *removeFromAllGroups = groupsMenu->addAction(tr("Remove from all groups"));
removeFromAllGroups->setData("");
connect(removeFromAllGroups, SIGNAL(triggered()), this, SLOT(removeFromGroup()));
}
}
}
}
}
} else {
QAction *action = contextMnu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste Friend Link"), this, SLOT(pastePerson()));
if (RSLinkClipboard::empty(RetroShareLink::TYPE_PERSON)) {
action->setDisabled(true);
@ -1371,6 +1406,80 @@ void FriendList::configurefriend()
ConfCertDialog::showIt(getRsId(getCurrentPeer()), ConfCertDialog::PageDetails);
}
void FriendList::showLobby()
{
std::string lobby_id = qobject_cast<QAction*>(sender())->data().toString().toStdString();
if(lobby_id.empty())
return;
std::string vpeer_id ;
if(rsMsgs->getVirtualPeerId( ChatLobbyId(QString::fromStdString(lobby_id).toULongLong() ),vpeer_id))
PopupChatDialog::chatFriend(vpeer_id) ;
}
void FriendList::unsubscribeToLobby()
{
std::string lobby_id = qobject_cast<QAction*>(sender())->data().toString().toStdString();
if(lobby_id.empty())
return;
std::string vpeer_id ;
rsMsgs->getVirtualPeerId( ChatLobbyId(QString::fromStdString(lobby_id).toULongLong() ),vpeer_id) ;
if(QMessageBox::Ok == QMessageBox::question(this,tr("Unsubscribe to lobby"),tr("You are about to unsubscribe a chat lobby<br>You can only re-enter if your friends invite you again."),QMessageBox::Ok | QMessageBox::Cancel))
rsMsgs->unsubscribeChatLobby(ChatLobbyId(QString::fromStdString(lobby_id).toULongLong())) ;
// we should also close existing windows.
PopupChatDialog::closeChat(vpeer_id) ;
}
void FriendList::inviteToLobby()
{
QTreeWidgetItem *c = getCurrentPeer();
if (c == NULL) {
return;
}
if (c->type() != TYPE_SSL) {
// wrong type
return;
}
std::string lobby_id = qobject_cast<QAction*>(sender())->data().toString().toStdString();
if(lobby_id.empty())
return;
std::string peer_id = getRsId(c) ;
// add to group
rsMsgs->invitePeerToLobby(ChatLobbyId(QString::fromStdString(lobby_id).toULongLong()), peer_id);
std::string vpeer_id ;
if(rsMsgs->getVirtualPeerId( ChatLobbyId(QString::fromStdString(lobby_id).toULongLong() ),vpeer_id) )
PopupChatDialog::chatFriend(vpeer_id) ;
}
void FriendList::createchatlobby()
{
QTreeWidgetItem *c = getCurrentPeer();
if (c == NULL)
return;
std::list<std::string> friend_list ;
std::string peer_id = getRsId(c) ;
friend_list.push_back(peer_id) ;
CreateLobbyDialog(friend_list).exec() ;
}
void FriendList::addToGroup()
{
QTreeWidgetItem *c = getCurrentPeer();

View file

@ -122,6 +122,11 @@ private slots:
void editGroup();
void removeGroup();
void inviteToLobby();
void createchatlobby();
void unsubscribeToLobby();
void showLobby();
};
#endif // FRIENDLIST_H

View file

@ -307,6 +307,12 @@ void NotifyQt::notifyListChange(int list, int type)
#endif
emit filesPostModChanged(true) ; /* Local */
break;
case NOTIFY_LIST_CHAT_LOBBY_INVITATION:
#ifdef NOTIFY_DEBUG
std::cerr << "received files changed" << std::endl ;
#endif
emit chatLobbyInviteReceived() ; /* Local */
break;
case NOTIFY_LIST_DIRLIST_FRIENDS:
#ifdef NOTIFY_DEBUG
std::cerr << "received files changed" << std::endl ;

View file

@ -92,6 +92,7 @@ class NotifyQt: public QObject, public NotifyBase
void downloadCompleteCountChanged(int /* count */);
void channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int status);
void historyChanged(uint msgId, int type);
void chatLobbyInviteReceived() ;
/* Notify from GUI */
void chatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType);

View file

@ -28,6 +28,7 @@
#include "rsharesettings.h"
#include <retroshare/rshistory.h>
#include <retroshare/rsmsgs.h>
#define VARIANT_STANDARD "Standard"
@ -115,6 +116,8 @@ ChatPage::save(QString &/*errmsg*/)
rsHistory->setSaveCount(true, ui.publicChatSaveCount->value());
rsHistory->setSaveCount(false, ui.privateChatSaveCount->value());
rsMsgs->setDefaultNickNameForChatLobby(ui.chatLobbyNick_LE->text().toStdString()) ;
ChatStyleInfo info;
QListWidgetItem *item = ui.publicList->currentItem();
if (item) {
@ -175,6 +178,10 @@ ChatPage::load()
publicStylePath = loadStyleInfo(ChatStyle::TYPE_PUBLIC, ui.publicList, ui.publicComboBoxVariant, publicStyleVariant);
privateStylePath = loadStyleInfo(ChatStyle::TYPE_PRIVATE, ui.privateList, ui.privateComboBoxVariant, privateStyleVariant);
historyStylePath = loadStyleInfo(ChatStyle::TYPE_HISTORY, ui.historyList, ui.historyComboBoxVariant, historyStyleVariant);
std::string nick ;
rsMsgs->getDefaultNickNameForChatLobby(nick) ;
ui.chatLobbyNick_LE->setText(QString::fromStdString(nick)) ;
}
void ChatPage::on_pushButtonChangeChatFont_clicked()

View file

@ -521,35 +521,89 @@
<property name="title">
<string>Chat Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox_emoteprivchat">
<property name="text">
<string>Enable Emoticons Privat Chat</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="checkBox_emoteprivchat">
<property name="text">
<string>Enable Emoticons Privat Chat</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_emotegroupchat">
<property name="text">
<string>Enable Emoticons Group Chat</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="sendMessageWithCtrlReturn">
<property name="text">
<string>Send message with Ctrl+Return</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Default nickname for chat lobbies:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="chatLobbyNick_LE">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_emotegroupchat">
<property name="text">
<string>Enable Emoticons Group Chat</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="sendMessageWithCtrlReturn">
<property name="text">
<string>Send message with Ctrl+Return</string>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="4">
<item>
<widget class="QGroupBox" name="groupBoxIRCColors">
<property name="maximumSize">
<size>

View file

@ -281,6 +281,7 @@ int main(int argc, char *argv[])
QObject::connect(notify,SIGNAL(messagesChanged()) ,w->messagesDialog ,SLOT(insertMessages() )) ;
QObject::connect(notify,SIGNAL(messagesTagsChanged()) ,w->messagesDialog ,SLOT(messagesTagsChanged() )) ;
QObject::connect(notify,SIGNAL(messagesChanged()) ,w ,SLOT(updateMessages() )) ;
QObject::connect(notify,SIGNAL(chatLobbyInviteReceived()) ,w->friendsDialog ,SLOT(readChatLobbyInvites() )) ;
QObject::connect(notify,SIGNAL(forumsChanged()) ,w ,SLOT(updateForums() ), Qt::QueuedConnection);
QObject::connect(notify,SIGNAL(channelsChanged(int)) ,w ,SLOT(updateChannels(int) ), Qt::QueuedConnection);
QObject::connect(notify,SIGNAL(downloadCompleteCountChanged(int)) ,w ,SLOT(updateTransfers(int) ));