From b3f55c5b51eae216aa4673966b0c668558fd7b74 Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 9 Apr 2023 18:48:15 +0530 Subject: [PATCH 1/2] Revert "Revert "Adeed a new spin box in the gui to track the variable which stores the maximum size limit allowed for autodownload in channels."" This reverts commit e89ad86da05b5636303e24bd9d3f3944e592bd2c. revert the reverted commits --- .../src/gui/settings/ChannelPage.cpp | 22 +++++- retroshare-gui/src/gui/settings/ChannelPage.h | 9 ++- .../src/gui/settings/ChannelPage.ui | 70 +++++++++++++------ 3 files changed, 76 insertions(+), 25 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChannelPage.cpp b/retroshare-gui/src/gui/settings/ChannelPage.cpp index ef2fa6307..28f4d4f66 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.cpp +++ b/retroshare-gui/src/gui/settings/ChannelPage.cpp @@ -22,6 +22,8 @@ #include "rsharesettings.h" #include "util/misc.h" #include "gui/notifyqt.h" +#include "../../libretroshare/src/retroshare/rsgxschannels.h" +#include "../../libretroshare/src/services/p3gxschannels.h" ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) : ConfigPage(parent, flags) @@ -33,7 +35,10 @@ ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each channel in a new tab")); ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ; - connect(ui.emoteicon_checkBox,SIGNAL(toggled(bool)),this,SLOT(updateEmotes())) ; + connect(ui.emoteicon_checkBox,SIGNAL(toggled(bool)),this,SLOT(updateEmotes())) ; + + // Connecting the spin box with the maximum auto download size in channels + connect(ui.autoDownloadSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateMaxAutoDownloadSizeLimit(int))); } @@ -49,6 +54,13 @@ void ChannelPage::load() Settings->beginGroup(QString("ChannelPostsWidget")); whileBlocking(ui.emoteicon_checkBox)->setChecked(Settings->value("Emoteicons_ChannelDecription", true).toBool()); Settings->endGroup(); + + // Getting the maximum auto download size from the configuration + uint64_t maxAutoDownloadSize; + rsGxsChannels->getMaxAutoDownloadSizeLimit(maxAutoDownloadSize); + int temp=(maxAutoDownloadSize/(Size_Of_1_GB)); + whileBlocking(ui.autoDownloadSpinBox)->setValue(temp); + } void ChannelPage::updateEmotes() @@ -57,3 +69,11 @@ void ChannelPage::updateEmotes() Settings->setValue("Emoteicons_ChannelDecription", ui.emoteicon_checkBox->isChecked()); Settings->endGroup(); } + +// Function to update the maximum size allowed for auto download in channels +void ChannelPage::updateMaxAutoDownloadSizeLimit(int value) +{ + uint64_t temp=(static_cast(value)*Size_Of_1_GB); + rsGxsChannels->setMaxAutoDownloadSizeLimit(temp); +} + diff --git a/retroshare-gui/src/gui/settings/ChannelPage.h b/retroshare-gui/src/gui/settings/ChannelPage.h index 93f32cabc..3b5b43a77 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.h +++ b/retroshare-gui/src/gui/settings/ChannelPage.h @@ -25,6 +25,8 @@ #include "ui_ChannelPage.h" #include "gui/common/FilesDefs.h" +#define Size_Of_1_GB (1024 * 1024 * 1024) // It is the size of 1 GB in bytes. + class ChannelPage : public ConfigPage { Q_OBJECT @@ -34,7 +36,7 @@ public: ~ChannelPage(); /** Loads the settings for this page */ - virtual void load(); + virtual void load(); virtual QPixmap iconPixmap() const { return FilesDefs::getPixmapFromQtResourcePath(":/icons/settings/channels.svg") ; } virtual QString pageName() const { return tr("Channels") ; } @@ -42,7 +44,10 @@ public: private slots: void updateEmotes(); - + + // Function to update the maximum size allowed for auto download in channels + void updateMaxAutoDownloadSizeLimit(int value); + private: Ui::ChannelPage ui; }; diff --git a/retroshare-gui/src/gui/settings/ChannelPage.ui b/retroshare-gui/src/gui/settings/ChannelPage.ui index 5e75e442e..38b3426e9 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.ui +++ b/retroshare-gui/src/gui/settings/ChannelPage.ui @@ -6,22 +6,23 @@ 0 0 - 423 + 526 334 - - - - - Tabs + + + + + Qt::Vertical - - - - - - + + + 20 + 5 + + + @@ -39,18 +40,43 @@ + + + + Tabs + + + + + + + + - - - Qt::Vertical + + + Downloads - - - 20 - 40 - - - + + + + + 1 + + + 200 + + + + + + + Maximum Auto Download Size (in GBs) + + + + + From 23dd7270f9f92a6639a3dd44c09be28b923ef7d0 Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 9 Apr 2023 22:07:35 +0530 Subject: [PATCH 2/2] Revert "Merge remote-tracking branch 'upstream/master'" This reverts commit c390af58449d96f2178d5b4c3de03277e455225c, reversing changes made to 1553508776059b465e5f4863ef2f30511b4b5b7b. bad commit needs to be reverted --- libbitdht | 2 +- libretroshare | 2 +- .../src/gui/settings/ChannelPage.cpp | 22 +----- retroshare-gui/src/gui/settings/ChannelPage.h | 9 +-- .../src/gui/settings/ChannelPage.ui | 70 ++++++------------- 5 files changed, 27 insertions(+), 78 deletions(-) diff --git a/libbitdht b/libbitdht index 2ddc86fb5..659423769 160000 --- a/libbitdht +++ b/libbitdht @@ -1 +1 @@ -Subproject commit 2ddc86fb575a61170f4c06a00152e3e7dc74c8f4 +Subproject commit 659423769541169457c41f71c8a038e2d64ba079 diff --git a/libretroshare b/libretroshare index 036107c6a..74cd958cf 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 036107c6ace161832100776077a11a3d1657d291 +Subproject commit 74cd958cf8a3c8b3e2d3f8a22657b5e16bdad476 diff --git a/retroshare-gui/src/gui/settings/ChannelPage.cpp b/retroshare-gui/src/gui/settings/ChannelPage.cpp index 28f4d4f66..ef2fa6307 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.cpp +++ b/retroshare-gui/src/gui/settings/ChannelPage.cpp @@ -22,8 +22,6 @@ #include "rsharesettings.h" #include "util/misc.h" #include "gui/notifyqt.h" -#include "../../libretroshare/src/retroshare/rsgxschannels.h" -#include "../../libretroshare/src/services/p3gxschannels.h" ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) : ConfigPage(parent, flags) @@ -35,10 +33,7 @@ ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each channel in a new tab")); ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ; - connect(ui.emoteicon_checkBox,SIGNAL(toggled(bool)),this,SLOT(updateEmotes())) ; - - // Connecting the spin box with the maximum auto download size in channels - connect(ui.autoDownloadSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateMaxAutoDownloadSizeLimit(int))); + connect(ui.emoteicon_checkBox,SIGNAL(toggled(bool)),this,SLOT(updateEmotes())) ; } @@ -54,13 +49,6 @@ void ChannelPage::load() Settings->beginGroup(QString("ChannelPostsWidget")); whileBlocking(ui.emoteicon_checkBox)->setChecked(Settings->value("Emoteicons_ChannelDecription", true).toBool()); Settings->endGroup(); - - // Getting the maximum auto download size from the configuration - uint64_t maxAutoDownloadSize; - rsGxsChannels->getMaxAutoDownloadSizeLimit(maxAutoDownloadSize); - int temp=(maxAutoDownloadSize/(Size_Of_1_GB)); - whileBlocking(ui.autoDownloadSpinBox)->setValue(temp); - } void ChannelPage::updateEmotes() @@ -69,11 +57,3 @@ void ChannelPage::updateEmotes() Settings->setValue("Emoteicons_ChannelDecription", ui.emoteicon_checkBox->isChecked()); Settings->endGroup(); } - -// Function to update the maximum size allowed for auto download in channels -void ChannelPage::updateMaxAutoDownloadSizeLimit(int value) -{ - uint64_t temp=(static_cast(value)*Size_Of_1_GB); - rsGxsChannels->setMaxAutoDownloadSizeLimit(temp); -} - diff --git a/retroshare-gui/src/gui/settings/ChannelPage.h b/retroshare-gui/src/gui/settings/ChannelPage.h index 3b5b43a77..93f32cabc 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.h +++ b/retroshare-gui/src/gui/settings/ChannelPage.h @@ -25,8 +25,6 @@ #include "ui_ChannelPage.h" #include "gui/common/FilesDefs.h" -#define Size_Of_1_GB (1024 * 1024 * 1024) // It is the size of 1 GB in bytes. - class ChannelPage : public ConfigPage { Q_OBJECT @@ -36,7 +34,7 @@ public: ~ChannelPage(); /** Loads the settings for this page */ - virtual void load(); + virtual void load(); virtual QPixmap iconPixmap() const { return FilesDefs::getPixmapFromQtResourcePath(":/icons/settings/channels.svg") ; } virtual QString pageName() const { return tr("Channels") ; } @@ -44,10 +42,7 @@ public: private slots: void updateEmotes(); - - // Function to update the maximum size allowed for auto download in channels - void updateMaxAutoDownloadSizeLimit(int value); - + private: Ui::ChannelPage ui; }; diff --git a/retroshare-gui/src/gui/settings/ChannelPage.ui b/retroshare-gui/src/gui/settings/ChannelPage.ui index 38b3426e9..5e75e442e 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.ui +++ b/retroshare-gui/src/gui/settings/ChannelPage.ui @@ -6,23 +6,22 @@ 0 0 - 526 + 423 334 - - - - - Qt::Vertical + + + + + Tabs - - - 20 - 5 - - - + + + + + + @@ -40,43 +39,18 @@ - - - - Tabs - - - - - - - - - - - Downloads + + + Qt::Vertical - - - - - 1 - - - 200 - - - - - - - Maximum Auto Download Size (in GBs) - - - - - + + + 20 + 40 + + +