mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-27 19:10:41 -05:00
merged with upstream/master
This commit is contained in:
commit
6c8737c84a
38 changed files with 284 additions and 109 deletions
|
|
@ -96,7 +96,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (fileSize < 1024) {
|
||||
fileSize = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", fileSize / multi);
|
||||
|
|
@ -115,7 +115,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (remaining < 1024) {
|
||||
remaining = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", remaining / multi);
|
||||
|
|
@ -134,7 +134,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (completed < 1024) {
|
||||
completed = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", completed / multi);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (fileSize < 1024) {
|
||||
fileSize = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", fileSize / multi);
|
||||
|
|
@ -104,7 +104,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
temp = "";
|
||||
} else {
|
||||
multi = 1.0;
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (transferred < 1024) {
|
||||
transferred = index.data().toLongLong();
|
||||
temp.sprintf("%.2f ", transferred / multi);
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ anonymous, you can use a fake email.</string>
|
|||
<item>
|
||||
<widget class="QLabel" name="label_hiddenaddr2">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>This can be a Tor Onion address of the form: xa76giaf6ifda7ri63i263.onion <br/>or an I2P address in the form: [52 characters].b32.i2p </p><p>In order to get one, you must configure either Tor or I2P to create a new hidden service / server tunnel. If you do not yet have one, you can still go on, and make it right later in Retroshare's Options-&gt;Server-&gt;Hidden Service configuration panel.</p></body></html></string>
|
||||
<string><html><head/><body><p>This can be a Tor Onion address of the form: xa76giaf6ifda7ri63i263.onion <br/>or an I2P address in the form: [52 characters].b32.i2p </p><p>In order to get one, you must configure either Tor or I2P to create a new hidden service / server tunnel. If you do not yet have one, you can still go on, and make it right later in RetroShare's Options-&gt;Network-&gt;Hidden Service configuration panel.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
#define HOST_SEARCH "search"
|
||||
#define HOST_CERTIFICATE "certificate"
|
||||
#define HOST_PUBLIC_MSG "public_msg"
|
||||
#define HOST_REGEXP "file|person|forum|channel|search|message|certificate|private_chat|public_msg"
|
||||
#define HOST_REGEXP "file|extra|person|forum|channel|search|message|certificate|private_chat|public_msg"
|
||||
|
||||
#define FILE_NAME "name"
|
||||
#define FILE_SIZE "size"
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi
|
|||
ui.participantsList->setColumnHidden(COLUMN_ID,true);
|
||||
|
||||
muteAct = new QAction(QIcon(), tr("Mute participant"), this);
|
||||
banAct = new QAction(QIcon(":/icons/yellow_biohazard64.png"), tr("Ban this person (Sets negative opinion)"), this);
|
||||
distantChatAct = new QAction(QIcon(":/images/chat_24.png"), tr("Start private chat"), this);
|
||||
sendMessageAct = new QAction(QIcon(":/images/mail_new.png"), tr("Send Message"), this);
|
||||
|
||||
|
|
@ -103,6 +104,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi
|
|||
connect(muteAct, SIGNAL(triggered()), this, SLOT(changePartipationState()));
|
||||
connect(distantChatAct, SIGNAL(triggered()), this, SLOT(distantChatParticipant()));
|
||||
connect(sendMessageAct, SIGNAL(triggered()), this, SLOT(sendMessage()));
|
||||
connect(banAct, SIGNAL(triggered()), this, SLOT(banParticipant()));
|
||||
|
||||
connect(actionSortByName, SIGNAL(triggered()), this, SLOT(sortParcipants()));
|
||||
connect(actionSortByActivity, SIGNAL(triggered()), this, SLOT(sortParcipants()));
|
||||
|
|
@ -201,15 +203,16 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
|
|||
contextMnu.addAction(distantChatAct);
|
||||
contextMnu.addAction(sendMessageAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(muteAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(actionSortByActivity);
|
||||
contextMnu.addAction(actionSortByName);
|
||||
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction(muteAct);
|
||||
contextMnu.addAction(banAct);
|
||||
|
||||
muteAct->setCheckable(true);
|
||||
muteAct->setEnabled(false);
|
||||
muteAct->setChecked(false);
|
||||
banAct->setEnabled(false);
|
||||
|
||||
if (selectedItems.size())
|
||||
{
|
||||
|
|
@ -219,6 +222,7 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
|
|||
if(selectedItems.count()>1 || (RsGxsId(selectedItems.at(0)->text(COLUMN_ID).toStdString())!=nickName))
|
||||
{
|
||||
muteAct->setEnabled(true);
|
||||
banAct->setEnabled(true);
|
||||
|
||||
QList<QTreeWidgetItem*>::iterator item;
|
||||
for (item = selectedItems.begin(); item != selectedItems.end(); ++item) {
|
||||
|
|
@ -237,6 +241,40 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint)
|
|||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Called when the "ban" menu is selected. Sets a negative reputation on the selected user.
|
||||
*/
|
||||
void ChatLobbyDialog::banParticipant()
|
||||
{
|
||||
QList<QTreeWidgetItem*> selectedItems = ui.participantsList->selectedItems();
|
||||
|
||||
if (selectedItems.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QList<QTreeWidgetItem*>::iterator item;
|
||||
for (item = selectedItems.begin(); item != selectedItems.end(); ++item) {
|
||||
|
||||
RsGxsId nickname;
|
||||
dynamic_cast<GxsIdRSTreeWidgetItem*>(*item)->getId(nickname) ;
|
||||
|
||||
RsGxsId gxs_id;
|
||||
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);
|
||||
|
||||
// This test avoids to mute/ban your own identity
|
||||
|
||||
if (gxs_id!=nickname)
|
||||
{
|
||||
std::cerr << "Giving negative opinion to GXS id " << nickname << std::endl;
|
||||
rsReputations->setOwnOpinion(nickname, RsReputations::OPINION_NEGATIVE);
|
||||
|
||||
dynamic_cast<GxsIdRSTreeWidgetItem*>(*item)->forceUpdate();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ChatLobbyDialog::init()
|
||||
{
|
||||
ChatLobbyInfo linfo ;
|
||||
|
|
@ -502,6 +540,8 @@ void ChatLobbyDialog::updateParticipantsList()
|
|||
|
||||
if (RsGxsId(participant.toStdString()) == gxs_id) widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_yellow_128.png"));
|
||||
|
||||
widgetitem->updateBannedState();
|
||||
|
||||
QTime qtLastAct=QTime(0,0,0).addSecs(now-tLastAct);
|
||||
widgetitem->setToolTip(COLUMN_ICON,tr("Right click to mute/unmute participants<br/>Double click to address this person<br/>")
|
||||
+tr("This participant is not active since:")
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ protected slots:
|
|||
void distantChatParticipant();
|
||||
void participantsTreeWidgetDoubleClicked(QTreeWidgetItem *item, int column);
|
||||
void sendMessage();
|
||||
void banParticipant();
|
||||
|
||||
private:
|
||||
void updateParticipantsList();
|
||||
|
|
@ -104,6 +105,7 @@ private:
|
|||
std::set<RsGxsId> mutedParticipants;
|
||||
|
||||
QAction *muteAct;
|
||||
QAction *banAct;
|
||||
QAction *distantChatAct;
|
||||
QAction *actionSortByName;
|
||||
QAction *actionSortByActivity;
|
||||
|
|
|
|||
|
|
@ -265,7 +265,13 @@ static QString getStyle(const QDir &styleDir, const QString &styleVariant, enumG
|
|||
return style;
|
||||
}
|
||||
|
||||
QString ChatStyle::formatMessage(enumFormatMessage type, const QString &name, const QDateTime ×tamp, const QString &message, unsigned int flag)
|
||||
QString ChatStyle::formatMessage(enumFormatMessage type
|
||||
, const QString &name
|
||||
, const QDateTime ×tamp
|
||||
, const QString &message
|
||||
, unsigned int flag
|
||||
, const QColor &backgroundColor /*= Qt::white*/
|
||||
)
|
||||
{
|
||||
bool me = false;
|
||||
QDomDocument doc ;
|
||||
|
|
@ -343,20 +349,27 @@ QString ChatStyle::formatMessage(enumFormatMessage type, const QString &name, co
|
|||
}
|
||||
|
||||
#ifdef COLORED_NICKNAMES
|
||||
QColor color;
|
||||
if (flag & CHAT_FORMATMSG_SYSTEM) {
|
||||
color = Qt::darkBlue;
|
||||
QColor color;
|
||||
QString colorName;
|
||||
|
||||
if (flag & CHAT_FORMATMSG_SYSTEM) {
|
||||
color = Qt::darkBlue;
|
||||
} else {
|
||||
// Calculate color from the name
|
||||
uint hash = 0;
|
||||
for (int i = 0; i < name.length(); ++i) {
|
||||
hash = (((hash << 1) + (hash >> 14)) ^ ((int) name[i].toLatin1())) & 0x3fff;
|
||||
// Calculate color from the name
|
||||
uint hash = 0;
|
||||
for (int i = 0; i < name.length(); ++i) {
|
||||
hash = (((hash << 1) + (hash >> 14)) ^ ((int) name[i].toLatin1())) & 0x3fff;
|
||||
}
|
||||
|
||||
color.setHsv(hash, 255, 150);
|
||||
color.setHsv(hash, 255, 150);
|
||||
// Always fix colors
|
||||
qreal desiredContrast = Settings->valueFromGroup("Chat", "MinimumContrast", 4.5).toDouble();
|
||||
colorName = color.name();
|
||||
RsHtml::findBestColor(colorName, backgroundColor, desiredContrast);
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(flag);
|
||||
Q_UNUSED(flag);
|
||||
Q_UNUSED(backgroundColor);
|
||||
#endif
|
||||
|
||||
QString strName = RsHtml::plainText(name).prepend(QString("<a name=\"name\">")).append(QString("</a>"));
|
||||
|
|
@ -381,7 +394,7 @@ QString ChatStyle::formatMessage(enumFormatMessage type, const QString &name, co
|
|||
.replace("%date%", strDate)
|
||||
.replace("%time%", strTime)
|
||||
#ifdef COLORED_NICKNAMES
|
||||
.replace("%color%", color.name())
|
||||
.replace("%color%", colorName)
|
||||
#endif
|
||||
.replace("%message%", messageBody ) ;
|
||||
if ( !styleOptimized.isEmpty() ) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#ifndef _CHATSTYLE_H
|
||||
#define _CHATSTYLE_H
|
||||
|
||||
#include <QColor>
|
||||
#include <QString>
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
|
|
@ -82,7 +83,7 @@ public:
|
|||
bool setStylePath(const QString &stylePath, const QString &styleVariant);
|
||||
bool setStyleFromSettings(enumStyleType styleType);
|
||||
|
||||
QString formatMessage(enumFormatMessage type, const QString &name, const QDateTime ×tamp, const QString &message, unsigned int flag = 0);
|
||||
QString formatMessage(enumFormatMessage type, const QString &name, const QDateTime ×tamp, const QString &message, unsigned int flag = 0, const QColor &backgroundColor = Qt::white);
|
||||
|
||||
static bool getAvailableStyles(enumStyleType styleType, QList<ChatStyleInfo> &styles);
|
||||
static bool getAvailableVariants(const QString &stylePath, QStringList &variants);
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const RsGxsId gx
|
|||
|
||||
QString formattedMessage = RsHtml().formatText(ui->textBrowser->document(), message, formatTextFlag, backgroundColor, desiredContrast, desiredMinimumFontSize);
|
||||
QDateTime dtTimestamp=incoming ? sendTime : recvTime;
|
||||
QString formatMsg = chatStyle.formatMessage(type, name, dtTimestamp, formattedMessage, formatFlag);
|
||||
QString formatMsg = chatStyle.formatMessage(type, name, dtTimestamp, formattedMessage, formatFlag, backgroundColor);
|
||||
QString timeStamp = dtTimestamp.toString(Qt::ISODate);
|
||||
|
||||
//replace Date and Time anchors
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ void AvatarWidget::refreshStatus()
|
|||
}
|
||||
case STATUS_FRAME:
|
||||
{
|
||||
uint32_t status ;
|
||||
uint32_t status = 0;
|
||||
|
||||
if(mId.isNotSet())
|
||||
return ;
|
||||
|
|
|
|||
|
|
@ -1818,7 +1818,7 @@ bool FriendList::importExportFriendlistFileDialog(QString &fileName, bool import
|
|||
{
|
||||
if(!misc::getSaveFileName(this,
|
||||
RshareSettings::LASTDIR_CERT,
|
||||
(import ? tr("Select file for importing yoour friendlist from") :
|
||||
(import ? tr("Select file for importing your friendlist from") :
|
||||
tr("Select a file for exporting your friendlist to")),
|
||||
tr("XML File (*.xml);;All Files (*)"),
|
||||
fileName,
|
||||
|
|
|
|||
|
|
@ -31,11 +31,12 @@
|
|||
#include "RsCollectionDialog.h"
|
||||
#include "RsCollectionFile.h"
|
||||
#include "util/misc.h"
|
||||
#define COLUMN_FILE 0
|
||||
#define COLUMN_SIZE 1
|
||||
#define COLUMN_HASH 2
|
||||
#define COLUMN_FILEC 3
|
||||
#define COLUMN_COUNT 4
|
||||
#define COLUMN_FILE 0
|
||||
#define COLUMN_FILEPATH 1
|
||||
#define COLUMN_SIZE 2
|
||||
#define COLUMN_HASH 3
|
||||
#define COLUMN_FILEC 4
|
||||
#define COLUMN_COUNT 5
|
||||
// In COLUMN_HASH (COLUMN_FILE reserved for CheckState)
|
||||
#define ROLE_NAME Qt::UserRole + 1
|
||||
#define ROLE_PATH Qt::UserRole + 2
|
||||
|
|
@ -145,6 +146,7 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
|||
|
||||
QTreeWidgetItem *headerItem = ui._fileEntriesTW->headerItem();
|
||||
headerItem->setText(COLUMN_FILE, tr("File"));
|
||||
headerItem->setText(COLUMN_FILEPATH, tr("File Path"));
|
||||
headerItem->setText(COLUMN_SIZE, tr("Size"));
|
||||
headerItem->setText(COLUMN_HASH, tr("Hash"));
|
||||
headerItem->setText(COLUMN_FILEC, tr("File Count"));
|
||||
|
|
@ -342,6 +344,7 @@ QTreeWidgetItem* RsCollectionDialog::getRootItem()
|
|||
root->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate);
|
||||
root->setText(COLUMN_FILE, "/");
|
||||
root->setToolTip(COLUMN_FILE,tr("This is the root directory."));
|
||||
root->setText(COLUMN_FILEPATH, "/");
|
||||
root->setText(COLUMN_HASH, "");
|
||||
root->setData(COLUMN_HASH, ROLE_NAME, "");
|
||||
root->setData(COLUMN_HASH, ROLE_PATH, "");
|
||||
|
|
@ -401,9 +404,9 @@ bool RsCollectionDialog::addChild(QTreeWidgetItem* parent, const std::vector<Col
|
|||
|
||||
QList<QTreeWidgetItem*> founds;
|
||||
QList<QTreeWidgetItem*> parentsFounds;
|
||||
parentsFounds = ui._fileEntriesTW->findItems(colFileInfo.path , Qt::MatchExactly | Qt::MatchRecursive, COLUMN_FILE);
|
||||
parentsFounds = ui._fileEntriesTW->findItems(colFileInfo.path , Qt::MatchExactly | Qt::MatchRecursive, COLUMN_FILEPATH);
|
||||
if (colFileInfo.type == DIR_TYPE_DIR){
|
||||
founds = ui._fileEntriesTW->findItems(colFileInfo.path + "/" +colFileInfo.name, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_FILE);
|
||||
founds = ui._fileEntriesTW->findItems(colFileInfo.path + "/" +colFileInfo.name, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_FILEPATH);
|
||||
} else {
|
||||
founds = ui._fileEntriesTW->findItems(colFileInfo.hash, Qt::MatchExactly | Qt::MatchRecursive, COLUMN_HASH);
|
||||
}
|
||||
|
|
@ -413,7 +416,8 @@ bool RsCollectionDialog::addChild(QTreeWidgetItem* parent, const std::vector<Col
|
|||
//item->setFlags(Qt::ItemIsUserCheckable | item->flags());
|
||||
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate);
|
||||
item->setCheckState(COLUMN_FILE, Qt::Checked);
|
||||
item->setText(COLUMN_FILE, colFileInfo.path + "/" + colFileInfo.name);
|
||||
item->setText(COLUMN_FILE, colFileInfo.name);
|
||||
item->setText(COLUMN_FILEPATH, colFileInfo.path + "/" + colFileInfo.name);
|
||||
item->setText(COLUMN_HASH, colFileInfo.hash);
|
||||
item->setData(COLUMN_HASH, ROLE_NAME, colFileInfo.name);
|
||||
item->setData(COLUMN_HASH, ROLE_PATH, colFileInfo.path);
|
||||
|
|
@ -704,7 +708,7 @@ void RsCollectionDialog::addRecursive(bool recursive)
|
|||
ColFileInfo root;
|
||||
if (item && (item != getRootItem())) {
|
||||
root.name = "";
|
||||
root.path = item->text(COLUMN_FILE);
|
||||
root.path = item->text(COLUMN_FILEPATH);
|
||||
} else {
|
||||
root.name = "";
|
||||
root.path = "";
|
||||
|
|
@ -725,7 +729,7 @@ void RsCollectionDialog::addRecursive(bool recursive)
|
|||
it.value() = dirToAdd.value(path);
|
||||
} else if(item) {
|
||||
if (item->data(COLUMN_HASH, ROLE_NAME) != "") {
|
||||
it.value() = item->text(COLUMN_FILE);
|
||||
it.value() = item->text(COLUMN_FILEPATH);
|
||||
}//if (item->data(COLUMN_HASH, ROLE_NAME) != "")
|
||||
}//if (dirToAdd.contains(path))
|
||||
}//for (QHash<QString,QString>::Iterator it
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ void GxsIdRSTreeWidgetItem::init()
|
|||
{
|
||||
mIdFound = false;
|
||||
mRetryWhenFailed = false;
|
||||
mBannedState = false ;
|
||||
}
|
||||
|
||||
static void fillGxsIdRSTreeWidgetItemCallback(GxsIdDetailsType type, const RsIdentityDetails &details, QObject *object, const QVariant &/*data*/)
|
||||
|
|
@ -114,6 +115,20 @@ void GxsIdRSTreeWidgetItem::setId(const RsGxsId &id, int column, bool retryWhenF
|
|||
startProcess();
|
||||
}
|
||||
|
||||
void GxsIdRSTreeWidgetItem::updateBannedState()
|
||||
{
|
||||
if(mBannedState != rsReputations->isIdentityBanned(mId))
|
||||
forceUpdate() ;
|
||||
}
|
||||
|
||||
void GxsIdRSTreeWidgetItem::forceUpdate()
|
||||
{
|
||||
mIdFound = false;
|
||||
mBannedState = rsReputations->isIdentityBanned(mId) ;
|
||||
|
||||
startProcess();
|
||||
}
|
||||
|
||||
void GxsIdRSTreeWidgetItem::startProcess()
|
||||
{
|
||||
if (mRetryWhenFailed) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ public:
|
|||
|
||||
void setAvatar(const RsGxsImage &avatar);
|
||||
virtual QVariant data(int column, int role) const;
|
||||
void forceUpdate();
|
||||
|
||||
void setBannedState(bool b) { mBannedState = b; } // does not actually change the state, but used instead by callbacks to leave a trace
|
||||
void updateBannedState() ; // checks reputation, and update is needed
|
||||
|
||||
private slots:
|
||||
void startProcess();
|
||||
|
|
@ -62,8 +66,9 @@ private:
|
|||
RsGxsId mId;
|
||||
int mColumn;
|
||||
bool mIdFound;
|
||||
bool mBannedState ;
|
||||
bool mRetryWhenFailed;
|
||||
uint32_t mIconTypeMask;
|
||||
uint32_t mIconTypeMask;
|
||||
RsGxsImage mAvatar;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -285,7 +285,8 @@ void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg)
|
|||
name = QString::fromUtf8(msg.peerName.c_str());
|
||||
}
|
||||
|
||||
QString formatMsg = style.formatMessage(type, name, QDateTime::fromTime_t(msg.sendTime), messageText);
|
||||
QColor backgroundColor = ui.listWidget->palette().base().color();
|
||||
QString formatMsg = style.formatMessage(type, name, QDateTime::fromTime_t(msg.sendTime), messageText, 0, backgroundColor);
|
||||
|
||||
itemWidget->setData(Qt::DisplayRole, qVariantFromValue(IMHistoryItemPainter(formatMsg)));
|
||||
itemWidget->setData(ROLE_MSGID, msg.msgId);
|
||||
|
|
|
|||
|
|
@ -339,14 +339,15 @@ void ChatPage::setPreviewMessages(QString &stylePath, QString styleVariant, QTex
|
|||
QString nameIncoming = tr("Incoming");
|
||||
QString nameOutgoing = tr("Outgoing");
|
||||
QDateTime timestmp = QDateTime::fromTime_t(time(NULL));
|
||||
QColor backgroundColor = textBrowser->palette().base().color();
|
||||
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, tr("Incoming message in history")));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HOUTGOING, nameOutgoing, timestmp, tr("Outgoing message in history")));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_INCOMING, nameIncoming, timestmp, tr("Incoming message")));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, nameOutgoing, timestmp, tr("Outgoing message")));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OOUTGOING, nameOutgoing, timestmp, tr("Outgoing offline message")));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_SYSTEM, tr("System"), timestmp, tr("System message")));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, tr("UserName"), timestmp, tr("/me is sending a message with /me")));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, tr("Incoming message in history"), 0, backgroundColor));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HOUTGOING, nameOutgoing, timestmp, tr("Outgoing message in history"), 0, backgroundColor));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_INCOMING, nameIncoming, timestmp, tr("Incoming message"), 0, backgroundColor));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, nameOutgoing, timestmp, tr("Outgoing message"), 0, backgroundColor));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OOUTGOING, nameOutgoing, timestmp, tr("Outgoing offline message"), 0, backgroundColor));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_SYSTEM, tr("System"), timestmp, tr("System message"), 0, backgroundColor));
|
||||
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, tr("UserName"), timestmp, tr("/me is sending a message with /me"), 0, backgroundColor));
|
||||
}
|
||||
|
||||
void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>611</width>
|
||||
<height>408</height>
|
||||
<width>1468</width>
|
||||
<height>659</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -34,8 +34,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>593</width>
|
||||
<height>156</height>
|
||||
<width>1450</width>
|
||||
<height>317</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Data size</string>
|
||||
<string>Stored data size</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
|
|
@ -93,12 +93,12 @@
|
|||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Received</string>
|
||||
<string>Receive time (secs ago)</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
<string>Sending time (secs ago)</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue