From 4bc102f1a1d3392d44bf2e4e8025b934ef7d778e Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 23 Oct 2020 20:01:31 +0200 Subject: [PATCH 01/14] Fixing News Feed default stylesheets --- .../src/gui/qss/stylesheet/Standard.qss | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 9d1c0d17a..f970db883 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -891,14 +891,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; } From 1469be18aa5042134463670ded7d86c26947fe42 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 25 Oct 2020 19:06:51 +0100 Subject: [PATCH 02/14] Fixing some default stylesheets & the Layout for the ChatLobby info Labels --- retroshare-gui/src/gui/ChatLobbyWidget.ui | 320 +++++++++--------- .../src/gui/qss/stylesheet/Standard.qss | 12 +- 2 files changed, 166 insertions(+), 166 deletions(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.ui b/retroshare-gui/src/gui/ChatLobbyWidget.ui index 9a563f4a7..d3e6e03e2 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.ui +++ b/retroshare-gui/src/gui/ChatLobbyWidget.ui @@ -234,176 +234,168 @@ Chat Room info - - - + + + 6 - - - - - - - 75 - true - - - - Chat room Name: - - - - - - - - 75 - true - - - - Chat room Id: - - - - - - - - 75 - true - - - - Topic: - - - - - - - - 75 - true - - - - Type: - - - - - - - - 75 - true - - - - Security: - - - - - - - - 75 - true - - - - Peers: - - - - + + + + + 75 + true + + + + Chat room Name: + + - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - true - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - TextLabel - - - - - - - - 0 - 0 - - - - TextLabel - - - - + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 75 + true + + + + Chat room Id: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 75 + true + + + + Topic: + + + + + + + + 0 + 0 + + + + TextLabel + + + true + + + + + + + + 75 + true + + + + Type: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 75 + true + + + + Security: + + + + + + + TextLabel + + + + + + + + 75 + true + + + + Peers: + + + + + + + + 0 + 0 + + + + TextLabel + + - + TextLabel @@ -413,7 +405,7 @@ - + Qt::Vertical diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index f970db883..e955c26e3 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -202,7 +202,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 +242,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 +792,8 @@ PostedListWidgetWithModel QComboBox#sortStrategy_CB { color: #0099cc; } -PostedListWidgetWithModel QToolButton#submitPostButton { +PostedListWidgetWithModel QToolButton#submitPostButton, GxsChannelPostsWidgetWithModel QToolButton#postButton, +GxsForumThreadWidget QToolButton#newthreadButton { font: bold; } From 11d358323357082105bab9c5795c54645672f7be Mon Sep 17 00:00:00 2001 From: defnax Date: Wed, 28 Oct 2020 22:53:42 +0100 Subject: [PATCH 03/14] * Fixing the Post buttons to get disabled when the limit has been exceeded --- retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp | 5 +++-- retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp | 7 +++++-- retroshare-gui/src/gui/qss/stylesheet/Standard.qss | 3 ++- retroshare-gui/src/qss/qdarkstyle-v2.qss | 3 ++- retroshare-gui/src/qss/qdarkstyle.qss | 3 ++- retroshare-gui/src/util/RichTextEdit.cpp | 6 +++--- retroshare-gui/src/util/RichTextEdit.h | 4 +++- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp index 902d28858..326db324a 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp @@ -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 ); diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp index f7f8ed726..90c9a04dc 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp @@ -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 ); @@ -77,6 +79,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")); diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index e955c26e3..54c501504 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -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 { font: bold; font-size: 15px; color: white; diff --git a/retroshare-gui/src/qss/qdarkstyle-v2.qss b/retroshare-gui/src/qss/qdarkstyle-v2.qss index 24b9fed24..5f541b007 100644 --- a/retroshare-gui/src/qss/qdarkstyle-v2.qss +++ b/retroshare-gui/src/qss/qdarkstyle-v2.qss @@ -2109,7 +2109,8 @@ GxsCreateCommentDialog QPushButton#postButton:hover, , GxsGroupDialog QPushButto padding: 2px; } -CreateGxsForumMsg QPushButton#postButton:disabled { +CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled, +CreateGxsChannelMsg QPushButton#postButton:disabled { font: bold; font-size: 15px; color: white; diff --git a/retroshare-gui/src/qss/qdarkstyle.qss b/retroshare-gui/src/qss/qdarkstyle.qss index da0a73ac4..97c078c02 100644 --- a/retroshare-gui/src/qss/qdarkstyle.qss +++ b/retroshare-gui/src/qss/qdarkstyle.qss @@ -1262,7 +1262,8 @@ ShareManager QPushButton#closeButton { padding: 2px; } -CreateGxsForumMsg QPushButton#postButton:disabled { +CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled, +CreateGxsChannelMsg QPushButton#postButton:disabled { font: bold; font-size: 15px; color: white; diff --git a/retroshare-gui/src/util/RichTextEdit.cpp b/retroshare-gui/src/util/RichTextEdit.cpp index 613aa1c19..9d4596a82 100644 --- a/retroshare-gui/src/util/RichTextEdit.cpp +++ b/retroshare-gui/src/util/RichTextEdit.cpp @@ -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)")); } diff --git a/retroshare-gui/src/util/RichTextEdit.h b/retroshare-gui/src/util/RichTextEdit.h index 8a4c95eba..aea07ba7f 100644 --- a/retroshare-gui/src/util/RichTextEdit.h +++ b/retroshare-gui/src/util/RichTextEdit.h @@ -38,11 +38,13 @@ 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(); - protected slots: void setPlainText(const QString &text) { f_textedit->setPlainText(text); } void setHtml(const QString &text) { f_textedit->setHtml(text); } From 20c3064e781ba5eb1b132cc6d523a467b57f3df9 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 30 Oct 2020 18:18:51 +0100 Subject: [PATCH 04/14] Added check message length for Comments Composer --- .../src/gui/gxs/GxsCreateCommentDialog.cpp | 21 +++++- .../src/gui/gxs/GxsCreateCommentDialog.h | 3 +- .../src/gui/gxs/GxsCreateCommentDialog.ui | 71 +++++++++++-------- .../src/gui/qss/stylesheet/Standard.qss | 2 +- retroshare-gui/src/qss/qdarkstyle-v2.qss | 2 +- retroshare-gui/src/qss/qdarkstyle.qss | 2 +- 6 files changed, 67 insertions(+), 34 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp index d823414de..ff31b10d9 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp @@ -26,6 +26,8 @@ #include #include +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); +} \ No newline at end of file diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h index ce394bf5e..1f38e2a98 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h @@ -43,7 +43,8 @@ public: private slots: void createComment(); - + void checkLength(); + private: Ui::GxsCreateCommentDialog *ui; RsGxsCommentService *mCommentService; diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui index 1825bcf55..46b547412 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.ui @@ -6,8 +6,8 @@ 0 0 - 459 - 324 + 505 + 367 @@ -32,7 +32,7 @@ - + 0 0 @@ -142,17 +142,20 @@ p, li { white-space: pre-wrap; } 6 - - - - + + + + Qt::Horizontal - - + + + 276 + 20 + - + - + @@ -162,7 +165,21 @@ p, li { white-space: pre-wrap; } - + + + + Cancel + + + + + + + TextLabel + + + + @@ -186,30 +203,26 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - - 276 - 20 - - - - - + Post - - + + + + + 0 + 0 + + + + + - Cancel + diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 54c501504..50ae5b314 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -188,7 +188,7 @@ ShareManager QPushButton#addButton:hover { } CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled, -CreateGxsChannelMsg QPushButton#postButton:disabled { +CreateGxsChannelMsg QPushButton#postButton:disabled, GxsCreateCommentDialog QPushButton#postButton:disabled { font: bold; font-size: 15px; color: white; diff --git a/retroshare-gui/src/qss/qdarkstyle-v2.qss b/retroshare-gui/src/qss/qdarkstyle-v2.qss index 5f541b007..0040d2cb6 100644 --- a/retroshare-gui/src/qss/qdarkstyle-v2.qss +++ b/retroshare-gui/src/qss/qdarkstyle-v2.qss @@ -2110,7 +2110,7 @@ GxsCreateCommentDialog QPushButton#postButton:hover, , GxsGroupDialog QPushButto } CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled, -CreateGxsChannelMsg QPushButton#postButton:disabled { +CreateGxsChannelMsg QPushButton#postButton:disabled, GxsCreateCommentDialog QPushButton#postButton:disabled { font: bold; font-size: 15px; color: white; diff --git a/retroshare-gui/src/qss/qdarkstyle.qss b/retroshare-gui/src/qss/qdarkstyle.qss index 97c078c02..6e37f3a82 100644 --- a/retroshare-gui/src/qss/qdarkstyle.qss +++ b/retroshare-gui/src/qss/qdarkstyle.qss @@ -1263,7 +1263,7 @@ ShareManager QPushButton#closeButton { } CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled, -CreateGxsChannelMsg QPushButton#postButton:disabled { +CreateGxsChannelMsg QPushButton#postButton:disabled, GxsCreateCommentDialog QPushButton#postButton:disabled { font: bold; font-size: 15px; color: white; From 9072feca82c1459363b3717a3f9b7b4f444ffef1 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 30 Oct 2020 19:03:55 +0100 Subject: [PATCH 05/14] Added missed line --- retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp index ff31b10d9..e36889a6e 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp @@ -123,4 +123,4 @@ void GxsCreateCommentDialog::checkLength(){ } ui->postButton->setEnabled(charRemains>=0); ui->infoLabel->setText(text); -} \ No newline at end of file +} From e6f7c4ba674acec459a8f44236a655e227fa2872 Mon Sep 17 00:00:00 2001 From: amir28 Date: Sat, 31 Oct 2020 16:27:54 +0330 Subject: [PATCH 06/14] Fix Appveyor Windows build failing Combine several commits from https://github.com/RetroShare/RetroShare/pull/2090 to one --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b22beb2de..cd706d02c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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% From bea5a9fa51d25dea8ea710b79c80d537f9608321 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 1 Nov 2020 14:43:26 +0100 Subject: [PATCH 07/14] Added back counting on Subscribe button --- .../gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp | 8 ++++---- .../src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index e03c41c32..4f3d37285 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -1048,7 +1048,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)) { @@ -1160,16 +1160,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); } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h index 2e50c77d6..fe299a864 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h @@ -175,7 +175,7 @@ private: void handleEvent_main_thread(std::shared_ptr 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; From 2d7038c02ae8485e254a94d9afb59761995c25a0 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 1 Nov 2020 16:01:37 +0100 Subject: [PATCH 08/14] Fixing indentation --- retroshare-gui/src/util/RichTextEdit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/util/RichTextEdit.h b/retroshare-gui/src/util/RichTextEdit.h index aea07ba7f..aae9d20ab 100644 --- a/retroshare-gui/src/util/RichTextEdit.h +++ b/retroshare-gui/src/util/RichTextEdit.h @@ -43,7 +43,7 @@ signals: public slots: void setText(const QString &text); - void setPlaceHolderTextPosted(); + void setPlaceHolderTextPosted(); protected slots: void setPlainText(const QString &text) { f_textedit->setPlainText(text); } From 079180c790cc0551c812a17df56c671b367a5818 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Tue, 3 Nov 2020 17:53:52 +0100 Subject: [PATCH 09/14] Fix compilation with libupnp 1.14.0 Based of sehraf patch https://github.com/RetroShare/RetroShare/issues/2072#issuecomment-703299870 --- libretroshare/src/rs_upnp/UPnPBase.cpp | 29 +++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/libretroshare/src/rs_upnp/UPnPBase.cpp b/libretroshare/src/rs_upnp/UPnPBase.cpp index a597452fc..353812469 100644 --- a/libretroshare/src/rs_upnp/UPnPBase.cpp +++ b/libretroshare/src/rs_upnp/UPnPBase.cpp @@ -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 * + * Copyright (C) 2019-2020 Gioacchino Mazzurco * * * * 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(&CUPnPControlPoint::Callback), @@ -1022,7 +1018,6 @@ error: #ifdef UPNP_DEBUG std::cerr << "UPnPControlPoint::CUPnPControlPoint() UpnpFinish called within CUPnPControlPoint constructor." << std::endl; #endif - return; } From 3be360ffc1c816ae11e37039f9ba2347767adea0 Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 4 Nov 2020 08:53:58 +0100 Subject: [PATCH 10/14] Fix Forum Post Selection BackGround Color --- .../src/gui/qss/stylesheet/Standard.qss | 10 + retroshare-gui/src/qss/qdarkstyle-v2.qss | 195 +++++++++--------- retroshare-gui/src/qss/qdarkstyle.qss | 18 ++ 3 files changed, 131 insertions(+), 92 deletions(-) diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 50ae5b314..d2304a83d 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -1038,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*/ diff --git a/retroshare-gui/src/qss/qdarkstyle-v2.qss b/retroshare-gui/src/qss/qdarkstyle-v2.qss index 0040d2cb6..b31ed8154 100644 --- a/retroshare-gui/src/qss/qdarkstyle-v2.qss +++ b/retroshare-gui/src/qss/qdarkstyle-v2.qss @@ -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,7 +2113,7 @@ 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; @@ -2122,12 +2133,12 @@ CreateGxsChannelMsg QPushButton#postButton:disabled, GxsCreateCommentDialog QPus } QTabBar#smTab::tab{ - height: 32px; + height: 32px; width: 32px; } QLabel#avatarLabel{ - border: 2px solid #CCCCCC; + border: 2px solid #CCCCCC; border-radius: 4px; } @@ -2178,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; diff --git a/retroshare-gui/src/qss/qdarkstyle.qss b/retroshare-gui/src/qss/qdarkstyle.qss index 6e37f3a82..b6af8f258 100644 --- a/retroshare-gui/src/qss/qdarkstyle.qss +++ b/retroshare-gui/src/qss/qdarkstyle.qss @@ -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; From d1c10d3c0e381227d370ee3f8283a66f7b48cf37 Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 4 Nov 2020 12:09:50 +0100 Subject: [PATCH 11/14] Fix Forum Post Resize [ ] forums: Clicking on diffent forum items causes changing of the width of the left pane. --- retroshare-gui/src/gui/common/RSImageBlockWidget.ui | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/common/RSImageBlockWidget.ui b/retroshare-gui/src/gui/common/RSImageBlockWidget.ui index ffae88bad..f483a1afd 100644 --- a/retroshare-gui/src/gui/common/RSImageBlockWidget.ui +++ b/retroshare-gui/src/gui/common/RSImageBlockWidget.ui @@ -6,8 +6,8 @@ 0 0 - 476 - 38 + 421 + 39 @@ -17,6 +17,9 @@ 0 + + QLayout::SetNoConstraint + 0 @@ -138,8 +141,8 @@ - 40 - 20 + 0 + 0 From 47a2a78350b081abd1dc0cbb43dd2932ff3c70cf Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 6 Nov 2020 11:04:50 +0100 Subject: [PATCH 12/14] Fix RSTreeView Header first Painting --- retroshare-gui/src/gui/common/RSTreeView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/common/RSTreeView.cpp b/retroshare-gui/src/gui/common/RSTreeView.cpp index 72b191fe2..ca2aedacc 100644 --- a/retroshare-gui/src/gui/common/RSTreeView.cpp +++ b/retroshare-gui/src/gui/common/RSTreeView.cpp @@ -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) From c5a80cce36369e5b20c25f21f70e84b6b70ae464 Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 6 Nov 2020 18:05:39 +0100 Subject: [PATCH 13/14] Add Download All files in Channel post --- .../GxsChannelFilesStatusWidget.cpp | 4 + .../gxschannels/GxsChannelFilesStatusWidget.h | 4 + .../GxsChannelPostsWidgetWithModel.cpp | 112 ++++++++++++------ .../GxsChannelPostsWidgetWithModel.h | 5 +- .../GxsChannelPostsWidgetWithModel.ui | 31 +++-- 5 files changed, 109 insertions(+), 47 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp index bc019e426..365dab3f3 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp @@ -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(); } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h index 1effe0549..8f2f7f8e4 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h @@ -37,6 +37,10 @@ public: explicit GxsChannelFilesStatusWidget(const RsGxsFile &file, QWidget *parent = 0); ~GxsChannelFilesStatusWidget(); +signals: + + void onButtonClick(); + private slots: void check(); void download(); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 4f3d37285..d73ad29ad 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -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; @@ -268,14 +268,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() ; - 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 { @@ -381,7 +385,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 @@ -391,7 +395,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 @@ -404,6 +408,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")); @@ -411,11 +418,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;icolumnCount();++i) - ui->postsTree->setColumnWidth(i,mChannelPostsDelegate->cellSize(i,font(),ui->postsTree->width())); + if(mChannelPostsModel->getMode() == RsGxsChannelPostsModel::TREE_MODE_GRID) + for(int i=0;icolumnCount();++i) + ui->postsTree->setColumnWidth(i,mChannelPostsDelegate->cellSize(i,font(),ui->postsTree->width())); /* Setup UI helper */ @@ -659,6 +666,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() ; + + 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() @@ -745,9 +780,9 @@ void GxsChannelPostsWidgetWithModel::showPostDetails() std::cerr << "showPostDetails: setting mSelectedPost to current post Id " << post.mMeta.mMsgId << ". Previous value: " << mSelectedPost << std::endl; mSelectedPost = post.mMeta.mMsgId; - std::list files; - for(auto& file:post.mFiles) - files.push_back(ChannelPostFileInfo(file,post.mMeta.mPublishTs)); + std::list files; + for(auto& file:post.mFiles) + files.push_back(ChannelPostFileInfo(file,post.mMeta.mPublishTs)); mChannelPostFilesModel->setFiles(files); @@ -793,6 +828,8 @@ void GxsChannelPostsWidgetWithModel::showPostDetails() RsThread::async([postId]() { rsGxsChannels->markRead(postId, true) ; } ); } + + updateDAll_PB(); } void GxsChannelPostsWidgetWithModel::updateCommentsCount(int n) @@ -842,21 +879,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 files; @@ -891,6 +928,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 @@ -911,7 +950,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()) @@ -972,7 +1011,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")); @@ -1114,13 +1153,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)); @@ -1233,6 +1272,7 @@ void GxsChannelPostsWidgetWithModel::blank() ui->postLogo_LB->hide(); ui->postName_LB->hide(); ui->postTime_LB->hide(); + ui->postDAll_PB->hide(); groupNameChanged(QString()); } @@ -1320,11 +1360,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); } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h index fe299a864..01bb86757 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h @@ -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); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui index a1daef1af..cec64ed95 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui @@ -380,7 +380,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html> @@ -496,6 +496,17 @@ p, li { white-space: pre-wrap; } + + + + + + + + :/icons/png/download.png:/icons/png/download.png + + + @@ -506,6 +517,7 @@ p, li { white-space: pre-wrap; } 75 true + true @@ -613,24 +625,25 @@ p, li { white-space: pre-wrap; } - GxsIdLabel - QLabel -
gui/gxs/GxsIdLabel.h
+ LineEditClear + QLineEdit +
gui/common/LineEditClear.h
SubscribeToolButton QToolButton
gui/common/SubscribeToolButton.h
+ + GxsIdLabel + QLabel +
gui/gxs/GxsIdLabel.h
+
RSTreeView QTreeView
gui/common/RSTreeView.h
-
- - LineEditClear - QLineEdit -
gui/common/LineEditClear.h
+ 1
GxsCommentDialog From b1129df0771d6c64d7ad8857204fd033ca08e112 Mon Sep 17 00:00:00 2001 From: Phenom Date: Sat, 7 Nov 2020 18:09:50 +0100 Subject: [PATCH 14/14] Change Chat History Dialog to no modal. It will be updated when new message comes. --- libretroshare/src/pqi/p3historymgr.cc | 2 +- libretroshare/src/pqi/p3historymgr.h | 4 +- libretroshare/src/pqi/p3peermgr.cc | 2 + libretroshare/src/retroshare/rshistory.h | 10 +-- libretroshare/src/rsserver/p3history.cc | 5 ++ libretroshare/src/rsserver/p3history.h | 15 +++-- retroshare-gui/src/gui/chat/ChatWidget.cpp | 12 ++-- retroshare-gui/src/gui/chat/ChatWidget.h | 19 +++--- .../src/gui/im_history/ImHistoryBrowser.cpp | 66 +++++++++++-------- .../src/gui/im_history/ImHistoryBrowser.h | 2 +- 10 files changed, 81 insertions(+), 56 deletions(-) diff --git a/libretroshare/src/pqi/p3historymgr.cc b/libretroshare/src/pqi/p3historymgr.cc index b546da76c..a53acb678 100644 --- a/libretroshare/src/pqi/p3historymgr.cc +++ b/libretroshare/src/pqi/p3historymgr.cc @@ -416,7 +416,7 @@ bool p3HistoryMgr::loadList(std::list& 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(); diff --git a/libretroshare/src/pqi/p3historymgr.h b/libretroshare/src/pqi/p3historymgr.h index 5f4ac0d98..a74eff67e 100644 --- a/libretroshare/src/pqi/p3historymgr.h +++ b/libretroshare/src/pqi/p3historymgr.h @@ -68,9 +68,9 @@ public: virtual void saveDone(); virtual bool loadList(std::list& 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 > mMessages; diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 07eb180d4..55b1eb041 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -1876,7 +1876,9 @@ bool p3PeerMgrIMPL::getExtAddressReportedByFriends(sockaddr_storage &addr, uint8 static bool cleanIpList(std::list& lst,const RsPeerId& pid,p3LinkMgr *link_mgr) { bool changed = false ; +#ifdef PEER_DEBUG rstime_t now = time(NULL) ; +#endif for(std::list::iterator it2(lst.begin());it2 != lst.end();) { diff --git a/libretroshare/src/retroshare/rshistory.h b/libretroshare/src/retroshare/rshistory.h index 16f942339..f8eb7ecaa 100644 --- a/libretroshare/src/retroshare/rshistory.h +++ b/libretroshare/src/retroshare/rshistory.h @@ -70,15 +70,17 @@ public: class RsHistory { public: - virtual bool getMessages(const ChatId &chatPeerId, std::list &msgs, uint32_t loadCount) = 0; + virtual bool chatIdToVirtualPeerId(const ChatId &chat_id, RsPeerId &peer_id) = 0; + virtual bool getMessages(const ChatId &chatPeerId, std::list &msgs, uint32_t loadCount) = 0; virtual bool getMessage(uint32_t msgId, HistoryMsg &msg) = 0; virtual void removeMessages(const std::list &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; diff --git a/libretroshare/src/rsserver/p3history.cc b/libretroshare/src/rsserver/p3history.cc index 9492a09f0..2818d9339 100644 --- a/libretroshare/src/rsserver/p3history.cc +++ b/libretroshare/src/rsserver/p3history.cc @@ -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) ; diff --git a/libretroshare/src/rsserver/p3history.h b/libretroshare/src/rsserver/p3history.h index 73d009657..2a75d328d 100644 --- a/libretroshare/src/rsserver/p3history.h +++ b/libretroshare/src/rsserver/p3history.h @@ -37,16 +37,21 @@ public: p3History(p3HistoryMgr* historyMgr); virtual ~p3History(); - virtual bool getMessages(const ChatId &chatPeerId, std::list &msgs, uint32_t loadCount); + virtual bool chatIdToVirtualPeerId(const ChatId &chat_id, RsPeerId &peer_id); + virtual bool getMessages(const ChatId &chatPeerId, std::list &msgs, uint32_t loadCount); virtual bool getMessage(uint32_t msgId, HistoryMsg &msg); virtual void removeMessages(const std::list &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; diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 7b8c532d0..a28d0943d 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -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() diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index 535636ddd..2e64dce75 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -23,20 +23,22 @@ #ifndef CHATWIDGET_H #define CHATWIDGET_H -#include -#include -#include -#include -#include +#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 #include +#include +#include +#include +#include +#include + //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 mChatWidgetHolder; ChatLobbyUserNotify* notify; diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp index 70b5b4b0d..9f84f6856 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -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 historyMsgs; + rsHistory->getMessages(m_chatId, historyMsgs, 1); + if (historyMsgs.empty()) + ui.listWidget->clear(); + return; + } } void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg) diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h index 0cfeb9a45..6888594a5 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h @@ -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();