2008-04-08 08:20:33 -04:00
|
|
|
/*
|
|
|
|
* RetroShare
|
|
|
|
* Copyright (C) 2006,2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2009-01-30 20:46:49 -05:00
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
#include "OnlineToaster.h"
|
2012-01-17 15:36:36 -05:00
|
|
|
#include "gui/chat/ChatDialog.h"
|
2010-12-07 19:14:12 -05:00
|
|
|
#include "util/WidgetBackgroundImage.h"
|
2008-04-08 08:20:33 -04:00
|
|
|
|
2012-03-30 19:02:52 -04:00
|
|
|
#include <retroshare/rspeers.h>
|
|
|
|
|
|
|
|
OnlineToaster::OnlineToaster(const std::string &peerId) : QWidget(NULL)
|
2010-12-07 19:14:12 -05:00
|
|
|
{
|
|
|
|
/* Invoke the Qt Designer generated object setup routine */
|
|
|
|
ui.setupUi(this);
|
2008-04-08 08:20:33 -04:00
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
this->peerId = peerId;
|
2008-04-08 08:20:33 -04:00
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
/* connect buttons */
|
|
|
|
connect(ui.messageButton, SIGNAL(clicked()), SLOT(chatButtonSlot()));
|
|
|
|
connect(ui.closeButton, SIGNAL(clicked()), SLOT(hide()));
|
2009-01-30 20:46:49 -05:00
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
/* set informations */
|
2012-03-30 19:02:52 -04:00
|
|
|
ui.messageLabel->setText(QString::fromUtf8(rsPeers->getPeerName(peerId).c_str()));
|
|
|
|
ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME);
|
|
|
|
ui.avatarWidget->setId(peerId, false);
|
2008-04-08 08:20:33 -04:00
|
|
|
|
2010-12-10 16:49:38 -05:00
|
|
|
WidgetBackgroundImage::setBackgroundImage(ui.windowFrame, ":images/toaster/backgroundtoaster.png", WidgetBackgroundImage::AdjustNone);
|
2009-01-30 20:46:49 -05:00
|
|
|
}
|
|
|
|
|
2010-12-07 19:14:12 -05:00
|
|
|
void OnlineToaster::chatButtonSlot()
|
|
|
|
{
|
2012-01-17 15:36:36 -05:00
|
|
|
ChatDialog::chatFriend(peerId);
|
2010-12-07 19:14:12 -05:00
|
|
|
hide();
|
2009-01-30 20:46:49 -05:00
|
|
|
}
|