fix #1318
This commit is contained in:
parent
202da682b8
commit
75fdd81bad
7 changed files with 63 additions and 32 deletions
|
@ -42,7 +42,7 @@
|
||||||
#
|
#
|
||||||
# Other information:
|
# Other information:
|
||||||
# - supports Windows, Linux, *BSD, macOS, OS/2, Android,
|
# - supports Windows, Linux, *BSD, macOS, OS/2, Android,
|
||||||
# - Qt 5.12.0 or newer is required,
|
# - Qt 5.14.0 or newer is required,
|
||||||
# - Qt 6.3.0 or newer is required,
|
# - Qt 6.3.0 or newer is required,
|
||||||
# - cmake 3.14.0 or newer is required,
|
# - cmake 3.14.0 or newer is required,
|
||||||
# - if you wish to make packages for Windows, then you must initialize all submodules
|
# - if you wish to make packages for Windows, then you must initialize all submodules
|
||||||
|
@ -133,7 +133,7 @@ option(MEDIAPLAYER_FORCE_OPENGL "Use opengl-based render API with libmpv." ON)
|
||||||
|
|
||||||
# Import Qt libraries.
|
# Import Qt libraries.
|
||||||
set(QT6_MIN_VERSION 6.3.0)
|
set(QT6_MIN_VERSION 6.3.0)
|
||||||
set(QT5_MIN_VERSION 5.12.0)
|
set(QT5_MIN_VERSION 5.14.0)
|
||||||
|
|
||||||
set(QT_COMPONENTS
|
set(QT_COMPONENTS
|
||||||
Core
|
Core
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "miscellaneous/textfactory.h"
|
#include "miscellaneous/textfactory.h"
|
||||||
#include "network-web/webfactory.h"
|
#include "network-web/webfactory.h"
|
||||||
|
|
||||||
|
#include <QClipboard>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
@ -24,9 +25,13 @@
|
||||||
FormAbout::FormAbout(bool go_to_changelog, QWidget* parent) : QDialog(parent) {
|
FormAbout::FormAbout(bool go_to_changelog, QWidget* parent) : QDialog(parent) {
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
m_ui.m_lblIcon->setPixmap(QPixmap(APP_ICON_PATH));
|
m_ui.m_lblIcon->setPixmap(QPixmap(APP_ICON_PATH));
|
||||||
|
m_ui.m_btnCopyInfo->setIcon(qApp->icons()->fromTheme(QSL("edit-copy")));
|
||||||
GuiUtilities::applyDialogProperties(*this,
|
GuiUtilities::applyDialogProperties(*this,
|
||||||
qApp->icons()->fromTheme(QSL("help-about")),
|
qApp->icons()->fromTheme(QSL("help-about")),
|
||||||
tr("About %1").arg(QSL(APP_NAME)));
|
tr("About %1").arg(QSL(APP_NAME)));
|
||||||
|
|
||||||
|
connect(m_ui.m_btnCopyInfo, &QPushButton::clicked, this, &FormAbout::copyInfoToClipboard);
|
||||||
|
|
||||||
loadLicenseAndInformation();
|
loadLicenseAndInformation();
|
||||||
loadSettingsAndPaths();
|
loadSettingsAndPaths();
|
||||||
|
|
||||||
|
@ -37,6 +42,21 @@ FormAbout::FormAbout(bool go_to_changelog, QWidget* parent) : QDialog(parent) {
|
||||||
|
|
||||||
FormAbout::~FormAbout() {}
|
FormAbout::~FormAbout() {}
|
||||||
|
|
||||||
|
void FormAbout::copyInfoToClipboard() {
|
||||||
|
auto* clip = QGuiApplication::clipboard();
|
||||||
|
|
||||||
|
if (clip != nullptr) {
|
||||||
|
clip->setText(m_ui.m_lblDesc->text().replace(QSL("<br/>"), QSL("\n")));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qApp->showGuiMessage(Notification::Event::GeneralEvent,
|
||||||
|
GuiMessage(tr("Cannot copy"),
|
||||||
|
tr("Cannot copy info to clipboard."),
|
||||||
|
QSystemTrayIcon::MessageIcon::Critical),
|
||||||
|
GuiMessageDestination(true, true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FormAbout::displayLicense() {
|
void FormAbout::displayLicense() {
|
||||||
m_ui.m_tbLicenses->setPlainText(m_ui.m_cbLicenses->currentData().toString());
|
m_ui.m_tbLicenses->setPlainText(m_ui.m_cbLicenses->currentData().toString());
|
||||||
}
|
}
|
||||||
|
@ -110,11 +130,13 @@ void FormAbout::loadLicenseAndInformation() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set other informative texts.
|
// Set other informative texts.
|
||||||
m_ui.m_lblDesc->setText(tr("<b>%8</b><br>"
|
m_ui.m_lblDesc->setTextFormat(Qt::TextFormat::MarkdownText);
|
||||||
"<b>Version:</b> %1 (built on %2/%3)<br>"
|
m_ui.m_lblDesc->setText(tr("### %8<br/>"
|
||||||
"<b>Revision:</b> %4<br>"
|
"**Version:** %1 (built on %2/%3)<br/>"
|
||||||
"<b>Build date:</b> %5<br>"
|
"**Revision:** %4<br/>"
|
||||||
"<b>Qt:</b> %6 (compiled against %7)<br>")
|
"**Build date:** %5<br/>"
|
||||||
|
"**OS:** %9<br/>"
|
||||||
|
"**Qt:** %6 (compiled against %7)")
|
||||||
.arg(qApp->applicationVersion(),
|
.arg(qApp->applicationVersion(),
|
||||||
QSL(APP_SYSTEM_NAME),
|
QSL(APP_SYSTEM_NAME),
|
||||||
QSL(APP_SYSTEM_VERSION),
|
QSL(APP_SYSTEM_VERSION),
|
||||||
|
@ -125,7 +147,8 @@ void FormAbout::loadLicenseAndInformation() {
|
||||||
QLocale::FormatType::ShortFormat),
|
QLocale::FormatType::ShortFormat),
|
||||||
qVersion(),
|
qVersion(),
|
||||||
QSL(QT_VERSION_STR),
|
QSL(QT_VERSION_STR),
|
||||||
QSL(APP_NAME)));
|
QSL(APP_NAME),
|
||||||
|
QSysInfo::prettyProductName()));
|
||||||
m_ui.m_txtInfo->setText(tr("<body>%5 is a (very) tiny feed reader."
|
m_ui.m_txtInfo->setText(tr("<body>%5 is a (very) tiny feed reader."
|
||||||
"<br><br>This software is distributed under the terms of GNU General "
|
"<br><br>This software is distributed under the terms of GNU General "
|
||||||
"Public License, version 3."
|
"Public License, version 3."
|
||||||
|
|
|
@ -15,6 +15,7 @@ class RSSGUARD_DLLSPEC FormAbout : public QDialog {
|
||||||
virtual ~FormAbout();
|
virtual ~FormAbout();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void copyInfoToClipboard();
|
||||||
void displayLicense();
|
void displayLicense();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>727</width>
|
<width>562</width>
|
||||||
<height>446</height>
|
<height>373</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -18,11 +18,8 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QFormLayout" name="m_formLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="fieldGrowthPolicy">
|
<item>
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="m_lblIcon">
|
<widget class="QLabel" name="m_lblIcon">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -56,7 +53,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item>
|
||||||
<widget class="QLabel" name="m_lblDesc">
|
<widget class="QLabel" name="m_lblDesc">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
@ -84,6 +81,19 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="m_btnCopyInfo">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Copy info to clipboard</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -123,6 +133,9 @@
|
||||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string notr="true"><!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" /><meta charset="utf-8" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
|
hr { height: 1px; border-width: 0; }
|
||||||
|
li.unchecked::marker { content: "\2610"; }
|
||||||
|
li.checked::marker { content: "\2612"; }
|
||||||
</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -179,6 +192,9 @@ p, li { white-space: pre-wrap; }
|
||||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string notr="true"><!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" /><meta charset="utf-8" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
|
hr { height: 1px; border-width: 0; }
|
||||||
|
li.unchecked::marker { content: "\2610"; }
|
||||||
|
li.checked::marker { content: "\2612"; }
|
||||||
</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>405</width>
|
<width>405</width>
|
||||||
<height>409</height>
|
<height>305</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
|
@ -15,7 +15,7 @@ PluginFactory::PluginFactory() {}
|
||||||
QList<ServiceEntryPoint*> PluginFactory::loadPlugins() const {
|
QList<ServiceEntryPoint*> PluginFactory::loadPlugins() const {
|
||||||
QList<ServiceEntryPoint*> plugins;
|
QList<ServiceEntryPoint*> plugins;
|
||||||
|
|
||||||
const QString plugin_name_wildcard = pluginNameWildCard() + pluginNameSuffix();
|
const QString plugin_name_wildcard = pluginNameWildCard();
|
||||||
const auto plugins_paths = pluginPaths();
|
const auto plugins_paths = pluginPaths();
|
||||||
const auto backup_current_dir = QDir::currentPath();
|
const auto backup_current_dir = QDir::currentPath();
|
||||||
|
|
||||||
|
@ -23,7 +23,11 @@ QList<ServiceEntryPoint*> PluginFactory::loadPlugins() const {
|
||||||
QDirIterator dir_iter(plugin_folder,
|
QDirIterator dir_iter(plugin_folder,
|
||||||
{plugin_name_wildcard},
|
{plugin_name_wildcard},
|
||||||
QDir::Filter::Files,
|
QDir::Filter::Files,
|
||||||
|
#if !defined(NDEBUG)
|
||||||
QDirIterator::IteratorFlag::Subdirectories);
|
QDirIterator::IteratorFlag::Subdirectories);
|
||||||
|
#else
|
||||||
|
QDirIterator::IteratorFlag::NoIteratorFlags);
|
||||||
|
#endif
|
||||||
|
|
||||||
while (dir_iter.hasNext()) {
|
while (dir_iter.hasNext()) {
|
||||||
dir_iter.next();
|
dir_iter.next();
|
||||||
|
@ -74,18 +78,6 @@ QStringList PluginFactory::pluginPaths() const {
|
||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PluginFactory::pluginNameSuffix() const {
|
|
||||||
#if defined(Q_OS_LINUX)
|
|
||||||
return QSL(".so");
|
|
||||||
#elif defined(Q_OS_WIN)
|
|
||||||
return QSL(".dll");
|
|
||||||
#elif defined(Q_OS_MACOS)
|
|
||||||
return QSL(".dylib");
|
|
||||||
#else
|
|
||||||
return QSL("");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
QString PluginFactory::pluginNameWildCard() const {
|
QString PluginFactory::pluginNameWildCard() const {
|
||||||
return QSL("*rssguard-*");
|
return QSL("*rssguard-*.*");
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ class PluginFactory {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList pluginPaths() const;
|
QStringList pluginPaths() const;
|
||||||
QString pluginNameSuffix() const;
|
|
||||||
QString pluginNameWildCard() const;
|
QString pluginNameWildCard() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue