From 4f1bdbca7090ce51845dc2a035d902aa8f83ff9a Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 2 Apr 2023 15:22:36 +0530 Subject: [PATCH 1/7] commiting changes --- libbitdht | 2 +- libretroshare | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libbitdht b/libbitdht index 659423769..2ddc86fb5 160000 --- a/libbitdht +++ b/libbitdht @@ -1 +1 @@ -Subproject commit 659423769541169457c41f71c8a038e2d64ba079 +Subproject commit 2ddc86fb575a61170f4c06a00152e3e7dc74c8f4 diff --git a/libretroshare b/libretroshare index 74cd958cf..036107c6a 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 74cd958cf8a3c8b3e2d3f8a22657b5e16bdad476 +Subproject commit 036107c6ace161832100776077a11a3d1657d291 From 7dabc1ff9b896943cc8df76aa5e99abdb5368a40 Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 9 Apr 2023 18:10:16 +0530 Subject: [PATCH 2/7] Adeed a new spin box in the gui to track the variable which stores the maximum size limit allowed for autodownload in channels. This spin box was linked to the variable from the p3gxschannel.h file. This spin box has 8GB as it's default value. --- .../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 e89ad86da05b5636303e24bd9d3f3944e592bd2c Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 9 Apr 2023 18:34:08 +0530 Subject: [PATCH 3/7] 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 7dabc1ff9b896943cc8df76aa5e99abdb5368a40. Forgot to open a new branch --- .../src/gui/settings/ChannelPage.cpp | 22 +----- retroshare-gui/src/gui/settings/ChannelPage.h | 9 +-- .../src/gui/settings/ChannelPage.ui | 70 ++++++------------- 3 files changed, 25 insertions(+), 76 deletions(-) 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 + + + From b3f55c5b51eae216aa4673966b0c668558fd7b74 Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 9 Apr 2023 18:48:15 +0530 Subject: [PATCH 4/7] 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 2fe8bcc8fd28fbcb02c4bc5ffa4e229b1b1144d4 Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 9 Apr 2023 22:03:45 +0530 Subject: [PATCH 5/7] 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 +- 2 files changed, 2 insertions(+), 2 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 From 23dd7270f9f92a6639a3dd44c09be28b923ef7d0 Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Sun, 9 Apr 2023 22:07:35 +0530 Subject: [PATCH 6/7] 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 + + + From fe92431cb6c0a1f00b45dda0161d715cd62f3719 Mon Sep 17 00:00:00 2001 From: Tushar Garg Date: Mon, 10 Apr 2023 07:06:59 +0530 Subject: [PATCH 7/7] This is the UI part of the auto download adjustable size feature. --- .../src/gui/settings/ChannelPage.cpp | 18 +++++ retroshare-gui/src/gui/settings/ChannelPage.h | 5 ++ .../src/gui/settings/ChannelPage.ui | 70 +++++++++++++------ 3 files changed, 71 insertions(+), 22 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChannelPage.cpp b/retroshare-gui/src/gui/settings/ChannelPage.cpp index ef2fa6307..857cc972e 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.cpp +++ b/retroshare-gui/src/gui/settings/ChannelPage.cpp @@ -22,6 +22,7 @@ #include "rsharesettings.h" #include "util/misc.h" #include "gui/notifyqt.h" +#include "retroshare/rsgxschannels.h" ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) : ConfigPage(parent, flags) @@ -35,6 +36,9 @@ ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) 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))); + } ChannelPage::~ChannelPage() @@ -49,6 +53,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 +68,10 @@ 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..adb573711 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 @@ -43,6 +45,9 @@ 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..8ea42f71a 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) + + + + +