From ef25a9079d6b2887026410643010f87f2a9cb6c5 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 8 Jul 2025 22:06:28 +0200 Subject: [PATCH 1/8] fixed using the right version of cmake > 3.5 --- retroshare.pri | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/retroshare.pri b/retroshare.pri index 2e8bb729a..18207838d 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -520,6 +520,18 @@ trough qmake command line arguments!") } } +# Some supportlibs compilation won't start if the intstalled CMAKE verison is >=3.5. +# Force compilation in that case +CMAKE_FORCE_MINVERSION="" +CMAKE_VERSION_SPLIT = $$system(cmake --version) +CMAKE_VERSION_SPLIT = $$split(CMAKE_VERSION_SPLIT, \\s+) +CMAKE_VERSION = $$member(CMAKE_VERSION_SPLIT, 2) +message("Cmake version detected: $${CMAKE_VERSION}") +versionAtLeast(CMAKE_VERSION, 3.5) { + warning("Forcing compilation with CMAKE_POLICY_VERSION_MINIMUM=3.5") + CMAKE_FORCE_MINVERSION="-DCMAKE_POLICY_VERSION_MINIMUM=3.5" +} + gxsdistsync:DEFINES *= RS_USE_GXS_DISTANT_SYNC wikipoos:DEFINES *= RS_USE_WIKI rs_gxs:DEFINES *= RS_ENABLE_GXS From d165a84b679342563d755f1895eddf513e602931 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Fri, 11 Jul 2025 16:35:19 +0200 Subject: [PATCH 2/8] Windows-msys2 build.bat add asio --- build_scripts/Windows-msys2/build/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/Windows-msys2/build/build.bat b/build_scripts/Windows-msys2/build/build.bat index bf68f3e20..e72ab3d1d 100644 --- a/build_scripts/Windows-msys2/build/build.bat +++ b/build_scripts/Windows-msys2/build/build.bat @@ -22,7 +22,7 @@ if not "%ParamNoupdate%"=="1" ( %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-json-c mingw-w64-%RsMSYS2Architecture%-libbotan" :: Webui - if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen" + if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen mingw-w64-%RsMSYS2Architecture%-asio" :: Plugins if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg" From 500ab2098bb991ca7f742c8cabd8947a01bfa97c Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 8 Jul 2025 22:48:05 +0200 Subject: [PATCH 3/8] Added asio as external library for Windows native compile --- build_scripts/Windows/build-libs/Makefile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile index 534356914..f1649d91f 100644 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -13,6 +13,7 @@ LIBMICROHTTPD_VERSION=0.9.75 FFMPEG_VERSION=4.4 RAPIDJSON_VERSION=1.1.0 XAPIAN_VERSION=1.4.19 +ASIO_VERSION=1-34-2 #RNP_VERSION=0.17.1 # libaries for rnp @@ -23,7 +24,7 @@ DOWNLOAD_PATH?=download BUILD_PATH=build LIBS_PATH?=libs -all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan copylibs +all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan asio copylibs #rnp download: \ @@ -398,6 +399,20 @@ $(BUILD_PATH)/botan-$(BOTAN_VERSION): rm -r -f botan-$(BOTAN_VERSION) mv $(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp $(BUILD_PATH)/botan-$(BOTAN_VERSION) +asio: $(BUILD_PATH)/asio-$(ASIO_VERSION) + +$(BUILD_PATH)/asio-$(ASIO_VERSION): + # prepare + rm -r -f $(BUILD_PATH)/asio-* + [ -d "asio-$(ASIO_VERSION)" ] || git clone https://github.com/chriskohlhoff/asio.git --depth=1 --branch asio-$(ASIO_VERSION) "asio-$(ASIO_VERSION)" + # copy files + mkdir -p $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp/include/asio + cp asio-$(ASIO_VERSION)/asio/include/*.hpp $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp/include/ + cp -r asio-$(ASIO_VERSION)/asio/include/asio/* $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp/include/asio/ + # cleanup + rm -r -f asio-$(ASIO_VERSION) + mv $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp $(BUILD_PATH)/asio-$(ASIO_VERSION) + rnp: $(BUILD_PATH)/rnp-$(RNP_VERSION) $(BUILD_PATH)/rnp-$(RNP_VERSION): From 42bd651fb3c19b0c1f44a598fe94ee7cf51fdd07 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Thu, 10 Jul 2025 22:27:33 +0200 Subject: [PATCH 4/8] Update MSYS2 packages --- .../WindowsMSys2_InstallGuide.md | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md index 2105112f1..2254776c7 100644 --- a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md +++ b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md @@ -18,8 +18,8 @@ At the end, you'll get at ..\\*-msys2\deploy\ the Portable 7zip file. ### MSYS2 INSTALLATION (for editing or debugging) -Download MSYS2 from [MSYS2](http://www.msys2.org/). Get the i686 version -if you run a 32-bit Windows or the x86_64 if you run a 64-bit Windows. +Download MSYS2 from [MSYS2](http://www.msys2.org/). Installing +MSYS2 requires 64 bit Windows 10 or newer. Run the installer and install MSYS2. @@ -40,26 +40,28 @@ Run MSYS2 MSYS again and finish updating with: Install the default programs needed to build: - pacman -S base-devel git wget p7zip gcc perl ruby python2 doxygen cmake + pacman -S base-devel git wget p7zip gcc perl ruby doxygen cmake -Install the 32-bit toolchain: +Install the 64-bit toolchain: - pacman -S mingw-w64-i686-toolchain + pacman -S mingw-w64-x86_64-toolchain Install all needed dependencies: - pacman -S mingw-w64-i686-miniupnpc - pacman -S mingw-w64-i686-libmicrohttpd - pacman -S mingw-w64-i686-libxslt - pacman -S mingw-w64-i686-xapian-core - pacman -S mingw-w64-i686-sqlcipher - pacman -S mingw-w64-i686-qt5 - pacman -S mingw32/mingw-w64-i686-cmake - pacman -S mingw-w64-i686-rapidjson + pacman -S mingw-w64-x86_64-miniupnpc + pacman -S mingw-w64-x86_64-libxslt + pacman -S mingw-w64-x86_64-xapian-core + pacman -S mingw-w64-x86_64-sqlcipher + pacman -S mingw-w64-x86_64-qt5-base + pacman -S mingw-w64-x86_64-qt5-multimedia + pacman -S mingw-w64-x86_64-ccmake + pacman -S mingw-w64-x86_64-rapidjson + pacman -S mingw-w64-x86_64-json-c + pacman -S mingw-w64-x86_64-libbotan If you want to use QtCreator as IDE, prefer using this one publish by MSYS2 as all build Kit are already setted. - pacman -S mingw-w64-i686-qt-creator + pacman -S mingw-w64-x86_64-qt-creator *You can start it from MSYS2 terminal.* @@ -67,7 +69,7 @@ We're done installing MSYS2, close the shell terminal. ### BUILDING RETROSHARE -Now run the MSYS2 MinGW 32-bit shell terminal (it's in the start menu). +Now run the MSYS2 MinGW 64-bit shell terminal (it's in the start menu). We will use it to checkout Retroshare and build it: git clone https://github.com/RetroShare/RetroShare.git From 8c26fa879d3246116f85e6da84559cf11b176525 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Fri, 11 Jul 2025 18:37:33 +0200 Subject: [PATCH 5/8] Added asio depency --- build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md | 1 + 1 file changed, 1 insertion(+) diff --git a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md index 2254776c7..a0d1b67b6 100644 --- a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md +++ b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md @@ -58,6 +58,7 @@ Install all needed dependencies: pacman -S mingw-w64-x86_64-rapidjson pacman -S mingw-w64-x86_64-json-c pacman -S mingw-w64-x86_64-libbotan + pacman -S mingw-w64-x86_64-asio If you want to use QtCreator as IDE, prefer using this one publish by MSYS2 as all build Kit are already setted. From 1094e3e65133e716bf31f1923c51173d5aaf22a8 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 13 Jul 2025 14:30:15 +0200 Subject: [PATCH 6/8] FeedReader: Moved proxy setting to own widget --- plugins/FeedReader/FeedReader.pro | 5 +- plugins/FeedReader/gui/AddFeedDialog.cpp | 11 ++-- plugins/FeedReader/gui/AddFeedDialog.ui | 38 ++++---------- plugins/FeedReader/gui/FeedReaderConfig.cpp | 15 +++--- plugins/FeedReader/gui/FeedReaderConfig.ui | 40 +++++---------- plugins/FeedReader/gui/ProxyWidget.cpp | 38 ++++++++++++++ plugins/FeedReader/gui/ProxyWidget.h | 31 +++++++++++ plugins/FeedReader/gui/ProxyWidget.ui | 57 +++++++++++++++++++++ 8 files changed, 165 insertions(+), 70 deletions(-) create mode 100644 plugins/FeedReader/gui/ProxyWidget.cpp create mode 100644 plugins/FeedReader/gui/ProxyWidget.h create mode 100644 plugins/FeedReader/gui/ProxyWidget.ui diff --git a/plugins/FeedReader/FeedReader.pro b/plugins/FeedReader/FeedReader.pro index 5c696b5c3..e9a352b33 100644 --- a/plugins/FeedReader/FeedReader.pro +++ b/plugins/FeedReader/FeedReader.pro @@ -45,6 +45,7 @@ SOURCES = FeedReaderPlugin.cpp \ gui/FeedReaderUserNotify.cpp \ gui/FeedReaderFeedItem.cpp \ gui/FeedTreeWidget.cpp \ + gui/ProxyWidget.cpp \ util/CURLWrapper.cpp \ util/XMLWrapper.cpp \ util/HTMLWrapper.cpp \ @@ -66,6 +67,7 @@ HEADERS = FeedReaderPlugin.h \ gui/FeedReaderUserNotify.h \ gui/FeedReaderFeedItem.h \ gui/FeedTreeWidget.h \ + gui/ProxyWidget.h \ util/CURLWrapper.h \ util/XMLWrapper.h \ util/HTMLWrapper.h \ @@ -76,7 +78,8 @@ FORMS = gui/FeedReaderDialog.ui \ gui/AddFeedDialog.ui \ gui/PreviewFeedDialog.ui \ gui/FeedReaderConfig.ui \ - gui/FeedReaderFeedItem.ui + gui/FeedReaderFeedItem.ui \ + gui/ProxyWidget.ui TARGET = FeedReader diff --git a/plugins/FeedReader/gui/AddFeedDialog.cpp b/plugins/FeedReader/gui/AddFeedDialog.cpp index 59baf908a..b6e781c4b 100644 --- a/plugins/FeedReader/gui/AddFeedDialog.cpp +++ b/plugins/FeedReader/gui/AddFeedDialog.cpp @@ -180,8 +180,7 @@ void AddFeedDialog::useStandardUpdateIntervalToggled() void AddFeedDialog::useStandardProxyToggled() { bool checked = ui->useStandardProxyCheckBox->isChecked(); - ui->proxyAddressLineEdit->setEnabled(!checked); - ui->proxyPortSpinBox->setEnabled(!checked); + ui->proxyWidget->setEnabled(!checked); } void AddFeedDialog::typeForumToggled() @@ -335,8 +334,8 @@ bool AddFeedDialog::fillFeed(uint32_t feedId) ui->passwordLineEdit->setText(QString::fromUtf8(feedInfo.password.c_str())); ui->useStandardProxyCheckBox->setChecked(feedInfo.flag.standardProxy); - ui->proxyAddressLineEdit->setText(QString::fromUtf8(feedInfo.proxyAddress.c_str())); - ui->proxyPortSpinBox->setValue(feedInfo.proxyPort); + ui->proxyWidget->setAddress(QString::fromUtf8(feedInfo.proxyAddress.c_str())); + ui->proxyWidget->setPort(feedInfo.proxyPort); ui->useStandardUpdateInterval->setChecked(feedInfo.flag.standardUpdateInterval); ui->updateIntervalSpinBox->setValue(feedInfo.updateInterval / 60); @@ -425,8 +424,8 @@ void AddFeedDialog::getFeedInfo(FeedInfo &feedInfo) feedInfo.password = ui->passwordLineEdit->text().toUtf8().constData(); feedInfo.flag.standardProxy = ui->useStandardProxyCheckBox->isChecked(); - feedInfo.proxyAddress = ui->proxyAddressLineEdit->text().toUtf8().constData(); - feedInfo.proxyPort = ui->proxyPortSpinBox->value(); + feedInfo.proxyAddress = ui->proxyWidget->address().toUtf8().constData(); + feedInfo.proxyPort = ui->proxyWidget->port(); feedInfo.flag.standardUpdateInterval = ui->useStandardUpdateInterval->isChecked(); feedInfo.updateInterval = ui->updateIntervalSpinBox->value() * 60; diff --git a/plugins/FeedReader/gui/AddFeedDialog.ui b/plugins/FeedReader/gui/AddFeedDialog.ui index ebb478162..569578473 100644 --- a/plugins/FeedReader/gui/AddFeedDialog.ui +++ b/plugins/FeedReader/gui/AddFeedDialog.ui @@ -133,37 +133,16 @@ Proxy - - + + Use standard proxy - - - - Server - - - - - - - - - - : - - - - - - - 65535 - - + + @@ -465,6 +444,12 @@ QComboBox
gui/common/RSComboBox.h
+ + ProxyWidget + QWidget +
gui/ProxyWidget.h
+ 1 +
urlLineEdit @@ -494,8 +479,7 @@ useStandardUpdateInterval updateIntervalSpinBox useStandardProxyCheckBox - proxyAddressLineEdit - proxyPortSpinBox + proxyWidget diff --git a/plugins/FeedReader/gui/FeedReaderConfig.cpp b/plugins/FeedReader/gui/FeedReaderConfig.cpp index 89456e3da..91b24f394 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.cpp +++ b/plugins/FeedReader/gui/FeedReaderConfig.cpp @@ -31,8 +31,7 @@ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags) /* Invoke the Qt Designer generated object setup routine */ ui->setupUi(this); - ui->proxyAddressLineEdit->setEnabled(false); - ui->proxyPortSpinBox->setEnabled(false); + ui->proxyWidget->setEnabled(false); /* Connect signals */ connect(ui->updateIntervalSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this]() { @@ -51,8 +50,7 @@ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags) 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->proxyWidget, &ProxyWidget::changed, this, &FeedReaderConfig::updateProxy); connect(ui->useProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useProxyToggled())); } @@ -75,8 +73,8 @@ void FeedReaderConfig::load() std::string proxyAddress; uint16_t proxyPort; whileBlocking(ui->useProxyCheckBox)->setChecked(rsFeedReader->getStandardProxy(proxyAddress, proxyPort)); - whileBlocking(ui->proxyAddressLineEdit)->setText(QString::fromUtf8(proxyAddress.c_str())); - whileBlocking(ui->proxyPortSpinBox)->setValue(proxyPort); + whileBlocking(ui->proxyWidget)->setAddress(QString::fromUtf8(proxyAddress.c_str())); + whileBlocking(ui->proxyWidget)->setPort(proxyPort); loaded = true; @@ -87,11 +85,10 @@ void FeedReaderConfig::useProxyToggled() { bool enabled = ui->useProxyCheckBox->isChecked(); - ui->proxyAddressLineEdit->setEnabled(enabled); - ui->proxyPortSpinBox->setEnabled(enabled); + ui->proxyWidget->setEnabled(enabled); } void FeedReaderConfig::updateProxy() { - rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyAddressLineEdit->text().toUtf8().constData(), ui->proxyPortSpinBox->value()); + rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyWidget->address().toUtf8().constData(), ui->proxyWidget->port()); } diff --git a/plugins/FeedReader/gui/FeedReaderConfig.ui b/plugins/FeedReader/gui/FeedReaderConfig.ui index 8928dc85e..18fa29a42 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.ui +++ b/plugins/FeedReader/gui/FeedReaderConfig.ui @@ -77,37 +77,16 @@ Proxy - - + + Use proxy - - - - Server - - - - - - - - - - 65535 - - - - - - - : - - + + @@ -157,12 +136,19 @@ + + + ProxyWidget + QWidget +
gui/ProxyWidget.h
+ 1 +
+
updateIntervalSpinBox storageTimeSpinBox useProxyCheckBox - proxyAddressLineEdit - proxyPortSpinBox + proxyWidget saveInBackgroundCheckBox setMsgToReadOnActivate openAllInNewTabCheckBox diff --git a/plugins/FeedReader/gui/ProxyWidget.cpp b/plugins/FeedReader/gui/ProxyWidget.cpp new file mode 100644 index 000000000..7752fc5bb --- /dev/null +++ b/plugins/FeedReader/gui/ProxyWidget.cpp @@ -0,0 +1,38 @@ +#include "ProxyWidget.h" +#include "ui_ProxyWidget.h" + +ProxyWidget::ProxyWidget(QWidget *parent) + : QWidget(parent) + , ui(new Ui::ProxyWidget) +{ + ui->setupUi(this); + + /* Connect signals */ + connect(ui->addressLineEdit, &QLineEdit::textChanged, this, &ProxyWidget::changed); + connect(ui->portSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, &ProxyWidget::changed); +} + +ProxyWidget::~ProxyWidget() +{ + delete ui; +} + +QString ProxyWidget::address() +{ + return ui->addressLineEdit->text(); +} + +void ProxyWidget::setAddress(const QString &value) +{ + ui->addressLineEdit->setText(value); +} + +int ProxyWidget::port() +{ + return ui->portSpinBox->value(); +} + +void ProxyWidget::setPort(int value) +{ + ui->portSpinBox->setValue(value); +} diff --git a/plugins/FeedReader/gui/ProxyWidget.h b/plugins/FeedReader/gui/ProxyWidget.h new file mode 100644 index 000000000..f87564e36 --- /dev/null +++ b/plugins/FeedReader/gui/ProxyWidget.h @@ -0,0 +1,31 @@ +#ifndef PROXYWIDGET_H +#define PROXYWIDGET_H + +#include + +namespace Ui { +class ProxyWidget; +} + +class ProxyWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ProxyWidget(QWidget *parent = nullptr); + ~ProxyWidget(); + + QString address(); + void setAddress(const QString &value); + + int port(); + void setPort(int value); + +Q_SIGNALS: + void changed(); + +private: + Ui::ProxyWidget *ui; +}; + +#endif // PROXYWIDGET_H diff --git a/plugins/FeedReader/gui/ProxyWidget.ui b/plugins/FeedReader/gui/ProxyWidget.ui new file mode 100644 index 000000000..5ce8b883f --- /dev/null +++ b/plugins/FeedReader/gui/ProxyWidget.ui @@ -0,0 +1,57 @@ + + + ProxyWidget + + + + 0 + 0 + 400 + 22 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Server + + + + + + + + + + : + + + + + + + 65535 + + + + + + + + From c8cea52b398a6234ce0dd7697ec5fc481768d7d2 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 13 Jul 2025 19:28:56 +0200 Subject: [PATCH 7/8] FeedReader: Reworked proxy setting --- plugins/FeedReader/gui/ProxyWidget.cpp | 110 ++++++++++++++++++++++++- plugins/FeedReader/gui/ProxyWidget.h | 9 ++ plugins/FeedReader/gui/ProxyWidget.ui | 6 +- 3 files changed, 117 insertions(+), 8 deletions(-) diff --git a/plugins/FeedReader/gui/ProxyWidget.cpp b/plugins/FeedReader/gui/ProxyWidget.cpp index 7752fc5bb..eeb0c5256 100644 --- a/plugins/FeedReader/gui/ProxyWidget.cpp +++ b/plugins/FeedReader/gui/ProxyWidget.cpp @@ -8,8 +8,23 @@ ProxyWidget::ProxyWidget(QWidget *parent) ui->setupUi(this); /* Connect signals */ - connect(ui->addressLineEdit, &QLineEdit::textChanged, this, &ProxyWidget::changed); + connectUi(true); connect(ui->portSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, &ProxyWidget::changed); + + /* Initialize types */ + ui->schemeComboBox->addItem("", ""); + ui->schemeComboBox->addItem("HTTP", "http://"); + ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("HTTP Proxy."), Qt::ToolTipRole); + ui->schemeComboBox->addItem("HTTPS", "https://"); + ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("HTTPS Proxy."), Qt::ToolTipRole); + ui->schemeComboBox->addItem("SOCKS4", "socks4://"); + ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS4 Proxy."), Qt::ToolTipRole); + ui->schemeComboBox->addItem("SOCKS4a", "socks4a://"); + ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS4a Proxy. Proxy resolves URL hostname."), Qt::ToolTipRole); + ui->schemeComboBox->addItem("SOCKS5", "socks5://"); + ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS5 Proxy."), Qt::ToolTipRole); + ui->schemeComboBox->addItem("SOCKS5h", "socks5h://"); + ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS5 Proxy. Proxy resolves URL hostname."), Qt::ToolTipRole); } ProxyWidget::~ProxyWidget() @@ -17,14 +32,55 @@ ProxyWidget::~ProxyWidget() delete ui; } +void ProxyWidget::connectUi(bool doConnect) +{ + if (doConnect) { + if (!mAddressConnection) { + mAddressConnection = connect(ui->addressLineEdit, &QLineEdit::textChanged, this, &ProxyWidget::addressChanged); + } + if (!mSchemeConnection) { + mSchemeConnection = connect(ui->schemeComboBox, (void(QComboBox::*)(int))&QComboBox::currentIndexChanged, this, &ProxyWidget::changed); + } + } else { + if (mAddressConnection) { + disconnect(mAddressConnection); + } + if (mSchemeConnection) { + disconnect(mSchemeConnection); + } + } +} + QString ProxyWidget::address() { - return ui->addressLineEdit->text(); + QString host = ui->addressLineEdit->text(); + if (host.isEmpty()) { + return ""; + } + + QString value; + + QString scheme = ui->schemeComboBox->currentData().toString(); + if (!scheme.isEmpty()) { + value = scheme; + } + + value += ui->addressLineEdit->text(); + + return value; } void ProxyWidget::setAddress(const QString &value) { - ui->addressLineEdit->setText(value); + int schemeIndex; + QString host; + + splitAddress(value, schemeIndex, host); + + connectUi(false); + ui->schemeComboBox->setCurrentIndex(schemeIndex); + ui->addressLineEdit->setText(host); + connectUi(true); } int ProxyWidget::port() @@ -36,3 +92,51 @@ void ProxyWidget::setPort(int value) { ui->portSpinBox->setValue(value); } + +void ProxyWidget::addressChanged(const QString &value) +{ + int schemeIndex; + QString host; + + splitAddress(value, schemeIndex, host); + + connectUi(false); + ui->schemeComboBox->setCurrentIndex(schemeIndex); + if (host != ui->addressLineEdit->text()) { + ui->addressLineEdit->setText(host); + } + connectUi(true); + + emit changed(); +} + +void ProxyWidget::splitAddress(const QString &value, int &schemeIndex, QString &host) +{ + if (value.isEmpty()) { + schemeIndex = ui->schemeComboBox->currentIndex(); + host = value; + return; + } + + QString scheme; + int index = value.indexOf("://"); + if (index >= 0) { + scheme = value.left(index + 3); + host = value.mid(index + 3); + } else { + if (ui->schemeComboBox->currentIndex() == 0) { + // Default to HTTP + scheme = "http://"; + } else { + scheme = ui->schemeComboBox->currentData().toString(); + } + host = value; + } + + schemeIndex = ui->schemeComboBox->findData(scheme); + if (schemeIndex < 0) { + /* Unknown scheme */ + schemeIndex = 0; + host = value; + } +} diff --git a/plugins/FeedReader/gui/ProxyWidget.h b/plugins/FeedReader/gui/ProxyWidget.h index f87564e36..d1fdac315 100644 --- a/plugins/FeedReader/gui/ProxyWidget.h +++ b/plugins/FeedReader/gui/ProxyWidget.h @@ -24,8 +24,17 @@ public: Q_SIGNALS: void changed(); +private Q_SLOTS: + void addressChanged(const QString &value); + +private: + void connectUi(bool doConnect); + void splitAddress(const QString &value, int &schemeIndex, QString &host); + private: Ui::ProxyWidget *ui; + QMetaObject::Connection mAddressConnection; + QMetaObject::Connection mSchemeConnection; }; #endif // PROXYWIDGET_H diff --git a/plugins/FeedReader/gui/ProxyWidget.ui b/plugins/FeedReader/gui/ProxyWidget.ui index 5ce8b883f..cc80cde49 100644 --- a/plugins/FeedReader/gui/ProxyWidget.ui +++ b/plugins/FeedReader/gui/ProxyWidget.ui @@ -27,11 +27,7 @@ 0 - - - Server - - + From ddb4300a6053eed41501c005de0514125bd4fab7 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 13 Jul 2025 23:50:27 +0200 Subject: [PATCH 8/8] FeedReader: Updated translation --- plugins/FeedReader/gui/ProxyWidget.ui | 2 +- plugins/FeedReader/lang/FeedReader_en.ts | 86 ++++++++++++++---------- 2 files changed, 53 insertions(+), 35 deletions(-) diff --git a/plugins/FeedReader/gui/ProxyWidget.ui b/plugins/FeedReader/gui/ProxyWidget.ui index cc80cde49..0671cebc3 100644 --- a/plugins/FeedReader/gui/ProxyWidget.ui +++ b/plugins/FeedReader/gui/ProxyWidget.ui @@ -35,7 +35,7 @@ - : + : diff --git a/plugins/FeedReader/lang/FeedReader_en.ts b/plugins/FeedReader/lang/FeedReader_en.ts index 707c8cec9..2fea9589e 100644 --- a/plugins/FeedReader/lang/FeedReader_en.ts +++ b/plugins/FeedReader/lang/FeedReader_en.ts @@ -9,7 +9,7 @@ - + Board @@ -34,7 +34,7 @@ - + Authentication (not yet supported) @@ -59,7 +59,7 @@ - + Update interval @@ -89,7 +89,7 @@ - + Storage time @@ -114,17 +114,7 @@ - - Server - - - - - : - - - - + Type @@ -199,7 +189,7 @@ - + Edit feed @@ -264,17 +254,7 @@ - - Server - - - - - : - - - - + Misc @@ -317,12 +297,12 @@ - + Message Folders - + New @@ -372,7 +352,7 @@ - + Add new folder @@ -535,7 +515,7 @@ - + Title @@ -551,6 +531,11 @@ Author + + + Copy Link Location + + Search Title @@ -567,7 +552,7 @@ - + Open link in browser @@ -577,7 +562,7 @@ - + The messages will be added to the forum @@ -637,7 +622,7 @@ - + Hide @@ -957,4 +942,37 @@ + + ProxyWidget + + + HTTP Proxy. + + + + + HTTPS Proxy. + + + + + SOCKS4 Proxy. + + + + + SOCKS4a Proxy. Proxy resolves URL hostname. + + + + + SOCKS5 Proxy. + + + + + SOCKS5 Proxy. Proxy resolves URL hostname. + + +