Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit c390af5844, reversing
changes made to 1553508776.

bad commit needs to be reverted
This commit is contained in:
Tushar Garg 2023-04-09 22:07:35 +05:30
parent b3f55c5b51
commit 23dd7270f9
5 changed files with 27 additions and 78 deletions

@ -1 +1 @@
Subproject commit 2ddc86fb575a61170f4c06a00152e3e7dc74c8f4 Subproject commit 659423769541169457c41f71c8a038e2d64ba079

@ -1 +1 @@
Subproject commit 036107c6ace161832100776077a11a3d1657d291 Subproject commit 74cd958cf8a3c8b3e2d3f8a22657b5e16bdad476

View File

@ -22,8 +22,6 @@
#include "rsharesettings.h" #include "rsharesettings.h"
#include "util/misc.h" #include "util/misc.h"
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "../../libretroshare/src/retroshare/rsgxschannels.h"
#include "../../libretroshare/src/services/p3gxschannels.h"
ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags) ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
: ConfigPage(parent, 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->setOpenAllInNewTabText(tr("Open each channel in a new tab"));
ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ; 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)));
} }
@ -54,13 +49,6 @@ void ChannelPage::load()
Settings->beginGroup(QString("ChannelPostsWidget")); Settings->beginGroup(QString("ChannelPostsWidget"));
whileBlocking(ui.emoteicon_checkBox)->setChecked(Settings->value("Emoteicons_ChannelDecription", true).toBool()); whileBlocking(ui.emoteicon_checkBox)->setChecked(Settings->value("Emoteicons_ChannelDecription", true).toBool());
Settings->endGroup(); 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() void ChannelPage::updateEmotes()
@ -69,11 +57,3 @@ void ChannelPage::updateEmotes()
Settings->setValue("Emoteicons_ChannelDecription", ui.emoteicon_checkBox->isChecked()); Settings->setValue("Emoteicons_ChannelDecription", ui.emoteicon_checkBox->isChecked());
Settings->endGroup(); Settings->endGroup();
} }
// Function to update the maximum size allowed for auto download in channels
void ChannelPage::updateMaxAutoDownloadSizeLimit(int value)
{
uint64_t temp=(static_cast<uint64_t>(value)*Size_Of_1_GB);
rsGxsChannels->setMaxAutoDownloadSizeLimit(temp);
}

View File

@ -25,8 +25,6 @@
#include "ui_ChannelPage.h" #include "ui_ChannelPage.h"
#include "gui/common/FilesDefs.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 class ChannelPage : public ConfigPage
{ {
Q_OBJECT Q_OBJECT
@ -36,7 +34,7 @@ public:
~ChannelPage(); ~ChannelPage();
/** Loads the settings for this page */ /** Loads the settings for this page */
virtual void load(); virtual void load();
virtual QPixmap iconPixmap() const { return FilesDefs::getPixmapFromQtResourcePath(":/icons/settings/channels.svg") ; } virtual QPixmap iconPixmap() const { return FilesDefs::getPixmapFromQtResourcePath(":/icons/settings/channels.svg") ; }
virtual QString pageName() const { return tr("Channels") ; } virtual QString pageName() const { return tr("Channels") ; }
@ -44,10 +42,7 @@ public:
private slots: private slots:
void updateEmotes(); void updateEmotes();
// Function to update the maximum size allowed for auto download in channels
void updateMaxAutoDownloadSizeLimit(int value);
private: private:
Ui::ChannelPage ui; Ui::ChannelPage ui;
}; };

View File

@ -6,23 +6,22 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>526</width> <width>423</width>
<height>334</height> <height>334</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout_3">
<item row="3" column="0"> <item row="1" column="0">
<spacer name="verticalSpacer"> <widget class="QGroupBox" name="tabsGroupBox">
<property name="orientation"> <property name="title">
<enum>Qt::Vertical</enum> <string>Tabs</string>
</property> </property>
<property name="sizeHint" stdset="0"> <layout class="QVBoxLayout" name="verticalLayout">
<size> <item>
<width>20</width> <widget class="GroupFrameSettingsWidget" name="groupFrameSettingsWidget" native="true"/>
<height>5</height> </item>
</size> </layout>
</property> </widget>
</spacer>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="generalGroupBox"> <widget class="QGroupBox" name="generalGroupBox">
@ -40,43 +39,18 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QGroupBox" name="tabsGroupBox">
<property name="title">
<string>Tabs</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="GroupFrameSettingsWidget" name="groupFrameSettingsWidget" native="true"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QGroupBox" name="downloadsGroupBox"> <spacer name="verticalSpacer">
<property name="title"> <property name="orientation">
<string>Downloads</string> <enum>Qt::Vertical</enum>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <property name="sizeHint" stdset="0">
<item row="0" column="0"> <size>
<widget class="QSpinBox" name="autoDownloadSpinBox"> <width>20</width>
<property name="minimum"> <height>40</height>
<number>1</number> </size>
</property> </property>
<property name="maximum"> </spacer>
<number>200</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Maximum Auto Download Size (in GBs)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>