* Moved to display own video at bottom and Friend at top.

* Added to display system message text when call is stopped.
* Fixing spaces on chat window.
* Clean up chatwidget buttons, moved text color to the font menu button

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7731 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-12-06 14:21:36 +00:00
parent 7a06e2f449
commit b11459329b
7 changed files with 101 additions and 132 deletions

View File

@ -108,8 +108,8 @@ VOIPChatWidgetHolder::VOIPChatWidgetHolder(ChatWidget *chatWidget)
// Make a widget with two video devices, one for echo, and one for the talking peer. // Make a widget with two video devices, one for echo, and one for the talking peer.
videoWidget = new QWidget(mChatWidget) ; videoWidget = new QWidget(mChatWidget) ;
videoWidget->setLayout(new QVBoxLayout()) ; videoWidget->setLayout(new QVBoxLayout()) ;
videoWidget->layout()->addWidget(echoVideoDevice = new QVideoOutputDevice(videoWidget)) ;
videoWidget->layout()->addWidget(outputVideoDevice = new QVideoOutputDevice(videoWidget)) ; videoWidget->layout()->addWidget(outputVideoDevice = new QVideoOutputDevice(videoWidget)) ;
videoWidget->layout()->addWidget(echoVideoDevice = new QVideoOutputDevice(videoWidget)) ;
videoWidget->hide(); videoWidget->hide();
connect(inputVideoDevice, SIGNAL(networkPacketReady()), this, SLOT(sendVideoData())); connect(inputVideoDevice, SIGNAL(networkPacketReady()), this, SLOT(sendVideoData()));
@ -159,6 +159,11 @@ void VOIPChatWidgetHolder::hangupCall()
if (outputAudioDevice) { if (outputAudioDevice) {
outputAudioDevice->stop(); outputAudioDevice->stop();
} }
if (mChatWidget) {
mChatWidget->addChatMsg(true, tr("VoIP Status"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("Outgoing Call stopped."), ChatWidget::MSGTYPE_SYSTEM);
}
audioListenToggleButton->setChecked(false); audioListenToggleButton->setChecked(false);
audioCaptureToggleButton->setChecked(false); audioCaptureToggleButton->setChecked(false);
hangupButton->hide(); hangupButton->hide();
@ -219,6 +224,9 @@ void VOIPChatWidgetHolder::toggleVideoCapture()
videoCaptureToggleButton->setToolTip(tr("Activate camera")); videoCaptureToggleButton->setToolTip(tr("Activate camera"));
outputVideoDevice->showFrameOff(); outputVideoDevice->showFrameOff();
videoWidget->hide(); videoWidget->hide();
if (mChatWidget)
mChatWidget->addChatMsg(true, tr("VoIP Status"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("Video call stopped"), ChatWidget::MSGTYPE_SYSTEM);
} }
} }

View File

@ -108,17 +108,14 @@ ChatWidget::ChatWidget(QWidget *parent) :
connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendChat())); connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendChat()));
connect(ui->addFileButton, SIGNAL(clicked()), this , SLOT(addExtraFile())); connect(ui->addFileButton, SIGNAL(clicked()), this , SLOT(addExtraFile()));
//connect(ui->textboldButton, SIGNAL(clicked()), this, SLOT(setFont()));
//connect(ui->textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
//connect(ui->textitalicButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture())); connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture()));
connect(ui->colorButton, SIGNAL(clicked()), this, SLOT(chooseColor()));
connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget())); connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory())); connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory()));
connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory())); connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory()));
connect(ui->actionMessageHistory, SIGNAL(triggered()), this, SLOT(messageHistory())); connect(ui->actionMessageHistory, SIGNAL(triggered()), this, SLOT(messageHistory()));
connect(ui->actionChooseFont, SIGNAL(triggered()), this, SLOT(chooseFont())); connect(ui->actionChooseFont, SIGNAL(triggered()), this, SLOT(chooseFont()));
connect(ui->actionChooseColor, SIGNAL(triggered()), this, SLOT(chooseColor()));
connect(ui->actionResetFont, SIGNAL(triggered()), this, SLOT(resetFont())); connect(ui->actionResetFont, SIGNAL(triggered()), this, SLOT(resetFont()));
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>))); connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
@ -143,6 +140,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
menu->addAction(ui->actionChooseFont); menu->addAction(ui->actionChooseFont);
menu->addAction(ui->actionChooseColor);
menu->addAction(ui->actionResetFont); menu->addAction(ui->actionResetFont);
ui->fontButton->setMenu(menu); ui->fontButton->setMenu(menu);
@ -246,7 +244,6 @@ void ChatWidget::init(const RsPeerId &peerId, const QString &title)
currentFont.fromString(PeerSettings->getPrivateChatFont(peerId)); currentFont.fromString(PeerSettings->getPrivateChatFont(peerId));
colorChanged(); colorChanged();
//fontChanged();
setColorAndFont(); setColorAndFont();
// load style // load style
@ -1112,7 +1109,7 @@ void ChatWidget::colorChanged()
{ {
QPixmap pix(16, 16); QPixmap pix(16, 16);
pix.fill(currentColor); pix.fill(currentColor);
ui->colorButton->setIcon(pix); ui->actionChooseColor->setIcon(pix);
} }
void ChatWidget::chooseFont() void ChatWidget::chooseFont()
@ -1121,7 +1118,6 @@ void ChatWidget::chooseFont()
QFont font = QFontDialog::getFont(&ok, currentFont, this); QFont font = QFontDialog::getFont(&ok, currentFont, this);
if (ok) { if (ok) {
currentFont = font; currentFont = font;
//fontChanged();
setFont(); setFont();
} }
} }
@ -1129,22 +1125,11 @@ void ChatWidget::chooseFont()
void ChatWidget::resetFont() void ChatWidget::resetFont()
{ {
currentFont.fromString(Settings->getChatScreenFont()); currentFont.fromString(Settings->getChatScreenFont());
//fontChanged();
setFont(); setFont();
} }
void ChatWidget::fontChanged()
{
//ui->textboldButton->setChecked(currentFont.bold());
//ui->textunderlineButton->setChecked(currentFont.underline());
//ui->textitalicButton->setChecked(currentFont.italic());
}
void ChatWidget::setColorAndFont() void ChatWidget::setColorAndFont()
{ {
//currentFont.setBold(ui->textboldButton->isChecked());
//currentFont.setUnderline(ui->textunderlineButton->isChecked());
//currentFont.setItalic(ui->textitalicButton->isChecked());
ui->chatTextEdit->setFont(currentFont); ui->chatTextEdit->setFont(currentFont);
ui->chatTextEdit->setTextColor(currentColor); ui->chatTextEdit->setTextColor(currentColor);

View File

@ -173,7 +173,6 @@ private:
void setCurrentFileName(const QString &fileName); void setCurrentFileName(const QString &fileName);
void colorChanged(); void colorChanged();
void fontChanged();
void setColorAndFont(); void setColorAndFont();
void processSettings(bool load); void processSettings(bool load);

View File

@ -540,14 +540,20 @@ border-image: url(:/images/closepressed.png)
</size> </size>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::TabFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Font</string> <string>Set text font &amp; color</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/fonts.png</normaloff>:/images/fonts.png</iconset> <normaloff>:/images/textedit/format-text-color.png</normaloff>:/images/textedit/format-text-color.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property> </property>
<property name="popupMode"> <property name="popupMode">
<enum>QToolButton::InstantPopup</enum> <enum>QToolButton::InstantPopup</enum>
@ -557,31 +563,6 @@ border-image: url(:/images/closepressed.png)
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QToolButton" name="colorButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Text Color</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="attachPictureButton"> <widget class="QToolButton" name="attachPictureButton">
<property name="minimumSize"> <property name="minimumSize">
@ -629,7 +610,7 @@ border-image: url(:/images/closepressed.png)
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Add a File for your Friend</string> <string>Attach a File</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
@ -836,6 +817,11 @@ border-image: url(:/images/closepressed.png)
<string>WARNING: Could take long time on big history.</string> <string>WARNING: Could take long time on big history.</string>
</property> </property>
</action> </action>
<action name="actionChooseColor">
<property name="text">
<string>Choose color</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

@ -102,10 +102,7 @@
</size> </size>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin"> <property name="margin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>

View File

@ -41,12 +41,6 @@
</widget> </widget>
<widget class="QStatusBar" name="chatstatusbar"/> <widget class="QStatusBar" name="chatstatusbar"/>
<widget class="QToolBar" name="chattoolBar"> <widget class="QToolBar" name="chattoolBar">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="movable"> <property name="movable">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -55,8 +49,8 @@
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>24</width> <width>32</width>
<height>24</height> <height>32</height>
</size> </size>
</property> </property>
<property name="floatable"> <property name="floatable">

View File

@ -25,7 +25,7 @@ QString retroshareVersion();
QString retroshareRevision(); QString retroshareRevision();
#define GUI_VERSION "0.6.x" #define GUI_VERSION "0.6.x"
#define GUI_REVISION "Revision: 7106" #define GUI_REVISION "Revision: 7669"