2010-05-14 07:48:20 -04:00
|
|
|
/****************************************************************
|
2007-11-14 22:18:48 -05:00
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
2011-05-17 13:27:47 -04:00
|
|
|
* Copyright (C) 2006 - 2011 RetroShare Team
|
2007-11-14 22:18:48 -05:00
|
|
|
*
|
|
|
|
* 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
|
2009-07-13 15:58:11 -04:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
2007-11-14 22:18:48 -05:00
|
|
|
* Boston, MA 02110-1301, USA.
|
2008-11-24 09:07:26 -05:00
|
|
|
****************************************************************/
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2011-10-20 17:34:44 -04:00
|
|
|
#include <time.h>
|
|
|
|
|
2010-07-23 14:52:58 -04:00
|
|
|
#include <QDropEvent>
|
2011-10-20 17:34:44 -04:00
|
|
|
#include <QMenu>
|
2012-05-11 20:40:53 -04:00
|
|
|
#include <QTimer>
|
2012-10-24 09:22:14 -04:00
|
|
|
#include <QMessageBox>
|
2008-11-24 09:07:26 -05:00
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
#include <retroshare/rspeers.h>
|
2011-09-29 05:20:09 -04:00
|
|
|
#include <retroshare/rshistory.h>
|
2008-01-25 03:49:40 -05:00
|
|
|
|
2012-08-05 16:12:55 -04:00
|
|
|
#include "chat/ChatUserNotify.h"
|
2010-09-19 20:10:51 -04:00
|
|
|
#include "connect/ConnectFriendWizard.h"
|
2010-09-21 12:11:19 -04:00
|
|
|
#include "groups/CreateGroup.h"
|
2010-05-02 20:09:55 -04:00
|
|
|
#include "MainWindow.h"
|
2010-08-12 12:00:21 -04:00
|
|
|
#include "NewsFeed.h"
|
2011-10-20 17:34:44 -04:00
|
|
|
#include "notifyqt.h"
|
|
|
|
#include "profile/ProfileWidget.h"
|
|
|
|
#include "profile/StatusMessage.h"
|
|
|
|
#include "RetroShareLink.h"
|
|
|
|
#include "settings/rsharesettings.h"
|
2010-12-02 19:54:40 -05:00
|
|
|
#include "util/misc.h"
|
2012-11-15 16:35:37 -05:00
|
|
|
#include "util/DateTime.h"
|
2011-10-20 17:34:44 -04:00
|
|
|
#include "FriendsDialog.h"
|
2013-02-22 16:42:27 -05:00
|
|
|
#include "NetworkView.h"
|
|
|
|
#include "NetworkDialog.h"
|
2014-05-07 19:45:53 -04:00
|
|
|
#include "gui/Identity/IdDialog.h"
|
2014-09-10 04:37:27 -04:00
|
|
|
#ifdef RS_USE_CIRCLES
|
2014-05-07 19:45:53 -04:00
|
|
|
#include "gui/Circles/CirclesDialog.h"
|
2014-09-10 04:37:27 -04:00
|
|
|
#endif
|
2011-10-20 17:34:44 -04:00
|
|
|
/* Images for Newsfeed icons */
|
2014-05-09 22:38:47 -04:00
|
|
|
//#define IMAGE_NEWSFEED ""
|
|
|
|
//#define IMAGE_NEWSFEED_NEW ":/images/message-state-new.png"
|
2014-05-07 19:45:53 -04:00
|
|
|
#define IMAGE_NETWORK2 ":/images/logo/logo_16.png"
|
2013-02-22 16:42:27 -05:00
|
|
|
#define IMAGE_PEERS ":/images/groupchat.png"
|
2014-05-07 19:45:53 -04:00
|
|
|
#define IMAGE_IDENTITY ":/images/identity/identities_32.png"
|
|
|
|
#define IMAGE_CIRCLES ":/images/circles/circles_32.png"
|
2008-11-24 09:07:26 -05:00
|
|
|
|
2008-07-09 05:53:47 -04:00
|
|
|
/******
|
2011-05-24 19:35:11 -04:00
|
|
|
* #define FRIENDS_DEBUG 1
|
2008-07-09 05:53:47 -04:00
|
|
|
*****/
|
|
|
|
|
2012-01-18 15:02:19 -05:00
|
|
|
static FriendsDialog *instance = NULL;
|
|
|
|
|
2008-11-24 09:07:26 -05:00
|
|
|
/** Constructor */
|
2011-05-17 13:27:47 -04:00
|
|
|
FriendsDialog::FriendsDialog(QWidget *parent)
|
2010-09-04 10:23:30 -04:00
|
|
|
: RsAutoUpdatePage(1500,parent)
|
2008-11-24 09:07:26 -05:00
|
|
|
{
|
2010-09-04 10:23:30 -04:00
|
|
|
/* Invoke the Qt Designer generated object setup routine */
|
|
|
|
ui.setupUi(this);
|
2009-09-30 18:30:57 -04:00
|
|
|
|
2012-01-18 15:02:19 -05:00
|
|
|
if (instance == NULL) {
|
|
|
|
instance = this;
|
|
|
|
}
|
2014-12-29 16:41:05 -05:00
|
|
|
QString msg = tr("Retroshare broadcast chat: messages are sent to all connected friends.");
|
|
|
|
// "<font color='grey'>" + DateTime::formatTime(QTime::currentTime()) + "</font> -
|
|
|
|
msg = QString("<font color='blue'><i>" + msg + "</i></font>");
|
|
|
|
ui.chatWidget->setWelcomeMessage(msg);
|
|
|
|
ui.chatWidget->init(ChatId::makeBroadcastId(), tr("Broadcast"));
|
2012-01-18 15:02:19 -05:00
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
connect(NotifyQt::getInstance(), SIGNAL(chatMessageReceived(ChatMessage)),
|
|
|
|
this, SLOT(chatMessageReceived(ChatMessage)));
|
|
|
|
connect(NotifyQt::getInstance(), SIGNAL(chatStatusChanged(ChatId,QString)),
|
|
|
|
this, SLOT(chatStatusReceived(ChatId,QString)));
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2012-08-26 16:31:10 -04:00
|
|
|
connect( ui.mypersonalstatusLabel, SIGNAL(clicked()), SLOT(statusmessage()));
|
2010-09-04 10:23:30 -04:00
|
|
|
connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar()));
|
|
|
|
connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
|
2011-10-20 17:34:44 -04:00
|
|
|
|
2011-09-05 17:19:07 -04:00
|
|
|
ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME);
|
|
|
|
ui.avatar->setOwnId();
|
|
|
|
|
2012-01-18 15:02:19 -05:00
|
|
|
ui.tabWidget->setTabPosition(QTabWidget::North);
|
2014-09-09 15:19:18 -04:00
|
|
|
ui.tabWidget->addTab(networkView = new NetworkView(),QIcon(IMAGE_NETWORK2), tr("Network graph"));
|
2013-07-16 16:00:46 -04:00
|
|
|
ui.tabWidget->addTab(networkDialog = new NetworkDialog(),QIcon(IMAGE_PEERS), tr("Keyring"));
|
2013-02-22 16:42:27 -05:00
|
|
|
|
|
|
|
//ui.tabWidget->addTab(new ProfileWidget(), tr("Profile"));
|
|
|
|
//newsFeed = new NewsFeed();
|
|
|
|
//int newsFeedTabIndex = ui.tabWidget->insertTab(0, newsFeed, tr("News Feed"));
|
|
|
|
//ui.tabWidget->setCurrentIndex(newsFeedTabIndex);
|
2012-01-18 15:02:19 -05:00
|
|
|
|
|
|
|
ui.tabWidget->hideCloseButton(0);
|
|
|
|
ui.tabWidget->hideCloseButton(1);
|
|
|
|
ui.tabWidget->hideCloseButton(2);
|
|
|
|
ui.tabWidget->hideCloseButton(3);
|
2014-05-07 19:45:53 -04:00
|
|
|
ui.tabWidget->hideCloseButton(4);
|
2010-11-10 07:24:36 -05:00
|
|
|
|
|
|
|
/* get the current text and text color of the tab bar */
|
2013-02-22 16:42:27 -05:00
|
|
|
//newsFeedTabColor = ui.tabWidget->tabBar()->tabTextColor(newsFeedTabIndex);
|
|
|
|
//newsFeedText = ui.tabWidget->tabBar()->tabText(newsFeedTabIndex);
|
2010-11-10 07:24:36 -05:00
|
|
|
|
2013-02-22 16:42:27 -05:00
|
|
|
//connect(newsFeed, SIGNAL(newsFeedChanged(int)), this, SLOT(newsFeedChanged(int)));
|
2009-09-25 21:10:25 -04:00
|
|
|
|
2013-07-16 18:33:45 -04:00
|
|
|
// menu = new QMenu();
|
|
|
|
// menu->addAction(ui.actionAdd_Friend);
|
|
|
|
// menu->addAction(ui.actionAdd_Group);
|
|
|
|
// menu->addAction(ui.actionCreate_new_Chat_lobby);
|
|
|
|
//
|
|
|
|
// menu->addSeparator();
|
|
|
|
// menu->addAction(ui.actionSet_your_Avatar);
|
|
|
|
// menu->addAction(ui.actionSet_your_Personal_Message);
|
|
|
|
//
|
|
|
|
// ui.menutoolButton->setMenu(menu);
|
2010-09-04 10:23:30 -04:00
|
|
|
|
2014-09-24 10:58:05 -04:00
|
|
|
/*QToolButton *addFriendButton = new QToolButton(this);
|
2014-04-29 07:52:13 -04:00
|
|
|
addFriendButton->setIcon(QIcon(":/images/user/add_user24.png"));
|
2014-09-09 15:19:18 -04:00
|
|
|
addFriendButton->setToolTip(tr("Add friend node"));
|
2014-04-29 07:52:13 -04:00
|
|
|
connect(addFriendButton, SIGNAL(clicked()), this, SLOT(addFriend()));
|
2014-09-24 10:58:05 -04:00
|
|
|
ui.friendList->addToolButton(addFriendButton);*/
|
2014-04-29 07:52:13 -04:00
|
|
|
|
2011-08-15 19:42:07 -04:00
|
|
|
/* Set initial size the splitter */
|
2014-12-12 14:44:45 -05:00
|
|
|
ui.splitter->setStretchFactor(0, 0);
|
|
|
|
ui.splitter->setStretchFactor(1, 1);
|
2014-12-29 16:41:05 -05:00
|
|
|
/*remove
|
|
|
|
QList<int> sizes;
|
2011-08-15 19:42:07 -04:00
|
|
|
sizes << height() << 100; // Qt calculates the right sizes
|
2014-12-29 16:41:05 -05:00
|
|
|
ui.splitter_2->setSizes(sizes);*/
|
2011-08-15 19:42:07 -04:00
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
loadmypersonalstatus();
|
|
|
|
|
2014-12-23 20:40:08 -05:00
|
|
|
ui.mypersonalstatusLabel->setMinimumWidth(25);
|
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
// load settings
|
2011-10-20 17:34:44 -04:00
|
|
|
RsAutoUpdatePage::lockAllEvents();
|
2014-11-06 11:15:23 -05:00
|
|
|
ui.friendList->setShowStatusColumn(false);
|
2011-11-11 20:26:26 -05:00
|
|
|
ui.friendList->setShowLastContactColumn(false);
|
2014-11-20 20:54:21 -05:00
|
|
|
ui.friendList->setShowAvatarColumn(true);
|
2013-09-10 18:04:39 -04:00
|
|
|
ui.friendList->setShowIPColumn(false);
|
2011-11-11 20:26:26 -05:00
|
|
|
ui.friendList->setRootIsDecorated(true);
|
|
|
|
ui.friendList->setShowGroups(true);
|
2010-09-04 10:23:30 -04:00
|
|
|
processSettings(true);
|
2011-10-20 17:34:44 -04:00
|
|
|
RsAutoUpdatePage::unlockAllEvents();
|
2010-09-04 10:23:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
// add self nick and Avatar to Friends.
|
|
|
|
RsPeerDetails pd ;
|
|
|
|
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
|
2014-12-14 10:46:20 -05:00
|
|
|
ui.nicknameLabel->setText(QString::fromUtf8(pd.name.c_str()));
|
2010-09-04 10:23:30 -04:00
|
|
|
}
|
|
|
|
|
2013-09-08 11:08:36 -04:00
|
|
|
QString hlp_str = tr(
|
2014-09-09 15:19:18 -04:00
|
|
|
" <h1><img width=\"32\" src=\":/images/64px_help.png\"> Network</h1> \
|
|
|
|
<p>The Network tab shows your friend Retroshare nodes: the neighbor Retroshare nodes that are connected to you. \
|
2013-09-08 11:08:36 -04:00
|
|
|
</p> \
|
2014-09-09 15:19:18 -04:00
|
|
|
<p>You can group nodes together to allow a finer level of information access, for instance to only allow \
|
|
|
|
some nodes to see some of your files.</p> \
|
2013-09-08 11:08:36 -04:00
|
|
|
<p>On the right, you will find 3 useful tabs: \
|
|
|
|
<ul> \
|
2014-09-09 15:19:18 -04:00
|
|
|
<li>Broadcast sends messages to all connected nodes at once</li> \
|
|
|
|
<li>Local network graph shows the network around you, based on discovery information</li> \
|
|
|
|
<li>Keyring contains node keys you collected, mostly forwarded to you by your friend nodes</li> \
|
2013-09-08 11:08:36 -04:00
|
|
|
</ul> </p> \
|
|
|
|
") ;
|
2013-07-19 08:18:58 -04:00
|
|
|
|
|
|
|
registerHelpButton(ui.helpButton, hlp_str) ;
|
|
|
|
|
2010-09-04 10:23:30 -04:00
|
|
|
/* Hide platform specific features */
|
2008-11-24 09:07:26 -05:00
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
FriendsDialog::~FriendsDialog ()
|
2010-05-11 16:02:52 -04:00
|
|
|
{
|
2010-06-08 17:38:36 -04:00
|
|
|
// save settings
|
|
|
|
processSettings(false);
|
2012-01-18 15:02:19 -05:00
|
|
|
|
|
|
|
if (this == instance) {
|
|
|
|
instance = NULL;
|
|
|
|
}
|
2010-05-11 16:02:52 -04:00
|
|
|
}
|
|
|
|
|
2013-02-23 09:29:36 -05:00
|
|
|
void FriendsDialog::activatePage(FriendsDialog::Page page)
|
|
|
|
{
|
|
|
|
switch(page)
|
|
|
|
{
|
2014-05-07 19:45:53 -04:00
|
|
|
case FriendsDialog::IdTab: ui.tabWidget->setCurrentWidget(idDialog) ;
|
|
|
|
break ;
|
2014-09-10 04:37:27 -04:00
|
|
|
#ifdef RS_USE_CIRCLES
|
2014-05-07 19:45:53 -04:00
|
|
|
case FriendsDialog::CirclesTab: ui.tabWidget->setCurrentWidget(circlesDialog) ;
|
|
|
|
break ;
|
2014-09-10 04:37:27 -04:00
|
|
|
#endif
|
2013-02-23 09:29:36 -05:00
|
|
|
case FriendsDialog::NetworkTab: ui.tabWidget->setCurrentWidget(networkDialog) ;
|
|
|
|
break ;
|
|
|
|
case FriendsDialog::BroadcastTab: ui.tabWidget->setCurrentWidget(networkDialog) ;
|
|
|
|
break ;
|
|
|
|
case FriendsDialog::NetworkViewTab: ui.tabWidget->setCurrentWidget(networkView) ;
|
|
|
|
break ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-05 16:12:55 -04:00
|
|
|
UserNotify *FriendsDialog::getUserNotify(QObject *parent)
|
|
|
|
{
|
|
|
|
return new ChatUserNotify(parent);
|
|
|
|
}
|
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
void FriendsDialog::processSettings(bool bLoad)
|
2010-06-08 17:38:36 -04:00
|
|
|
{
|
2011-05-17 13:27:47 -04:00
|
|
|
Settings->beginGroup(QString("FriendsDialog"));
|
2010-06-08 17:38:36 -04:00
|
|
|
|
|
|
|
if (bLoad) {
|
|
|
|
// load settings
|
|
|
|
|
|
|
|
// state of splitter
|
|
|
|
ui.splitter->restoreState(Settings->value("Splitter").toByteArray());
|
2014-12-29 16:41:05 -05:00
|
|
|
//remove ui.splitter_2->restoreState(Settings->value("GroupChatSplitter").toByteArray());
|
2010-06-08 17:38:36 -04:00
|
|
|
} else {
|
|
|
|
// save settings
|
|
|
|
|
|
|
|
// state of splitter
|
|
|
|
Settings->setValue("Splitter", ui.splitter->saveState());
|
2014-12-29 16:41:05 -05:00
|
|
|
//remove Settings->setValue("GroupChatSplitter", ui.splitter_2->saveState());
|
2010-06-08 17:38:36 -04:00
|
|
|
}
|
|
|
|
|
2011-11-11 20:26:26 -05:00
|
|
|
ui.friendList->processSettings(bLoad);
|
|
|
|
|
2010-06-08 17:38:36 -04:00
|
|
|
Settings->endGroup();
|
|
|
|
}
|
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
void FriendsDialog::showEvent(QShowEvent *event)
|
2010-09-04 10:23:30 -04:00
|
|
|
{
|
|
|
|
static bool first = true;
|
|
|
|
if (first) {
|
|
|
|
// Workaround: now the scroll position is correct calculated
|
|
|
|
first = false;
|
2014-12-29 16:41:05 -05:00
|
|
|
/* remove
|
2010-09-04 10:23:30 -04:00
|
|
|
QScrollBar *scrollbar = ui.msgText->verticalScrollBar();
|
|
|
|
scrollbar->setValue(scrollbar->maximum());
|
2014-12-29 16:41:05 -05:00
|
|
|
*/
|
2010-09-04 10:23:30 -04:00
|
|
|
}
|
2010-09-10 16:43:11 -04:00
|
|
|
|
|
|
|
RsAutoUpdatePage::showEvent(event);
|
2010-09-04 10:23:30 -04:00
|
|
|
}
|
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
void FriendsDialog::chatMessageReceived(const ChatMessage &msg)
|
2010-03-17 11:34:36 -04:00
|
|
|
{
|
2014-12-29 16:41:05 -05:00
|
|
|
if(msg.chat_id.isBroadcast())
|
|
|
|
{
|
|
|
|
QDateTime sendTime = QDateTime::fromTime_t(msg.sendTime);
|
|
|
|
QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime);
|
|
|
|
QString message = QString::fromUtf8(msg.msg.c_str());
|
|
|
|
QString name = QString::fromUtf8(rsPeers->getPeerName(msg.broadcast_peer_id).c_str());
|
2010-03-17 11:34:36 -04:00
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
ui.chatWidget->addChatMsg(msg.incoming, name, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL);
|
|
|
|
}
|
2010-03-17 11:34:36 -04:00
|
|
|
}
|
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
void FriendsDialog::chatStatusReceived(const ChatId &chat_id, const QString &status_string)
|
2012-04-12 19:00:39 -04:00
|
|
|
{
|
2014-12-29 16:41:05 -05:00
|
|
|
if(chat_id.isBroadcast())
|
|
|
|
{
|
|
|
|
QString name = QString::fromUtf8(rsPeers->getPeerName(chat_id.broadcast_status_peer_id).c_str());
|
|
|
|
ui.chatWidget->updateStatusString(name + " %1", status_string);
|
2012-04-12 19:00:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
void FriendsDialog::updateDisplay()
|
2009-11-17 07:45:06 -05:00
|
|
|
{
|
2007-11-14 22:18:48 -05:00
|
|
|
}
|
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
void FriendsDialog::addFriend()
|
2010-09-29 15:30:59 -04:00
|
|
|
{
|
2011-10-20 17:34:44 -04:00
|
|
|
std::string groupId = ui.friendList->getSelectedGroupId();
|
2010-09-29 15:30:59 -04:00
|
|
|
|
|
|
|
ConnectFriendWizard connwiz (this);
|
|
|
|
|
|
|
|
if (groupId.empty() == false) {
|
|
|
|
connwiz.setGroup(groupId);
|
|
|
|
}
|
|
|
|
|
|
|
|
connwiz.exec ();
|
|
|
|
}
|
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
void FriendsDialog::getAvatar()
|
2009-09-02 18:42:31 -04:00
|
|
|
{
|
2011-08-12 16:27:05 -04:00
|
|
|
QByteArray ba;
|
|
|
|
if (misc::getOpenAvatarPicture(this, ba))
|
2009-09-02 18:42:31 -04:00
|
|
|
{
|
2011-05-24 19:35:11 -04:00
|
|
|
#ifdef FRIENDS_DEBUG
|
2011-08-12 16:27:05 -04:00
|
|
|
std::cerr << "Avatar image size = " << ba.size() << std::endl ;
|
2011-05-24 19:35:11 -04:00
|
|
|
#endif
|
2009-09-02 18:42:31 -04:00
|
|
|
|
2011-08-12 16:27:05 -04:00
|
|
|
rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()), ba.size()) ; // last char 0 included.
|
2009-09-02 18:42:31 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-29 18:52:46 -04:00
|
|
|
/** Loads own personal status */
|
2011-05-17 13:27:47 -04:00
|
|
|
void FriendsDialog::loadmypersonalstatus()
|
2009-09-29 18:52:46 -04:00
|
|
|
{
|
2014-12-15 10:53:10 -05:00
|
|
|
QString statustring = QString::fromUtf8(rsMsgs->getCustomStateString().c_str());
|
|
|
|
|
|
|
|
if (statustring.isEmpty())
|
|
|
|
{
|
2014-12-22 10:44:47 -05:00
|
|
|
ui.mypersonalstatusLabel->setText(tr("Set your status message here."));
|
2014-12-15 10:53:10 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui.mypersonalstatusLabel->setText(statustring);
|
|
|
|
}
|
2009-09-29 18:52:46 -04:00
|
|
|
}
|
2009-10-08 15:08:44 -04:00
|
|
|
|
2011-05-17 13:27:47 -04:00
|
|
|
void FriendsDialog::statusmessage()
|
2009-10-08 15:08:44 -04:00
|
|
|
{
|
2010-05-02 20:09:55 -04:00
|
|
|
StatusMessage statusmsgdialog (this);
|
|
|
|
statusmsgdialog.exec();
|
2009-10-08 15:08:44 -04:00
|
|
|
}
|
2010-01-31 17:29:30 -05:00
|
|
|
|
2012-03-30 19:02:52 -04:00
|
|
|
/*static*/ bool FriendsDialog::isGroupChatActive()
|
|
|
|
{
|
|
|
|
FriendsDialog *friendsDialog = dynamic_cast<FriendsDialog*>(MainWindow::getPage(MainWindow::Friends));
|
|
|
|
if (!friendsDialog) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (friendsDialog->ui.tabWidget->currentWidget() == friendsDialog->ui.groupChatTab) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*static*/ void FriendsDialog::groupChatActivate()
|
|
|
|
{
|
|
|
|
FriendsDialog *friendsDialog = dynamic_cast<FriendsDialog*>(MainWindow::getPage(MainWindow::Friends));
|
|
|
|
if (!friendsDialog) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::showWindow(MainWindow::Friends);
|
|
|
|
friendsDialog->ui.tabWidget->setCurrentWidget(friendsDialog->ui.groupChatTab);
|
2014-12-29 16:41:05 -05:00
|
|
|
friendsDialog->ui.chatWidget->focusDialog();
|
2012-03-30 19:02:52 -04:00
|
|
|
}
|