mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-30 17:23:23 -05:00
merged before commit
This commit is contained in:
commit
df6abc88e5
@ -506,6 +506,9 @@ void IdDialog::insertIdList(uint32_t token)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* count items */
|
||||||
|
ui->label_count->setText( "(" + QString::number(ui->idTreeWidget->topLevelItemCount()) + ")" );
|
||||||
|
|
||||||
filterIds();
|
filterIds();
|
||||||
|
|
||||||
updateSelection();
|
updateSelection();
|
||||||
|
@ -20,7 +20,16 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -38,7 +47,16 @@
|
|||||||
<enum>QFrame::Sunken</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -73,6 +91,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_count">
|
||||||
|
<property name="text">
|
||||||
|
<string>()</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="titleBarSpacer">
|
<spacer name="titleBarSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -129,7 +154,16 @@
|
|||||||
<enum>QFrame::Sunken</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -213,7 +247,7 @@
|
|||||||
<string>Reputation</string>
|
<string>Reputation</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textAlignment">
|
<property name="textAlignment">
|
||||||
<set>AlignLeft|AlignVCenter</set>
|
<set>AlignLeading|AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
@ -312,7 +346,16 @@
|
|||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@ -479,7 +522,16 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
|
@ -677,12 +677,20 @@ void MainWindow::updateTrayCombine()
|
|||||||
updateFriends();
|
updateFriends();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::toggleStatusToolTip(bool toggle){
|
||||||
|
if(!toggle)return;
|
||||||
|
QString tray = "RetroShare\n";
|
||||||
|
tray += "\n" + nameAndLocation;
|
||||||
|
trayIcon->setToolTip(tray);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::updateStatus()
|
void MainWindow::updateStatus()
|
||||||
{
|
{
|
||||||
// This call is essential to remove locks due to QEventLoop re-entrance while asking gpg passwds. Dont' remove it!
|
// This call is essential to remove locks due to QEventLoop re-entrance while asking gpg passwds. Dont' remove it!
|
||||||
if(RsAutoUpdatePage::eventsLocked())
|
if(RsAutoUpdatePage::eventsLocked())
|
||||||
return;
|
return;
|
||||||
|
if(Settings->valueFromGroup("StatusBar", "DisableSysTrayToolTip", QVariant(false)).toBool())
|
||||||
|
return;
|
||||||
float downKb = 0;
|
float downKb = 0;
|
||||||
float upKb = 0;
|
float upKb = 0;
|
||||||
rsConfig->GetCurrentDataRates(downKb, upKb);
|
rsConfig->GetCurrentDataRates(downKb, upKb);
|
||||||
|
@ -184,6 +184,7 @@ public slots:
|
|||||||
void setNewPage(int page);
|
void setNewPage(int page);
|
||||||
void setCompactStatusMode(bool compact);
|
void setCompactStatusMode(bool compact);
|
||||||
|
|
||||||
|
void toggleStatusToolTip(bool toggle);
|
||||||
protected:
|
protected:
|
||||||
/** Default Constructor */
|
/** Default Constructor */
|
||||||
MainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
MainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
||||||
|
@ -590,7 +590,7 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
QVariant TreeStyle_RDM::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant TreeStyle_RDM::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (role == Qt::SizeHintRole)
|
/*if (role == Qt::SizeHintRole)
|
||||||
{
|
{
|
||||||
int defw = QFontMetricsF(QWidget().font()).width(headerData(section,Qt::Horizontal,Qt::DisplayRole).toString()) ;
|
int defw = QFontMetricsF(QWidget().font()).width(headerData(section,Qt::Horizontal,Qt::DisplayRole).toString()) ;
|
||||||
int defh = QFontMetricsF(QWidget().font()).height();
|
int defh = QFontMetricsF(QWidget().font()).height();
|
||||||
@ -600,7 +600,7 @@ QVariant TreeStyle_RDM::headerData(int section, Qt::Orientation orientation, int
|
|||||||
defw = 200/16.0*defh;
|
defw = 200/16.0*defh;
|
||||||
}
|
}
|
||||||
return QSize(defw, defh);
|
return QSize(defw, defh);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (role != Qt::DisplayRole)
|
if (role != Qt::DisplayRole)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@ -636,7 +636,7 @@ QVariant TreeStyle_RDM::headerData(int section, Qt::Orientation orientation, int
|
|||||||
}
|
}
|
||||||
QVariant FlatStyle_RDM::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant FlatStyle_RDM::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (role == Qt::SizeHintRole)
|
/*if (role == Qt::SizeHintRole)
|
||||||
{
|
{
|
||||||
int defw = QFontMetricsF(QWidget().font()).width(headerData(section,Qt::Horizontal,Qt::DisplayRole).toString()) ;
|
int defw = QFontMetricsF(QWidget().font()).width(headerData(section,Qt::Horizontal,Qt::DisplayRole).toString()) ;
|
||||||
int defh = QFontMetricsF(QWidget().font()).height();
|
int defh = QFontMetricsF(QWidget().font()).height();
|
||||||
@ -646,7 +646,7 @@ QVariant FlatStyle_RDM::headerData(int section, Qt::Orientation orientation, int
|
|||||||
defw = defh*200/16.0;
|
defw = defh*200/16.0;
|
||||||
}
|
}
|
||||||
return QSize(defw, defh);
|
return QSize(defw, defh);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (role != Qt::DisplayRole)
|
if (role != Qt::DisplayRole)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
@ -260,7 +260,7 @@ void CreateGxsForumMsg::loadFormInformation()
|
|||||||
ui.signBox->setEnabled(true);
|
ui.signBox->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.forumMessage->setText("");
|
//ui.forumMessage->setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateGxsForumMsg::createMsg()
|
void CreateGxsForumMsg::createMsg()
|
||||||
@ -506,3 +506,8 @@ void CreateGxsForumMsg::loadRequest(const TokenQueue *queue, const TokenRequest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateGxsForumMsg::insertPastedText(QString msg)
|
||||||
|
{
|
||||||
|
ui.forumMessage->append(msg);
|
||||||
|
}
|
||||||
|
@ -40,6 +40,7 @@ public:
|
|||||||
|
|
||||||
void newMsg(); /* cleanup */
|
void newMsg(); /* cleanup */
|
||||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||||
|
void insertPastedText(QString msg) ;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||||
|
@ -97,6 +97,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
|
|||||||
mTokenTypeInsertThreads = nextTokenType();
|
mTokenTypeInsertThreads = nextTokenType();
|
||||||
mTokenTypeMessageData = nextTokenType();
|
mTokenTypeMessageData = nextTokenType();
|
||||||
mTokenTypeReplyMessage = nextTokenType();
|
mTokenTypeReplyMessage = nextTokenType();
|
||||||
|
mTokenTypeReplyForumMessage = nextTokenType();
|
||||||
|
|
||||||
setUpdateWhenInvisible(true);
|
setUpdateWhenInvisible(true);
|
||||||
|
|
||||||
@ -137,7 +138,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
|
|||||||
|
|
||||||
ui->subscribeToolButton->hide() ;
|
ui->subscribeToolButton->hide() ;
|
||||||
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
|
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
|
||||||
connect(ui->newmessageButton, SIGNAL(clicked()), this, SLOT(createmessage()));
|
connect(ui->newmessageButton, SIGNAL(clicked()), this, SLOT(replytoforummessage()));
|
||||||
connect(ui->newthreadButton, SIGNAL(clicked()), this, SLOT(createthread()));
|
connect(ui->newthreadButton, SIGNAL(clicked()), this, SLOT(createthread()));
|
||||||
|
|
||||||
connect(ui->threadTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(changedThread()));
|
connect(ui->threadTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(changedThread()));
|
||||||
@ -404,7 +405,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
|||||||
QMenu contextMnu(this);
|
QMenu contextMnu(this);
|
||||||
|
|
||||||
QAction *replyAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply"), &contextMnu);
|
QAction *replyAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply"), &contextMnu);
|
||||||
connect(replyAct, SIGNAL(triggered()), this, SLOT(createmessage()));
|
connect(replyAct, SIGNAL(triggered()), this, SLOT(replytoforummessage()));
|
||||||
|
|
||||||
QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply with private message"), &contextMnu);
|
QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply with private message"), &contextMnu);
|
||||||
connect(replyauthorAct, SIGNAL(triggered()), this, SLOT(replytomessage()));
|
connect(replyauthorAct, SIGNAL(triggered()), this, SLOT(replytomessage()));
|
||||||
@ -1787,6 +1788,18 @@ void GxsForumThreadWidget::replytomessage()
|
|||||||
requestMsgData_ReplyMessage(postId);
|
requestMsgData_ReplyMessage(postId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsForumThreadWidget::replytoforummessage()
|
||||||
|
{
|
||||||
|
if (groupId().isNull() || mThreadId.isNull()) {
|
||||||
|
QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get Message ... then complete replyMessageData().
|
||||||
|
RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId);
|
||||||
|
requestMsgData_ReplyForumMessage(postId);
|
||||||
|
}
|
||||||
|
|
||||||
void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg)
|
void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg)
|
||||||
{
|
{
|
||||||
if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
|
if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
|
||||||
@ -1815,6 +1828,34 @@ void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsForumThreadWidget::replyForumMessageData(const RsGxsForumMsg &msg)
|
||||||
|
{
|
||||||
|
if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
|
||||||
|
{
|
||||||
|
std::cerr << "GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!msg.mMeta.mAuthorId.isNull())
|
||||||
|
{
|
||||||
|
CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), mThreadId);
|
||||||
|
QTextDocument doc ;
|
||||||
|
// doc.setHtml(QString::fromUtf8(msg.mMsg.c_str()) );
|
||||||
|
// std::string cited_text(doc.toPlainText().toStdString()) ;
|
||||||
|
RsHtml::makeQuotedText(ui->postText);
|
||||||
|
|
||||||
|
cfm->insertPastedText(RsHtml::makeQuotedText(ui->postText)) ;
|
||||||
|
cfm->show();
|
||||||
|
|
||||||
|
/* window will destroy itself! */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to an Anonymous Author"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GxsForumThreadWidget::changedViewBox()
|
void GxsForumThreadWidget::changedViewBox()
|
||||||
{
|
{
|
||||||
if (mInProcessSettings) {
|
if (mInProcessSettings) {
|
||||||
@ -2031,6 +2072,24 @@ void GxsForumThreadWidget::requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &
|
|||||||
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeReplyMessage);
|
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeReplyMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsForumThreadWidget::requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId)
|
||||||
|
{
|
||||||
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||||
|
|
||||||
|
#ifdef DEBUG_FORUMS
|
||||||
|
std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
GxsMsgReq msgIds;
|
||||||
|
std::vector<RsGxsMessageId> &vect = msgIds[msgId.first];
|
||||||
|
vect.push_back(msgId.second);
|
||||||
|
|
||||||
|
uint32_t token;
|
||||||
|
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeReplyForumMessage);
|
||||||
|
}
|
||||||
|
|
||||||
void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
|
void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FORUMS
|
#ifdef DEBUG_FORUMS
|
||||||
@ -2047,7 +2106,6 @@ void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
replyMessageData(msgs[0]);
|
replyMessageData(msgs[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2057,6 +2115,32 @@ void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsForumThreadWidget::loadMsgData_ReplyForumMessage(const uint32_t &token)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG_FORUMS
|
||||||
|
std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
std::vector<RsGxsForumMsg> msgs;
|
||||||
|
if (rsGxsForums->getMsgData(token, msgs))
|
||||||
|
{
|
||||||
|
if (msgs.size() != 1)
|
||||||
|
{
|
||||||
|
std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Wrong number of answers";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
replyForumMessageData(msgs[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Missing Message Data...";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GxsForumThreadWidget::loadMsgData_BanAuthor(const uint32_t &token)
|
void GxsForumThreadWidget::loadMsgData_BanAuthor(const uint32_t &token)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FORUMS
|
#ifdef DEBUG_FORUMS
|
||||||
@ -2116,6 +2200,11 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.mUserType == mTokenTypeReplyForumMessage) {
|
||||||
|
loadMsgData_ReplyForumMessage(req.mToken);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (req.mUserType == mTokenTypeBanAuthor) {
|
if (req.mUserType == mTokenTypeBanAuthor) {
|
||||||
loadMsgData_BanAuthor(req.mToken);
|
loadMsgData_BanAuthor(req.mToken);
|
||||||
return;
|
return;
|
||||||
|
@ -75,7 +75,13 @@ private slots:
|
|||||||
void clickedThread (QTreeWidgetItem *item, int column);
|
void clickedThread (QTreeWidgetItem *item, int column);
|
||||||
|
|
||||||
void replytomessage();
|
void replytomessage();
|
||||||
|
void replytoforummessage();
|
||||||
|
|
||||||
void replyMessageData(const RsGxsForumMsg &msg);
|
void replyMessageData(const RsGxsForumMsg &msg);
|
||||||
|
void replyForumMessageData(const RsGxsForumMsg &msg);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//void print();
|
//void print();
|
||||||
//void printpreview();
|
//void printpreview();
|
||||||
@ -141,6 +147,9 @@ private:
|
|||||||
void loadMessageData(const uint32_t &token);
|
void loadMessageData(const uint32_t &token);
|
||||||
void requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &msgId);
|
void requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &msgId);
|
||||||
void loadMsgData_ReplyMessage(const uint32_t &token);
|
void loadMsgData_ReplyMessage(const uint32_t &token);
|
||||||
|
|
||||||
|
void requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId);
|
||||||
|
void loadMsgData_ReplyForumMessage(const uint32_t &token);
|
||||||
void loadMsgData_BanAuthor(const uint32_t &token);
|
void loadMsgData_BanAuthor(const uint32_t &token);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -162,6 +171,7 @@ private:
|
|||||||
uint32_t mTokenTypeInsertThreads;
|
uint32_t mTokenTypeInsertThreads;
|
||||||
uint32_t mTokenTypeMessageData;
|
uint32_t mTokenTypeMessageData;
|
||||||
uint32_t mTokenTypeReplyMessage;
|
uint32_t mTokenTypeReplyMessage;
|
||||||
|
uint32_t mTokenTypeReplyForumMessage;
|
||||||
uint32_t mTokenTypeBanAuthor;
|
uint32_t mTokenTypeBanAuthor;
|
||||||
|
|
||||||
/* Color definitions (for standard see qss.default) */
|
/* Color definitions (for standard see qss.default) */
|
||||||
|
@ -45,6 +45,7 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
|
|||||||
connect(ui.checkBoxHideSoundStatus, SIGNAL(toggled(bool)), pMainWindow->soundStatusInstance(), SLOT(setHidden(bool)));
|
connect(ui.checkBoxHideSoundStatus, SIGNAL(toggled(bool)), pMainWindow->soundStatusInstance(), SLOT(setHidden(bool)));
|
||||||
connect(ui.checkBoxHideToasterDisable, SIGNAL(toggled(bool)), pMainWindow->toasterDisableInstance(), SLOT(setHidden(bool)));
|
connect(ui.checkBoxHideToasterDisable, SIGNAL(toggled(bool)), pMainWindow->toasterDisableInstance(), SLOT(setHidden(bool)));
|
||||||
connect(ui.checkBoxShowSystrayOnStatus, SIGNAL(toggled(bool)), pMainWindow->sysTrayStatusInstance(), SLOT(setVisible(bool)));
|
connect(ui.checkBoxShowSystrayOnStatus, SIGNAL(toggled(bool)), pMainWindow->sysTrayStatusInstance(), SLOT(setVisible(bool)));
|
||||||
|
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), pMainWindow, SLOT(toggleStatusToolTip(bool)));
|
||||||
|
|
||||||
/* Populate combo boxes */
|
/* Populate combo boxes */
|
||||||
foreach (QString code, LanguageSupport::languageCodes()) {
|
foreach (QString code, LanguageSupport::languageCodes()) {
|
||||||
@ -142,6 +143,8 @@ bool AppearancePage::save(QString &errmsg)
|
|||||||
Settings->setValueToGroup("StatusBar", "HideSound", QVariant(ui.checkBoxHideSoundStatus->isChecked()));
|
Settings->setValueToGroup("StatusBar", "HideSound", QVariant(ui.checkBoxHideSoundStatus->isChecked()));
|
||||||
Settings->setValueToGroup("StatusBar", "HideToaster", QVariant(ui.checkBoxHideToasterDisable->isChecked()));
|
Settings->setValueToGroup("StatusBar", "HideToaster", QVariant(ui.checkBoxHideToasterDisable->isChecked()));
|
||||||
Settings->setValueToGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(ui.checkBoxShowSystrayOnStatus->isChecked()));
|
Settings->setValueToGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(ui.checkBoxShowSystrayOnStatus->isChecked()));
|
||||||
|
Settings->setValueToGroup("StatusBar", "DisableSysTrayToolTip", QVariant(ui.checkBoxDisableSysTrayToolTip->isChecked()));
|
||||||
|
MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -228,6 +231,7 @@ void AppearancePage::load()
|
|||||||
ui.checkBoxHideSoundStatus->setChecked(Settings->valueFromGroup("StatusBar", "HideSound", QVariant(false)).toBool());
|
ui.checkBoxHideSoundStatus->setChecked(Settings->valueFromGroup("StatusBar", "HideSound", QVariant(false)).toBool());
|
||||||
ui.checkBoxHideToasterDisable->setChecked(Settings->valueFromGroup("StatusBar", "HideToaster", QVariant(false)).toBool());
|
ui.checkBoxHideToasterDisable->setChecked(Settings->valueFromGroup("StatusBar", "HideToaster", QVariant(false)).toBool());
|
||||||
ui.checkBoxShowSystrayOnStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool());
|
ui.checkBoxShowSystrayOnStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool());
|
||||||
|
ui.checkBoxDisableSysTrayToolTip->setChecked(Settings->valueFromGroup("StatusBar", "DisableSysTrayToolTip", QVariant(false)).toBool());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
<enum>Qt::NoContextMenu</enum>
|
<enum>Qt::NoContextMenu</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@ -199,7 +208,16 @@
|
|||||||
<enum>QFrame::Plain</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -212,7 +230,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="rbtActionOnListItem">
|
<widget class="QRadioButton" name="rbtActionOnListItem">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>On List Item</string>
|
<string>On List Ite&m</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -248,7 +266,16 @@
|
|||||||
<enum>QFrame::Plain</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -461,6 +488,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxDisableSysTrayToolTip">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable SysTray ToolTip</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <QtXml>
|
#include <QtXml>
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QTextDocumentFragment>
|
||||||
#include <qmath.h>
|
#include <qmath.h>
|
||||||
|
|
||||||
#include "HandleRichText.h"
|
#include "HandleRichText.h"
|
||||||
@ -997,3 +998,15 @@ QString RsHtml::plainText(const std::string &text)
|
|||||||
return Qt::escape(QString::fromUtf8(text.c_str()));
|
return Qt::escape(QString::fromUtf8(text.c_str()));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString RsHtml::makeQuotedText(RSTextBrowser *browser)
|
||||||
|
{
|
||||||
|
QString text = browser->textCursor().selection().toPlainText();
|
||||||
|
if(text.length() == 0)
|
||||||
|
{
|
||||||
|
text = browser->toPlainText();
|
||||||
|
}
|
||||||
|
QStringList sl = text.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
|
||||||
|
text = sl.join("\n>");
|
||||||
|
return QString(">") + text;
|
||||||
|
}
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
|
#include <gui/common/RSTextBrowser.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file provides helper functions and functors for translating data from/to
|
* This file provides helper functions and functors for translating data from/to
|
||||||
* rich text format and HTML. Its main goal is to facilitate decoding of chat
|
* rich text format and HTML. Its main goal is to facilitate decoding of chat
|
||||||
@ -72,6 +74,8 @@ public:
|
|||||||
static QString plainText(const QString &text);
|
static QString plainText(const QString &text);
|
||||||
static QString plainText(const std::string &text);
|
static QString plainText(const std::string &text);
|
||||||
|
|
||||||
|
static QString makeQuotedText(RSTextBrowser* browser);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void embedHtml(QTextDocument *textDocument, QDomDocument &doc, QDomElement ¤tElement, EmbedInHtml& embedInfos, ulong flag);
|
void embedHtml(QTextDocument *textDocument, QDomDocument &doc, QDomElement ¤tElement, EmbedInHtml& embedInfos, ulong flag);
|
||||||
void replaceAnchorWithImg(QDomDocument& doc, QDomElement &element, QTextDocument *textDocument, const RetroShareLink &link);
|
void replaceAnchorWithImg(QDomDocument& doc, QDomElement &element, QTextDocument *textDocument, const RetroShareLink &link);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user