fixed bug due to passing shared_ptr to RsThread::async() without making an explicit copy before

This commit is contained in:
csoler 2020-11-08 18:25:20 +01:00
commit d2bd947252
31 changed files with 632 additions and 443 deletions

View File

@ -16,6 +16,7 @@
# version format
version: RetroShare-git-{branch}-{build}
image: Visual Studio 2019
# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}
@ -94,7 +95,7 @@ install:
- set PATH=C:\msys64\usr\bin;%PATH%
- set PATH=C:\msys64\mingw32\bin;%PATH%
- >
pacman --noconfirm -S
pacman --noconfirm -Sy
mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-rapidjson
mingw-w64-i686-sqlcipher mingw-w64-i686-xapian-core mingw-w64-i686-cmark
#- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH%

View File

@ -416,7 +416,7 @@ bool p3HistoryMgr::loadList(std::list<RsItem*>& load)
}
// have to convert to virtual peer id, to be able to use existing serialiser and file format
bool p3HistoryMgr::chatIdToVirtualPeerId(ChatId chat_id, RsPeerId &peer_id)
bool p3HistoryMgr::chatIdToVirtualPeerId(const ChatId& chat_id, RsPeerId &peer_id)
{
if (chat_id.isBroadcast()) {
peer_id = RsPeerId();

View File

@ -68,9 +68,9 @@ public:
virtual void saveDone();
virtual bool loadList(std::list<RsItem*>& load);
private:
static bool chatIdToVirtualPeerId(ChatId chat_id, RsPeerId& peer_id);
static bool chatIdToVirtualPeerId(const ChatId& chat_id, RsPeerId& peer_id);
private:
uint32_t nextMsgId;
std::map<RsPeerId, std::map<uint32_t, RsHistoryMsgItem*> > mMessages;

View File

@ -1876,7 +1876,9 @@ bool p3PeerMgrIMPL::getExtAddressReportedByFriends(sockaddr_storage &addr, uint8
static bool cleanIpList(std::list<pqiIpAddress>& lst,const RsPeerId& pid,p3LinkMgr *link_mgr)
{
bool changed = false ;
#ifdef PEER_DEBUG
rstime_t now = time(NULL) ;
#endif
for(std::list<pqiIpAddress>::iterator it2(lst.begin());it2 != lst.end();)
{

View File

@ -70,15 +70,17 @@ public:
class RsHistory
{
public:
virtual bool getMessages(const ChatId &chatPeerId, std::list<HistoryMsg> &msgs, uint32_t loadCount) = 0;
virtual bool chatIdToVirtualPeerId(const ChatId &chat_id, RsPeerId &peer_id) = 0;
virtual bool getMessages(const ChatId &chatPeerId, std::list<HistoryMsg> &msgs, uint32_t loadCount) = 0;
virtual bool getMessage(uint32_t msgId, HistoryMsg &msg) = 0;
virtual void removeMessages(const std::list<uint32_t> &msgIds) = 0;
virtual void clear(const ChatId &chatPeerId) = 0;
virtual void clear(const ChatId &chatPeerId) = 0;
virtual bool getEnable(uint32_t chat_type) = 0;
virtual void setEnable(uint32_t chat_type, bool enable) = 0;
virtual uint32_t getMaxStorageDuration() = 0 ;
virtual void setMaxStorageDuration(uint32_t seconds) = 0 ;
virtual uint32_t getMaxStorageDuration() = 0;
virtual void setMaxStorageDuration(uint32_t seconds) = 0;
// 0 = no limit, >0 count of saved messages
virtual uint32_t getSaveCount(uint32_t chat_type) = 0;

View File

@ -6,7 +6,7 @@
* Copyright (c) 2004-2009 Marcelo Roberto Jimenez ( phoenix@amule.org ) *
* Copyright (c) 2006-2009 aMule Team ( admin@amule.org / http://www.amule.org)*
* Copyright (c) 2009-2010 Retroshare Team *
* Copyright (C) 2019 Gioacchino Mazzurco <gio@eigenlab.org> *
* Copyright (C) 2019-2020 Gioacchino Mazzurco <gio@eigenlab.org> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
@ -35,6 +35,7 @@
#include "util/rsstring.h"
#include "rs_upnp/upnp18_retrocompat.h"
#include "util/rstime.h"
#include "util/rsdebug.h"
#ifdef __GNUC__
#if __GNUC__ >= 4
@ -923,16 +924,18 @@ m_WanService(NULL)
#endif
// Pointer to self
s_CtrlPoint = this;
// Start UPnP
int ret;
char *ipAddress = NULL;
unsigned short port = 0;
#ifdef UPNP_DEBUG
int resLog = UpnpInitLog();
std::cerr << "UPnPControlPoint::CUPnPControlPoint() Init log : " << resLog << std::endl;
#endif
ret = UpnpInit(ipAddress, udpPort);
#if UPNP_VERSION < 11400
int ret = UpnpInit(nullptr, udpPort);
#else
int ret = UpnpInit2(nullptr, udpPort);
#endif
#ifdef UPNP_DEBUG
std::cerr << "CUPnPControlPoint Constructor UpnpInit finished" << std::endl;
#endif
@ -942,15 +945,8 @@ m_WanService(NULL)
#endif
goto error;
}
port = UpnpGetServerPort();
ipAddress = UpnpGetServerIpAddress();
#ifdef UPNP_DEBUG
std::cerr << "UPnPControlPoint::CUPnPControlPoint() bound to " << ipAddress << ":" <<
port << "." << std::endl;
#else
// unused variable
(void)port;
#endif
RS_INFO("bound to ", UpnpGetServerIpAddress(), ":", UpnpGetServerPort());
ret = UpnpRegisterClient(
reinterpret_cast<Upnp_FunPtr>(&CUPnPControlPoint::Callback),
@ -1022,7 +1018,6 @@ error:
#ifdef UPNP_DEBUG
std::cerr << "UPnPControlPoint::CUPnPControlPoint() UpnpFinish called within CUPnPControlPoint constructor." << std::endl;
#endif
return;
}

View File

@ -31,6 +31,11 @@ p3History::~p3History()
{
}
bool p3History::chatIdToVirtualPeerId(const ChatId &chat_id, RsPeerId &peer_id)
{
return mHistoryMgr->chatIdToVirtualPeerId(chat_id, peer_id);
}
void p3History::setMaxStorageDuration(uint32_t seconds)
{
mHistoryMgr->setMaxStorageDuration(seconds) ;

View File

@ -37,16 +37,21 @@ public:
p3History(p3HistoryMgr* historyMgr);
virtual ~p3History();
virtual bool getMessages(const ChatId &chatPeerId, std::list<HistoryMsg> &msgs, uint32_t loadCount);
virtual bool chatIdToVirtualPeerId(const ChatId &chat_id, RsPeerId &peer_id);
virtual bool getMessages(const ChatId &chatPeerId, std::list<HistoryMsg> &msgs, uint32_t loadCount);
virtual bool getMessage(uint32_t msgId, HistoryMsg &msg);
virtual void removeMessages(const std::list<uint32_t> &msgIds);
virtual void clear(const ChatId &chatPeerId);
virtual void clear(const ChatId &chatPeerId);
virtual bool getEnable(uint32_t chat_type);
virtual void setEnable(uint32_t chat_type, bool enable);
virtual uint32_t getMaxStorageDuration();
virtual void setMaxStorageDuration(uint32_t seconds);
// 0 = no limit, >0 count of saved messages
virtual uint32_t getSaveCount(uint32_t chat_type);
virtual void setSaveCount(uint32_t chat_type, uint32_t count);
virtual void setMaxStorageDuration(uint32_t seconds) ;
virtual uint32_t getMaxStorageDuration() ;
virtual void setSaveCount(uint32_t chat_type, uint32_t count);
private:
p3HistoryMgr* mHistoryMgr;

View File

@ -234,176 +234,168 @@
<property name="title">
<string>Chat Room info</string>
</property>
<layout class="QVBoxLayout" name="lobbyinfo_groupBoxVLayout">
<item>
<layout class="QHBoxLayout" name="lobbyInfoHLayout">
<layout class="QGridLayout" name="lobbyinfo_groupBoxgridLayout">
<item row="0" column="0">
<layout class="QGridLayout" name="lobbyinfo_gridLayout">
<property name="topMargin">
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" name="lobbyInfoNameVLayout">
<item>
<widget class="QLabel" name="lobbyname_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Chat room Name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbyid_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Chat room Id:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbytopic_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Topic:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbytype_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbysec_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Security:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbypeers_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Peers:</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="0">
<widget class="QLabel" name="lobbyname_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Chat room Name:</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="lobbyInfoValueVLayout">
<item>
<widget class="QLabel" name="lobbyname_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbyid_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbytopic_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbytype_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbysec_lineEdit">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lobbypeers_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="QLabel" name="lobbyname_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lobbyid_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Chat room Id:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="lobbyid_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lobbytopic_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Topic:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="lobbytopic_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lobbytype_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="lobbytype_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lobbysec_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Security:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="lobbysec_lineEdit">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lobbypeers_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Peers:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="lobbypeers_lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<item row="1" column="0">
<widget class="QLabel" name="lobbyInfoLabel">
<property name="text">
<string notr="true">TextLabel</string>
@ -413,7 +405,7 @@
</property>
</widget>
</item>
<item>
<item row="2" column="0">
<spacer name="lobbyInfoVSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>

View File

@ -56,8 +56,9 @@ PostedCreatePostDialog::PostedCreatePostDialog(RsPosted *posted, const RsGxsGrou
connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(ui->addPicButton, SIGNAL(clicked() ), this , SLOT(addPicture()));
ui->headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/postedlinks.png"));
connect(ui->RichTextEditWidget, SIGNAL(textSizeOk(bool)),ui->submitButton, SLOT(setEnabled(bool)));
ui->headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/postedlinks.png"));
ui->headerFrame->setHeaderText(tr("Create a new Post"));
setAttribute ( Qt::WA_DeleteOnClose, true );

View File

@ -42,7 +42,6 @@
#include "gui/settings/rsharesettings.h"
#include "gui/settings/rsettingswin.h"
#include "gui/settings/RsharePeerSettings.h"
#include "gui/im_history/ImHistoryBrowser.h"
#include "gui/common/StatusDefs.h"
#include "gui/common/FilesDefs.h"
#include "gui/common/Emoticons.h"
@ -78,7 +77,7 @@ ChatWidget::ChatWidget(QWidget *parent)
, lastStatusSendTime(0)
, firstShow(true), inChatCharFormatChanged(false), firstSearch(true)
, lastUpdateCursorPos(0), lastUpdateCursorEnd(0)
, completer(NULL), notify(NULL)
, completer(NULL), imBrowser(NULL), notify(NULL)
, ui(new Ui::ChatWidget)
{
ui->setupUi(this);
@ -87,8 +86,8 @@ ChatWidget::ChatWidget(QWidget *parent)
double fmm = iconHeight > FMM_THRESHOLD ? FMM : FMM_SMALLER;
iconHeight *= fmm;
QSize iconSize = QSize(iconHeight, iconHeight);
int butt_size(iconSize.height() + fmm);
QSize buttonSize = QSize(butt_size, butt_size);
//int butt_size(iconSize.height() + fmm);
//QSize buttonSize = QSize(butt_size, butt_size);
lastMsgDate = QDate::currentDate();
@ -1607,8 +1606,9 @@ void ChatWidget::deleteChatHistory()
void ChatWidget::messageHistory()
{
ImHistoryBrowser imBrowser(chatId, ui->chatTextEdit, window());
imBrowser.exec();
if (!imBrowser)
imBrowser = new ImHistoryBrowser(chatId, ui->chatTextEdit, this->title, window());
imBrowser->show();
}
void ChatWidget::addExtraFile()

View File

@ -23,20 +23,22 @@
#ifndef CHATWIDGET_H
#define CHATWIDGET_H
#include <QWidget>
#include <QCompleter>
#include <QTextCursor>
#include <QTextCharFormat>
#include <QToolButton>
#include "ChatLobbyUserNotify.h"
#include "ChatStyle.h"
#include "gui/common/HashBox.h"
#include "gui/common/RsButtonOnText.h"
#include "ChatStyle.h"
#include "gui/im_history/ImHistoryBrowser.h"
#include "gui/style/RSStyle.h"
#include "ChatLobbyUserNotify.h"
#include <retroshare/rsmsgs.h>
#include <retroshare/rsfiles.h>
#include <QCompleter>
#include <QTextCharFormat>
#include <QTextCursor>
#include <QToolButton>
#include <QWidget>
//For PersonId anchor.
#define PERSONID "PersonId:"
@ -258,7 +260,8 @@ private:
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;
QCompleter *completer;
ImHistoryBrowser* imBrowser;
QList<ChatWidgetHolder*> mChatWidgetHolder;
ChatLobbyUserNotify* notify;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>476</width>
<height>38</height>
<width>421</width>
<height>39</height>
</rect>
</property>
<property name="windowTitle">
@ -17,6 +17,9 @@
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
@ -138,8 +141,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>

View File

@ -58,7 +58,8 @@ void RSTreeView::setAutoSelect(bool b)
void RSTreeView::resizeEvent(QResizeEvent *e)
{
emit sizeChanged(e->size());
QTreeView::resizeEvent(e);
emit sizeChanged(e->size());
}
void RSTreeView::setPlaceholderText(const QString &text)

View File

@ -26,6 +26,8 @@
#include <QMessageBox>
#include <iostream>
static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000;
GxsCreateCommentDialog::GxsCreateCommentDialog(RsGxsCommentService *service, const RsGxsGrpMsgIdPair &parentId, const RsGxsMessageId& threadId, const RsGxsId& default_author,QWidget *parent) :
QDialog(parent),
ui(new Ui::GxsCreateCommentDialog), mCommentService(service), mParentId(parentId), mThreadId(threadId)
@ -33,9 +35,10 @@ GxsCreateCommentDialog::GxsCreateCommentDialog(RsGxsCommentService *service, co
ui->setupUi(this);
connect(ui->postButton, SIGNAL(clicked()), this, SLOT(createComment()));
connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(close()));
connect(ui->commentTextEdit, SIGNAL(textChanged()), this, SLOT(checkLength()));
/* fill in the available OwnIds for signing */
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, default_author);
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, default_author);
}
void GxsCreateCommentDialog::loadComment(const QString &msgText, const QString &msgAuthor, const RsGxsId &msgAuthorId)
@ -105,3 +108,19 @@ GxsCreateCommentDialog::~GxsCreateCommentDialog()
{
delete ui;
}
void GxsCreateCommentDialog::checkLength(){
QString text;
RsHtml::optimizeHtml(ui->commentTextEdit, text);
std::wstring msg = text.toStdWString();
int charRemains = MAX_ALLOWED_GXS_MESSAGE_SIZE - msg.length();
if(charRemains >= 0) {
text = tr("It remains %1 characters after HTML conversion.").arg(charRemains);
ui->infoLabel->setStyleSheet("QLabel#infoLabel { }");
}else{
text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains));
ui->infoLabel->setStyleSheet("QLabel#infoLabel {color: red; font: bold; }");
}
ui->postButton->setEnabled(charRemains>=0);
ui->infoLabel->setText(text);
}

View File

@ -43,7 +43,8 @@ public:
private slots:
void createComment();
void checkLength();
private:
Ui::GxsCreateCommentDialog *ui;
RsGxsCommentService *mCommentService;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>459</width>
<height>324</height>
<width>505</width>
<height>367</height>
</rect>
</property>
<property name="windowTitle">
@ -32,7 +32,7 @@
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -142,17 +142,20 @@ p, li { white-space: pre-wrap; }
<property name="topMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="GxsIdLabel" name="replaytolabel">
<property name="styleSheet">
<string notr="true"/>
<item row="5" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="text">
<string/>
<property name="sizeHint" stdset="0">
<size>
<width>276</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<item row="2" column="0" colspan="3">
<widget class="MimeTextEdit" name="commentTextEdit">
<property name="styleSheet">
<string notr="true"/>
@ -165,7 +168,21 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="5" column="2">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="infoLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<layout class="QHBoxLayout" name="signedHLayout">
<item>
<widget class="QLabel" name="signedLabel">
@ -189,30 +206,26 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>276</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<item row="5" column="1">
<widget class="QPushButton" name="postButton">
<property name="text">
<string>Post</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="cancelButton">
<item row="0" column="0" colspan="3">
<widget class="GxsIdLabel" name="replaytolabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Cancel</string>
<string/>
</property>
</widget>
</item>

View File

@ -58,10 +58,12 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/channel.png"));
if(!existing_post.isNull())
if(!existing_post.isNull()){
headerFrame->setHeaderText(tr("Edit Channel Post"));
else
postButton->setText(tr("Update"));
}else{
headerFrame->setHeaderText(tr("New Channel Post"));
}
setAttribute ( Qt::WA_DeleteOnClose, true );
@ -79,6 +81,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
connect(stackedWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
connect(generateCheckBox, SIGNAL(toggled(bool)), generateSpinBox, SLOT(setEnabled(bool)));
connect(aspectRatio_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(changeAspectRatio(int)));
connect(RichTextEditWidget, SIGNAL(textSizeOk(bool)),postButton, SLOT(setEnabled(bool)));
channelpostButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/comment.png"));
attachmentsButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/attachements.png"));

View File

@ -284,6 +284,7 @@ void GxsChannelFilesStatusWidget::download()
rsFiles->FileRequest(mFile.mName, mFile.mHash, mFile.mSize, destination, RS_FILE_REQ_ANONYMOUS_ROUTING, sources);
emit onButtonClick();// Signals the parent widget to e.g. update the downloadable file count
check();
}
@ -291,6 +292,7 @@ void GxsChannelFilesStatusWidget::pause()
{
rsFiles->FileControl(mFile.mHash, RS_FILE_CTRL_PAUSE);
emit onButtonClick();// Signals the parent widget to e.g. update the downloadable file count
check();
}
@ -298,6 +300,7 @@ void GxsChannelFilesStatusWidget::resume()
{
rsFiles->FileControl(mFile.mHash, RS_FILE_CTRL_START);
emit onButtonClick();// Signals the parent widget to e.g. update the downloadable file count
check();
}
@ -309,6 +312,7 @@ void GxsChannelFilesStatusWidget::cancel()
rsFiles->FileCancel(mFile.mHash);
emit onButtonClick();// Signals the parent widget to e.g. update the downloadable file count
check();
}

View File

@ -37,6 +37,10 @@ public:
explicit GxsChannelFilesStatusWidget(const RsGxsFile &file, QWidget *parent = 0);
~GxsChannelFilesStatusWidget();
signals:
void onButtonClick();
private slots:
void check();
void download();

View File

@ -107,8 +107,12 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
//
// We need to update the data!
if(e->mChannelGroupId == mChannelGroup.mMeta.mGroupId)
RsThread::async([this, e]()
// make a copy of e, so as to avoid destruction of the shared pointer during async thread execution, since [e] doesn't actually tell
// the shared_ptr that it is copied! So no counter is updated.
RsGxsChannelEvent E(*e);
if(E.mChannelGroupId == mChannelGroup.mMeta.mGroupId)
RsThread::async([this, E]()
{
// 1 - get message data from p3GxsChannels. No need for pointers here, because we send only a single post to postToObject()
@ -116,24 +120,29 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
std::vector<RsGxsComment> comments;
std::vector<RsGxsVote> votes;
if(!rsGxsChannels->getChannelContent(mChannelGroup.mMeta.mGroupId,std::set<RsGxsMessageId>{ e->mChannelMsgId }, posts,comments,votes))
std::cerr << "display of e 1: " << E << std::endl;
if(!rsGxsChannels->getChannelContent(E.mChannelGroupId,std::set<RsGxsMessageId>{ E.mChannelMsgId }, posts,comments,votes))
{
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve channel message data for channel/msg " << e->mChannelGroupId << "/" << e->mChannelMsgId << std::endl;
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve channel message data for channel/msg " << E.mChannelGroupId << "/" << E.mChannelMsgId << std::endl;
return;
}
// Need to call this in order to get the actuall comment count. The previous call only retrieves the message, since we supplied the message ID.
// another way to go would be to save the comment ids of the existing message and re-insert them before calling getChannelContent.
if(!rsGxsChannels->getChannelComments(mChannelGroup.mMeta.mGroupId,std::set<RsGxsMessageId>{ e->mChannelMsgId },comments))
std::cerr << "display of e 2: " << E << std::endl;
std::cerr << "Before call : IS_MSG_READ=" << IS_MSG_NEW(posts[0].mMeta.mMsgFlags) << " for message id " << E.mChannelMsgId << std::endl;
if(!rsGxsChannels->getChannelComments(E.mChannelGroupId,std::set<RsGxsMessageId>{ E.mChannelMsgId },comments))
{
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve message comment data for channel/msg " << e->mChannelGroupId << "/" << e->mChannelMsgId << std::endl;
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve message comment data for channel/msg " << E.mChannelGroupId << "/" << E.mChannelMsgId << std::endl;
return;
}
updateCommentCounts(posts,comments);
// 2 - update the model in the UI thread.
std::cerr << "After call : IS_MSG_READ=" << IS_MSG_NEW(posts[0].mMeta.mMsgFlags) << std::endl;
// 2 - update the model in the UI thread.
RsQThreadUtils::postToObject( [posts,this]()
{
@ -143,7 +152,7 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
for(uint32_t j=0;j<mPosts.size();++j)
if(mPosts[j].mMeta.mMsgId == posts[i].mMeta.mMsgId)
{
{
mPosts[j] = posts[i];
triggerViewUpdate();
@ -151,10 +160,10 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
}
},this);
});
}
default:
break;
}
}
}
@ -225,7 +234,7 @@ void RsGxsChannelPostsModel::setFilter(const QStringList& strings,bool only_unre
count = mFilteredPosts.size();
beginInsertRows(QModelIndex(),0,rowCount()-1);
beginInsertRows(QModelIndex(),0,rowCount()-1);
endInsertRows();
postMods();

View File

@ -56,7 +56,7 @@
* #define DEBUG_CHANNEL
***/
static const int mTokenTypeGroupData = 1;
//static const int mTokenTypeGroupData = 1;
static const int CHANNEL_TABS_DETAILS= 0;
static const int CHANNEL_TABS_POSTS = 1;
@ -280,14 +280,18 @@ void ChannelPostDelegate::setWidgetGrid(bool use_grid)
//=== ChannelPostFilesDelegate ===//
//===============================================================================================================================================//
QWidget *ChannelPostFilesDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex& index) const
QWidget *ChannelPostFilesDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, const QModelIndex& index) const
{
ChannelPostFileInfo file = index.data(Qt::UserRole).value<ChannelPostFileInfo>() ;
if(index.column() == RsGxsChannelPostFilesModel::COLUMN_FILES_FILE)
return new GxsChannelFilesStatusWidget(file,parent);
else
return NULL;
if(index.column() == RsGxsChannelPostFilesModel::COLUMN_FILES_FILE)
{
GxsChannelFilesStatusWidget* w = new GxsChannelFilesStatusWidget(file,parent);
connect(w,SIGNAL(onButtonClick()),this->parent(),SLOT(updateDAll_PB()));
return w;
}
else
return NULL;
}
void ChannelPostFilesDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
{
@ -393,7 +397,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
connect(ui->commentsDialog,SIGNAL(commentsLoaded(int)),this,SLOT(updateCommentsCount(int)));
ui->channelPostFiles_TV->setModel(mChannelPostFilesModel = new RsGxsChannelPostFilesModel(this));
ui->channelPostFiles_TV->setItemDelegate(new ChannelPostFilesDelegate());
ui->channelPostFiles_TV->setItemDelegate(new ChannelPostFilesDelegate(this));
ui->channelPostFiles_TV->setPlaceholderText(tr("No files in this post, or no post selected"));
ui->channelPostFiles_TV->setSortingEnabled(true);
ui->channelPostFiles_TV->sortByColumn(3, Qt::AscendingOrder); // sort by time
@ -403,7 +407,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
connect(ui->channelFiles_TV->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(sortColumnFiles(int,Qt::SortOrder)));
ui->channelFiles_TV->setModel(mChannelFilesModel = new RsGxsChannelPostFilesModel());
ui->channelFiles_TV->setItemDelegate(mFilesDelegate = new ChannelPostFilesDelegate());
ui->channelFiles_TV->setItemDelegate(mFilesDelegate = new ChannelPostFilesDelegate(this));
ui->channelFiles_TV->setPlaceholderText(tr("No files in the channel, or no channel selected"));
ui->channelFiles_TV->setSortingEnabled(true);
ui->channelFiles_TV->sortByColumn(3, Qt::AscendingOrder); // sort by time
@ -416,6 +420,9 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
ui->postName_LB->hide();
ui->postTime_LB->hide();
ui->postLogo_LB->hide();
ui->postDAll_PB->hide();
connect(ui->postDAll_PB,SIGNAL(clicked()),this,SLOT(download()));
ui->postDetails_TE->setPlaceholderText(tr("No text to display"));
@ -423,11 +430,11 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
ui->splitter->setStretchFactor(0, 1);
ui->splitter->setStretchFactor(1, 0);
QFontMetricsF fm(font());
QFontMetricsF fm(font());
if(mChannelPostsModel->getMode() == RsGxsChannelPostsModel::TREE_MODE_GRID)
for(int i=0;i<mChannelPostsModel->columnCount();++i)
ui->postsTree->setColumnWidth(i,mChannelPostsDelegate->cellSize(i,font(),ui->postsTree->width()));
if(mChannelPostsModel->getMode() == RsGxsChannelPostsModel::TREE_MODE_GRID)
for(int i=0;i<mChannelPostsModel->columnCount();++i)
ui->postsTree->setColumnWidth(i,mChannelPostsDelegate->cellSize(i,font(),ui->postsTree->width()));
/* Setup UI helper */
@ -671,6 +678,34 @@ void GxsChannelPostsWidgetWithModel::download()
rsFiles->FileRequest(file.mName, file.mHash, file.mSize, destination, RS_FILE_REQ_ANONYMOUS_ROUTING, sources);
}
ui->postDAll_PB->hide();
}
void GxsChannelPostsWidgetWithModel::updateDAll_PB()
{
QModelIndex index = ui->postsTree->selectionModel()->currentIndex();
RsGxsChannelPost post = index.data(Qt::UserRole).value<RsGxsChannelPost>() ;
size_t newFileToDl = 0;
uint64_t newFileTotalSize = 0;
QString newFilesDetails;
for(auto& file:post.mFiles)
{
FileInfo fileInfo;
if (!rsFiles->FileDetails(file.mHash, RS_FILE_HINTS_DOWNLOAD | RS_FILE_HINTS_SPEC_ONLY, fileInfo)) {
++newFileToDl;
newFileTotalSize += file.mSize;
newFilesDetails += QString::fromUtf8(file.mName.c_str()) + " " + misc::friendlyUnit(file.mSize) + "\n";
}
}
ui->postDAll_PB->setHidden(newFileToDl == 0);
ui->postDAll_PB->setToolTip((newFileToDl == 1 ? tr("Download this file:") : tr("Download All these %1 files:").arg(newFileToDl) ) + "\n"
+ newFilesDetails
+ tr("Totaling: %1").arg(misc::friendlyUnit(newFileTotalSize)));
}
void GxsChannelPostsWidgetWithModel::editPost()
@ -765,9 +800,9 @@ void GxsChannelPostsWidgetWithModel::showPostDetails()
#endif
mSelectedPost = post.mMeta.mMsgId;
std::list<ChannelPostFileInfo> files;
for(auto& file:post.mFiles)
files.push_back(ChannelPostFileInfo(file,post.mMeta.mPublishTs));
std::list<ChannelPostFileInfo> files;
for(auto& file:post.mFiles)
files.push_back(ChannelPostFileInfo(file,post.mMeta.mPublishTs));
mChannelPostFilesModel->setFiles(files);
@ -815,6 +850,8 @@ void GxsChannelPostsWidgetWithModel::showPostDetails()
RsThread::async([postId]() { rsGxsChannels->markRead(postId, true) ; } );
}
updateDAll_PB();
}
void GxsChannelPostsWidgetWithModel::updateCommentsCount(int n)
@ -874,21 +911,21 @@ void GxsChannelPostsWidgetWithModel::updateGroupData()
void GxsChannelPostsWidgetWithModel::postChannelPostLoad()
{
std::cerr << "Post channel load..." << std::endl;
std::cerr << "Post channel load..." << std::endl;
if(!mSelectedPost.isNull())
{
QModelIndex index = mChannelPostsModel->getIndexOfMessage(mSelectedPost);
{
QModelIndex index = mChannelPostsModel->getIndexOfMessage(mSelectedPost);
std::cerr << "Setting current index to " << index.row() << ","<< index.column() << " for current post "
<< mSelectedPost.toStdString() << std::endl;
std::cerr << "Setting current index to " << index.row() << ","<< index.column() << " for current post "
<< mSelectedPost.toStdString() << std::endl;
ui->postsTree->selectionModel()->setCurrentIndex(index,QItemSelectionModel::ClearAndSelect);
ui->postsTree->scrollTo(index);//May change if model reloaded
ui->postsTree->setFocus();
}
else
std::cerr << "No pre-selected channel post." << std::endl;
}
else
std::cerr << "No pre-selected channel post." << std::endl;
std::list<ChannelPostFileInfo> files;
@ -923,6 +960,8 @@ void GxsChannelPostsWidgetWithModel::postChannelPostLoad()
void GxsChannelPostsWidgetWithModel::updateDisplay(bool complete)
{
// First, clear all widget
blank();
#ifdef DEBUG_CHANNEL
std::cerr << "udateDisplay: groupId()=" << groupId()<< std::endl;
#endif
@ -943,7 +982,7 @@ void GxsChannelPostsWidgetWithModel::updateDisplay(bool complete)
}
if(complete) // need to update the group data, reload the messages etc.
{
#warning todo
#warning csoler 2020-06-02 : todo
//saveExpandedItems(mSavedExpandedMessages);
//if(mGroupId != mChannelPostsModel->currentGroupId())
@ -1004,7 +1043,7 @@ QString GxsChannelPostsWidgetWithModel::groupName(bool)
return QString::fromUtf8(mGroup.mMeta.mGroupName.c_str());
}
void GxsChannelPostsWidgetWithModel::groupNameChanged(const QString &name)
void GxsChannelPostsWidgetWithModel::groupNameChanged(const QString &/*name*/)
{
// if (groupId().isNull()) {
// ui->nameLabel->setText(tr("No Channel Selected"));
@ -1080,7 +1119,7 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
setAutoDownload(autoDownload);
#endif
setSubscribeButtonText(group.mMeta.mGroupId,group.mMeta.mSubscribeFlags);
setSubscribeButtonText(group.mMeta.mGroupId,group.mMeta.mSubscribeFlags, group.mMeta.mPop);
if (IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags))
{
@ -1148,13 +1187,13 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
ui->infoAdministrator->setId(group.mMeta.mAuthorId) ;
if(!group.mMeta.mAuthorId.isNull())
{
RetroShareLink link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
ui->infoAdministrator->setText(link.toHtml());
}
else
ui->infoAdministrator->setText("[No contact author]");
if(!group.mMeta.mAuthorId.isNull())
{
RetroShareLink link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
ui->infoAdministrator->setText(link.toHtml());
}
else
ui->infoAdministrator->setText("[No contact author]");
ui->infoCreated->setText(DateTime::formatLongDateTime(group.mMeta.mPublishTs));
@ -1194,16 +1233,16 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
//ui->fileToolButton->setEnabled(false);
#endif
setSubscribeButtonText(group.mMeta.mGroupId,group.mMeta.mSubscribeFlags);
setSubscribeButtonText(group.mMeta.mGroupId,group.mMeta.mSubscribeFlags, group.mMeta.mPop);
showPostDetails();
}
void GxsChannelPostsWidgetWithModel::setSubscribeButtonText(const RsGxsGroupId& group_id,uint32_t flags)
void GxsChannelPostsWidgetWithModel::setSubscribeButtonText(const RsGxsGroupId& group_id,uint32_t flags, uint32_t mPop)
{
if(IS_GROUP_SUBSCRIBED(flags))
{
ui->subscribeToolButton->setText(tr("Unsubscribe"));
ui->subscribeToolButton->setText(tr("Subscribed")+ " " + QString::number(mPop));
ui->subscribeToolButton->setSubscribed(true);
ui->subscribeToolButton->setEnabled(true);
}
@ -1267,6 +1306,7 @@ void GxsChannelPostsWidgetWithModel::blank()
ui->postLogo_LB->hide();
ui->postName_LB->hide();
ui->postTime_LB->hide();
ui->postDAll_PB->hide();
groupNameChanged(QString());
}
@ -1354,11 +1394,11 @@ public:
void GxsChannelPostsWidgetWithModel::setAllMessagesReadDo(bool read, uint32_t& /*token*/)
{
if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags))
return;
if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags))
return;
QModelIndex src_index;
//QModelIndex src_index;
mChannelPostsModel->setAllMsgReadStatus(read);
mChannelPostsModel->setAllMsgReadStatus(read);
}

View File

@ -142,8 +142,9 @@ protected:
private slots:
void showPostDetails();
void updateGroupData();
void download();
void createMsg();
void download();
void updateDAll_PB();
void createMsg();
// void toggleAutoDownload();
void subscribeGroup(bool subscribe);
void filterChanged(QString);
@ -175,7 +176,7 @@ private:
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
private:
void setSubscribeButtonText(const RsGxsGroupId& group_id,uint32_t flags);
void setSubscribeButtonText(const RsGxsGroupId& group_id,uint32_t flags, uint32_t mPop);
// QAction *mAutoDownloadAction;

View File

@ -380,7 +380,7 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
@ -496,6 +496,17 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="postDAll_PB">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/download.png</normaloff>:/icons/png/download.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -506,6 +517,7 @@ p, li { white-space: pre-wrap; }
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
@ -615,13 +627,12 @@ p, li { white-space: pre-wrap; }
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header location="global">gui/common/LineEditClear.h</header>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>RSTreeView</class>
<extends>QTreeView</extends>
<header>gui/common/RSTreeView.h</header>
<container>1</container>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header>
</customwidget>
<customwidget>
<class>GxsIdLabel</class>
@ -629,9 +640,10 @@ p, li { white-space: pre-wrap; }
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header>
<class>RSTreeView</class>
<extends>QTreeView</extends>
<header>gui/common/RSTreeView.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GxsCommentDialog</class>

View File

@ -91,14 +91,15 @@ void ImHistoryBrowserCreateItemsThread::run()
}
/** Default constructor */
ImHistoryBrowser::ImHistoryBrowser(const ChatId &chatId, QTextEdit *edit, QWidget *parent)
ImHistoryBrowser::ImHistoryBrowser(const ChatId &chatId, QTextEdit *edit,const QString &chatTitle, QWidget *parent)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
setWindowTitle(tr("%1 's Message History").arg(chatTitle));
ui.headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/images/user/agt_forum64.png"));
ui.headerFrame->setHeaderText(tr("Message History"));
ui.headerFrame->setHeaderText(windowTitle());
m_chatId = chatId;
textEdit = edit;
@ -225,36 +226,43 @@ void ImHistoryBrowser::historyAdd(HistoryMsg& msg)
void ImHistoryBrowser::historyChanged(uint msgId, int type)
{
if (type == NOTIFY_TYPE_ADD) {
/* history message added */
HistoryMsg msg;
if (rsHistory->getMessage(msgId, msg) == false) {
return;
}
if (type == NOTIFY_TYPE_ADD) {
/* history message added */
HistoryMsg msg;
if (rsHistory->getMessage(msgId, msg) == false) {
return;
}
RsPeerId virtChatId;
if ( rsHistory->chatIdToVirtualPeerId(m_chatId ,virtChatId)
&& virtChatId == msg.chatPeerId)
historyAdd(msg);
historyAdd(msg);
return;
}
return;
}
if (type == NOTIFY_TYPE_DEL) {
/* history message removed */
int count = ui.listWidget->count();
for (int i = 0; i < count; ++i) {
QListWidgetItem *itemWidget = ui.listWidget->item(i);
if (itemWidget->data(ROLE_MSGID).toString().toUInt() == msgId) {
delete(ui.listWidget->takeItem(i));
break;
}
}
return;
}
if (type == NOTIFY_TYPE_DEL) {
/* history message removed */
int count = ui.listWidget->count();
for (int i = 0; i < count; ++i) {
QListWidgetItem *itemWidget = ui.listWidget->item(i);
if (itemWidget->data(ROLE_MSGID).toString().toUInt() == msgId) {
delete(ui.listWidget->takeItem(i));
break;
}
}
return;
}
if (type == NOTIFY_TYPE_MOD) {
/* clear history */
ui.listWidget->clear();
return;
}
if (type == NOTIFY_TYPE_MOD) {
/* clear history */
// As no ChatId nor msgId are send via Notify,
// only check if history of this chat is empty before clear our list.
std::list<HistoryMsg> historyMsgs;
rsHistory->getMessages(m_chatId, historyMsgs, 1);
if (historyMsgs.empty())
ui.listWidget->clear();
return;
}
}
void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg)

View File

@ -41,7 +41,7 @@ class ImHistoryBrowser : public QDialog
public:
/** Default constructor */
ImHistoryBrowser(const ChatId &chatId, QTextEdit *edit, QWidget *parent = 0);
ImHistoryBrowser(const ChatId &chatId, QTextEdit *edit,const QString &chatTitle, QWidget *parent = 0);
/** Default destructor */
virtual ~ImHistoryBrowser();

View File

@ -187,7 +187,8 @@ ShareManager QPushButton#addButton:hover {
padding: 4px;
}
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#postButton:disabled {
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
CreateGxsChannelMsg QPushButton#postButton:disabled, GxsCreateCommentDialog QPushButton#postButton:disabled {
font: bold;
font-size: 15px;
color: white;
@ -202,7 +203,8 @@ CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushB
GxsForumThreadWidget QLabel#forumName
{
font: bold;
font: bold;
font-size: 14px;
}
CreateForumMsg > QToolBar#toolBar, CreateForumV2Msg > QToolBar#toolBar {
@ -241,6 +243,12 @@ ChatLobbyWidget QLabel#lobbyinfo_label
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}
ChatLobbyWidget QLabel#lobbyname_lineEdit
{
font: bold;
font-size: 16px;
}
ChatLobbyWidget QGroupBox#lobbyinfo_groupBox
{
@ -785,7 +793,8 @@ PostedListWidgetWithModel QComboBox#sortStrategy_CB {
color: #0099cc;
}
PostedListWidgetWithModel QToolButton#submitPostButton {
PostedListWidgetWithModel QToolButton#submitPostButton, GxsChannelPostsWidgetWithModel QToolButton#postButton,
GxsForumThreadWidget QToolButton#newthreadButton {
font: bold;
}
@ -891,14 +900,27 @@ GxsGroupDialog QLabel#groupLogo{
border-radius: 3px;
}
BoardPostDisplayWidget_compact QFrame#mainFrame {
GxsChannelGroupItem QFrame#frame, GxsForumGroupItem QFrame#frame,
PostedGroupItem QFrame#frame {
background-color: white;
}
PostedItem QFrame#mainFrame {
background-color: white;
}
PostedItem > QFrame#mainFrame [new=false]{
background: white;
}
PostedItem QFrame#voteFrame {
background: #f8f9fa;
}
BoardPostDisplayWidget_compact QFrame#mainFrame {
background-color: white;
}
BoardPostDisplayWidget_compact > QFrame#mainFrame [new=false]{
background: white;
}
@ -1016,10 +1038,20 @@ MessagesDialog QWidget#messageTreeWidget::item:hover {
color: black;
}
GxsForumThreadWidget QWidget#threadTreeWidget {
selection-background-color: #cde8ff;
show-decoration-selected: 1;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item {
padding: 2px;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item:selected:active ,
GxsForumThreadWidget QWidget#threadTreeWidget::item:selected:!active {
background-color: #cde8ff;
}
GxsChannelDialog GroupTreeWidget QTreeWidget#treeWidget::item{
/*background-color: #F00000;*/
/*padding: 2px*/

View File

@ -91,14 +91,14 @@ QMainWindow::separator:horizontal {
width: 5px;
margin-top: 2px;
margin-bottom: 2px;
image: url(qss/qdarkstyle/rc/Vsepartoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Vsepartoolbar.png);
}
QMainWindow::separator:vertical {
height: 5px;
margin-left: 2px;
margin-right: 2px;
image: url(qss/qdarkstyle/rc/Hsepartoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Hsepartoolbar.png);
}
/* QToolTip --------------------------------------------------------------- */
@ -157,47 +157,47 @@ QCheckBox::indicator {
}
QCheckBox::indicator:unchecked {
image: url(qss/qdarkstyle/rc/checkbox_unchecked.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked.png);
}
QCheckBox::indicator:unchecked:hover,
QCheckBox::indicator:unchecked:focus,
QCheckBox::indicator:unchecked:pressed {
border: none;
image: url(qss/qdarkstyle/rc/checkbox_unchecked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked_focus.png);
}
QCheckBox::indicator:unchecked:disabled {
image: url(qss/qdarkstyle/rc/checkbox_unchecked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked_disabled.png);
}
QCheckBox::indicator:checked {
image: url(qss/qdarkstyle/rc/checkbox_checked.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked.png);
}
QCheckBox::indicator:checked:hover,
QCheckBox::indicator:checked:focus,
QCheckBox::indicator:checked:pressed {
border: none;
image: url(qss/qdarkstyle/rc/checkbox_checked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked_focus.png);
}
QCheckBox::indicator:checked:disabled{
image: url(qss/qdarkstyle/rc/checkbox_checked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked_disabled.png);
}
QCheckBox::indicator:indeterminate {
image: url(qss/qdarkstyle/rc/checkbox_indeterminate.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_indeterminate.png);
}
QCheckBox::indicator:indeterminate:disabled {
image: url(qss/qdarkstyle/rc/checkbox_indeterminate_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_indeterminate_disabled.png);
}
QCheckBox::indicator:indeterminate:focus,
QCheckBox::indicator:indeterminate:hover,
QCheckBox::indicator:indeterminate:pressed {
image: url(qss/qdarkstyle/rc/checkbox_indeterminate_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_indeterminate_focus.png);
}
/* QGroupBox -------------------------------------------------------------- */
@ -236,22 +236,22 @@ QGroupBox::indicator:unchecked:hover,
QGroupBox::indicator:unchecked:focus,
QGroupBox::indicator:unchecked:pressed {
border: none;
image: url(qss/qdarkstyle/rc/checkbox_unchecked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked_focus.png);
}
QGroupBox::indicator:checked:hover,
QGroupBox::indicator:checked:focus,
QGroupBox::indicator:checked:pressed {
border: none;
image: url(qss/qdarkstyle/rc/checkbox_checked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked_focus.png);
}
QGroupBox::indicator:checked:disabled {
image: url(qss/qdarkstyle/rc/checkbox_checked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked_disabled.png);
}
QGroupBox::indicator:unchecked:disabled {
image: url(qss/qdarkstyle/rc/checkbox_unchecked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked_disabled.png);
}
/* QRadioButton ----------------------------------------------------------- */
@ -294,7 +294,7 @@ QRadioButton::indicator {
}
QRadioButton::indicator:unchecked {
image: url(qss/qdarkstyle/rc/radio_unchecked.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_unchecked.png);
}
QRadioButton::indicator:unchecked:hover,
@ -302,13 +302,13 @@ QRadioButton::indicator:unchecked:focus,
QRadioButton::indicator:unchecked:pressed {
border: none;
outline: none;
image: url(qss/qdarkstyle/rc/radio_unchecked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_unchecked_focus.png);
}
QRadioButton::indicator:checked {
border: none;
outline: none;
image: url(qss/qdarkstyle/rc/radio_checked.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_checked.png);
}
QRadioButton::indicator:checked:hover,
@ -316,16 +316,16 @@ QRadioButton::indicator:checked:focus,
QRadioButton::indicator:checked:pressed {
border: none;
outline: none;
image: url(qss/qdarkstyle/rc/radio_checked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_checked_focus.png);
}
QRadioButton::indicator:checked:disabled {
outline: none;
image: url(qss/qdarkstyle/rc/radio_checked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_checked_disabled.png);
}
QRadioButton::indicator:unchecked:disabled {
image: url(qss/qdarkstyle/rc/radio_unchecked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_unchecked_disabled.png);
}
/* QMenuBar --------------------------------------------------------------- */
@ -403,42 +403,42 @@ QMenu::indicator {
/* non-exclusive indicator = check box style indicator (see QActionGroup::setExclusive) */
QMenu::indicator:non-exclusive:unchecked {
image: url(qss/qdarkstyle/rc/checkbox_unchecked.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked.png);
}
QMenu::indicator:non-exclusive:unchecked:selected {
image: url(qss/qdarkstyle/rc/checkbox_unchecked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked_disabled.png);
}
QMenu::indicator:non-exclusive:checked {
image: url(qss/qdarkstyle/rc/checkbox_checked.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked.png);
}
QMenu::indicator:non-exclusive:checked:selected {
image: url(qss/qdarkstyle/rc/checkbox_checked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked_disabled.png);
}
/* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */
QMenu::indicator:exclusive:unchecked {
image: url(qss/qdarkstyle/rc/radio_unchecked.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_unchecked.png);
}
QMenu::indicator:exclusive:unchecked:selected {
image: url(qss/qdarkstyle/rc/radio_unchecked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_unchecked_disabled.png);
}
QMenu::indicator:exclusive:checked {
image: url(qss/qdarkstyle/rc/radio_checked.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_checked.png);
}
QMenu::indicator:exclusive:checked:selected {
image: url(qss/qdarkstyle/rc/radio_checked_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/radio_checked_disabled.png);
}
QMenu::right-arrow {
margin: 5px;
image: url(qss/qdarkstyle/rc/right_arrow.png)
image: url(%THISPATH%/qdarkstyle/rc/right_arrow.png)
}
/* QAbstractItemView ------------------------------------------------------ */
@ -501,7 +501,7 @@ QScrollBar::handle:horizontal:hover {
QScrollBar::add-line:horizontal {
margin: 0px 0px 0px 0px;
border-image: url(qss/qdarkstyle/rc/right_arrow_disabled.png);
border-image: url(%THISPATH%/qdarkstyle/rc/right_arrow_disabled.png);
width: 10px;
height: 10px;
subcontrol-position: right;
@ -510,7 +510,7 @@ QScrollBar::add-line:horizontal {
QScrollBar::sub-line:horizontal {
margin: 0px 3px 0px 3px;
border-image: url(qss/qdarkstyle/rc/left_arrow_disabled.png);
border-image: url(%THISPATH%/qdarkstyle/rc/left_arrow_disabled.png);
height: 10px;
width: 10px;
subcontrol-position: left;
@ -519,7 +519,7 @@ QScrollBar::sub-line:horizontal {
QScrollBar::add-line:horizontal:hover,
QScrollBar::add-line:horizontal:on {
border-image: url(qss/qdarkstyle/rc/right_arrow.png);
border-image: url(%THISPATH%/qdarkstyle/rc/right_arrow.png);
height: 10px;
width: 10px;
subcontrol-position: right;
@ -528,7 +528,7 @@ QScrollBar::add-line:horizontal:on {
QScrollBar::sub-line:horizontal:hover,
QScrollBar::sub-line:horizontal:on {
border-image: url(qss/qdarkstyle/rc/left_arrow.png);
border-image: url(%THISPATH%/qdarkstyle/rc/left_arrow.png);
height: 10px;
width: 10px;
subcontrol-position: left;
@ -570,7 +570,7 @@ QScrollBar::handle:vertical:hover {
QScrollBar::sub-line:vertical {
margin: 3px 0px 3px 0px;
border-image: url(qss/qdarkstyle/rc/up_arrow_disabled.png);
border-image: url(%THISPATH%/qdarkstyle/rc/up_arrow_disabled.png);
height: 10px;
width: 10px;
subcontrol-position: top;
@ -579,7 +579,7 @@ QScrollBar::sub-line:vertical {
QScrollBar::add-line:vertical {
margin: 3px 0px 3px 0px;
border-image: url(qss/qdarkstyle/rc/down_arrow_disabled.png);
border-image: url(%THISPATH%/qdarkstyle/rc/down_arrow_disabled.png);
height: 10px;
width: 10px;
subcontrol-position: bottom;
@ -588,7 +588,7 @@ QScrollBar::add-line:vertical {
QScrollBar::sub-line:vertical:hover,
QScrollBar::sub-line:vertical:on {
border-image: url(qss/qdarkstyle/rc/up_arrow.png);
border-image: url(%THISPATH%/qdarkstyle/rc/up_arrow.png);
height: 10px;
width: 10px;
subcontrol-position: top;
@ -597,7 +597,7 @@ QScrollBar::sub-line:vertical:on {
QScrollBar::add-line:vertical:hover,
QScrollBar::add-line:vertical:on {
border-image: url(qss/qdarkstyle/rc/down_arrow.png);
border-image: url(%THISPATH%/qdarkstyle/rc/down_arrow.png);
height: 10px;
width: 10px;
subcontrol-position: bottom;
@ -654,7 +654,7 @@ QPlainTextEdit:selected {
/* QSizeGrip --------------------------------------------------------------- */
QSizeGrip {
image: url(qss/qdarkstyle/rc/sizegrip.png);
image: url(%THISPATH%/qdarkstyle/rc/sizegrip.png);
width: 12px;
height: 12px;
}
@ -682,29 +682,29 @@ QToolBar QToolButton{
QToolBar::handle:horizontal {
width: 6px;
image: url(qss/qdarkstyle/rc/Hmovetoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Hmovetoolbar.png);
}
QToolBar::handle:vertical {
height: 6px;
image: url(qss/qdarkstyle/rc/Vmovetoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Vmovetoolbar.png);
}
QToolBar::separator:horizontal {
width: 3px;
image: url(qss/qdarkstyle/rc/Hsepartoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Hsepartoolbar.png);
}
QToolBar::separator:vertical {
height: 3px;
image: url(qss/qdarkstyle/rc/Vsepartoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Vsepartoolbar.png);
}
QToolButton#qt_toolbar_ext_button {
background: #32414B;
border: 0px;
color: #F0F0F0;
image: url(qss/qdarkstyle/rc/right_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/right_arrow.png);
}
/* QAbstractSpinBox ------------------------------------------------------- */
@ -732,13 +732,13 @@ QAbstractSpinBox:up-button {
QAbstractSpinBox::up-arrow,
QAbstractSpinBox::up-arrow:disabled,
QAbstractSpinBox::up-arrow:off {
image: url(qss/qdarkstyle/rc/up_arrow_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/up_arrow_disabled.png);
width: 9px;
height: 9px;
}
QAbstractSpinBox::up-arrow:hover {
image: url(qss/qdarkstyle/rc/up_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/up_arrow.png);
}
QAbstractSpinBox:down-button {
@ -752,13 +752,13 @@ QAbstractSpinBox:down-button {
QAbstractSpinBox::down-arrow,
QAbstractSpinBox::down-arrow:disabled,
QAbstractSpinBox::down-arrow:off {
image: url(qss/qdarkstyle/rc/down_arrow_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow_disabled.png);
width: 9px;
height: 9px;
}
QAbstractSpinBox::down-arrow:hover {
image: url(qss/qdarkstyle/rc/down_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow.png);
}
QAbstractSpinBox:hover{
@ -1028,13 +1028,13 @@ QToolButton::menu-button:checked:hover {
}
QToolButton::menu-indicator {
image: url(qss/qdarkstyle/rc/down_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow.png);
top: -8px; /* shift it a bit */
left: -4px; /* shift it a bit */
}
QToolButton::menu-arrow {
image: url(qss/qdarkstyle/rc/down_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow.png);
}
QToolButton::menu-arrow:open {
@ -1109,7 +1109,8 @@ QComboBox::item:alternate {
}
QComboBox::item:checked {
font-weight: bold;
/*font-weight: bold;*/
background-color: #148CD2;
}
QComboBox::item:selected {
@ -1128,13 +1129,13 @@ QComboBox::drop-down {
}
QComboBox::down-arrow {
image: url(qss/qdarkstyle/rc/down_arrow_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow_disabled.png);
}
QComboBox::down-arrow:on,
QComboBox::down-arrow:hover,
QComboBox::down-arrow:focus {
image: url(qss/qdarkstyle/rc/down_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow.png);
}
/* QSlider ---------------------------------------------------------------- */
@ -1289,15 +1290,15 @@ QTabBar::close-button {
border: 0;
margin: 2px;
padding: 0;
image: url(qss/qdarkstyle/rc/close.png);
image: url(%THISPATH%/qdarkstyle/rc/close.png);
}
QTabBar::close-button:hover {
image: url(qss/qdarkstyle/rc/close-hover.png);
image: url(%THISPATH%/qdarkstyle/rc/close-hover.png);
}
QTabBar::close-button:pressed {
image: url(qss/qdarkstyle/rc/close-pressed.png);
image: url(%THISPATH%/qdarkstyle/rc/close-pressed.png);
}
/* QTabBar::tab - selected ----------------------------------------------- */
@ -1486,19 +1487,19 @@ QTabBar::tab:right:!selected:hover {
}
QTabBar QToolButton::right-arrow:enabled {
image: url(qss/qdarkstyle/rc/right_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/right_arrow.png);
}
QTabBar QToolButton::left-arrow:enabled {
image: url(qss/qdarkstyle/rc/left_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/left_arrow.png);
}
QTabBar QToolButton::right-arrow:disabled {
image: url(qss/qdarkstyle/rc/right_arrow_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/right_arrow_disabled.png);
}
QTabBar QToolButton::left-arrow:disabled {
image: url(qss/qdarkstyle/rc/left_arrow_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/left_arrow_disabled.png);
}
QTabBar QToolButton{
@ -1514,8 +1515,8 @@ QDockWidget {
background-color: #19232D;
border: 1px solid #32414B;
border-radius: 4px;
titlebar-close-icon: url(qss/qdarkstyle/rc/close.png);
titlebar-normal-icon: url(qss/qdarkstyle/rc/undock.png);
titlebar-close-icon: url(%THISPATH%/qdarkstyle/rc/close.png);
titlebar-normal-icon: url(%THISPATH%/qdarkstyle/rc/undock.png);
}
QDockWidget::title {
@ -1557,39 +1558,39 @@ QDockWidget::float-button:pressed {
QTreeView:branch:selected,
QTreeView:branch:hover {
background: url(qss/qdarkstyle/rc/transparent.png);
background: url(%THISPATH%/qdarkstyle/rc/transparent.png);
}
QTreeView::branch:has-siblings:!adjoins-item {
border-image: url(qss/qdarkstyle/rc/transparent.png);
border-image: url(%THISPATH%/qdarkstyle/rc/transparent.png);
}
QTreeView::branch:has-siblings:adjoins-item {
border-image: url(qss/qdarkstyle/rc/transparent.png);
border-image: url(%THISPATH%/qdarkstyle/rc/transparent.png);
}
QTreeView::branch:!has-children:!has-siblings:adjoins-item {
border-image: url(qss/qdarkstyle/rc/transparent.png);
border-image: url(%THISPATH%/qdarkstyle/rc/transparent.png);
}
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
image: url(qss/qdarkstyle/rc/branch_closed.png);
image: url(%THISPATH%/qdarkstyle/rc/branch_closed.png);
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
image: url(qss/qdarkstyle/rc/branch_open.png);
image: url(%THISPATH%/qdarkstyle/rc/branch_open.png);
}
QTreeView::branch:has-children:!has-siblings:closed:hover,
QTreeView::branch:closed:has-children:has-siblings:hover {
image: url(qss/qdarkstyle/rc/branch_closed-on.png);
image: url(%THISPATH%/qdarkstyle/rc/branch_closed-on.png);
}
QTreeView::branch:open:has-children:!has-siblings:hover,
QTreeView::branch:open:has-children:has-siblings:hover {
image: url(qss/qdarkstyle/rc/branch_open-on.png);
image: url(%THISPATH%/qdarkstyle/rc/branch_open-on.png);
}
QListView::item:!selected:hover,
@ -1611,12 +1612,12 @@ QColumnView::item:selected:hover {
QTreeView::indicator:checked,
QListView::indicator:checked {
image: url(qss/qdarkstyle/rc/checkbox_checked.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked.png);
}
QTreeView::indicator:unchecked,
QListView::indicator:unchecked {
image: url(qss/qdarkstyle/rc/checkbox_unchecked.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked.png);
}
QTreeView::indicator:checked:hover,
@ -1625,7 +1626,7 @@ QTreeView::indicator:checked:pressed,
QListView::indicator:checked:hover,
QListView::indicator:checked:focus,
QListView::indicator:checked:pressed {
image: url(qss/qdarkstyle/rc/checkbox_checked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_checked_focus.png);
}
QTreeView::indicator:unchecked:hover,
@ -1634,7 +1635,7 @@ QTreeView::indicator:unchecked:pressed,
QListView::indicator:unchecked:hover,
QListView::indicator:unchecked:focus,
QListView::indicator:unchecked:pressed {
image: url(qss/qdarkstyle/rc/checkbox_unchecked_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_unchecked_focus.png);
}
QTreeView::indicator:indeterminate:hover,
@ -1643,12 +1644,12 @@ QTreeView::indicator:indeterminate:pressed,
QListView::indicator:indeterminate:hover,
QListView::indicator:indeterminate:focus,
QListView::indicator:indeterminate:pressed {
image: url(qss/qdarkstyle/rc/checkbox_indeterminate_focus.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_indeterminate_focus.png);
}
QTreeView::indicator:indeterminate,
QListView::indicator:indeterminate {
image: url(qss/qdarkstyle/rc/checkbox_indeterminate.png);
image: url(%THISPATH%/qdarkstyle/rc/checkbox_indeterminate.png);
}
QListView,
@ -1771,7 +1772,7 @@ QHeaderView::down-arrow {
width: 16px;
height: 16px;
border-right: 1px solid #19232D;
image: url(qss/qdarkstyle/rc/down_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow.png);
}
QHeaderView::up-arrow {
@ -1779,7 +1780,7 @@ QHeaderView::up-arrow {
width: 16px;
height: 16px;
border-right: 1px solid #19232D;
image: url(qss/qdarkstyle/rc/up_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/up_arrow.png);
}
/* QToolBox -------------------------------------------------------------- */
@ -1876,12 +1877,12 @@ QSplitter::separator:hover {
QSplitter::separator:horizontal {
width: 5px;
image: url(qss/qdarkstyle/rc/Vsepartoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Vsepartoolbar.png);
}
QSplitter::separator:vertical {
height: 5px;
image: url(qss/qdarkstyle/rc/Hsepartoolbar.png);
image: url(%THISPATH%/qdarkstyle/rc/Hsepartoolbar.png);
}
@ -1912,13 +1913,13 @@ QDateEdit::drop-down {
}
QDateEdit::down-arrow {
image: url(qss/qdarkstyle/rc/down_arrow_disabled.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow_disabled.png);
}
QDateEdit::down-arrow:on,
QDateEdit::down-arrow:hover,
QDateEdit::down-arrow:focus {
image: url(qss/qdarkstyle/rc/down_arrow.png);
image: url(%THISPATH%/qdarkstyle/rc/down_arrow.png);
}
QDateEdit QAbstractItemView {
@ -1976,10 +1977,6 @@ GxsForumThreadWidget QLabel#forumName
font: bold;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item {
padding: 2px;
}
ForumsDialog, GxsForumThreadWidget
{
qproperty-textColorRead: darkgray;
@ -1993,6 +1990,20 @@ ForumsDialog, GxsForumThreadWidget
qproperty-backgroundColorFiltered: darkGreen;
}
GxsForumThreadWidget QWidget#threadTreeWidget {
selection-background-color: #005599;
show-decoration-selected: 1;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item {
padding: 2px;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item:selected:active ,
GxsForumThreadWidget QWidget#threadTreeWidget::item:selected:!active {
background-color: #005599;
}
QTreeView [new=true]{
color: #0099cc;
@ -2056,8 +2067,8 @@ GxsChannelPostsWidgetWithModel QToolButton#subscribeToolButton:disabled {
}
/* only for MenuButtonPopup */
GxsChannelPostsWidgetWithModel QToolButton#subscribeToolButton[popupMode="1"] {
padding-right: 0px;
GxsChannelPostsWidgetWithModel QToolButton#subscribeToolButton[popupMode="1"] {
padding-right: 0px;
}
GxsChannelPostsWidgetWithModel QToolButton#subscribeToolButton::menu-arrow {
@ -2102,14 +2113,15 @@ GxsCreateCommentDialog QPushButton#postButton, GxsGroupDialog QPushButton#create
CreateCircleDialog QPushButton#createButton:hover, CreateLobbyDialog QPushButton#createButton:hover,
IdEditDialog QPushButton#createButton:hover, CreateGxsForumMsg QPushButton#postButton:hover,
GxsCreateCommentDialog QPushButton#postButton:hover, , GxsGroupDialog QPushButton#createButton:hover {
GxsCreateCommentDialog QPushButton#postButton:hover, GxsGroupDialog QPushButton#createButton:hover {
background: #03b1f3;
border-radius: 4px;
min-width: 4em;
padding: 2px;
}
CreateGxsForumMsg QPushButton#postButton:disabled {
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
CreateGxsChannelMsg QPushButton#postButton:disabled, GxsCreateCommentDialog QPushButton#postButton:disabled {
font: bold;
font-size: 15px;
color: white;
@ -2121,12 +2133,12 @@ CreateGxsForumMsg QPushButton#postButton:disabled {
}
QTabBar#smTab::tab{
height: 32px;
height: 32px;
width: 32px;
}
QLabel#avatarLabel{
border: 2px solid #CCCCCC;
border: 2px solid #CCCCCC;
border-radius: 4px;
}
@ -2177,7 +2189,7 @@ BoardPostDisplayWidget_compact QFrame#voteFrame {
background: #141415;
}
BoardPostDisplayWidget_compact QToolButton#voteDownButton, QToolButton#voteUpButton,
BoardPostDisplayWidget_compact QToolButton#voteDownButton, QToolButton#voteUpButton,
BoardPostDisplayWidget_card QToolButton#voteDownButton, QToolButton#voteUpButton
{
border: none;

View File

@ -557,6 +557,14 @@ QComboBox:on
selection-background-color: #4a4a4a;
}
/* Needed to remove indicator - fix #132 */
QComboBox::indicator {
background-color:transparent;
selection-background-color:transparent;
color:transparent;
selection-color:transparent;
}
QComboBox QAbstractItemView
{
background-color: #201F1F;
@ -1176,10 +1184,20 @@ GxsForumThreadWidget QToolButton#subscribeToolButton:hover {
border-radius: 4px;
}
GxsForumThreadWidget QWidget#threadTreeWidget {
selection-background-color: #445566;
show-decoration-selected: 1;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item {
padding: 2px;
}
GxsForumThreadWidget QWidget#threadTreeWidget::item:selected:active ,
GxsForumThreadWidget QWidget#threadTreeWidget::item:selected:!active {
background-color: #445566;
}
GxsChannelPostsWidgetWithModel QToolButton#subscribeToolButton {
font: bold;
font-size: 14px;
@ -1262,7 +1280,8 @@ ShareManager QPushButton#closeButton {
padding: 2px;
}
CreateGxsForumMsg QPushButton#postButton:disabled {
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
CreateGxsChannelMsg QPushButton#postButton:disabled, GxsCreateCommentDialog QPushButton#postButton:disabled {
font: bold;
font-size: 15px;
color: white;

View File

@ -602,15 +602,15 @@ void RichTextEdit::checkLength(){
if(charRemains >= 0) {
text = tr("It remains %1 characters after HTML conversion.").arg(charRemains);
f_info->setStyleSheet("QLabel#f_info { }");
emit textSizeOk(true);
}else{
text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains));
f_info->setStyleSheet("QLabel#f_info {color: red; font: bold; }");
f_info->setStyleSheet("QLabel#f_info {color: red; font: bold; }");
emit textSizeOk(false);
}
//buttonBox->button(QDialogButtonBox::Ok)->setEnabled(charRemains>=0);
f_info->setText(text);
}
void RichTextEdit::setPlaceHolderTextPosted() {
f_textedit->setPlaceholderText(tr("Text (optional)"));
}

View File

@ -38,10 +38,12 @@ class RichTextEdit : public QWidget, protected Ui::RichTextEdit {
QTextCursor textCursor() const { return f_textedit->textCursor(); }
void setTextCursor(const QTextCursor& cursor) { f_textedit->setTextCursor(cursor); }
signals:
void textSizeOk(bool);
public slots:
void setText(const QString &text);
void setPlaceHolderTextPosted();
void setPlaceHolderTextPosted();
protected slots:
void setPlainText(const QString &text) { f_textedit->setPlainText(text); }