mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
* 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:
parent
7a06e2f449
commit
b11459329b
@ -108,8 +108,8 @@ VOIPChatWidgetHolder::VOIPChatWidgetHolder(ChatWidget *chatWidget)
|
||||
// Make a widget with two video devices, one for echo, and one for the talking peer.
|
||||
videoWidget = new QWidget(mChatWidget) ;
|
||||
videoWidget->setLayout(new QVBoxLayout()) ;
|
||||
videoWidget->layout()->addWidget(echoVideoDevice = new QVideoOutputDevice(videoWidget)) ;
|
||||
videoWidget->layout()->addWidget(outputVideoDevice = new QVideoOutputDevice(videoWidget)) ;
|
||||
videoWidget->layout()->addWidget(echoVideoDevice = new QVideoOutputDevice(videoWidget)) ;
|
||||
videoWidget->hide();
|
||||
|
||||
connect(inputVideoDevice, SIGNAL(networkPacketReady()), this, SLOT(sendVideoData()));
|
||||
@ -159,6 +159,11 @@ void VOIPChatWidgetHolder::hangupCall()
|
||||
if (outputAudioDevice) {
|
||||
outputAudioDevice->stop();
|
||||
}
|
||||
|
||||
if (mChatWidget) {
|
||||
mChatWidget->addChatMsg(true, tr("VoIP Status"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("Outgoing Call stopped."), ChatWidget::MSGTYPE_SYSTEM);
|
||||
}
|
||||
|
||||
audioListenToggleButton->setChecked(false);
|
||||
audioCaptureToggleButton->setChecked(false);
|
||||
hangupButton->hide();
|
||||
@ -219,6 +224,9 @@ void VOIPChatWidgetHolder::toggleVideoCapture()
|
||||
videoCaptureToggleButton->setToolTip(tr("Activate camera"));
|
||||
outputVideoDevice->showFrameOff();
|
||||
videoWidget->hide();
|
||||
|
||||
if (mChatWidget)
|
||||
mChatWidget->addChatMsg(true, tr("VoIP Status"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("Video call stopped"), ChatWidget::MSGTYPE_SYSTEM);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,17 +108,14 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
||||
connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendChat()));
|
||||
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->colorButton, SIGNAL(clicked()), this, SLOT(chooseColor()));
|
||||
connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
|
||||
connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||
connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory()));
|
||||
connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory()));
|
||||
connect(ui->actionMessageHistory, SIGNAL(triggered()), this, SLOT(messageHistory()));
|
||||
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->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
@ -143,6 +140,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
||||
|
||||
QMenu *menu = new QMenu();
|
||||
menu->addAction(ui->actionChooseFont);
|
||||
menu->addAction(ui->actionChooseColor);
|
||||
menu->addAction(ui->actionResetFont);
|
||||
ui->fontButton->setMenu(menu);
|
||||
|
||||
@ -246,7 +244,6 @@ void ChatWidget::init(const RsPeerId &peerId, const QString &title)
|
||||
currentFont.fromString(PeerSettings->getPrivateChatFont(peerId));
|
||||
|
||||
colorChanged();
|
||||
//fontChanged();
|
||||
setColorAndFont();
|
||||
|
||||
// load style
|
||||
@ -1112,7 +1109,7 @@ void ChatWidget::colorChanged()
|
||||
{
|
||||
QPixmap pix(16, 16);
|
||||
pix.fill(currentColor);
|
||||
ui->colorButton->setIcon(pix);
|
||||
ui->actionChooseColor->setIcon(pix);
|
||||
}
|
||||
|
||||
void ChatWidget::chooseFont()
|
||||
@ -1121,7 +1118,6 @@ void ChatWidget::chooseFont()
|
||||
QFont font = QFontDialog::getFont(&ok, currentFont, this);
|
||||
if (ok) {
|
||||
currentFont = font;
|
||||
//fontChanged();
|
||||
setFont();
|
||||
}
|
||||
}
|
||||
@ -1129,22 +1125,11 @@ void ChatWidget::chooseFont()
|
||||
void ChatWidget::resetFont()
|
||||
{
|
||||
currentFont.fromString(Settings->getChatScreenFont());
|
||||
//fontChanged();
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatWidget::fontChanged()
|
||||
{
|
||||
//ui->textboldButton->setChecked(currentFont.bold());
|
||||
//ui->textunderlineButton->setChecked(currentFont.underline());
|
||||
//ui->textitalicButton->setChecked(currentFont.italic());
|
||||
}
|
||||
|
||||
void ChatWidget::setColorAndFont()
|
||||
{
|
||||
//currentFont.setBold(ui->textboldButton->isChecked());
|
||||
//currentFont.setUnderline(ui->textunderlineButton->isChecked());
|
||||
//currentFont.setItalic(ui->textitalicButton->isChecked());
|
||||
|
||||
ui->chatTextEdit->setFont(currentFont);
|
||||
ui->chatTextEdit->setTextColor(currentColor);
|
||||
|
@ -22,26 +22,26 @@
|
||||
|
||||
#ifndef CHATWIDGET_H
|
||||
#define CHATWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QCompleter>
|
||||
#include <QTextCursor>
|
||||
#include <QTextCharFormat>
|
||||
#include "gui/common/HashBox.h"
|
||||
#include "ChatStyle.h"
|
||||
#include "gui/style/RSStyle.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QCompleter>
|
||||
#include <QTextCursor>
|
||||
#include <QTextCharFormat>
|
||||
#include "gui/common/HashBox.h"
|
||||
#include "ChatStyle.h"
|
||||
#include "gui/style/RSStyle.h"
|
||||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rsfiles.h>
|
||||
|
||||
class QAction;
|
||||
class QTextEdit;
|
||||
class QPushButton;
|
||||
class ChatWidget;
|
||||
class QMenu;
|
||||
|
||||
namespace Ui {
|
||||
class ChatWidget;
|
||||
class QTextEdit;
|
||||
class QPushButton;
|
||||
class ChatWidget;
|
||||
class QMenu;
|
||||
|
||||
namespace Ui {
|
||||
class ChatWidget;
|
||||
}
|
||||
|
||||
// a Container for the logic behind buttons in a PopupChatDialog
|
||||
@ -95,11 +95,11 @@ public:
|
||||
bool setStyle();
|
||||
const RSStyle *getStyle() { return &style; }
|
||||
|
||||
// Adds one widget in the chat bar. Used to add e.g. new buttons. The widget should be
|
||||
// small enough in size.
|
||||
// Adds one widget in the chat bar. Used to add e.g. new buttons. The widget should be
|
||||
// small enough in size.
|
||||
void addChatBarWidget(QWidget *w) ;
|
||||
|
||||
// Adds a new horizonal widget in the layout of the chat window.
|
||||
|
||||
// Adds a new horizonal widget in the layout of the chat window.
|
||||
void addChatHorizontalWidget(QWidget *w) ;
|
||||
|
||||
bool isActive();
|
||||
@ -128,32 +128,32 @@ protected:
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
void updateTitle();
|
||||
|
||||
private slots:
|
||||
void contextMenuTextBrowser(QPoint);
|
||||
void contextMenuSearchButton(QPoint);
|
||||
void chatCharFormatChanged();
|
||||
|
||||
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||
|
||||
private slots:
|
||||
void contextMenuTextBrowser(QPoint);
|
||||
void contextMenuSearchButton(QPoint);
|
||||
void chatCharFormatChanged();
|
||||
|
||||
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||
|
||||
void smileyWidget();
|
||||
void addSmiley();
|
||||
|
||||
void addExtraFile();
|
||||
void addExtraPicture();
|
||||
void on_closeInfoFrameButton_clicked();
|
||||
void on_searchButton_clicked(bool bValue);
|
||||
void on_searchBefore_clicked();
|
||||
void on_searchAfter_clicked();
|
||||
void toogle_FindCaseSensitively();
|
||||
void toogle_FindWholeWords();
|
||||
void toogle_MoveToCursor();
|
||||
void toogle_SeachWithoutLimit();
|
||||
|
||||
void on_markButton_clicked(bool bValue);
|
||||
|
||||
void chooseColor();
|
||||
void chooseFont();
|
||||
void addExtraFile();
|
||||
void addExtraPicture();
|
||||
void on_closeInfoFrameButton_clicked();
|
||||
void on_searchButton_clicked(bool bValue);
|
||||
void on_searchBefore_clicked();
|
||||
void on_searchAfter_clicked();
|
||||
void toogle_FindCaseSensitively();
|
||||
void toogle_FindWholeWords();
|
||||
void toogle_MoveToCursor();
|
||||
void toogle_SeachWithoutLimit();
|
||||
|
||||
void on_markButton_clicked(bool bValue);
|
||||
|
||||
void chooseColor();
|
||||
void chooseFont();
|
||||
void resetFont();
|
||||
void setFont();
|
||||
|
||||
@ -163,17 +163,16 @@ private slots:
|
||||
void updatePeersCustomStateString(const QString& peer_id, const QString& status_string) ;
|
||||
|
||||
bool fileSave();
|
||||
bool fileSaveAs();
|
||||
|
||||
private:
|
||||
bool findText(const QString& qsStringToFind);
|
||||
bool findText(const QString& qsStringToFind, bool bBackWard, bool bForceMove);
|
||||
void removeFoundText();
|
||||
void updateStatusTyping();
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
|
||||
bool fileSaveAs();
|
||||
|
||||
private:
|
||||
bool findText(const QString& qsStringToFind);
|
||||
bool findText(const QString& qsStringToFind, bool bBackWard, bool bForceMove);
|
||||
void removeFoundText();
|
||||
void updateStatusTyping();
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
|
||||
void colorChanged();
|
||||
void fontChanged();
|
||||
void setColorAndFont();
|
||||
void processSettings(bool load);
|
||||
|
||||
@ -200,26 +199,26 @@ private:
|
||||
|
||||
ChatStyle chatStyle;
|
||||
RSStyle style;
|
||||
|
||||
bool firstShow;
|
||||
bool inChatCharFormatChanged;
|
||||
bool firstSearch;
|
||||
QPalette qpSave_leSearch;
|
||||
std::map<QTextCursor,QTextCharFormat> smFoundCursor;
|
||||
int iCharToStartSearch;
|
||||
bool bFindCaseSensitively;
|
||||
bool bFindWholeWords;
|
||||
bool bMoveToCursor;
|
||||
bool bSearchWithoutLimit;
|
||||
uint uiMaxSearchLimitColor;
|
||||
QColor cFoundColor;
|
||||
QString qsLastsearchText;
|
||||
QTextCursor qtcCurrent;
|
||||
|
||||
QTextCursor qtcMark;
|
||||
|
||||
TransferRequestFlags mDefaultExtraFileFlags ; // flags for extra files shared in this chat. Will be 0 by default, but might be ANONYMOUS for chat lobbies.
|
||||
QDate lastMsgDate ;
|
||||
|
||||
bool firstShow;
|
||||
bool inChatCharFormatChanged;
|
||||
bool firstSearch;
|
||||
QPalette qpSave_leSearch;
|
||||
std::map<QTextCursor,QTextCharFormat> smFoundCursor;
|
||||
int iCharToStartSearch;
|
||||
bool bFindCaseSensitively;
|
||||
bool bFindWholeWords;
|
||||
bool bMoveToCursor;
|
||||
bool bSearchWithoutLimit;
|
||||
uint uiMaxSearchLimitColor;
|
||||
QColor cFoundColor;
|
||||
QString qsLastsearchText;
|
||||
QTextCursor qtcCurrent;
|
||||
|
||||
QTextCursor qtcMark;
|
||||
|
||||
TransferRequestFlags mDefaultExtraFileFlags ; // flags for extra files shared in this chat. Will be 0 by default, but might be ANONYMOUS for chat lobbies.
|
||||
QDate lastMsgDate ;
|
||||
|
||||
QCompleter *completer;
|
||||
|
||||
|
@ -540,14 +540,20 @@ border-image: url(:/images/closepressed.png)
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
<enum>Qt::TabFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Font</string>
|
||||
<string>Set text font & color</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<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 name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
@ -557,31 +563,6 @@ border-image: url(:/images/closepressed.png)
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<widget class="QToolButton" name="attachPictureButton">
|
||||
<property name="minimumSize">
|
||||
@ -629,7 +610,7 @@ border-image: url(:/images/closepressed.png)
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add a File for your Friend</string>
|
||||
<string>Attach a File</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
@ -836,6 +817,11 @@ border-image: url(:/images/closepressed.png)
|
||||
<string>WARNING: Could take long time on big history.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChooseColor">
|
||||
<property name="text">
|
||||
<string>Choose color</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
@ -102,10 +102,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
|
@ -41,12 +41,6 @@
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="chatstatusbar"/>
|
||||
<widget class="QToolBar" name="chattoolBar">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -55,8 +49,8 @@
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="floatable">
|
||||
|
@ -25,7 +25,7 @@ QString retroshareVersion();
|
||||
QString retroshareRevision();
|
||||
|
||||
#define GUI_VERSION "0.6.x"
|
||||
#define GUI_REVISION "Revision: 7106"
|
||||
#define GUI_REVISION "Revision: 7669"
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user