mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Beautify Answer Button for VOIP Toaster
Display peername on voip notify text git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8307 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8b8ffa8caa
commit
fc97cdcfa2
@ -35,6 +35,7 @@
|
||||
#include "QVideoDevice.h"
|
||||
|
||||
#include <retroshare/rsstatus.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
#define CALL_START ":/images/call-start.png"
|
||||
#define CALL_STOP ":/images/call-stop.png"
|
||||
@ -288,7 +289,7 @@ void VOIPChatWidgetHolder::addVideoData(const RsPeerId &peer_id, QByteArray* arr
|
||||
{
|
||||
if (!videoCaptureToggleButton->isChecked()) {
|
||||
if (mChatWidget) {
|
||||
QString buttonName = QString::fromStdString(peer_id.toStdString());
|
||||
QString buttonName = QString::fromUtf8(rsPeers->getPeerName(peer_id).c_str());
|
||||
if (buttonName.isEmpty()) buttonName = "VoIP";//TODO maybe change all with GxsId
|
||||
button_map::iterator it = buttonMapTakeVideo.find(buttonName);
|
||||
if (it == buttonMapTakeVideo.end()){
|
||||
@ -380,7 +381,7 @@ void VOIPChatWidgetHolder::addAudioData(const RsPeerId &peer_id, QByteArray* arr
|
||||
}
|
||||
|
||||
if (mChatWidget) {
|
||||
QString buttonName = QString::fromStdString(peer_id.toStdString());
|
||||
QString buttonName = QString::fromUtf8(rsPeers->getPeerName(peer_id).c_str());
|
||||
if (buttonName.isEmpty()) buttonName = "VoIP";//TODO maybe change all with GxsId
|
||||
button_map::iterator it = buttonMapTakeVideo.find(buttonName);
|
||||
if (it == buttonMapTakeVideo.end()){
|
||||
|
@ -40,9 +40,11 @@ VOIPToasterItem::VOIPToasterItem(const RsPeerId &peer_id, const QString &msg, co
|
||||
switch (mType){
|
||||
case AudioCall:
|
||||
toasterButton->setIcon(QIcon("://images/call-start.png"));
|
||||
toasterButton->setText(tr("Answer"));
|
||||
break;
|
||||
case VideoCall:
|
||||
toasterButton->setIcon(QIcon("://images/video-icon-on.png"));
|
||||
toasterButton->setText(tr("Answer with video"));
|
||||
break;
|
||||
default:
|
||||
ChatDialog::chatFriend(ChatId(mPeerId));
|
||||
@ -53,7 +55,7 @@ VOIPToasterItem::VOIPToasterItem(const RsPeerId &peer_id, const QString &msg, co
|
||||
|
||||
/* set informations */
|
||||
textLabel->setText(RsHtml().formatText(NULL, msg, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE));
|
||||
toasterLabel->setText(QString::fromUtf8(rsPeers->getPeerName(mPeerId).c_str()));
|
||||
//toasterLabel->setText(QString::fromUtf8(rsPeers->getPeerName(mPeerId).c_str()));
|
||||
avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME);
|
||||
avatarWidget->setId(ChatId(mPeerId));
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
@ -70,7 +70,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/logo/logo_16.png</pixmap>
|
||||
<pixmap>:/images/logo/logo_16.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
@ -80,7 +80,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="toasterLabel">
|
||||
<property name="text">
|
||||
<string notr="true">Name</string>
|
||||
<string notr="true">RetroShare</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -112,7 +112,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/images/closenormal.png</normaloff>:/images/closenormal.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
@ -123,27 +123,70 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="toasterButton">
|
||||
<property name="text">
|
||||
<string>Show Chat</string>
|
||||
<widget class="QLabel" name="textLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>218</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="textLabel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>218</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
<widget class="QPushButton" name="toasterButton">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton{
|
||||
border: 1px solid #199909;
|
||||
font-size: 12pt; color: white;
|
||||
min-width: 128px; min-height: 24px;
|
||||
border-radius: 6px;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.67,
|
||||
stop: 0 #22c70d, stop: 1 #116a06);
|
||||
}
|
||||
QPushButton::hover{
|
||||
border: 1px solid #199909;
|
||||
font-size: 12pt; color: white;
|
||||
min-width: 128px; min-height: 24px;
|
||||
border-radius: 6px;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.67,
|
||||
stop: 0 #26df0f, stop: 1 #1db20a);
|
||||
}
|
||||
|
||||
QPushButton::pressed{
|
||||
border: 1px solid #333333;
|
||||
font-size: 12pt; color: white;
|
||||
min-width: 128px; min-height: 24px;
|
||||
border-radius: 6px;
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.67,
|
||||
stop: 0 #444444, stop: 1 #222222);
|
||||
} </string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -179,8 +222,7 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="VOIP_images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -322,7 +322,7 @@ void VOIPToasterNotify::voipAudioCallReceived(const RsPeerId &peer_id)
|
||||
if (!mToasterAudioCall.contains(peer_id)){
|
||||
ToasterItemData toasterItemData;
|
||||
toasterItemData.mPeerId = peer_id;
|
||||
toasterItemData.mMsg = tr("Audio Call received from this peer.");
|
||||
toasterItemData.mMsg = QString::fromUtf8(rsPeers->getPeerName(toasterItemData.mPeerId).c_str()) + " " + tr("calling");
|
||||
|
||||
mPendingToasterAudioCall.push_back(toasterItemData);
|
||||
mToasterAudioCall.insert(peer_id, NULL);
|
||||
@ -346,7 +346,7 @@ void VOIPToasterNotify::voipVideoCallReceived(const RsPeerId &peer_id)
|
||||
if (!mToasterVideoCall.contains(peer_id)){
|
||||
ToasterItemData toasterItemData;
|
||||
toasterItemData.mPeerId = peer_id;
|
||||
toasterItemData.mMsg = tr("Video Call received from this peer.");
|
||||
toasterItemData.mMsg = QString::fromUtf8(rsPeers->getPeerName(toasterItemData.mPeerId).c_str()) + " " + tr("calling");
|
||||
|
||||
mPendingToasterVideoCall.push_back(toasterItemData);
|
||||
mToasterVideoCall.insert(peer_id, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user