added the toaster files

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6871 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2013-10-22 12:04:11 +00:00
parent ad45aa18c4
commit 3ba5a72787
3 changed files with 321 additions and 0 deletions

View File

@ -0,0 +1,46 @@
/*
* RetroShare
* Copyright (C) 2012 RetroShare Team
*
* 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
*/
#include "CallToaster.h"
#include "gui/chat/ChatDialog.h"
#include <retroshare/rspeers.h>
CallToaster::CallToaster(const std::string &peerId) : QWidget(NULL)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
this->peerId = peerId;
/* connect buttons */
connect(ui.toasterButton, SIGNAL(clicked()), SLOT(chatButtonSlot()));
connect(ui.closeButton, SIGNAL(clicked()), SLOT(hide()));
/* set informations */
ui.textLabel->setText(QString::fromUtf8(rsPeers->getPeerName(peerId).c_str()));
ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME);
ui.avatarWidget->setId(peerId, false);
}
void CallToaster::chatButtonSlot()
{
ChatDialog::chatFriend(peerId);
hide();
}

View File

@ -0,0 +1,47 @@
/*
* RetroShare
* Copyright (C) 2013 RetroShare Team
*
* 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
*/
#ifndef CALLTOASTER_H
#define CALLTOASTER_H
#include "ui_CallToaster.h"
/**
* Shows a toaster when friend is Calling you .
*
*
*/
class CAllToaster : public QWidget
{
Q_OBJECT
public:
CallToaster(const std::string &peerId);
private slots:
void chatButtonSlot();
private:
std::string peerId;
/** Qt Designer generated object */
Ui::CallToaster ui;
};
#endif //MESSAGETOASTER_H

View File

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CallToaster</class>
<widget class="QWidget" name="CallToaster">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>100</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>100</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="windowFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>1</number>
</property>
<property name="spacing">
<number>1</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="toasterImage">
<property name="minimumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="pixmap">
<pixmap>:/images/rstray3.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="toasterLabel">
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">Name</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="minimumSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/closenormal.png</normaloff>:/images/closenormal.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" rowspan="2">
<widget class="AvatarWidget" name="avatarWidget">
<property name="minimumSize">
<size>
<width>70</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>70</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLabel" name="textLabel">
<property name="maximumSize">
<size>
<width>218</width>
<height>43</height>
</size>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="toasterButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Answer</string>
</property>
<property name="icon">
<iconset resource="VOIP_images.qrc">
<normaloff>:/images/call-start-22.png</normaloff>:/images/call-start-22.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Decline</string>
</property>
<property name="icon">
<iconset resource="VOIP_images.qrc">
<normaloff>:/images/call-stop-22.png</normaloff>:/images/call-stop-22.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>AvatarWidget</class>
<extends>QLabel</extends>
<header>gui/common/AvatarWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="VOIP_images.qrc"/>
</resources>
<connections/>
</ui>