display unread counts in title too
This commit is contained in:
parent
ba9634678f
commit
b442d9fb84
File diff suppressed because it is too large
Load Diff
@ -26,7 +26,7 @@
|
|||||||
<url type="donation">https://github.com/sponsors/martinrotter</url>
|
<url type="donation">https://github.com/sponsors/martinrotter</url>
|
||||||
<content_rating type="oars-1.1" />
|
<content_rating type="oars-1.1" />
|
||||||
<releases>
|
<releases>
|
||||||
<release version="4.1.2" date="2022-02-22"/>
|
<release version="4.1.2" date="2022-02-24"/>
|
||||||
</releases>
|
</releases>
|
||||||
<content_rating type="oars-1.0">
|
<content_rating type="oars-1.0">
|
||||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||||
|
@ -16,8 +16,6 @@ FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*>& entry_points, Fe
|
|||||||
: QDialog(parent), m_ui(new Ui::FormAddAccount), m_model(model), m_entryPoints(entry_points) {
|
: QDialog(parent), m_ui(new Ui::FormAddAccount), m_model(model), m_entryPoints(entry_points) {
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
GuiUtilities::applyResponsiveDialogResize(*this);
|
|
||||||
|
|
||||||
// Set flags and attributes.
|
// Set flags and attributes.
|
||||||
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("list-add")));
|
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("list-add")));
|
||||||
|
|
||||||
|
@ -44,20 +44,6 @@ void GuiUtilities::applyDialogProperties(QWidget& widget, const QIcon& icon, con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiUtilities::applyResponsiveDialogResize(QWidget& widget, double factor) {
|
|
||||||
#if defined(Q_OS_ANDROID)
|
|
||||||
auto desktop_geom = QApplication::desktop()->screenGeometry();
|
|
||||||
auto ratio = double(widget.size().height()) / widget.size().width();
|
|
||||||
int widt = desktop_geom.width() * factor;
|
|
||||||
int heig = widt * ratio;
|
|
||||||
|
|
||||||
widget.resize(widt, heig);
|
|
||||||
#else
|
|
||||||
Q_UNUSED(factor)
|
|
||||||
Q_UNUSED(widget)
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void GuiUtilities::restoreState(QWidget* wdg, QByteArray state) {
|
void GuiUtilities::restoreState(QWidget* wdg, QByteArray state) {
|
||||||
QHash<QString, QHash<QString, QVariant>> props;
|
QHash<QString, QHash<QString, QVariant>> props;
|
||||||
QDataStream str(&state, QIODevice::OpenModeFlag::ReadOnly);
|
QDataStream str(&state, QIODevice::OpenModeFlag::ReadOnly);
|
||||||
|
@ -11,7 +11,6 @@ class GuiUtilities {
|
|||||||
public:
|
public:
|
||||||
static void setLabelAsNotice(QLabel& label, bool is_warning, bool set_margins = true);
|
static void setLabelAsNotice(QLabel& label, bool is_warning, bool set_margins = true);
|
||||||
static void applyDialogProperties(QWidget& widget, const QIcon& icon = QIcon(), const QString& title = QString());
|
static void applyDialogProperties(QWidget& widget, const QIcon& icon = QIcon(), const QString& title = QString());
|
||||||
static void applyResponsiveDialogResize(QWidget& widget, double factor = 0.6);
|
|
||||||
static void restoreState(QWidget* wdg, QByteArray state);
|
static void restoreState(QWidget* wdg, QByteArray state);
|
||||||
static QByteArray saveState(QWidget* wdg);
|
static QByteArray saveState(QWidget* wdg);
|
||||||
|
|
||||||
|
@ -8,25 +8,25 @@
|
|||||||
|
|
||||||
NetworkProxyDetails::NetworkProxyDetails(QWidget* parent) : QWidget(parent) {
|
NetworkProxyDetails::NetworkProxyDetails(QWidget* parent) : QWidget(parent) {
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
GuiUtilities::setLabelAsNotice(*m_ui.m_lblProxyInfo, false);
|
|
||||||
|
|
||||||
|
m_ui.m_lblProxyInfo->setHelpText(tr("Note that these settings are applied only on newly established connections."), false);
|
||||||
m_ui.m_txtProxyPassword->setPasswordMode(true);
|
m_ui.m_txtProxyPassword->setPasswordMode(true);
|
||||||
|
|
||||||
connect(m_ui.m_cmbProxyType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
connect(m_ui.m_cmbProxyType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
&NetworkProxyDetails::onProxyTypeChanged);
|
this, &NetworkProxyDetails::onProxyTypeChanged);
|
||||||
|
|
||||||
m_ui.m_cmbProxyType->addItem(tr("No proxy"), QNetworkProxy::ProxyType::NoProxy);
|
m_ui.m_cmbProxyType->addItem(tr("No proxy"), QNetworkProxy::ProxyType::NoProxy);
|
||||||
m_ui.m_cmbProxyType->addItem(tr("System proxy"), QNetworkProxy::ProxyType::DefaultProxy);
|
m_ui.m_cmbProxyType->addItem(tr("System proxy"), QNetworkProxy::ProxyType::DefaultProxy);
|
||||||
m_ui.m_cmbProxyType->addItem(tr("Socks5"), QNetworkProxy::ProxyType::Socks5Proxy);
|
m_ui.m_cmbProxyType->addItem(tr("Socks5"), QNetworkProxy::ProxyType::Socks5Proxy);
|
||||||
m_ui.m_cmbProxyType->addItem(tr("Http"), QNetworkProxy::ProxyType::HttpProxy);
|
m_ui.m_cmbProxyType->addItem(tr("Http"), QNetworkProxy::ProxyType::HttpProxy);
|
||||||
|
|
||||||
connect(m_ui.m_cmbProxyType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
connect(m_ui.m_cmbProxyType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
&NetworkProxyDetails::changed);
|
this, &NetworkProxyDetails::changed);
|
||||||
connect(m_ui.m_txtProxyHost, &QLineEdit::textChanged, this, &NetworkProxyDetails::changed);
|
connect(m_ui.m_txtProxyHost, &QLineEdit::textChanged, this, &NetworkProxyDetails::changed);
|
||||||
connect(m_ui.m_txtProxyPassword, &QLineEdit::textChanged, this, &NetworkProxyDetails::changed);
|
connect(m_ui.m_txtProxyPassword, &QLineEdit::textChanged, this, &NetworkProxyDetails::changed);
|
||||||
connect(m_ui.m_txtProxyUsername, &QLineEdit::textChanged, this, &NetworkProxyDetails::changed);
|
connect(m_ui.m_txtProxyUsername, &QLineEdit::textChanged, this, &NetworkProxyDetails::changed);
|
||||||
connect(m_ui.m_spinProxyPort, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
connect(m_ui.m_spinProxyPort, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
&NetworkProxyDetails::changed);
|
this, &NetworkProxyDetails::changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkProxy NetworkProxyDetails::proxy() const {
|
QNetworkProxy NetworkProxyDetails::proxy() const {
|
||||||
|
@ -120,17 +120,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="m_lblProxyInfo">
|
<widget class="HelpSpoiler" name="m_lblProxyInfo" native="true"/>
|
||||||
<property name="text">
|
|
||||||
<string>Note that these settings are applied only on newly established connections.</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -189,6 +179,12 @@
|
|||||||
<extends>QLineEdit</extends>
|
<extends>QLineEdit</extends>
|
||||||
<header>baselineedit.h</header>
|
<header>baselineedit.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>HelpSpoiler</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>helpspoiler.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
@ -241,7 +241,7 @@ ExternalTool SettingsBrowserMail::tweakExternalTool(const ExternalTool& tool) co
|
|||||||
bool ok;
|
bool ok;
|
||||||
QString parameters = QInputDialog::getText(window(),
|
QString parameters = QInputDialog::getText(window(),
|
||||||
tr("Enter parameters"),
|
tr("Enter parameters"),
|
||||||
tr("Enter (optional) parameters separated by \"%1\":").arg(QSL(EXECUTION_LINE_SEPARATOR)),
|
tr("Enter (optional) parameters:"),
|
||||||
QLineEdit::EchoMode::Normal,
|
QLineEdit::EchoMode::Normal,
|
||||||
tool.parameters(),
|
tool.parameters(),
|
||||||
&ok);
|
&ok);
|
||||||
@ -265,6 +265,7 @@ void SettingsBrowserMail::editSelectedExternalTool() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
ext_tool = tweakExternalTool(ext_tool);
|
ext_tool = tweakExternalTool(ext_tool);
|
||||||
|
|
||||||
m_ui->m_listTools->currentItem()->setText(0, ext_tool.executable());
|
m_ui->m_listTools->currentItem()->setText(0, ext_tool.executable());
|
||||||
m_ui->m_listTools->currentItem()->setText(1, ext_tool.parameters());
|
m_ui->m_listTools->currentItem()->setText(1, ext_tool.parameters());
|
||||||
m_ui->m_listTools->currentItem()->setData(0, Qt::ItemDataRole::UserRole, QVariant::fromValue(ext_tool));
|
m_ui->m_listTools->currentItem()->setData(0, Qt::ItemDataRole::UserRole, QVariant::fromValue(ext_tool));
|
||||||
|
@ -50,7 +50,8 @@ SettingsGui::SettingsGui(Settings* settings, QWidget* parent) : SettingsPanel(se
|
|||||||
m_ui->m_checkForceDarkFusion->setVisible(qApp->skins()->isStyleGoodForDarkVariant(txt));
|
m_ui->m_checkForceDarkFusion->setVisible(qApp->skins()->isStyleGoodForDarkVariant(txt));
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SettingsGui::requireRestart);
|
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &SettingsGui::requireRestart);
|
||||||
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
&SettingsGui::dirtifySettings);
|
&SettingsGui::dirtifySettings);
|
||||||
connect(m_ui->m_treeSkins, &QTreeWidget::currentItemChanged, this, &SettingsGui::dirtifySettings);
|
connect(m_ui->m_treeSkins, &QTreeWidget::currentItemChanged, this, &SettingsGui::dirtifySettings);
|
||||||
|
@ -429,18 +429,18 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>ToolBarEditor</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>toolbareditor.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>HelpSpoiler</class>
|
<class>HelpSpoiler</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>helpspoiler.h</header>
|
<header>helpspoiler.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ToolBarEditor</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>toolbareditor.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>m_tabUi</tabstop>
|
<tabstop>m_tabUi</tabstop>
|
||||||
|
@ -92,8 +92,8 @@ void SystemTrayIcon::show() {
|
|||||||
showPrivate();
|
showPrivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemTrayIcon::setNumber(int number, bool any_new_message) {
|
void SystemTrayIcon::setNumber(int number, bool any_feed_has_new_unread_messages) {
|
||||||
Q_UNUSED(any_new_message)
|
Q_UNUSED(any_feed_has_new_unread_messages)
|
||||||
|
|
||||||
if (number <= 0 || !qApp->settings()->value(GROUP(GUI), SETTING(GUI::UnreadNumbersInTrayIcon)).toBool()) {
|
if (number <= 0 || !qApp->settings()->value(GROUP(GUI), SETTING(GUI::UnreadNumbersInTrayIcon)).toBool()) {
|
||||||
// Either no unread messages or numbers in tray icon are disabled.
|
// Either no unread messages or numbers in tray icon are disabled.
|
||||||
|
@ -41,7 +41,7 @@ class SystemTrayIcon : public QSystemTrayIcon {
|
|||||||
virtual ~SystemTrayIcon();
|
virtual ~SystemTrayIcon();
|
||||||
|
|
||||||
// Sets the number to be visible in the tray icon, number <= 0 removes it.
|
// Sets the number to be visible in the tray icon, number <= 0 removes it.
|
||||||
void setNumber(int number = -1, bool any_new_message = false);
|
void setNumber(int number = -1, bool any_feed_has_new_unread_messages = false);
|
||||||
|
|
||||||
void showMessage(const QString& title, const QString& message, MessageIcon icon = Information,
|
void showMessage(const QString& title, const QString& message, MessageIcon icon = Information,
|
||||||
int milliseconds_timeout_hint = TRAY_ICON_BUBBLE_TIMEOUT, const std::function<void ()>& functor = nullptr);
|
int milliseconds_timeout_hint = TRAY_ICON_BUBBLE_TIMEOUT, const std::function<void ()>& functor = nullptr);
|
||||||
|
@ -629,9 +629,9 @@ void Application::onAboutToQuit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::showMessagesNumber(int unread_messages, bool any_feed_has_unread_messages) {
|
void Application::showMessagesNumber(int unread_messages, bool any_feed_has_new_unread_messages) {
|
||||||
if (m_trayIcon != nullptr) {
|
if (m_trayIcon != nullptr) {
|
||||||
m_trayIcon->setNumber(unread_messages, any_feed_has_unread_messages);
|
m_trayIcon->setNumber(unread_messages, any_feed_has_new_unread_messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
@ -652,6 +652,10 @@ void Application::showMessagesNumber(int unread_messages, bool any_feed_has_unre
|
|||||||
|
|
||||||
QDBusConnection::sessionBus().send(signal);
|
QDBusConnection::sessionBus().send(signal);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mainForm()->setWindowTitle(unread_messages > 0
|
||||||
|
? QSL("%1 (%2)").arg(QSL(APP_NAME), QString::number(unread_messages))
|
||||||
|
: QSL(APP_NAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::restart() {
|
void Application::restart() {
|
||||||
|
@ -177,7 +177,7 @@ class RSSGUARD_DLLSPEC Application : public SingleApplication {
|
|||||||
void onCommitData(QSessionManager& manager);
|
void onCommitData(QSessionManager& manager);
|
||||||
void onSaveState(QSessionManager& manager);
|
void onSaveState(QSessionManager& manager);
|
||||||
void onAboutToQuit();
|
void onAboutToQuit();
|
||||||
void showMessagesNumber(int unread_messages, bool any_feed_has_unread_messages);
|
void showMessagesNumber(int unread_messages, bool any_feed_has_new_unread_messages);
|
||||||
|
|
||||||
#if defined(USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
#if QT_VERSION_MAJOR == 6
|
#if QT_VERSION_MAJOR == 6
|
||||||
|
Loading…
x
Reference in New Issue
Block a user