From bb5c758f876659e3d2db71623e6b3c8ba3eb36d5 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Oct 2020 00:01:17 +0200 Subject: [PATCH 01/31] cleaned up the mess in chat settings --- retroshare-gui/src/gui/settings/ChatPage.ui | 1189 +++++++++---------- 1 file changed, 579 insertions(+), 610 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui index 9484cc4c6..1ca6431b1 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.ui +++ b/retroshare-gui/src/gui/settings/ChatPage.ui @@ -7,55 +7,20 @@ 0 0 800 - 600 + 649 - - + + - 0 + 2 General - - - - Distant Chat - - - - - - - Everyone - - - - - Contacts - - - - - Nobody - - - - - - - - Accept encrypted distant chat from - - - - - - @@ -67,106 +32,9 @@ - Chat Settings + General settings - - - - - Enable Emoticons Private Chat - - - true - - - - - - - Enable Emoticons Group Chat - - - true - - - - - - - Enable custom fonts - - - true - - - - - - - Enable custom font size - - - true - - - - - - - 0 - - - - - Minimum font size - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 1 - - - 64 - - - - - - - - - Enable bold - - - true - - - - - - - Enable italics - - - true - - - + @@ -225,120 +93,30 @@ - - - - - - - Chat Rooms - - - - - Blink tab icon + + + Qt::Vertical - - - - - - Default identity for chat rooms: + + + 20 + 40 + - - - - - - - - Qt::Horizontal - - - QSizePolicy::Maximum - - - - 40 - 20 - - - - - - - - - - - - - Do not send typing notifications - - + - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Private Chat - - - - - - Open Window for new chat - - - - - - - Grab Focus when chat arrives - - - - - - - Use a single tabbed window - - - - - - - Blink window/tab icon - - - - - - - Chat Font + Fonts @@ -347,9 +125,6 @@ 2 - - 0 - 0 @@ -386,10 +161,87 @@ + + + + Enable custom fonts + + + true + + + + + + + Enable custom font size + + + true + + + + + + + Enable bold + + + true + + + + + + + Enable italics + + + true + + + + + + + 0 + + + + + Minimum displayed font size + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 1 + + + 64 + + + + + - Search by default + Search @@ -398,9 +250,6 @@ 2 - - 0 - 0 @@ -567,11 +416,383 @@ + + + Chat rooms + + + + + + + + Default identity for chat rooms: + + + + + + + + + + + + Do not send typing notifications + + + + + + + Blink tab icon + + + + + + + Qt::Horizontal + + + + + + + + + + + + 0 + 0 + + + + Style: + + + + + + + + + + + 0 + 0 + + + + Variant: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + Author: + + + + + + + + 0 + 0 + + + + AuthorText + + + + + + + + + + + Description: + + + + + + + + 0 + 0 + + + + DescriptionText + + + + + + + + + + 0 + 0 + + + + + + + + + Private chat + + + + + + + + Accept chat from: + + + + + + + + Everyone + + + + + Contacts only + + + + + Nobody + + + + + + + + + + Open Window for new chat + + + + + + + Grab Focus when chat arrives + + + + + + + Use a single tabbed window + + + + + + + Blink window/tab icon + + + + + + + Enable Emoticons + + + true + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + + + + Style: + + + + + + + + + + + 0 + 0 + + + + Variant: + + + + + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + Author: + + + + + + + + 0 + 0 + + + + Author Text + + + + + + + + + + + + 0 + 0 + + + + Description: + + + + + + + + 0 + 0 + + + + Description Text + + + + + + + + + + 0 + 0 + + + + + + + + + Broadcast + + + + + + Enable Emoticons + + + true + + + + + + + Qt::Vertical + + + + 20 + 549 + + + + + + History - + @@ -867,375 +1088,123 @@ - + - Qt::Vertical + Qt::Horizontal - - - 20 - 40 - - - + - - - - - Style - - - - - QTabWidget::North + + + + + + 0 + 0 + + + + Style: + + + + + + + + + + + 0 + 0 + + + + Variant: + + + + + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + Author: + + + + + + + + 0 + 0 + + + + Author Text + + + + + + + + + + + + 0 + 0 + + + + Description: + + + + + + + + 0 + 0 + + + + Description Text + + + + + + + + + + 0 + 0 + - - 0 - - - - Chat rooms - - - - - - - 0 - 0 - - - - - - - - - - Style: - - - - - - - - - - - 0 - 0 - - - - Variant: - - - - - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - 0 - 0 - - - - Author - - - - - - - - 0 - 0 - - - - Description - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Private chat - - - - - - - 0 - 0 - - - - - - - - - - Style: - - - - - - - - - - - 0 - 0 - - - - Variant: - - - - - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - 0 - 0 - - - - Author - - - - - - - - 0 - 0 - - - - Description - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - History - - - - - - - 0 - 0 - - - - - - - - - - Style: - - - - - - - - - - - 0 - 0 - - - - Variant: - - - - - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - 0 - 0 - - - - Author - - - - - - - - 0 - 0 - - - - Description - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - From 8b7341185d43c3e6227385a02ad262330c488639 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Oct 2020 21:54:26 +0200 Subject: [PATCH 02/31] moved chat room part from notify page into preferences->chat --- retroshare-gui/src/gui/settings/ChatPage.cpp | 49 ++++++++++- retroshare-gui/src/gui/settings/ChatPage.h | 4 + retroshare-gui/src/gui/settings/ChatPage.ui | 73 ++++++++++++++--- .../src/gui/settings/NotifyPage.cpp | 81 ++++++------------- retroshare-gui/src/gui/settings/NotifyPage.h | 2 - retroshare-gui/src/gui/settings/NotifyPage.ui | 60 +------------- 6 files changed, 142 insertions(+), 127 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index d28909220..b1d516186 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -27,6 +27,7 @@ #include #include #include "ChatPage.h" +#include "gui/MainWindow.h" #include #include "gui/chat/ChatDialog.h" #include "gui/notifyqt.h" @@ -224,7 +225,14 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags) ui.minimumContrastLabel->hide(); ui.minimumContrast->hide(); #endif - connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int))); + connect(ui.chatLobbies_CountFollowingText, SIGNAL(toggled(bool)),ui.chatLobbies_TextToNotify,SLOT(setEnabled(bool))); + connect(ui.chatLobbies_CountUnRead, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; + connect(ui.chatLobbies_CheckNickName, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; + connect(ui.chatLobbies_CountFollowingText, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; + connect(ui.chatLobbies_TextToNotify, SIGNAL(textChanged(QString)),this, SLOT(updateChatLobbyUserNotify())); + connect(ui.chatLobbies_TextCaseSensitive, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; + + connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int))); connect(ui.checkBox_emoteprivchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); connect(ui.checkBox_emotegroupchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); @@ -286,7 +294,37 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.publicStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_publicList_currentRowChanged(int))); connect(ui.privateStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_privateList_currentRowChanged(int))); connect(ui.historyStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_historyList_currentRowChanged(int))); + + /* Add user notify */ + const QList &userNotifyList = MainWindow::getInstance()->getUserNotifyList() ; + QList::const_iterator it; + + mChatLobbyUserNotify = nullptr; + + for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it) + { + UserNotify *userNotify = *it; + + //To get ChatLobbyUserNotify Settings + + if(!mChatLobbyUserNotify) + mChatLobbyUserNotify = dynamic_cast(*it); + } } + +void ChatPage::updateChatLobbyUserNotify() +{ + if(!mChatLobbyUserNotify) + return ; + + mChatLobbyUserNotify->setCountUnRead(ui.chatLobbies_CountUnRead->isChecked()) ; + mChatLobbyUserNotify->setCheckForNickName(ui.chatLobbies_CheckNickName->isChecked()) ; + mChatLobbyUserNotify->setCountSpecificText(ui.chatLobbies_CountFollowingText->isChecked()) ; + mChatLobbyUserNotify->setTextToNotify(ui.chatLobbies_TextToNotify->document()->toPlainText()); + mChatLobbyUserNotify->setTextCaseSensitive(ui.chatLobbies_TextCaseSensitive->isChecked()); +} + + void ChatPage::updateChatFlags() { uint chatflags = 0; @@ -423,6 +461,15 @@ ChatPage::load() ui._collected_contacts_LW->insertItem(0,item) ; } #endif + + if (mChatLobbyUserNotify){ + whileBlocking(ui.chatLobbies_CountUnRead)->setChecked(mChatLobbyUserNotify->isCountUnRead()); + whileBlocking(ui.chatLobbies_CheckNickName)->setChecked(mChatLobbyUserNotify->isCheckForNickName()); + whileBlocking(ui.chatLobbies_CountFollowingText)->setChecked(mChatLobbyUserNotify->isCountSpecificText()) ; + whileBlocking(ui.chatLobbies_TextToNotify)->setEnabled(mChatLobbyUserNotify->isCountSpecificText()) ; + whileBlocking(ui.chatLobbies_TextToNotify)->setPlainText(mChatLobbyUserNotify->textToNotify()); + whileBlocking(ui.chatLobbies_TextCaseSensitive)->setChecked(mChatLobbyUserNotify->isTextCaseSensitive()); + } } void ChatPage::on_pushButtonChangeChatFont_clicked() diff --git a/retroshare-gui/src/gui/settings/ChatPage.h b/retroshare-gui/src/gui/settings/ChatPage.h index 6c79f7ed7..5559d8adc 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.h +++ b/retroshare-gui/src/gui/settings/ChatPage.h @@ -23,6 +23,7 @@ #include "retroshare-gui/configpage.h" #include "gui/chat/ChatStyle.h" +#include "gui/chat/ChatLobbyUserNotify.h" #include "ui_ChatPage.h" #include "gui/common/FilesDefs.h" @@ -44,6 +45,7 @@ class ChatPage : public ConfigPage virtual QString helpText() const { return ""; } private slots: + void updateChatLobbyUserNotify(); void on_historyComboBoxVariant_currentIndexChanged(int index); void on_privateComboBoxVariant_currentIndexChanged(int index); void on_publicComboBoxVariant_currentIndexChanged(int index); @@ -87,6 +89,8 @@ class ChatPage : public ConfigPage /** Qt Designer generated object */ Ui::ChatPage ui; + + ChatLobbyUserNotify* mChatLobbyUserNotify; }; #endif diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui index 1ca6431b1..2c61252ab 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.ui +++ b/retroshare-gui/src/gui/settings/ChatPage.ui @@ -14,7 +14,7 @@ - 2 + 1 @@ -420,9 +420,19 @@ Chat rooms - + + + + + Checked, if the identity and the text above occurrences must be in the same case to trigger count. + + + Case sensitive search + + + @@ -436,18 +446,50 @@ - + + + + + Do not send typing notifications + + + + + + + Blink tab icon + + + + + + + + + + + Count all unread messages + + + + + + + Count occurrences of my current identity + + + + + + + - Do not send typing notifications + Count occurrences of any of the following texts (separate by newlines): - - - Blink tab icon - - + @@ -561,6 +603,19 @@ + + + + Qt::Vertical + + + + 20 + 8 + + + + diff --git a/retroshare-gui/src/gui/settings/NotifyPage.cpp b/retroshare-gui/src/gui/settings/NotifyPage.cpp index 6035e25a0..dae48bad9 100755 --- a/retroshare-gui/src/gui/settings/NotifyPage.cpp +++ b/retroshare-gui/src/gui/settings/NotifyPage.cpp @@ -44,7 +44,6 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.testToasterButton, SIGNAL(clicked()), this, SLOT(testToaster())); connect(ui.pushButtonDisableAll,SIGNAL(toggled(bool)), NotifyQt::getInstance(), SLOT(SetDisableAll(bool))); connect(NotifyQt::getInstance(),SIGNAL(disableAllChanged(bool)), ui.pushButtonDisableAll, SLOT(setChecked(bool))); - connect(ui.chatLobbies_CountFollowingText,SIGNAL(toggled(bool)),ui.chatLobbies_TextToNotify,SLOT(setEnabled(bool))); ui.notify_Blogs->hide(); @@ -114,41 +113,37 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags) } - /* Add user notify */ - const QList &userNotifyList = MainWindow::getInstance()->getUserNotifyList() ; - QList::const_iterator it; - rowFeed = 0; - mChatLobbyUserNotify = 0; - for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it) { - UserNotify *userNotify = *it; + /* Add user notify */ + const QList &userNotifyList = MainWindow::getInstance()->getUserNotifyList() ; + QList::const_iterator it; + rowFeed = 0; + for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it) { + UserNotify *userNotify = *it; - QString name; - if (!userNotify->hasSetting(&name, NULL)) { - continue; - } + QString name; + if (!userNotify->hasSetting(&name, NULL)) { + continue; + } - QCheckBox *enabledCheckBox = new QCheckBox(name, this); - enabledCheckBox->setFont(font); - ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0); - connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled())); + QCheckBox *enabledCheckBox = new QCheckBox(name, this); + enabledCheckBox->setFont(font); + ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0); + connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled())); - QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this); - combinedCheckBox->setFont(font); - ui.notifyLayout->addWidget(combinedCheckBox, rowFeed, 1); + QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this); + combinedCheckBox->setFont(font); + ui.notifyLayout->addWidget(combinedCheckBox, rowFeed, 1); - QCheckBox *blinkCheckBox = new QCheckBox(tr("Blink"), this); - blinkCheckBox->setFont(font); - ui.notifyLayout->addWidget(blinkCheckBox, rowFeed++, 2); + QCheckBox *blinkCheckBox = new QCheckBox(tr("Blink"), this); + blinkCheckBox->setFont(font); + ui.notifyLayout->addWidget(blinkCheckBox, rowFeed++, 2); - mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox, blinkCheckBox)); + mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox, blinkCheckBox)); - connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ; - connect(blinkCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ; - connect(combinedCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ; - - //To get ChatLobbyUserNotify Settings - if (!mChatLobbyUserNotify) mChatLobbyUserNotify = dynamic_cast(*it); - } + connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ; + connect(blinkCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ; + connect(combinedCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ; + } connect(ui.popup_Connect, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ; connect(ui.popup_NewMsg, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ; @@ -177,12 +172,6 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.spinBoxToasterYMargin, SIGNAL(valueChanged(int)), this, SLOT(updateToasterMargin())); connect(ui.comboBoxToasterPosition, SIGNAL(currentIndexChanged(int)),this, SLOT(updateToasterPosition())) ; - - connect(ui.chatLobbies_CountUnRead, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; - connect(ui.chatLobbies_CheckNickName, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; - connect(ui.chatLobbies_CountFollowingText, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; - connect(ui.chatLobbies_TextToNotify, SIGNAL(textChanged(QString)),this, SLOT(updateChatLobbyUserNotify())); - connect(ui.chatLobbies_TextCaseSensitive, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ; } NotifyPage::~NotifyPage() @@ -297,18 +286,6 @@ void NotifyPage::updateToasterPosition() Settings->setToasterPosition((RshareSettings::enumToasterPosition) ui.comboBoxToasterPosition->itemData(index).toInt()); } -void NotifyPage::updateChatLobbyUserNotify() -{ - if(!mChatLobbyUserNotify) - return ; - - mChatLobbyUserNotify->setCountUnRead(ui.chatLobbies_CountUnRead->isChecked()) ; - mChatLobbyUserNotify->setCheckForNickName(ui.chatLobbies_CheckNickName->isChecked()) ; - mChatLobbyUserNotify->setCountSpecificText(ui.chatLobbies_CountFollowingText->isChecked()) ; - mChatLobbyUserNotify->setTextToNotify(ui.chatLobbies_TextToNotify->document()->toPlainText()); - mChatLobbyUserNotify->setTextCaseSensitive(ui.chatLobbies_TextCaseSensitive->isChecked()); -} - /** Loads the settings for this page */ void NotifyPage::load() { @@ -397,14 +374,6 @@ void NotifyPage::load() notifyToggled() ; - if (mChatLobbyUserNotify){ - whileBlocking(ui.chatLobbies_CountUnRead)->setChecked(mChatLobbyUserNotify->isCountUnRead()); - whileBlocking(ui.chatLobbies_CheckNickName)->setChecked(mChatLobbyUserNotify->isCheckForNickName()); - whileBlocking(ui.chatLobbies_CountFollowingText)->setChecked(mChatLobbyUserNotify->isCountSpecificText()) ; - whileBlocking(ui.chatLobbies_TextToNotify)->setEnabled(mChatLobbyUserNotify->isCountSpecificText()) ; - whileBlocking(ui.chatLobbies_TextToNotify)->setPlainText(mChatLobbyUserNotify->textToNotify()); - whileBlocking(ui.chatLobbies_TextCaseSensitive)->setChecked(mChatLobbyUserNotify->isTextCaseSensitive()); - } } void NotifyPage::notifyToggled() diff --git a/retroshare-gui/src/gui/settings/NotifyPage.h b/retroshare-gui/src/gui/settings/NotifyPage.h index f78c188a0..66bf99e1d 100755 --- a/retroshare-gui/src/gui/settings/NotifyPage.h +++ b/retroshare-gui/src/gui/settings/NotifyPage.h @@ -100,12 +100,10 @@ private slots: void updateToasterMargin(); void updateToasterPosition(); - void updateChatLobbyUserNotify(); private: uint getNewsFlags(); uint getNotifyFlags(); - ChatLobbyUserNotify* mChatLobbyUserNotify; QList mFeedNotifySettingList; QList mToasterNotifySettingList; diff --git a/retroshare-gui/src/gui/settings/NotifyPage.ui b/retroshare-gui/src/gui/settings/NotifyPage.ui index f468a62ec..93883ab2f 100755 --- a/retroshare-gui/src/gui/settings/NotifyPage.ui +++ b/retroshare-gui/src/gui/settings/NotifyPage.ui @@ -14,7 +14,7 @@ - 0 + 2 @@ -443,60 +443,6 @@ - - - Chat Rooms - - - - - - Count all unread messages - - - - - - - Count occurrences of my current identity - - - - - - - Count occurrences of any of the following texts (separate by newlines): - - - - - - - - - - Checked, if the identity and the text above occurrences must be in the same case to trigger count. - - - Case sensitive - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - @@ -527,10 +473,6 @@ spinBoxToasterYMargin systray_GroupChat systray_ChatLobby - chatLobbies_CountUnRead - chatLobbies_CheckNickName - chatLobbies_CountFollowingText - chatLobbies_TextToNotify pushButtonDisableAll From 8efd529af05b83051af84eb28e158171bd4eb086 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 1 Nov 2020 23:17:56 +0100 Subject: [PATCH 03/31] improved layout of chat prefs and hide broadcast tab that wasnt showing any useful option --- retroshare-gui/src/gui/settings/ChatPage.cpp | 3 + retroshare-gui/src/gui/settings/ChatPage.ui | 695 ++++++++++--------- 2 files changed, 356 insertions(+), 342 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index b1d516186..88711a113 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -310,6 +310,9 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags) if(!mChatLobbyUserNotify) mChatLobbyUserNotify = dynamic_cast(*it); } + + // hide the broadcast page: it only shows "show/hide emoticons, which is really not much for an entire page + ui.tabWidget->removeTab(3); } void ChatPage::updateChatLobbyUserNotify() diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui index 2c61252ab..2cbce96df 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.ui +++ b/retroshare-gui/src/gui/settings/ChatPage.ui @@ -7,413 +7,424 @@ 0 0 800 - 649 + 592 - 1 + 0 General - - - + + + - - - - 0 - 0 - - - - General settings - - - - + + + + + + 0 + 0 + + + + General settings + + - + + + + + Minimum text contrast + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 1.000000000000000 + + + 21.000000000000000 + + + 0.500000000000000 + + + + + + + - Minimum text contrast + Send message with Ctrl+Return - - - Qt::Horizontal + + + Send as plain text by default - - - 40 - 20 - - - + - - - 1.000000000000000 - - - 21.000000000000000 - - - 0.500000000000000 + + + Load embedded images - - - - - Send message with Ctrl+Return - - - - - - - Send as plain text by default - - - - - - - Load embedded images - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - Fonts - - - - 2 - - - 2 - - - 0 - - - 0 - - - - - Change Chat Font - - - - - - - - 0 - 0 - - - - Chat Font: - - - - - - - Font Preview - - - - - - - - - - Enable custom fonts - - - true - - - - - - - Enable custom font size - - - true - - - - - - - Enable bold - - - true - - - - - - - Enable italics - - - true - - - - - - - 0 - - - - - Minimum displayed font size - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 1 - - - 64 + + + Search + + + 2 + + + 2 + + + 0 + + + 0 + + + + + Show Bar by default + + + + + + + + + Threshold for automatic search + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 100 + + + + + + + + + Case sensitive + + + + + + + Whole Words + + + + + + + Move to cursor + + + + + + + Color All Text Found + + + + + + + + + Maximum count for coloring matching text + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 1000 + + + + + + + + + + + Color of found text + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + Choose color of found text + + + + + + - - - Search - - - - 2 - - - 2 - - - 0 - - - 0 - - - - - Show Bar by default + + + + + Fonts + + + + 2 + + + 2 + + + 0 + + + 0 - - - - - + - Threshold for automatic search + Change Chat Font - + + + + 0 + 0 + + + + Chat Font: + + + + + + + Font Preview + + + + + Qt::Horizontal - - - 40 - 20 - - - - - - - - 100 - - - - - - - Case sensitive - - - - - - - Whole Words - - - - - - - Move to cursor - - - - - - - Color All Text Found - - - - - - + - Maximum count for coloring matching text + Enable italics + + + true - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 1000 - - - - - - - - - + - Color of found text + Enable custom fonts + + + true - - - Qt::Horizontal + + + Enable bold - - - 40 - 20 - - - - - - - - - 24 - 24 - - - - - 24 - 24 - - - - Choose color of found text + + true + + + + Enable custom font size + + + true + + + + + + + 0 + + + + + Minimum displayed font size + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 1 + + + 64 + + + + + - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Qt::Vertical + + + + 20 + 120 + + + + From 80135eda56dbbe15acbec8293af3e81eba61f843 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 13 Nov 2020 22:04:09 +0100 Subject: [PATCH 04/31] Use the new mail icon on the Shared Files context menu for recommended action. --- retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index 3fdb6239d..d33010bc3 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -60,7 +60,7 @@ #define IMAGE_PLAY ":/images/start.png" #define IMAGE_HASH_BUSY ":/images/settings.png" #define IMAGE_HASH_DONE ":/images/accepted16.png" -#define IMAGE_MSG ":/images/message-mail.png" +#define IMAGE_MSG ":/icons/png/message.png" #define IMAGE_ATTACHMENT ":/icons/png/attachements.png" #define IMAGE_FRIEND ":/images/peers_16x16.png" #define IMAGE_COPYLINK ":/images/copyrslink.png" From 9ce886cfb676a9c6ec2e558001a7b369c4c6a00d Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 15 Nov 2020 18:30:52 +0100 Subject: [PATCH 05/31] Added back to display comments counts on the comments button --- .../src/gui/Posted/BoardPostDisplayWidget.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp index 5594d47a0..d454d8dd3 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp @@ -60,29 +60,25 @@ BoardPostDisplayWidgetBase::BoardPostDisplayWidgetBase(const RsPostedPost& post, void BoardPostDisplayWidgetBase::setCommentsSize(int comNb) { - QString sComButText ; + QString sComButText = tr("Comment"); + QString sComButTooltip ; if (comNb == 1) sComButText = tr("1 comment"); else if(comNb > 1) sComButText = tr("%1 comments").arg(comNb); - else - sComButText = tr("No comments yet. Click to add one."); - commentButton()->setToolTip(sComButText); + if (comNb == 0) + sComButTooltip = tr("No comments yet. Click to add one."); + + commentButton()->setToolTip(sComButTooltip); + commentButton()->setText(sComButText); if(comNb > 0) commentButton()->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/comments_blue.png")); else commentButton()->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/comments.png")); -// QString sComButText = tr("Comment"); -// if (comNb == 1) -// sComButText = sComButText.append("(1)"); -// else if(comNb > 1) -// sComButText = tr("Comments ").append("(%1)").arg(comNb); -// - commentButton()->setText(tr("Comments")); } void BoardPostDisplayWidgetBase::makeDownVote() From d473f1be3fdb14ce91c29b5f9d7bda398a61723c Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 16 Nov 2020 12:44:10 +0100 Subject: [PATCH 06/31] Fix JSON API compilation --- libretroshare/src/retroshare/rspeers.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index c7c9ffe9b..19127d2ca 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -797,13 +797,13 @@ public: * @jsonapi{development} * @param[in] sslId Id of the peer of which we want to generate an invite, * a null id (all 0) is passed, an invite for own node is returned. - * @param[in] includeSignatures true to add key signatures to the invite - * @param[in] includeExtraLocators false to avoid to add extra locators + * @param[in] inviteFlags specify extra data to include in the invite * @return invite string */ virtual std::string GetRetroshareInvite( - const RsPeerId& sslId = RsPeerId(), - RetroshareInviteFlags = RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP ) = 0; + const RsPeerId& sslId = RsPeerId(), + RetroshareInviteFlags inviteFlags = + RetroshareInviteFlags::DNS | RetroshareInviteFlags::CURRENT_IP ) = 0; /** * @brief Get RetroShare short invite of the given peer @@ -811,19 +811,19 @@ public: * @param[out] invite storage for the generated invite * @param[in] sslId Id of the peer of which we want to generate an invite, * a null id (all 0) is passed, an invite for own node is returned. - * @param[in] formatRadix true to get in base64 format false to get URL. - * @param[in] bareBones true to get smallest invite, which miss also - * the information necessary to attempt an outgoing connection, but still - * enough to accept an incoming one. + * @param[in] inviteFlags specify extra data to include in the invite and + * format. * @param[in] baseUrl URL into which to sneak in the RetroShare invite * radix, this is primarly useful to trick other applications into making * the invite clickable, or to disguise the RetroShare invite into a * "normal" looking web link. Used only if formatRadix is false. * @return false if error occurred, true otherwise */ - virtual bool getShortInvite(std::string& invite, const RsPeerId& sslId = RsPeerId(), - RetroshareInviteFlags locator_flags = RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::DNS, - const std::string& baseUrl = "https://retroshare.me/" ) = 0; + virtual bool getShortInvite( + std::string& invite, const RsPeerId& sslId = RsPeerId(), + RetroshareInviteFlags inviteFlags = + RetroshareInviteFlags::CURRENT_IP | RetroshareInviteFlags::DNS, + const std::string& baseUrl = "https://retroshare.me/" ) = 0; /** * @brief Parse the give short invite to extract contained information From c50826e32fc724a20c7bb52706f1d42f5dd92f38 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 16 Nov 2020 21:55:00 +0100 Subject: [PATCH 07/31] Improved the Channel Composer & small fixes * Fixed the issue with stretching of the RichTextEdit * Improved the Layout * Moved the Channel Name to the Top Right to be visible always * Added option to hide the Thumbnail frame when needs more space for Post Edit/Blog Posting --- .../gui/gxschannels/CreateGxsChannelMsg.cpp | 21 + .../src/gui/gxschannels/CreateGxsChannelMsg.h | 1 + .../gui/gxschannels/CreateGxsChannelMsg.ui | 464 ++++++++++-------- 3 files changed, 270 insertions(+), 216 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp index a66aac6e0..ed21fd86d 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp @@ -75,6 +75,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId connect(removeAllFilesButton, SIGNAL(clicked() ), this , SLOT(clearAllAttachments())); //connect(addfilepushButton, SIGNAL(clicked() ), this , SLOT(addExtraFile())); connect(subjectEdit,SIGNAL(textChanged(const QString&)),this,SLOT(updatePreviewText(const QString&))); + connect(expandButton, SIGNAL(clicked()), this, SLOT( toggle())); connect(addThumbnailButton, SIGNAL(clicked() ), this , SLOT(addThumbnail())); connect(thumbNailCb, SIGNAL(toggled(bool)), this, SLOT(allowAutoMediaThumbNail(bool))); @@ -86,6 +87,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId channelpostButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/comment.png")); attachmentsButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/attachements.png")); addThumbnailButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/add-image.png")); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); aspectRatio_CB->setItemIcon(0,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-auto.svg")); aspectRatio_CB->setItemIcon(1,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-1-1.svg")); @@ -926,3 +928,22 @@ void CreateGxsChannelMsg::on_attachmentsButton_clicked() { stackedWidget->setCurrentIndex(1); } + +void CreateGxsChannelMsg::toggle() +{ + if (expandButton->isChecked()) + { + thumbnailFrame->hide(); + gridLayoutTextEdit->setContentsMargins(0,9,0,0); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); + expandButton->setToolTip(tr("Show")); + } + else + { + thumbnailFrame->show(); + gridLayoutTextEdit->setContentsMargins(0,0,0,0); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); + expandButton->setToolTip(tr("Hide")); + } +} + diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h index 882137b67..c527f35ae 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h @@ -57,6 +57,7 @@ protected: virtual void dropEvent(QDropEvent *event); private slots: + void toggle() ; void addExtraFile(); void checkAttachmentReady(); void deleteAttachment(); diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui index bc8574587..8e5a6d1c6 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui @@ -57,10 +57,10 @@ 0 - - + + - Attachments + Channel Post @@ -70,7 +70,58 @@ - + + + + 9 + + + + + Generate mass data + + + + + + + 1 + + + 999 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Post + + + + + + + Cancel + + + + + + true @@ -85,192 +136,192 @@ 0 - + 0 + + 0 + 0 - - - - - - - 0 - 0 - - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - - - 6 + + 0 + + + + + QFrame::NoFrame - - - - - 0 - 0 - - - - - 75 - true - - - - Channel Post to: - - - - - - - true - - - true - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + QFrame::Plain + + + + 6 + + + 9 + + + 6 + + + 0 + + + + + 6 + + + + + + 0 + 0 + + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + + + <!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;"> <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:10pt; font-weight:600;">Attachments:</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Use Drag and Drop / Add Files button, to Hash new files.</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/images/feedback_arrow.png" /><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> Copy/Paste RetroShare links from your shares</span></p></body></html> - + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + Add Channel Thumbnail + + + + 24 + 24 + + + + + + + + <html><head/><body><p>Choose aspect ratio policy. In 'Auto' mode, the most suitable aspect ratio is chosen for you.</p></body></html> + + + + 24 + 24 + + + + + Auto + + + + + 1:1 + + + + + 3:4 + + + + + 16:9 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + - - - - - - Add Channel Thumbnail - - - - 24 - 24 - - - - - - - - <html><head/><body><p>Choose aspect ratio policy. In 'Auto' mode, the most suitable aspect ratio is chosen for you.</p></body></html> - - - - 24 - 24 - - - - - Auto - - - - - 1:1 - - - - - 3:4 - - - - - 16:9 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - + + - 9 + 6 - + Title - - - - Qt::Vertical + + + + <html><head/><body><p>Hide</p></body></html> - - - 20 - 40 - + + - + + true + + + + + + + + 0 + 0 + + + - - - - - 0 - 0 - - - - @@ -344,7 +395,7 @@ p, li { white-space: pre-wrap; } - <html><head/><body><p>Add File</p></body></html> + <html><head/><body><p>Remove File</p></body></html> @@ -393,7 +444,7 @@ p, li { white-space: pre-wrap; } 0 0 - 827 + 824 24 @@ -444,23 +495,10 @@ p, li { white-space: pre-wrap; } - - - - Qt::Horizontal - - - - 486 - 20 - - - - - - + + - Channel Post + Attachments @@ -470,52 +508,46 @@ p, li { white-space: pre-wrap; } - - + + 9 + + 6 + + + 6 + + + 6 + - + + + + 0 + 0 + + + + + 75 + true + + - Generate mass data + Channel Post to: - - - 1 + + + true - - 999 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Post - - - - - - - Cancel + + true From 203570690bc800b022b8a443cc58ee4ead7f3ee0 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 17 Nov 2020 22:21:51 +0100 Subject: [PATCH 08/31] Fixing issue with Search field on boards to get visible the ID --- .../src/gui/Posted/PostedListWidgetWithModel.ui | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui index fac82f929..4e17f5d0a 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui @@ -460,18 +460,14 @@ p, li { white-space: pre-wrap; } - - - - Search - - - Qt::Horizontal + + QSizePolicy::Minimum + 40 @@ -480,6 +476,13 @@ p, li { white-space: pre-wrap; } + + + + Search + + + From 26c5ce4ed2bbd369cd8b046ad920a98962a2f591 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 19 Nov 2020 12:42:44 +0100 Subject: [PATCH 09/31] Fixed crash when adding a new comment to a post without active item in tree --- .../src/gui/gxs/GxsCommentTreeWidget.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index 6ee0cebad..56a2cf1b6 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -313,7 +313,11 @@ void GxsCommentTreeWidget::setCurrentCommentMsgId(QTreeWidgetItem *current, QTre mCurrentCommentText = current->text(PCITEM_COLUMN_COMMENT); mCurrentCommentAuthor = current->text(PCITEM_COLUMN_AUTHOR); mCurrentCommentAuthorId = RsGxsId(current->text(PCITEM_COLUMN_AUTHORID).toStdString()); - + } else { + mCurrentCommentMsgId.clear(); + mCurrentCommentText.clear(); + mCurrentCommentAuthor.clear(); + mCurrentCommentAuthorId.clear(); } } @@ -323,19 +327,22 @@ void GxsCommentTreeWidget::customPopUpMenu(const QPoint& point) QMenu contextMnu( this ); QAction* action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_REPLY), tr("Reply to Comment"), this, SLOT(replyToComment())); - action->setDisabled(mCurrentCommentMsgId.isNull()); + action->setDisabled(!item || mCurrentCommentMsgId.isNull()); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Submit Comment"), this, SLOT(makeComment())); action->setDisabled(mMsgVersions.empty()); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPY), tr("Copy Comment"), this, SLOT(copyComment())); - action->setData( item->data(PCITEM_COLUMN_COMMENT,Qt::DisplayRole) ); - action->setDisabled(mCurrentCommentMsgId.isNull()); + action->setData( item ? item->data(PCITEM_COLUMN_COMMENT,Qt::DisplayRole) : "" ); + action->setDisabled(!item || mCurrentCommentMsgId.isNull()); contextMnu.addSeparator(); action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEUP), tr("Vote Up"), this, SLOT(voteUp())); - action->setDisabled(mVoterId.isNull()); + action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull()); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEDOWN), tr("Vote Down"), this, SLOT(voteDown())); - action->setDisabled(mVoterId.isNull()); + action->setDisabled(!item || mCurrentCommentMsgId.isNull() || mVoterId.isNull()); if (!mCurrentCommentMsgId.isNull()) From efe454c937b7f77c5dd290ceb4f32215c8005fd6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 19 Nov 2020 15:17:25 +0100 Subject: [PATCH 10/31] Fixed save of settings in plugin FeedReader --- plugins/FeedReader/gui/FeedReaderConfig.cpp | 58 +++++++++++++-------- plugins/FeedReader/gui/FeedReaderConfig.h | 4 +- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/plugins/FeedReader/gui/FeedReaderConfig.cpp b/plugins/FeedReader/gui/FeedReaderConfig.cpp index 99d3dde6a..b55207e88 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.cpp +++ b/plugins/FeedReader/gui/FeedReaderConfig.cpp @@ -22,6 +22,7 @@ #include "ui_FeedReaderConfig.h" #include "gui/settings/rsharesettings.h" #include "interface/rsFeedReader.h" +#include /** Constructor */ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags) @@ -30,12 +31,30 @@ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags) /* Invoke the Qt Designer generated object setup routine */ ui->setupUi(this); - connect(ui->useProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useProxyToggled())); - ui->proxyAddressLineEdit->setEnabled(false); ui->proxyPortSpinBox->setEnabled(false); - loaded = false; + /* Connect signals */ + connect(ui->updateIntervalSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this]() { + rsFeedReader->setStandardUpdateInterval(ui->updateIntervalSpinBox->value() * 60); + }); + connect(ui->storageTimeSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this]() { + rsFeedReader->setStandardStorageTime(ui->storageTimeSpinBox->value() * 60 *60 * 24); + }); + connect(ui->saveInBackgroundCheckBox, QCheckBox::toggled, this, [this]() { + rsFeedReader->setSaveInBackground(ui->saveInBackgroundCheckBox->isChecked()); + }); + connect(ui->setMsgToReadOnActivate, QCheckBox::toggled, this, [this]() { + Settings->setValueToGroup("FeedReaderDialog", "SetMsgToReadOnActivate", ui->setMsgToReadOnActivate->isChecked()); + }); + connect(ui->openAllInNewTabCheckBox, QCheckBox::toggled, this, [this]() { + Settings->setValueToGroup("FeedReaderDialog", "OpenAllInNewTab", ui->openAllInNewTabCheckBox->isChecked()); + }); + connect(ui->useProxyCheckBox, QCheckBox::toggled, this, &FeedReaderConfig::updateProxy); + connect(ui->proxyAddressLineEdit, QLineEdit::textChanged, this, &FeedReaderConfig::updateProxy); + connect(ui->proxyPortSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, &FeedReaderConfig::updateProxy); + + connect(ui->useProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useProxyToggled())); } /** Destructor */ @@ -47,31 +66,21 @@ FeedReaderConfig::~FeedReaderConfig() /** Loads the settings for this page */ void FeedReaderConfig::load() { - ui->updateIntervalSpinBox->setValue(rsFeedReader->getStandardUpdateInterval() / 60); - ui->storageTimeSpinBox->setValue(rsFeedReader->getStandardStorageTime() / (60 * 60 *24)); - ui->saveInBackgroundCheckBox->setChecked(rsFeedReader->getSaveInBackground()); - ui->setMsgToReadOnActivate->setChecked(FeedReaderSetting_SetMsgToReadOnActivate()); - ui->openAllInNewTabCheckBox->setChecked(FeedReaderSetting_OpenAllInNewTab()); + whileBlocking(ui->updateIntervalSpinBox)->setValue(rsFeedReader->getStandardUpdateInterval() / 60); + whileBlocking(ui->storageTimeSpinBox)->setValue(rsFeedReader->getStandardStorageTime() / (60 * 60 *24)); + whileBlocking(ui->saveInBackgroundCheckBox)->setChecked(rsFeedReader->getSaveInBackground()); + whileBlocking(ui->setMsgToReadOnActivate)->setChecked(FeedReaderSetting_SetMsgToReadOnActivate()); + whileBlocking(ui->openAllInNewTabCheckBox)->setChecked(FeedReaderSetting_OpenAllInNewTab()); std::string proxyAddress; uint16_t proxyPort; - ui->useProxyCheckBox->setChecked(rsFeedReader->getStandardProxy(proxyAddress, proxyPort)); - ui->proxyAddressLineEdit->setText(QString::fromUtf8(proxyAddress.c_str())); - ui->proxyPortSpinBox->setValue(proxyPort); + whileBlocking(ui->useProxyCheckBox)->setChecked(rsFeedReader->getStandardProxy(proxyAddress, proxyPort)); + whileBlocking(ui->proxyAddressLineEdit)->setText(QString::fromUtf8(proxyAddress.c_str())); + whileBlocking(ui->proxyPortSpinBox)->setValue(proxyPort); loaded = true; -} -bool FeedReaderConfig::save(QString &/*errmsg*/) -{ - rsFeedReader->setStandardUpdateInterval(ui->updateIntervalSpinBox->value() * 60); - rsFeedReader->setStandardStorageTime(ui->storageTimeSpinBox->value() * 60 *60 * 24); - rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyAddressLineEdit->text().toUtf8().constData(), ui->proxyPortSpinBox->value()); - rsFeedReader->setSaveInBackground(ui->saveInBackgroundCheckBox->isChecked()); - Settings->setValueToGroup("FeedReaderDialog", "SetMsgToReadOnActivate", ui->setMsgToReadOnActivate->isChecked()); - Settings->setValueToGroup("FeedReaderDialog", "OpenAllInNewTab", ui->openAllInNewTabCheckBox->isChecked()); - - return true; + useProxyToggled(); } void FeedReaderConfig::useProxyToggled() @@ -81,3 +90,8 @@ void FeedReaderConfig::useProxyToggled() ui->proxyAddressLineEdit->setEnabled(enabled); ui->proxyPortSpinBox->setEnabled(enabled); } + +void FeedReaderConfig::updateProxy() +{ + rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyAddressLineEdit->text().toUtf8().constData(), ui->proxyPortSpinBox->value()); +} diff --git a/plugins/FeedReader/gui/FeedReaderConfig.h b/plugins/FeedReader/gui/FeedReaderConfig.h index ed01f5107..af31fe33f 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.h +++ b/plugins/FeedReader/gui/FeedReaderConfig.h @@ -40,8 +40,6 @@ public: /** Default Destructor */ virtual ~FeedReaderConfig(); - /** Saves the changes on this page */ - virtual bool save(QString &errmsg); /** Loads the settings for this page */ virtual void load(); @@ -51,10 +49,10 @@ public: private slots: void useProxyToggled(); + void updateProxy(); private: Ui::FeedReaderConfig *ui; - bool loaded; }; #endif From b900a794487ef05d27076bdb4773b095b52e2492 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 19 Nov 2020 20:38:51 +0100 Subject: [PATCH 11/31] * moved the Title back to the old place --- .../gui/gxschannels/CreateGxsChannelMsg.ui | 173 ++++++++++-------- 1 file changed, 99 insertions(+), 74 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui index 8e5a6d1c6..30b07a2e3 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui @@ -59,6 +59,12 @@ + + + 0 + 0 + + Channel Post @@ -170,37 +176,7 @@ 0 - - - - 6 - - - - - - 0 - 0 - - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -216,7 +192,7 @@ p, li { white-space: pre-wrap; } - + @@ -282,6 +258,81 @@ p, li { white-space: pre-wrap; } + + + + 9 + + + 0 + + + 6 + + + 6 + + + + + + 0 + 0 + + + + + 75 + true + + + + Channel Post to: + + + + + + + true + + + true + + + + + + + + + 6 + + + + + + 0 + 0 + + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + @@ -444,7 +495,7 @@ p, li { white-space: pre-wrap; } 0 0 - 824 + 63 24 @@ -497,6 +548,12 @@ p, li { white-space: pre-wrap; } + + + 0 + 0 + + Attachments @@ -509,49 +566,17 @@ p, li { white-space: pre-wrap; } - - - 9 + + + Qt::Horizontal - - 6 + + + 40 + 20 + - - 6 - - - 6 - - - - - - 0 - 0 - - - - - 75 - true - - - - Channel Post to: - - - - - - - true - - - true - - - - + From edf83f0eb3c158bedc269e5eca0a218506d93ff3 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 19 Nov 2020 22:24:03 +0100 Subject: [PATCH 12/31] Hide the Subscribe Button on the Channel Post & Forum MSG Feeds * Hide the Subscribe Button on the Channel Post & Forum MSG Feeds * Fixed to enabled the RS Links for Channel Names back. --- .../src/gui/feeds/GxsChannelPostItem.cpp | 9 ++++-- .../src/gui/feeds/GxsChannelPostItem.ui | 27 +++++++---------- .../src/gui/feeds/GxsForumMsgItem.cpp | 3 ++ .../src/gui/qss/stylesheet/Standard.qss | 30 +++++++++++++++++-- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index f8346183f..fa37f17a1 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -209,6 +209,9 @@ void GxsChannelPostItem::setup() ui->scoreLabel->hide(); + // hide unsubscribe button not necessary + ui->unsubscribeButton->hide(); + ui->downloadButton->hide(); ui->playButton->hide(); //ui->warn_image_label->hide(); @@ -426,7 +429,7 @@ void GxsChannelPostItem::fill() mInFill = true; QString title; - + QString msgText; //float f = QFontMetricsF(font()).height()/14.0 ; if(mPost.mThumbnail.mData != NULL) @@ -465,8 +468,10 @@ void GxsChannelPostItem::fill() title += link.toHtml(); ui->titleLabel->setText(title); + msgText = tr("Post") + ": "; RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, messageName()); - ui->subjectLabel->setText(msgLink.toHtml()); + msgText += msgLink.toHtml(); + ui->subjectLabel->setText(msgText); if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags)) { diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui index 2188df912..e45e9d867 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui @@ -77,7 +77,7 @@ - + 0 @@ -124,16 +124,6 @@ - - - - TextLabel - - - true - - - @@ -147,6 +137,16 @@ + + + + TextLabel + + + true + + + @@ -469,11 +469,6 @@ - - StyledElidedLabel - QLabel -
gui/common/StyledElidedLabel.h
-
ElidedLabel QLabel diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index 45869585d..17437129b 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -118,6 +118,9 @@ void GxsForumMsgItem::setup() ui->subjectLabel->setMinimumWidth(20); + // hide unsubscribe button not necessary + ui->unsubscribeButton->hide(); + ui->expandFrame->hide(); ui->parentFrame->hide(); } diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index d2304a83d..b8dda64e2 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -169,7 +169,7 @@ ShareManager QPushButton#closeButton { padding-right: 6px; } -ShareManager QPushButton#addButton { +ShareManager QPushButton#addButton{ font: bold; font-size: 15px; color: white; @@ -180,7 +180,25 @@ ShareManager QPushButton#addButton { padding: 4px; } -ShareManager QPushButton#addButton:hover { +ShareManager QPushButton#addButton:hover{ + background: #5AD75A; + border-radius: 4px; + min-width: 4em; + padding: 4px; +} + +SearchDialog QPushButton#pushButtonSearch { + font: bold; + font-size: 15px; + color: white; + background: #32CD32; + border-radius: 4px; + max-height: 25px; + min-width: 4em; + padding: 4px; +} + +SearchDialog QPushButton#pushButtonSearch:hover{ background: #5AD75A; border-radius: 4px; min-width: 4em; @@ -444,10 +462,16 @@ GxsChannelPostItem > QFrame#mainFrame[new=true] { border-radius: 10px; } -GxsChannelPostItem QLabel#newLabel { +GxsChannelPostItem QLabel#newLabel{ border: 1px solid #167BE7; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2291E0, stop: 1 #3EB3FF); border-radius: 3px; + color: white; +} + +GxsChannelPostItem QLabel#subjectLabel, GxsChannelPostItem QLabel#titleLabel { + font: 11pt; + font: bold italic; } GxsChannelPostItem QLabel#logoLabel { From d136db2ffb7624c4a0f030f134a2162702845a42 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 20 Nov 2020 20:14:49 +0100 Subject: [PATCH 13/31] Fixing the stylesheets for Channel Post Feeds --- retroshare-gui/src/gui/qss/stylesheet/Standard.qss | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index b8dda64e2..7615dcabb 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -451,15 +451,11 @@ ChanNewItem QLabel#logoLabel { } GxsChannelPostItem > QFrame#mainFrame[new=false] { - border: 3px solid #D3D3D3; - background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFFF, stop:1 #F2F2F2); - border-radius: 10px; + background-color: white; } GxsChannelPostItem > QFrame#mainFrame[new=true] { - border: 3px solid #82B9F4; background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #F0F8FD, stop:0.8 #E6F2FD, stop: 0.81 #E6F2FD, stop: 1 #D2E7FD); - border-radius: 10px; } GxsChannelPostItem QLabel#newLabel{ @@ -474,6 +470,11 @@ GxsChannelPostItem QLabel#subjectLabel, GxsChannelPostItem QLabel#titleLabel { font: bold italic; } +GxsChannelPostItem QFrame#msgFrame { + border: 2px solid #82B9F4; + border-radius: 3px; +} + GxsChannelPostItem QLabel#logoLabel { border: 2px solid #D3D3D3; } From a0a1b43cef622b8625280c19bfc9b23dbdc249a9 Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 21 Nov 2020 12:11:48 +0100 Subject: [PATCH 14/31] Moved the Tunnel status Label to the Top --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 5 + retroshare-gui/src/gui/chat/ChatWidget.h | 1 + retroshare-gui/src/gui/chat/ChatWidget.ui | 605 +++++++++++---------- 3 files changed, 322 insertions(+), 289 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 52fd01ad8..ae135ab00 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -292,6 +292,11 @@ void ChatWidget::addTitleBarWidget(QWidget *w) ui->pluginTitleFrame->layout()->addWidget(w) ; } +void ChatWidget::addTopBarWidget(QWidget *w) +{ + ui->pluginTopFrame->layout()->addWidget(w) ; +} + void ChatWidget::hideChatText(bool hidden) { ui->chatTextFrame->setHidden(hidden); ; diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index 39dc88181..b90cceb28 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -115,6 +115,7 @@ public: // small enough in size. void addChatBarWidget(QWidget *w) ; void addTitleBarWidget(QWidget *w); + void addTopBarWidget(QWidget *w); void hideChatText(bool hidden); RSButtonOnText* getNewButtonOnTextBrowser(); RSButtonOnText* getNewButtonOnTextBrowser(QString text); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index f4d070c11..7ecbcfdc2 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.ui +++ b/retroshare-gui/src/gui/chat/ChatWidget.ui @@ -26,6 +26,322 @@ 2 + + + + QLayout::SetMaximumSize + + + + + + 0 + 0 + + + + + 16777215 + 64 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + 3 + + + 2 + + + 3 + + + 3 + + + 3 + + + + + + + + 75 + true + + + + Title + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + (Status) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + Status message + + + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 3 + + + 2 + + + 0 + + + 2 + + + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 28 + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + Qt::CustomContextMenu + + + + :/icons/png/search.png:/icons/png/search.png + + + + 28 + 28 + + + + true + + + true + + + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + + :/icons/png/highlight.png:/icons/png/highlight.png + + + + 28 + 28 + + + + true + + + true + + + + + + + Qt::NoFocus + + + + :/icons/png/arrow-left.png:/icons/png/arrow-left.png + + + + 28 + 28 + + + + true + + + + + + + Qt::NoFocus + + + + :/icons/png/arrow-right.png:/icons/png/arrow-right.png + + + + 28 + 28 + + + + true + + + + + + + Qt::NoFocus + + + + :/icons/png/chat-bubble-notify.png:/icons/png/chat-bubble-notify.png + + + + 28 + 28 + + + + true + + + + + + + Qt::NoFocus + + + <html><head/><body><p>Chat menu</p></body></html> + + + + :/icons/png/menu.png:/icons/png/menu.png + + + + 28 + 28 + + + + QToolButton::InstantPopup + + + true + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 3 + + + 2 + + + 0 + + + 2 + + + 0 + + + + + + + + + @@ -561,295 +877,6 @@ border-image: url(:/images/closepressed.png)
- - - - QLayout::SetMaximumSize - - - - - - 0 - 0 - - - - - 16777215 - 64 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - 3 - - - 2 - - - 3 - - - 3 - - - 3 - - - - - - - - 75 - true - - - - Title - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - (Status) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - - Status message - - - - - - - - - Qt::Horizontal - - - - 40 - 28 - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Qt::CustomContextMenu - - - - :/icons/png/search.png:/icons/png/search.png - - - - 28 - 28 - - - - true - - - true - - - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - - :/icons/png/highlight.png:/icons/png/highlight.png - - - - 28 - 28 - - - - true - - - true - - - - - - - Qt::NoFocus - - - - :/icons/png/arrow-left.png:/icons/png/arrow-left.png - - - - 28 - 28 - - - - true - - - - - - - Qt::NoFocus - - - - :/icons/png/arrow-right.png:/icons/png/arrow-right.png - - - - 28 - 28 - - - - true - - - - - - - Qt::NoFocus - - - - :/icons/png/chat-bubble-notify.png:/icons/png/chat-bubble-notify.png - - - - 28 - 28 - - - - true - - - - - - - Qt::NoFocus - - - <html><head/><body><p>Chat menu</p></body></html> - - - - :/icons/png/menu.png:/icons/png/menu.png - - - - 28 - 28 - - - - QToolButton::InstantPopup - - - true - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 3 - - - 2 - - - 0 - - - 2 - - - 0 - - - - - - - - - From 18ffc45bd3f02b6056ccb337f8fd909c48bafadd Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 21 Nov 2020 12:34:34 +0100 Subject: [PATCH 15/31] Forget to commit this --- retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp index f78b5cc30..c5ab40cbf 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp @@ -62,7 +62,7 @@ PopupDistantChatDialog::PopupDistantChatDialog(const DistantChatPeerId& tunnel_i _update_timer->start() ; - getChatWidget()->addChatBarWidget(_status_label) ; + getChatWidget()->addTopBarWidget(_status_label) ; updateDisplay() ; } From 1bf251f8f7b24d3721463c51c866c7aede78a474 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 22 Nov 2020 15:41:06 +0100 Subject: [PATCH 16/31] Added a "Remove Thumbnail" button to remove a unwanted Thumbnail from the post easy & fast. --- .../src/gui/gxschannels/CreateGxsChannelMsg.cpp | 16 +++++++++++++--- .../src/gui/gxschannels/CreateGxsChannelMsg.h | 1 + .../src/gui/gxschannels/CreateGxsChannelMsg.ui | 13 +++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp index ed21fd86d..07a1d0ee9 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp @@ -88,6 +88,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId attachmentsButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/attachements.png")); addThumbnailButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/add-image.png")); expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); + removeButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/mail/delete.png"))); aspectRatio_CB->setItemIcon(0,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-auto.svg")); aspectRatio_CB->setItemIcon(1,FilesDefs::getIconFromQtResourcePath(":/icons/svg/ratio-1-1.svg")); @@ -116,6 +117,8 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId generateSpinBox->hide(); #endif + removeButton->hide(); + /* load settings */ processSettings(true); } @@ -826,8 +829,8 @@ void CreateGxsChannelMsg::addThumbnail() picture = img; // to show the selected - preview_W->setPixmap(picture, aspectRatio_CB->currentIndex()==0); - + preview_W->setPixmap(picture, aspectRatio_CB->currentIndex()==0); + removeButton->show(); } void CreateGxsChannelMsg::loadOriginalChannelPostInfo() @@ -871,7 +874,8 @@ void CreateGxsChannelMsg::loadOriginalChannelPostInfo() if(post.mThumbnail.mData != NULL) { GxsIdDetails::loadPixmapFromData(post.mThumbnail.mData,post.mThumbnail.mSize,picture,GxsIdDetails::ORIGINAL); - preview_W->setPixmap(picture,true); + preview_W->setPixmap(picture,true); + removeButton->show(); } @@ -947,3 +951,9 @@ void CreateGxsChannelMsg::toggle() } } +void CreateGxsChannelMsg::on_removeButton_clicked() +{ + preview_W->setPixmap(FilesDefs::getPixmapFromQtResourcePath(ChannelPostThumbnailView::CHAN_DEFAULT_IMAGE),true); + removeButton->hide(); +} + diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h index c527f35ae..116081fee 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h @@ -75,6 +75,7 @@ private slots: void on_channelpostButton_clicked(); void on_attachmentsButton_clicked(); + void on_removeButton_clicked(); private: void processSettings(bool load); void loadChannelInfo(); diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui index 30b07a2e3..b29e9cdd8 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.ui @@ -240,6 +240,19 @@ p, li { white-space: pre-wrap; } + + + + <html><head/><body><p>Remove Thumbnail</p></body></html> + + + + 24 + 24 + + + + From 5fc8689bf231bf0d57353c6659c107f895e66be0 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 23 Nov 2020 17:11:19 +0100 Subject: [PATCH 17/31] Fixed compile of FeedReader plugin with msys2 --- plugins/FeedReader/gui/FeedReaderConfig.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/FeedReader/gui/FeedReaderConfig.cpp b/plugins/FeedReader/gui/FeedReaderConfig.cpp index b55207e88..89456e3da 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.cpp +++ b/plugins/FeedReader/gui/FeedReaderConfig.cpp @@ -41,17 +41,17 @@ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags) connect(ui->storageTimeSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this]() { rsFeedReader->setStandardStorageTime(ui->storageTimeSpinBox->value() * 60 *60 * 24); }); - connect(ui->saveInBackgroundCheckBox, QCheckBox::toggled, this, [this]() { + connect(ui->saveInBackgroundCheckBox, &QCheckBox::toggled, this, [this]() { rsFeedReader->setSaveInBackground(ui->saveInBackgroundCheckBox->isChecked()); }); - connect(ui->setMsgToReadOnActivate, QCheckBox::toggled, this, [this]() { + connect(ui->setMsgToReadOnActivate, &QCheckBox::toggled, this, [this]() { Settings->setValueToGroup("FeedReaderDialog", "SetMsgToReadOnActivate", ui->setMsgToReadOnActivate->isChecked()); }); - connect(ui->openAllInNewTabCheckBox, QCheckBox::toggled, this, [this]() { + connect(ui->openAllInNewTabCheckBox, &QCheckBox::toggled, this, [this]() { Settings->setValueToGroup("FeedReaderDialog", "OpenAllInNewTab", ui->openAllInNewTabCheckBox->isChecked()); }); - connect(ui->useProxyCheckBox, QCheckBox::toggled, this, &FeedReaderConfig::updateProxy); - connect(ui->proxyAddressLineEdit, QLineEdit::textChanged, this, &FeedReaderConfig::updateProxy); + connect(ui->useProxyCheckBox, &QCheckBox::toggled, this, &FeedReaderConfig::updateProxy); + connect(ui->proxyAddressLineEdit, &QLineEdit::textChanged, this, &FeedReaderConfig::updateProxy); connect(ui->proxyPortSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, &FeedReaderConfig::updateProxy); connect(ui->useProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useProxyToggled())); From e9298c16bc68a1d0977186b36e44c14777e9d886 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 23 Nov 2020 18:18:40 +0100 Subject: [PATCH 18/31] Fixed linking with enabled libretroshare_shared with msys2 --- libretroshare/src/use_libretroshare.pri | 8 +++++++- plugins/Common/retroshare_plugin.pri | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index b287a6591..a8f103b77 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -10,7 +10,13 @@ INCLUDEPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src) equals(TARGET, retroshare):equals(TEMPLATE, lib){ } else { LIBS *= -L$$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/) -lretroshare - PRE_TARGETDEPS *= $$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/libretroshare.a) + win32-g++|win32-clang-g++:!isEmpty(QMAKE_SH):libretroshare_shared { + # Windows msys2 + LIBRETROSHARE_TARGET=libretroshare.dll.a + } else { + LIBRETROSHARE_TARGET=libretroshare.a + } + PRE_TARGETDEPS *= $$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/$${LIBRETROSHARE_TARGET}) } !include("../../openpgpsdk/src/use_openpgpsdk.pri"):error("Including") diff --git a/plugins/Common/retroshare_plugin.pri b/plugins/Common/retroshare_plugin.pri index 8ed4553e1..d567538e0 100644 --- a/plugins/Common/retroshare_plugin.pri +++ b/plugins/Common/retroshare_plugin.pri @@ -43,7 +43,13 @@ win32 { } libretroshare_shared { - PRE_TARGETDEPS += $$OUT_PWD/../../libretroshare/src/lib/libretroshare.a + win32-g++|win32-clang-g++:!isEmpty(QMAKE_SH) { + # Windows msys2 + LIBRETROSHARE_TARGET=libretroshare.dll.a + } else { + LIBRETROSHARE_TARGET=libretroshare.a + } + PRE_TARGETDEPS += $$OUT_PWD/../../libretroshare/src/lib/$${LIBRETROSHARE_TARGET} LIBS += -L"$$OUT_PWD/../../libretroshare/src/lib" -lretroshare } From bcafd06748c386d4ceadf2e3e4add21d6575d37b Mon Sep 17 00:00:00 2001 From: hunbernd Date: Sun, 22 Nov 2020 22:14:37 +0100 Subject: [PATCH 19/31] Fixed msys2 pack script: - copy retroshare.dll (added if exist by thunder) - copy plugins from the lib folder --- build_scripts/Windows-msys2/build/pack.bat | 5 +++-- plugins/Common/retroshare_plugin.pri | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat index 4c12ed7c0..20fb72c4d 100644 --- a/build_scripts/Windows-msys2/build/pack.bat +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -104,6 +104,7 @@ copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\RetroShare*.exe" "%RsDepl copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" "%RsDeployPath%" %Quite% copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite% copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite% +if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite% echo copy extensions for /D %%D in ("%RsBuildPath%\plugins\*") do ( @@ -212,8 +213,8 @@ endlocal exit /B 1 :copy_extension -if exist "%~1\%RsBuildConfig%\%~n1.dll" ( - copy "%~1\%RsBuildConfig%\%~n1.dll" %2 %Quite% +if exist "%~1\lib\%~n1.dll" ( + copy "%~1\lib\%~n1.dll" %2 %Quite% ) goto :EOF diff --git a/plugins/Common/retroshare_plugin.pri b/plugins/Common/retroshare_plugin.pri index d567538e0..77812db81 100644 --- a/plugins/Common/retroshare_plugin.pri +++ b/plugins/Common/retroshare_plugin.pri @@ -75,7 +75,7 @@ win32 { DEFINES += WINDOWS_SYS WIN32 STATICLIB MINGW WIN32_LEAN_AND_MEAN #DEFINES += MINIUPNPC_VERSION=13 -# DESTDIR = lib + DESTDIR = lib # Switch off optimization for release version QMAKE_CXXFLAGS_RELEASE -= -O2 From 457206272c987c68dcddb70a78a371f8e14eae0e Mon Sep 17 00:00:00 2001 From: Phenom Date: Tue, 24 Nov 2020 15:48:56 +0100 Subject: [PATCH 20/31] Add Remove Only Selected in Network Keyring. --- retroshare-gui/src/gui/NetworkDialog.cpp | 42 +++++++++++++------ retroshare-gui/src/gui/NetworkDialog.h | 3 ++ .../src/gui/common/FriendSelectionWidget.cpp | 5 ++- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index 5dc999740..1b02cbc7c 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -133,21 +133,22 @@ void NetworkDialog::connectTreeWidgetCostumPopupMenu( QPoint /*point*/ ) contextMnu->addAction(QIcon(IMAGE_PEERDETAILS), tr("Profile details..."), this, SLOT(peerdetails())); contextMnu->addSeparator() ; contextMnu->addAction(QIcon(), tr("Remove unused keys..."), this, SLOT(removeUnusedKeys())); + contextMnu->addAction(QIcon(), tr("Remove this key"), this, SLOT(removeSelectedKeys())); contextMnu->exec(QCursor::pos()); } void NetworkDialog::removeUnusedKeys() { - std::set pre_selected ; - std::list ids ; + std::set pre_selected ; + std::list ids ; rsPeers->getGPGAllList(ids) ; RsPeerDetails details ; time_t now = time(NULL) ; - time_t THREE_MONTHS = 3*31*24*60*60 ;//3*DayPerMonth*HoursPerDay*MinPerHour*SecPerMin + time_t THREE_MONTHS = 3*31*24*60*60 ;//3*DayPerMonth*HoursPerDay*MinPerHour*SecPerMin - for(std::list::const_iterator it(ids.begin());it!=ids.end();++it) + for(std::list::const_iterator it(ids.begin());it!=ids.end();++it) { rsPeers->getGPGDetails(*it,details) ; @@ -159,17 +160,34 @@ void NetworkDialog::removeUnusedKeys() if(now > (time_t) (THREE_MONTHS + details.lastUsed) && !details.accept_connection) { std::cerr << "Adding " << *it << " to pre-selection." << std::endl; - pre_selected.insert(*it) ; + pre_selected.insert(*it) ; } } - std::set selected = FriendSelectionDialog::selectFriends_PGP(NULL, - tr("Clean keyring"), - tr("The selected keys below haven't been used in the last 3 months. \nDo you want to delete them permanently ? \n\nNotes: Your old keyring will be backed up.\n The removal may fail when running multiple Retroshare instances on the same machine."),FriendSelectionWidget::MODUS_CHECK,FriendSelectionWidget::SHOW_GPG | FriendSelectionWidget::SHOW_NON_FRIEND_GPG, - pre_selected) ; - + std::set selected = FriendSelectionDialog::selectFriends_PGP(NULL, + tr("Clean keyring"), + tr("The selected keys below haven't been used in the last 3 months. \nDo you want to delete them permanently ? \n\nNotes: Your old keyring will be backed up.\n The removal may fail when running multiple Retroshare instances on the same machine."),FriendSelectionWidget::MODUS_CHECK,FriendSelectionWidget::SHOW_GPG | FriendSelectionWidget::SHOW_NON_FRIEND_GPG, + pre_selected) ; + + removeKeys(selected); +} + +void NetworkDialog::removeSelectedKeys() +{ + QModelIndexList l = ui.connectTreeWidget->selectionModel()->selection().indexes(); + if(l.empty()) + return; + + std::set selected; + selected.insert(RsPgpId(ui.connectTreeWidget->model()->data(ui.connectTreeWidget->model()->index(l.begin()->row(), COLUMN_PEERID)).toString().toStdString())); + + removeKeys(selected); +} + +void NetworkDialog::removeKeys(std::set selected) +{ std::cerr << "Removing these keys from the keyring: " << std::endl; - for(std::set::const_iterator it(selected.begin());it!=selected.end();++it) + for(std::set::const_iterator it(selected.begin());it!=selected.end();++it) std::cerr << " " << *it << std::endl; std::string backup_file ; @@ -200,7 +218,7 @@ void NetworkDialog::removeUnusedKeys() } QMessageBox::warning(NULL,tr("Keyring info"),tr("Key removal has failed. Your keyring remains intact.\n\nReported error:")+" "+error_string ) ; } - updateDisplay(); + updateDisplay(); // insertConnect() ; } diff --git a/retroshare-gui/src/gui/NetworkDialog.h b/retroshare-gui/src/gui/NetworkDialog.h index 9561c1db3..6a5b1c367 100644 --- a/retroshare-gui/src/gui/NetworkDialog.h +++ b/retroshare-gui/src/gui/NetworkDialog.h @@ -68,6 +68,7 @@ protected: private slots: void removeUnusedKeys() ; + void removeSelectedKeys() ; void makeFriend() ; void denyFriend() ; void peerdetails(); @@ -86,6 +87,8 @@ private slots: private: + void removeKeys(std::set selected) ; + /* Color definitions (for standard see qss.default) */ QColor mBackgroundColorSelf; QColor mBackgroundColorOwnSign; diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp index d253691bf..bb5e693ba 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp @@ -185,7 +185,7 @@ int FriendSelectionWidget::addColumn(const QString &title) return column; } -void FriendSelectionWidget::showEvent(QShowEvent *e) +void FriendSelectionWidget::showEvent(QShowEvent */*e*/) { if(gxsIds.empty()) loadIdentities(); @@ -838,6 +838,9 @@ void FriendSelectionWidget::contextMenuRequested(const QPoint &/*pos*/) contextMenu->addAction(QIcon(), tr("Mark all"), this, SLOT(selectAll())); contextMenu->addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll())); } + if (mListModus == MODUS_CHECK) { + contextMenu->addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll())); + } if (!mContextMenuActions.isEmpty()) { bool addSeparator = false; From cf0360a1721050eda5a766668a74dccf6a26a88c Mon Sep 17 00:00:00 2001 From: Phenom Date: Tue, 24 Nov 2020 15:57:09 +0100 Subject: [PATCH 21/31] Add current PID in Lock file. --- libretroshare/src/util/rsdir.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretroshare/src/util/rsdir.cc b/libretroshare/src/util/rsdir.cc index fe9907d2d..8556b8198 100644 --- a/libretroshare/src/util/rsdir.cc +++ b/libretroshare/src/util/rsdir.cc @@ -892,6 +892,10 @@ int RsDirUtil::createLockFile(const std::string& lock_file_path, rs_lock_handle_ return 2; } + // Write to lock file our pid + std::string ourPID = std::to_string(::getpid()); + write(lock_handle, ourPID.c_str(), sizeof(char)*ourPID.size() ); + return 0; #else // Suspended. The user should make sure he's not already using the file descriptor. From fc8604154be1ae85470c46ebdc2776c749e93cf1 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 24 Nov 2020 18:39:21 +0100 Subject: [PATCH 22/31] cancelled commit c1c6d33 because PR2122 provides a more advanced set --- libretroshare/src/rsitems/itempriorities.h | 66 +++++++++++----------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/libretroshare/src/rsitems/itempriorities.h b/libretroshare/src/rsitems/itempriorities.h index 8a464add4..b7f29babc 100644 --- a/libretroshare/src/rsitems/itempriorities.h +++ b/libretroshare/src/rsitems/itempriorities.h @@ -25,30 +25,28 @@ // This file centralises QoS priorities for all transfer RsItems. // -const uint8_t QOS_PRIORITY_UNKNOWN = 0 ; -const uint8_t QOS_PRIORITY_DEFAULT = 3 ; -const uint8_t QOS_PRIORITY_TOP = 9 ; +const uint8_t QOS_PRIORITY_UNKNOWN = 0 ; +const uint8_t QOS_PRIORITY_DEFAULT = 3 ; +const uint8_t QOS_PRIORITY_TOP = 9 ; // Turtle traffic // -const uint8_t QOS_PRIORITY_RS_TURTLE_OPEN_TUNNEL = 7 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_TUNNEL_OK = 7 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST = 7 ; - -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_DATA = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 5 ; - -const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 4 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_ITEM = 3 ; -//const uint8_t QOS_PRIORITY_RS_TURTLE_FORWARD_FILE_DATA= 3 ; // unused -const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_DATA = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA = 7 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_OPEN_TUNNEL = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_TUNNEL_OK = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_REQUEST = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST= 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 3 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_DATA = 3 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 3 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 3 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_ITEM = 3 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FORWARD_FILE_DATA= 3 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_DATA = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA= 7 ; // File transfer // @@ -56,23 +54,24 @@ const uint8_t QOS_PRIORITY_RS_FILE_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_FILE_CRC_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_CHUNK_CRC_REQUEST = 5 ; const uint8_t QOS_PRIORITY_RS_FILE_MAP_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_DATA = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_CRC = 5 ; +const uint8_t QOS_PRIORITY_RS_CACHE_REQUEST = 4 ; +const uint8_t QOS_PRIORITY_RS_FILE_DATA = 3 ; +const uint8_t QOS_PRIORITY_RS_FILE_CRC = 3 ; const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_MAP = 5 ; -//const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; // unused +const uint8_t QOS_PRIORITY_RS_FILE_MAP = 3 ; +const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; // Discovery // const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ; const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 1 ; +const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 1 ; const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority. const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 1 ; // File database // @@ -93,11 +92,11 @@ const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ; // RTT // -const uint8_t QOS_PRIORITY_RS_RTT_PING = 9 ; +const uint8_t QOS_PRIORITY_RS_RTT_PING = 9 ; // BanList // -const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 3 ; +const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 2 ; // Bandwidth Control. // @@ -110,11 +109,10 @@ const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ; // GXS // -const uint8_t QOS_PRIORITY_RS_GXS_NET = 6 ; - +const uint8_t QOS_PRIORITY_RS_GXS_NET = 3 ; // GXS Reputation. -const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 3; +const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 2; // Service Info / Control. -const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 8; +const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 7; From c7b6f5ffba8f1f183ac8378045f8eb787aa1e639 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 23 Nov 2020 22:22:02 +0100 Subject: [PATCH 23/31] Upgraded external libraries in Windows build environment - cmake-3.19.0 - opencv-4.5.0 - openssl-1.1.1h --- build_scripts/Windows/build-libs/Makefile | 4 ++-- build_scripts/Windows/env/tools/prepare-msys2.bat | 4 ++-- build_scripts/Windows/env/tools/prepare-tools.bat | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile index 6a0c3b5f0..e6927150f 100644 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -1,10 +1,10 @@ ZLIB_VERSION=1.2.3 BZIP2_VERSION=1.0.6 MINIUPNPC_VERSION=2.0 -OPENSSL_VERSION=1.1.1g +OPENSSL_VERSION=1.1.1h SPEEX_VERSION=1.2.0 SPEEXDSP_VERSION=1.2rc3 -OPENCV_VERSION=3.4.11 +OPENCV_VERSION=4.5.0 LIBXML2_VERSION=2.9.7 LIBXSLT_VERSION=1.1.32 CURL_VERSION=7.58.0 diff --git a/build_scripts/Windows/env/tools/prepare-msys2.bat b/build_scripts/Windows/env/tools/prepare-msys2.bat index 80d17521f..0a649ae0e 100644 --- a/build_scripts/Windows/env/tools/prepare-msys2.bat +++ b/build_scripts/Windows/env/tools/prepare-msys2.bat @@ -27,8 +27,8 @@ if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" ( set MSYS2Install=msys2-base-%MSYS2Architecture%-20190524.tar.xz set MSYS2Url=http://sourceforge.net/projects/msys2/files/Base/%MSYS2Architecture%/%MSYS2Install%/download -set CMakeInstall=cmake-3.1.0-win32-x86.zip -set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall% +set CMakeInstall=cmake-3.19.0-win32-x86.zip +set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall% set CMakeUnpackPath=%EnvMSYS2Path%\msys%MSYS2Base% if exist "%EnvMSYS2Path%\msys%MSYS2Base%" ( diff --git a/build_scripts/Windows/env/tools/prepare-tools.bat b/build_scripts/Windows/env/tools/prepare-tools.bat index 8b48d7c32..d53a70cf6 100644 --- a/build_scripts/Windows/env/tools/prepare-tools.bat +++ b/build_scripts/Windows/env/tools/prepare-tools.bat @@ -16,9 +16,9 @@ set NSISInstallPath=%EnvToolsPath%\NSIS set MinGitInstall=MinGit-2.28.0-32-bit.zip set MinGitUrl=https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/%MinGitInstall% set MinGitInstallPath=%EnvToolsPath%\MinGit -set CMakeVersion=cmake-3.1.0-win32-x86 +set CMakeVersion=cmake-3.19.0-win32-x86 set CMakeInstall=%CMakeVersion%.zip -set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall% +set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall% set CMakeInstallPath=%EnvToolsPath%\cmake set TorProjectUrl=https://www.torproject.org set TorDownloadIndexUrl=%TorProjectUrl%/download/tor From 7a0dfbcda92cd9a2c0e7158d9ebc2264a62a3da1 Mon Sep 17 00:00:00 2001 From: hunbernd Date: Sun, 22 Nov 2020 21:58:56 +0100 Subject: [PATCH 24/31] Fixed includes and macros for newer opencv --- plugins/VOIP/VOIP.pro | 9 ++++++++- plugins/VOIP/VOIPPlugin.cpp | 2 +- plugins/VOIP/gui/QVideoDevice.cpp | 5 +++-- plugins/VOIP/gui/VideoProcessor.cpp | 14 +++++++------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/plugins/VOIP/VOIP.pro b/plugins/VOIP/VOIP.pro index 20feb82c6..ca5b13b7b 100644 --- a/plugins/VOIP/VOIP.pro +++ b/plugins/VOIP/VOIP.pro @@ -121,10 +121,17 @@ win32 { message(Use system opencv libraries.) LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc } - LIBS += -lzlib -lole32 -loleaut32 -luuid -lvfw32 -llibjpeg-turbo -llibtiff -llibpng -llibjasper -lIlmImf + LIBS += -lole32 -loleaut32 -luuid -lvfw32 LIBS += -lavifil32 -lavicap32 -lavcodec -lavutil -lswresample + + # Check for msys2 + !isEmpty(PREFIX_MSYS2) { + message(Use msys2 opencv4.) + INCLUDEPATH += "$${PREFIX_MSYS2}/include/opencv4" + } } + #################################### MacOSX ##################################### macx { diff --git a/plugins/VOIP/VOIPPlugin.cpp b/plugins/VOIP/VOIPPlugin.cpp index 1f5a31b2e..e5b412858 100644 --- a/plugins/VOIP/VOIPPlugin.cpp +++ b/plugins/VOIP/VOIPPlugin.cpp @@ -38,7 +38,7 @@ #include "gui/SoundManager.h" #include "gui/chat/ChatWidget.h" -#include +#include #include #define IMAGE_VOIP ":/images/talking_on.svg" diff --git a/plugins/VOIP/gui/QVideoDevice.cpp b/plugins/VOIP/gui/QVideoDevice.cpp index c6db0f4f9..1a3d084db 100644 --- a/plugins/VOIP/gui/QVideoDevice.cpp +++ b/plugins/VOIP/gui/QVideoDevice.cpp @@ -18,8 +18,9 @@ * * *******************************************************************************/ -#include -#include +#include +#include +#include #include #include diff --git a/plugins/VOIP/gui/VideoProcessor.cpp b/plugins/VOIP/gui/VideoProcessor.cpp index fa8437008..b9d867cf3 100644 --- a/plugins/VOIP/gui/VideoProcessor.cpp +++ b/plugins/VOIP/gui/VideoProcessor.cpp @@ -473,10 +473,10 @@ FFmpegVideo::FFmpegVideo() encoding_context->rc_max_rate = 0; encoding_context->rc_buffer_size = 0; #endif - if (encoding_codec->capabilities & CODEC_CAP_TRUNCATED) - encoding_context->flags |= CODEC_FLAG_TRUNCATED; - encoding_context->flags |= CODEC_FLAG_PSNR;//Peak signal-to-noise ratio - encoding_context->flags |= CODEC_CAP_PARAM_CHANGE; + if (encoding_codec->capabilities & AV_CODEC_CAP_TRUNCATED) + encoding_context->flags |= AV_CODEC_FLAG_TRUNCATED; + encoding_context->flags |= AV_CODEC_FLAG_PSNR;//Peak signal-to-noise ratio + encoding_context->flags |= AV_CODEC_CAP_PARAM_CHANGE; encoding_context->i_quant_factor = 0.769f; encoding_context->b_quant_factor = 1.4f; encoding_context->time_base.num = 1; @@ -569,10 +569,10 @@ FFmpegVideo::FFmpegVideo() decoding_context->pix_fmt = AV_PIX_FMT_YUV420P; #endif - if(decoding_codec->capabilities & CODEC_CAP_TRUNCATED) - decoding_context->flags |= CODEC_FLAG_TRUNCATED; // we do not send complete frames + if(decoding_codec->capabilities & AV_CODEC_CAP_TRUNCATED) + decoding_context->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames //we can receive truncated frames - decoding_context->flags2 |= CODEC_FLAG2_CHUNKS; + decoding_context->flags2 |= AV_CODEC_FLAG2_CHUNKS; AVDictionary* dictionary = NULL; if(avcodec_open2(decoding_context, decoding_codec, &dictionary) < 0) From 1ee38877cacb2e7e1c814d245ff14355037aac55 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 24 Nov 2020 17:34:10 +0100 Subject: [PATCH 25/31] Fixed linking of VOIP plugin for msys2 --- plugins/VOIP/VOIP.pro | 65 +++++++++++-------------------------------- 1 file changed, 16 insertions(+), 49 deletions(-) diff --git a/plugins/VOIP/VOIP.pro b/plugins/VOIP/VOIP.pro index ca5b13b7b..8186c48ec 100644 --- a/plugins/VOIP/VOIP.pro +++ b/plugins/VOIP/VOIP.pro @@ -65,73 +65,40 @@ win32 { DEPENDPATH += . $$INC_DIR INCLUDEPATH += . $$INC_DIR - OPENCV_VERSION = "341" USE_PRECOMPILED_LIBS = for(lib, RS_LIB_DIR) { #message(Scanning $$lib) - exists( $$lib/opencv/libopencv_core$${OPENCV_VERSION}.a) { - isEmpty(USE_PRECOMPILED_LIBS) { - message(Get pre-compiled opencv $$OPENCV_VERSION libraries here:) - message($$lib) + isEmpty(USE_PRECOMPILED_LIBS) { + exists($$lib/opencv/libopencv_core.a) { + message(Get pre-compiled opencv libraries here:) + message($$lib/opencv) LIBS += -L"$$lib/opencv" - LIBS += -lopencv_core$$OPENCV_VERSION -lopencv_highgui$$OPENCV_VERSION -lopencv_imgproc$$OPENCV_VERSION -lopencv_videoio$$OPENCV_VERSION -lopencv_imgcodecs$$OPENCV_VERSION -llibwebp USE_PRECOMPILED_LIBS = 1 } - } - exists( $$lib/opencv/libopencv_core.a) { - isEmpty(USE_PRECOMPILED_LIBS) { + exists($$lib/libopencv_core.dll.a) { message(Get pre-compiled opencv libraries here:) message($$lib) - LIBS += -L"$$lib/opencv" - LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc + LIBS += -L"$$lib" USE_PRECOMPILED_LIBS = 1 } } - exists( $$lib/libopencv_core.dll.a) { - isEmpty(USE_PRECOMPILED_LIBS) { - message(Get pre-compiled opencv libraries here:) - message($$lib) - LIBS += -L"$$lib/opencv" - LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc - USE_PRECOMPILED_LIBS = 1 - } - } - exists( $$lib/opencv/libopencv_videoio.a) { - message(videoio found in opencv libraries.) - message($$lib) - LIBS += -lopencv_videoio - } - exists( $$lib/libopencv_videoio.dll.a) { - message(videoio found in opencv libraries.) - message($$lib) - LIBS += -lopencv_videoio - } - exists( $$lib/opencv/libopencv_imgcodecs.a) { - message(videoio found in opencv libraries.) - message($$lib) - LIBS += -lopencv_imgcodecs - } - exists( $$lib/opencv/liblibwebp.a) { - message(videoio found in opencv libraries.) - message($$lib) - LIBS += -llibwebp - } } isEmpty(USE_PRECOMPILED_LIBS) { message(Use system opencv libraries.) - LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc } - LIBS += -lole32 -loleaut32 -luuid -lvfw32 - LIBS += -lavifil32 -lavicap32 -lavcodec -lavutil -lswresample - # Check for msys2 - !isEmpty(PREFIX_MSYS2) { - message(Use msys2 opencv4.) - INCLUDEPATH += "$${PREFIX_MSYS2}/include/opencv4" - } + LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_videoio -lopencv_imgcodecs -llibwebp -llibtiff -llibpng -llibopenjp2 -lIlmImf + LIBS += -lole32 -loleaut32 -luuid -lvfw32 + + # Check for msys2 + !isEmpty(PREFIX_MSYS2) { + message(Use msys2 opencv4.) + INCLUDEPATH += "$${PREFIX_MSYS2}/include/opencv4" + } else { + LIBS += -llibjpeg-turbo -lzlib + } } - #################################### MacOSX ##################################### macx { From 0ae073d073497a1def58abe6c6b213f10451ab27 Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 25 Nov 2020 15:34:20 +0100 Subject: [PATCH 26/31] Fix RsItem deserialise when they are too small (< 8 bytes). --- libretroshare/src/serialiser/rsserializer.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/serialiser/rsserializer.cc b/libretroshare/src/serialiser/rsserializer.cc index e59b7d9fd..1a029ee2e 100644 --- a/libretroshare/src/serialiser/rsserializer.cc +++ b/libretroshare/src/serialiser/rsserializer.cc @@ -33,11 +33,16 @@ RsItem *RsServiceSerializer::deserialise(void *data, uint32_t *size) { - if(!data || !size || !*size) + if(!data || !size || *size < 8) { - RsErr() << __PRETTY_FUNCTION__ << " Called with null paramethers data: " - << data << " size: " << static_cast(size) << " *size: " - << (size ? *size : 0) << " this should never happen!" + RsErr() << __PRETTY_FUNCTION__ << " Called with inconsistent parameters data: " << std::endl; + if(data) + RsErr() << "Data is: " << RsUtil::BinToHex(static_cast(data),std::min(50u,*size)) << ((*size>50)?"...":"") << std::endl; + else + RsErr() << "Null Data" << std::endl; + + RsErr() << " size: " << static_cast(size) << " *size: " << (size ? *size : 0) << std::endl + << " this should never happen!" << std::endl; print_stacktrace(); return nullptr; From ee6f83aab4f27848c442769b4f49911a517e0ffb Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 25 Nov 2020 19:56:07 +0100 Subject: [PATCH 27/31] Add Save Selected Post in current Forum when switch to other. --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 158 ++++++++++-------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 1 + 2 files changed, 90 insertions(+), 69 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index d2500c6d8..cefb966df 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -908,6 +908,7 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) return; mThreadId = mOrigThreadId = new_id; + mLastSelectedPosts[groupId()] = new_id; #ifdef DEBUG_FORUMS std::cerr << "Switched to new thread ID " << mThreadId << std::endl; @@ -1492,22 +1493,25 @@ void GxsForumThreadWidget::expandSubtree() { bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) { - QModelIndex source_index = mThreadModel->getIndexOfMessage(msgId); + QModelIndex source_index = mThreadModel->getIndexOfMessage(msgId); - if(!source_index.isValid()) - { - std::cerr << "(EE) Cannot navigate to msg " << msgId << " in forum " << mForumGroup.mMeta.mGroupId << ": index unknown. Setting mNavigatePendingMsgId." << std::endl; + if(!source_index.isValid()) + { + std::cerr << "(EE) Cannot navigate to msg " << msgId << " in forum " << mForumGroup.mMeta.mGroupId << ": index unknown. Setting mNavigatePendingMsgId." << std::endl; - mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading. - return true; // we have to return true here, otherwise the caller will intepret the async loading as an error. - } + mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading. + return true; // we have to return true here, otherwise the caller will intepret the async loading as an error. + } - QModelIndex indx = mThreadProxyModel->mapFromSource(source_index); + QModelIndex indx = mThreadProxyModel->mapFromSource(source_index); - ui->threadTreeWidget->setCurrentIndex(indx); - ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded - ui->threadTreeWidget->setFocus(); - return true; + ui->threadTreeWidget->selectionModel()->setCurrentIndex(indx,QItemSelectionModel::ClearAndSelect); + ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded + ui->threadTreeWidget->setFocus(); + + mNavigatePendingMsgId.clear(); + + return true; } void GxsForumThreadWidget::copyMessageLink() @@ -1797,22 +1801,33 @@ void GxsForumThreadWidget::saveImage() void GxsForumThreadWidget::changedViewBox() { - ui->threadTreeWidget->selectionModel()->clear(); - ui->threadTreeWidget->selectionModel()->reset(); - mThreadId.clear(); + ui->threadTreeWidget->selectionModel()->clear(); + ui->threadTreeWidget->selectionModel()->reset(); + mThreadId.clear(); - // save index - Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex()); + // save index + Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex()); - if(ui->viewBox->currentIndex() == VIEW_FLAT) - mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT); - else - mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_TREE); + if(ui->viewBox->currentIndex() == VIEW_FLAT) + mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT); + else + mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_TREE); - if(ui->viewBox->currentIndex() == VIEW_LAST_POST) - mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_CHILDREN_PUBLISH_TS); - else - mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_PUBLISH_TS); + if(ui->viewBox->currentIndex() == VIEW_LAST_POST) + mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_CHILDREN_PUBLISH_TS); + else + mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_PUBLISH_TS); + + if( (mLastSelectedPosts.count(groupId()) > 0) + && !mLastSelectedPosts[groupId()].isNull() + && mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]).isValid()) + { + QModelIndex source_index = mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]); + QModelIndex index = mThreadProxyModel->mapFromSource(source_index); + + ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded + } } void GxsForumThreadWidget::filterColumnChanged(int column) @@ -1868,67 +1883,72 @@ void GxsForumThreadWidget::filterItems(const QString& text) void GxsForumThreadWidget::postForumLoading() { - if(groupId().isNull()) - { - ui->nextUnreadButton->setEnabled(false); - return; - } + if(groupId().isNull()) + { + ui->nextUnreadButton->setEnabled(false); + return; + } #ifdef DEBUG_FORUMS - std::cerr << "Post forum loading..." << std::endl; + std::cerr << "Post forum loading..." << std::endl; #endif - if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid()) - { + + if (!mNavigatePendingMsgId.isNull()) + navigate(mNavigatePendingMsgId); + + else if( (mLastSelectedPosts.count(groupId()) > 0) + && !mLastSelectedPosts[groupId()].isNull() + && mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]).isValid()) + { #ifdef DEBUG_FORUMS - std::cerr << "Pending msg navigation: " << mNavigatePendingMsgId << ". Using it as new thread Id" << std::endl; + std::cerr << "Last selected msg navigation: " << mLastSelectedPosts[groupId()].toStdString() << ". Using it as new thread Id" << std::endl; #endif - QModelIndex source_index = mThreadModel->getIndexOfMessage(mNavigatePendingMsgId); - QModelIndex index = mThreadProxyModel->mapFromSource(source_index); + QModelIndex source_index = mThreadModel->getIndexOfMessage(mLastSelectedPosts[groupId()]); + QModelIndex index = mThreadProxyModel->mapFromSource(source_index); - ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); - ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded + ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded - mNavigatePendingMsgId.clear(); - } - else - { + } + else + { - QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId); + QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId); - if(!mThreadId.isNull() && source_index.isValid()) - { - QModelIndex index = mThreadProxyModel->mapFromSource(source_index); - ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); - ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded + if(!mThreadId.isNull() && source_index.isValid()) + { + QModelIndex index = mThreadProxyModel->mapFromSource(source_index); + ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded #ifdef DEBUG_FORUMS - std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl; + std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl; #endif - } - else - { + } + else + { #ifdef DEBUG_FORUMS - std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl; + std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl; #endif - ui->threadTreeWidget->selectionModel()->clear(); - ui->threadTreeWidget->selectionModel()->reset(); - mThreadId.clear(); - //blank(); - } - // we also need to restore expanded threads - } + ui->threadTreeWidget->selectionModel()->clear(); + ui->threadTreeWidget->selectionModel()->reset(); + mThreadId.clear(); + //blank(); + } + // we also need to restore expanded threads + } - ui->newthreadButton->show(); - ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); - ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); - ui->threadTreeWidget->update(); - ui->viewBox->setEnabled(true); - ui->filterLineEdit->setEnabled(true); + ui->newthreadButton->show(); + ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); + ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); + ui->threadTreeWidget->update(); + ui->viewBox->setEnabled(true); + ui->filterLineEdit->setEnabled(true); - recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages); - //mUpdating = false; + recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages); + //mUpdating = false; - ui->nextUnreadButton->setEnabled(true); + ui->nextUnreadButton->setEnabled(true); } void GxsForumThreadWidget::updateGroupData() diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 22aa2ecc3..aa4f78fbb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -224,6 +224,7 @@ private: QColor mBackgroundColorPinned; QColor mBackgroundColorFiltered; + std::map mLastSelectedPosts; RsGxsMessageId mNavigatePendingMsgId; QList mIgnoredMsgId; From 3fff0869a21fb242939929fbdffa998bb3c5bd4c Mon Sep 17 00:00:00 2001 From: Phenom Date: Thu, 26 Nov 2020 19:13:54 +0100 Subject: [PATCH 28/31] Fix Valgrind report at End of RS XXXX bytes in XX blocks are still reachable in loss record. --- libretroshare/src/gxs/rsgxsdataaccess.cc | 88 ++++++++++++------------ 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index bfd2ce3a3..60ad7339b 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -709,44 +709,46 @@ void RsGxsDataAccess::processRequests() while (!mRequestQueue.empty()) { - // Extract the first elements from the request queue. cleanup all other elements marked at terminated. + // Extract the first elements from the request queue. cleanup all other elements marked at terminated. GxsRequest* req = nullptr; { RsStackMutex stack(mDataMutex); /******* LOCKED *******/ - rstime_t now = time(nullptr); // this is ok while in the loop below + rstime_t now = time(nullptr); // this is ok while in the loop below - while(!mRequestQueue.empty() && req == nullptr) - { - if(now > mRequestQueue.begin()->second->reqTime + MAX_REQUEST_AGE) - { + while(!mRequestQueue.empty() && req == nullptr) + { + if(now > mRequestQueue.begin()->second->reqTime + MAX_REQUEST_AGE) + { + delete mRequestQueue.begin()->second; mRequestQueue.erase(mRequestQueue.begin()); continue; - } + } - switch( mRequestQueue.begin()->second->status ) - { - case PARTIAL: - RsErr() << "Found partial request in mRequestQueue. This is a bug." << std::endl; // fallthrough - case COMPLETE: - case DONE: - case FAILED: - case CANCELLED: + switch( mRequestQueue.begin()->second->status ) + { + case PARTIAL: + RsErr() << "Found partial request in mRequestQueue. This is a bug." << std::endl; // fallthrough + case COMPLETE: + case DONE: + case FAILED: + case CANCELLED: #ifdef DATA_DEBUG - RsDbg() << " request " << mRequestQueue.begin()->second->token << ": status = " << mRequestQueue.begin()->second->status << ": removing from the RequestQueue" << std::endl; + RsDbg() << " request " << mRequestQueue.begin()->second->token << ": status = " << mRequestQueue.begin()->second->status << ": removing from the RequestQueue" << std::endl; #endif - mRequestQueue.erase(mRequestQueue.begin()); - continue; - break; - case PENDING: - req = mRequestQueue.begin()->second; - req->status = PARTIAL; - mRequestQueue.erase(mRequestQueue.begin()); // remove it right away from the waiting queue. - break; - } + delete mRequestQueue.begin()->second; + mRequestQueue.erase(mRequestQueue.begin()); + continue; + break; + case PENDING: + req = mRequestQueue.begin()->second; + req->status = PARTIAL; + mRequestQueue.erase(mRequestQueue.begin()); // remove it right away from the waiting queue. + break; + } - } - } + } + } // END OF MUTEX. if (!req) break; @@ -813,33 +815,33 @@ void RsGxsDataAccess::processRequests() else RsErr() << __PRETTY_FUNCTION__ << " Failed to process request, token: " << req->token << std::endl; - // We cannot easily remove the request here because the queue may have more elements now and mRequestQueue.begin() is not necessarily the same element. - // but we mark it as COMPLETE/FAILED so that it will be removed in the next loop. + // We cannot easily remove the request here because the queue may have more elements now and mRequestQueue.begin() is not necessarily the same element. + // but we mark it as COMPLETE/FAILED so that it will be removed in the next loop. { RsStackMutex stack(mDataMutex); /******* LOCKED *******/ - if(ok) - { - // When the request is complete, we move it to the complete list, so that the caller can easily retrieve the request data + if(ok) + { + // When the request is complete, we move it to the complete list, so that the caller can easily retrieve the request data #ifdef DATA_DEBUG - RsDbg() << " Request completed successfully. Marking as COMPLETE." << std::endl; + RsDbg() << " Request completed successfully. Marking as COMPLETE." << std::endl; #endif req->status = COMPLETE ; - mCompletedRequests[req->token] = req; - mPublicToken[req->token] = COMPLETE; - } - else - { + mCompletedRequests[req->token] = req; + mPublicToken[req->token] = COMPLETE; + } + else + { req->status = FAILED; - mPublicToken[req->token] = FAILED; + mPublicToken[req->token] = FAILED; #ifdef DATA_DEBUG - RsDbg() << " Request failed. Marking as FAILED." << std::endl; + RsDbg() << " Request failed. Marking as FAILED." << std::endl; #endif - } - } + } + } // END OF MUTEX. - } // END OF MUTEX. + } } From 92322d1a4b4a52c42df0eeb027aa36335389f8f7 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 26 Nov 2020 20:03:49 +0100 Subject: [PATCH 29/31] Fixed to use the right icons for the Grant & Cancel membership & improved Circle Notiy layout * Fixed to use the right icons for the Grant & Cancel membership & improved Circle Notify layout * Fixed stylesheets for the Circle notify feeds --- .../src/gui/feeds/GxsCircleItem.cpp | 9 +- retroshare-gui/src/gui/feeds/GxsCircleItem.ui | 145 +++++++++--------- .../src/gui/qss/stylesheet/Standard.qss | 9 ++ 3 files changed, 92 insertions(+), 71 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp b/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp index 18997a084..aa7dfa705 100644 --- a/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp @@ -25,6 +25,7 @@ #include "gui/notifyqt.h" #include "gui/Circles/CreateCircleDialog.h" #include "gui/gxs/GxsIdDetails.h" +#include "gui/common/FilesDefs.h" #include #include @@ -98,8 +99,9 @@ void GxsCircleItem::setup() ui->gxsIdLabel->setId(mGxsId); ui->inviteeButton->setHidden(false); - ui->inviteeButton->setText(tr("Grant membership")); - ui->inviteeButton->setToolTip(tr("Grant membership to this circle, for this identity")); + ui->inviteeButton->setText(tr("Grant membership")); + ui->inviteeButton->setToolTip(tr("Grant membership to this circle, for this identity")); + ui->inviteeButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/accepted16.png")); ui->membershipButton->setHidden(true); } @@ -133,6 +135,7 @@ void GxsCircleItem::setup() ui->inviteeButton->setHidden(false); ui->inviteeButton->setText(tr("Revoke membership")); ui->inviteeButton->setToolTip(tr("Revoke membership for that identity")); + ui->inviteeButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png")); } else { @@ -155,6 +158,7 @@ void GxsCircleItem::setup() ui->membershipButton->setHidden(false); ui->membershipButton->setText(tr("Cancel membership request")); ui->membershipButton->setToolTip(tr("Cancel your membership request from that circle")); + ui->membershipButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png")); ui->inviteeButton->setHidden(true); } @@ -168,6 +172,7 @@ void GxsCircleItem::setup() ui->membershipButton->setHidden(false); ui->membershipButton->setText(tr("Cancel membership")); ui->membershipButton->setToolTip(tr("Cancel your membership from that circle")); + ui->membershipButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png")); ui->inviteeButton->setHidden(true); } diff --git a/retroshare-gui/src/gui/feeds/GxsCircleItem.ui b/retroshare-gui/src/gui/feeds/GxsCircleItem.ui index fa8d30014..ced9279b3 100644 --- a/retroshare-gui/src/gui/feeds/GxsCircleItem.ui +++ b/retroshare-gui/src/gui/feeds/GxsCircleItem.ui @@ -7,7 +7,7 @@ 0 0 618 - 217 + 108 @@ -133,29 +133,86 @@ - - - - 0 - 0 - - - - - 75 - true - true - - - - Circle msg - - + + + + + + 20 + 20 + + + + TextLabel + + + true + + + + + + + + 10 + 75 + true + + + + name + + + true + + + + + + + + 0 + 0 + + + + + 75 + true + true + + + + Circle msg + + + + + + + Qt::Horizontal + + + + 358 + 20 + + + + + + + + 10 + 75 + true + + Circle name: @@ -186,56 +243,6 @@ - - - - - - Identity: - - - - - - - - 20 - 20 - - - - TextLabel - - - true - - - - - - - name - - - true - - - - - - - Qt::Horizontal - - - - 358 - 20 - - - - - - diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 7615dcabb..be77a72fb 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -483,6 +483,15 @@ GxsChannelPostItem QLabel#logoLabel { background-color: black; } +GxsCircleItem QFrame#frame { + background-color: white; +} + +GxsCircleItem QLabel#nameLabel, QLabel#titleLabel { + font: 11pt; + font: bold italic; +} + ForumNewItem > QFrame#frame, ForumMsgItem > QFrame#frame { border: 2px solid #CCCCCC; background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEEEEE, stop: 1 #CCCCCC); From e8691e9b0ff12336bd5b22bc740b4360a68347c8 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sun, 22 Nov 2020 20:25:42 +0100 Subject: [PATCH 30/31] Priority optimization and fixes --- libretroshare/src/ft/ftserver.cc | 2 + libretroshare/src/gxs/rsgxsnetservice.cc | 2 +- libretroshare/src/gxstunnel/p3gxstunnel.cc | 7 +- libretroshare/src/rsitems/itempriorities.h | 109 +++++++++++---------- libretroshare/src/turtle/rsturtleitem.h | 2 +- 5 files changed, 66 insertions(+), 56 deletions(-) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 0f42b8437..f5442a620 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1083,6 +1083,8 @@ bool ftServer::sendTurtleItem(const RsPeerId& peerId,const RsFileHash& hash,RsTu if(!encryptItem(item, hash, encrypted_item)) return false ; + encrypted_item->setPriorityLevel(item->priority_level()); + delete item ; mTurtleRouter->sendTurtleData(peerId,encrypted_item) ; diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 740c1d2ab..23f364510 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -308,7 +308,7 @@ static const uint32_t GROUP_STATS_UPDATE_DELAY = 240; // static const uint32_t GROUP_STATS_UPDATE_NB_PEERS = 2; // number of peers to which the group stats are asked static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000; // 200,000 bytes including signature and headers static const uint32_t MIN_DELAY_BETWEEN_GROUP_SEARCH = 40; // dont search same group more than every 40 secs. -static const uint32_t SAFETY_DELAY_FOR_UNSUCCESSFUL_UPDATE = 1800; // avoid re-sending the same msg list to a peer who asks twice for the same update in less than this time +static const uint32_t SAFETY_DELAY_FOR_UNSUCCESSFUL_UPDATE = 0; // avoid re-sending the same msg list to a peer who asks twice for the same update in less than this time static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_UNKNOWN = 0x00 ; static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_NO_ERROR = 0x01 ; diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 2909238ea..e500f82b0 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -1221,9 +1221,12 @@ bool p3GxsTunnelService::locked_sendClearTunnelData(RsGxsTunnelDHPublicKeyItem * std::cerr << "GxsTunnelService::sendClearTunnelData(): try sending item " << (void*)item << " to peer " << item->PeerId() << std::endl; #endif - // make a TurtleGenericData item out of it, and send it in clear. - // + // make a RsTurtleGenericData item out of it, and send it in clear. + // this is compatible with nodes older than 0.6.6 RsTurtleGenericDataItem *gitem = new RsTurtleGenericDataItem ; + // force item priority to QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA to make the DH exchange faster on 0.6.6+ nodes + // this will not affect old nodes + gitem->setPriorityLevel(QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA); RsGxsTunnelSerialiser ser ; diff --git a/libretroshare/src/rsitems/itempriorities.h b/libretroshare/src/rsitems/itempriorities.h index b7f29babc..2707f3b62 100644 --- a/libretroshare/src/rsitems/itempriorities.h +++ b/libretroshare/src/rsitems/itempriorities.h @@ -25,70 +25,74 @@ // This file centralises QoS priorities for all transfer RsItems. // -const uint8_t QOS_PRIORITY_UNKNOWN = 0 ; -const uint8_t QOS_PRIORITY_DEFAULT = 3 ; -const uint8_t QOS_PRIORITY_TOP = 9 ; +const uint8_t QOS_PRIORITY_UNKNOWN = 0 ; +const uint8_t QOS_PRIORITY_DEFAULT = 3 ; +const uint8_t QOS_PRIORITY_TOP = 9 ; // Turtle traffic // -const uint8_t QOS_PRIORITY_RS_TURTLE_OPEN_TUNNEL = 6 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_TUNNEL_OK = 6 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST = 6 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST= 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 3 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_DATA = 3 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 3 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 3 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_ITEM = 3 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FORWARD_FILE_DATA= 3 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_DATA = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA= 7 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_OPEN_TUNNEL = 7 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_TUNNEL_OK = 7 ; + +const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_REQUEST = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_REQUEST = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP_REQUEST = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 6 ; // unused +const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST = 6 ; // unused + +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_DATA = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 5 ; // unused +const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 5 ; // unused + +const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA = 7 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_DATA = 5 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_ITEM = 3 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FORWARD_FILE_DATA = 3 ; // unused // File transfer // -const uint8_t QOS_PRIORITY_RS_FILE_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_CRC_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_CHUNK_CRC_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_MAP_REQUEST = 5 ; -const uint8_t QOS_PRIORITY_RS_CACHE_REQUEST = 4 ; -const uint8_t QOS_PRIORITY_RS_FILE_DATA = 3 ; -const uint8_t QOS_PRIORITY_RS_FILE_CRC = 3 ; -const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_MAP = 3 ; -const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; +const uint8_t QOS_PRIORITY_RS_FILE_REQUEST = 6 ; +const uint8_t QOS_PRIORITY_RS_FILE_MAP_REQUEST = 6 ; +const uint8_t QOS_PRIORITY_RS_FILE_CRC_REQUEST = 6 ; // unused +const uint8_t QOS_PRIORITY_RS_CHUNK_CRC_REQUEST = 6 ; + +const uint8_t QOS_PRIORITY_RS_FILE_DATA = 5 ; +const uint8_t QOS_PRIORITY_RS_FILE_MAP = 5 ; +const uint8_t QOS_PRIORITY_RS_FILE_CRC = 5 ; // unused +const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 5 ; + +const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; // unused // Discovery // -const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ; -const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 1 ; -const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 1 ; +const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ; +const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have -const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority. -const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 1 ; +const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have +const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority. +const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 2 ; // File database // -const uint8_t QOS_PRIORITY_RS_FAST_SYNC_REQUEST = 7 ; -const uint8_t QOS_PRIORITY_RS_SLOW_SYNC_REQUEST = 3 ; +const uint8_t QOS_PRIORITY_RS_FAST_SYNC_REQUEST = 7 ; +const uint8_t QOS_PRIORITY_RS_SLOW_SYNC_REQUEST = 3 ; // Heartbeat. // -const uint8_t QOS_PRIORITY_RS_HEARTBEAT_PULSE = 8 ; +const uint8_t QOS_PRIORITY_RS_HEARTBEAT_PULSE = 8 ; // Chat/Msgs // -const uint8_t QOS_PRIORITY_RS_CHAT_ITEM = 7 ; -const uint8_t QOS_PRIORITY_RS_CHAT_AVATAR_ITEM = 2 ; -const uint8_t QOS_PRIORITY_RS_MSG_ITEM = 2 ; // depreciated. -const uint8_t QOS_PRIORITY_RS_MAIL_ITEM = 2 ; // new mail service -const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ; +const uint8_t QOS_PRIORITY_RS_CHAT_ITEM = 7 ; +const uint8_t QOS_PRIORITY_RS_CHAT_AVATAR_ITEM = 2 ; +const uint8_t QOS_PRIORITY_RS_MSG_ITEM = 2 ; // depreciated. +const uint8_t QOS_PRIORITY_RS_MAIL_ITEM = 2 ; // new mail service +const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ; // RTT // @@ -96,23 +100,24 @@ const uint8_t QOS_PRIORITY_RS_RTT_PING = 9 ; // BanList // -const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 2 ; +const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 3 ; // Bandwidth Control. // -const uint8_t QOS_PRIORITY_RS_BWCTRL_ALLOWED_ITEM = 9 ; +const uint8_t QOS_PRIORITY_RS_BWCTRL_ALLOWED_ITEM = 9 ; // Dsdv Routing // -const uint8_t QOS_PRIORITY_RS_DSDV_ROUTE = 4 ; -const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ; +const uint8_t QOS_PRIORITY_RS_DSDV_ROUTE = 4 ; +const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ; // GXS // -const uint8_t QOS_PRIORITY_RS_GXS_NET = 3 ; +const uint8_t QOS_PRIORITY_RS_GXS_NET = 6 ; + // GXS Reputation. -const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 2; +const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 3; // Service Info / Control. -const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 7; +const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 8; diff --git a/libretroshare/src/turtle/rsturtleitem.h b/libretroshare/src/turtle/rsturtleitem.h index c13a22199..db029cc64 100644 --- a/libretroshare/src/turtle/rsturtleitem.h +++ b/libretroshare/src/turtle/rsturtleitem.h @@ -324,7 +324,7 @@ class RsTurtleGenericTunnelItem: public RsTurtleItem class RsTurtleGenericDataItem: public RsTurtleGenericTunnelItem { public: - RsTurtleGenericDataItem() : RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_GENERIC_DATA), data_size(0), data_bytes(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_FILE_REQUEST);} + RsTurtleGenericDataItem() : RsTurtleGenericTunnelItem(RS_TURTLE_SUBTYPE_GENERIC_DATA), data_size(0), data_bytes(0) { setPriorityLevel(QOS_PRIORITY_RS_TURTLE_GENERIC_DATA);} virtual ~RsTurtleGenericDataItem() { if(data_bytes != NULL) free(data_bytes) ; } virtual bool shouldStampTunnel() const { return true ; } From 9324d9de6cd836d222c5c9f66ad1d99928f2de75 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Wed, 25 Nov 2020 13:13:20 +0100 Subject: [PATCH 31/31] More optimization of priorities --- libretroshare/src/rsitems/itempriorities.h | 74 +++++++++++----------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/libretroshare/src/rsitems/itempriorities.h b/libretroshare/src/rsitems/itempriorities.h index 2707f3b62..a376a9d64 100644 --- a/libretroshare/src/rsitems/itempriorities.h +++ b/libretroshare/src/rsitems/itempriorities.h @@ -23,7 +23,7 @@ #include -// This file centralises QoS priorities for all transfer RsItems. +// This file centralises QoS priorities for all transfer RsItems // const uint8_t QOS_PRIORITY_UNKNOWN = 0 ; const uint8_t QOS_PRIORITY_DEFAULT = 3 ; @@ -41,9 +41,9 @@ const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC_REQUEST = 6 ; // unused const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC_REQUEST = 6 ; // unused const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_DATA = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 5 ; -const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 5 ; // unused -const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 5 ; // unused +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_MAP = 6 ; +const uint8_t QOS_PRIORITY_RS_TURTLE_FILE_CRC = 6 ; // unused +const uint8_t QOS_PRIORITY_RS_TURTLE_CHUNK_CRC = 6 ; // unused const uint8_t QOS_PRIORITY_RS_TURTLE_GENERIC_FAST_DATA = 7 ; const uint8_t QOS_PRIORITY_RS_TURTLE_SEARCH_RESULT = 6 ; @@ -59,65 +59,67 @@ const uint8_t QOS_PRIORITY_RS_FILE_CRC_REQUEST = 6 ; // unused const uint8_t QOS_PRIORITY_RS_CHUNK_CRC_REQUEST = 6 ; const uint8_t QOS_PRIORITY_RS_FILE_DATA = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_MAP = 5 ; -const uint8_t QOS_PRIORITY_RS_FILE_CRC = 5 ; // unused -const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 5 ; +const uint8_t QOS_PRIORITY_RS_FILE_MAP = 6 ; +const uint8_t QOS_PRIORITY_RS_FILE_CRC = 6 ; // unused +const uint8_t QOS_PRIORITY_RS_CHUNK_CRC = 6 ; const uint8_t QOS_PRIORITY_RS_CACHE_ITEM = 3 ; // unused // Discovery // -const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ; -const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_HEART_BEAT = 8 ; +const uint8_t QOS_PRIORITY_RS_DISC_ASK_INFO = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_REPLY = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_VERSION = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have -const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority. -const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ; -const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_CONTACT = 2 ; // CONTACT and PGPLIST must have +const uint8_t QOS_PRIORITY_RS_DISC_PGP_LIST = 2 ; // same priority +const uint8_t QOS_PRIORITY_RS_DISC_SERVICES = 2 ; +const uint8_t QOS_PRIORITY_RS_DISC_PGP_CERT = 2 ; // File database // -const uint8_t QOS_PRIORITY_RS_FAST_SYNC_REQUEST = 7 ; -const uint8_t QOS_PRIORITY_RS_SLOW_SYNC_REQUEST = 3 ; +const uint8_t QOS_PRIORITY_RS_FAST_SYNC_REQUEST = 7 ; +const uint8_t QOS_PRIORITY_RS_SLOW_SYNC_REQUEST = 3 ; -// Heartbeat. +// Heartbeat // -const uint8_t QOS_PRIORITY_RS_HEARTBEAT_PULSE = 8 ; +const uint8_t QOS_PRIORITY_RS_HEARTBEAT_PULSE = 8 ; // Chat/Msgs // -const uint8_t QOS_PRIORITY_RS_CHAT_ITEM = 7 ; -const uint8_t QOS_PRIORITY_RS_CHAT_AVATAR_ITEM = 2 ; -const uint8_t QOS_PRIORITY_RS_MSG_ITEM = 2 ; // depreciated. -const uint8_t QOS_PRIORITY_RS_MAIL_ITEM = 2 ; // new mail service -const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ; +const uint8_t QOS_PRIORITY_RS_CHAT_ITEM = 7 ; +const uint8_t QOS_PRIORITY_RS_CHAT_AVATAR_ITEM = 2 ; +const uint8_t QOS_PRIORITY_RS_MSG_ITEM = 2 ; // deprecated +const uint8_t QOS_PRIORITY_RS_MAIL_ITEM = 2 ; // new mail service +const uint8_t QOS_PRIORITY_RS_STATUS_ITEM = 2 ; // RTT // -const uint8_t QOS_PRIORITY_RS_RTT_PING = 9 ; +const uint8_t QOS_PRIORITY_RS_RTT_PING = 9 ; // BanList // -const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 3 ; +const uint8_t QOS_PRIORITY_RS_BANLIST_ITEM = 3 ; -// Bandwidth Control. +// Bandwidth Control // -const uint8_t QOS_PRIORITY_RS_BWCTRL_ALLOWED_ITEM = 9 ; +const uint8_t QOS_PRIORITY_RS_BWCTRL_ALLOWED_ITEM = 9 ; -// Dsdv Routing +// DsDv Routing // -const uint8_t QOS_PRIORITY_RS_DSDV_ROUTE = 4 ; -const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ; +const uint8_t QOS_PRIORITY_RS_DSDV_ROUTE = 4 ; +const uint8_t QOS_PRIORITY_RS_DSDV_DATA = 2 ; // GXS // -const uint8_t QOS_PRIORITY_RS_GXS_NET = 6 ; +const uint8_t QOS_PRIORITY_RS_GXS_NET = 6 ; -// GXS Reputation. -const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 3; +// GXS Reputation +// +const uint8_t QOS_PRIORITY_RS_GXSREPUTATION_ITEM = 3 ; -// Service Info / Control. -const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 8; +// Service Info / Control +// +const uint8_t QOS_PRIORITY_RS_SERVICE_INFO_ITEM = 8 ;