some refactorings, tray icon test
This commit is contained in:
parent
1fc0337211
commit
44ee50ab76
@ -30,7 +30,7 @@
|
|||||||
<url type="donation">https://martinrotter.github.io/donate/</url>
|
<url type="donation">https://martinrotter.github.io/donate/</url>
|
||||||
<content_rating type="oars-1.1" />
|
<content_rating type="oars-1.1" />
|
||||||
<releases>
|
<releases>
|
||||||
<release version="3.9.2" date="2021-04-28"/>
|
<release version="3.9.0" date="2021-02-25"/>
|
||||||
</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>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include "services/owncloud/network/owncloudnetworkfactory.h"
|
#include "services/owncloud/network/owncloudnetworkfactory.h"
|
||||||
#include "services/standard/gui/formstandardimportexport.h"
|
#include "services/standard/gui/formstandardimportexport.h"
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
#include "network-web/adblock/adblockicon.h"
|
#include "network-web/adblock/adblockicon.h"
|
||||||
#include "network-web/adblock/adblockmanager.h"
|
#include "network-web/adblock/adblockmanager.h"
|
||||||
#endif
|
#endif
|
||||||
@ -62,7 +62,7 @@ FormMain::FormMain(QWidget* parent, Qt::WindowFlags f)
|
|||||||
setWindowIcon(qApp->desktopAwareIcon());
|
setWindowIcon(qApp->desktopAwareIcon());
|
||||||
setWindowTitle(APP_LONG_NAME);
|
setWindowTitle(APP_LONG_NAME);
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
m_ui->m_menuWebBrowserTabs->addAction(qApp->web()->adBlock()->adBlockIcon());
|
m_ui->m_menuWebBrowserTabs->addAction(qApp->web()->adBlock()->adBlockIcon());
|
||||||
m_ui->m_menuWebBrowserTabs->addAction(qApp->web()->engineSettingsAction());
|
m_ui->m_menuWebBrowserTabs->addAction(qApp->web()->engineSettingsAction());
|
||||||
#endif
|
#endif
|
||||||
@ -204,7 +204,7 @@ QList<QAction*> FormMain::allActions() const {
|
|||||||
|
|
||||||
void FormMain::prepareMenus() {
|
void FormMain::prepareMenus() {
|
||||||
// Setup menu for tray icon.
|
// Setup menu for tray icon.
|
||||||
if (SystemTrayIcon::isSystemTrayAvailable()) {
|
if (SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
m_trayMenu = new TrayIconMenu(APP_NAME, this);
|
m_trayMenu = new TrayIconMenu(APP_NAME, this);
|
||||||
#else
|
#else
|
||||||
@ -449,7 +449,7 @@ void FormMain::updateFeedButtonsAvailability() {
|
|||||||
|
|
||||||
void FormMain::switchVisibility(bool force_hide) {
|
void FormMain::switchVisibility(bool force_hide) {
|
||||||
if (force_hide || isVisible()) {
|
if (force_hide || isVisible()) {
|
||||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
if (SystemTrayIcon::isSystemTrayDesired() && SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -813,7 +813,8 @@ void FormMain::changeEvent(QEvent* event) {
|
|||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::WindowStateChange: {
|
case QEvent::WindowStateChange: {
|
||||||
if ((windowState() & Qt::WindowState::WindowMinimized) == Qt::WindowState::WindowMinimized &&
|
if ((windowState() & Qt::WindowState::WindowMinimized) == Qt::WindowState::WindowMinimized &&
|
||||||
SystemTrayIcon::isSystemTrayActivated() &&
|
SystemTrayIcon::isSystemTrayDesired() &&
|
||||||
|
SystemTrayIcon::isSystemTrayAreaAvailable() &&
|
||||||
qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideMainWindowWhenMinimized)).toBool()) {
|
qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideMainWindowWhenMinimized)).toBool()) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
QTimer::singleShot(CHANGE_EVENT_DELAY, this, [this]() {
|
QTimer::singleShot(CHANGE_EVENT_DELAY, this, [this]() {
|
||||||
|
@ -515,7 +515,7 @@ void FormMessageFiltersManager::beautifyScript() {
|
|||||||
proc_clang_format.setInputChannelMode(QProcess::InputChannelMode::ManagedInputChannel);
|
proc_clang_format.setInputChannelMode(QProcess::InputChannelMode::ManagedInputChannel);
|
||||||
proc_clang_format.setArguments({ "--assume-filename=script.js", "--style=Chromium" });
|
proc_clang_format.setArguments({ "--assume-filename=script.js", "--style=Chromium" });
|
||||||
|
|
||||||
#if defined (Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
proc_clang_format.setProgram(qApp->applicationDirPath() + QDir::separator() +
|
proc_clang_format.setProgram(qApp->applicationDirPath() + QDir::separator() +
|
||||||
QSL("clang-format") + QDir::separator() +
|
QSL("clang-format") + QDir::separator() +
|
||||||
QSL("clang-format.exe"));
|
QSL("clang-format.exe"));
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "definitions/definitions.h"
|
#include "definitions/definitions.h"
|
||||||
|
|
||||||
#if defined (Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
@ -31,7 +31,7 @@ void GuiUtilities::applyDialogProperties(QWidget& widget, const QIcon& icon, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GuiUtilities::applyResponsiveDialogResize(QWidget& widget, double factor) {
|
void GuiUtilities::applyResponsiveDialogResize(QWidget& widget, double factor) {
|
||||||
#if defined (Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
auto desktop_geom = QApplication::desktop()->screenGeometry();
|
auto desktop_geom = QApplication::desktop()->screenGeometry();
|
||||||
auto ratio = double(widget.size().height()) / widget.size().width();
|
auto ratio = double(widget.size().height()) / widget.size().width();
|
||||||
int widt = desktop_geom.width() * factor;
|
int widt = desktop_geom.width() * factor;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "services/abstract/labelsnode.h"
|
#include "services/abstract/labelsnode.h"
|
||||||
#include "services/abstract/serviceroot.h"
|
#include "services/abstract/serviceroot.h"
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
#include "gui/webbrowser.h"
|
#include "gui/webbrowser.h"
|
||||||
#include "gui/webviewer.h"
|
#include "gui/webviewer.h"
|
||||||
#else
|
#else
|
||||||
@ -48,7 +48,7 @@ void MessagePreviewer::createConnections() {
|
|||||||
MessagePreviewer::MessagePreviewer(bool should_resize_to_fit, QWidget* parent)
|
MessagePreviewer::MessagePreviewer(bool should_resize_to_fit, QWidget* parent)
|
||||||
: QWidget(parent), m_layout(new QGridLayout(this)), m_toolBar(new QToolBar(this)), m_verticalScrollBarPosition(0.0),
|
: QWidget(parent), m_layout(new QGridLayout(this)), m_toolBar(new QToolBar(this)), m_verticalScrollBarPosition(0.0),
|
||||||
m_separator(nullptr), m_btnLabels(QList<QPair<LabelButton*, QAction*>>()) {
|
m_separator(nullptr), m_btnLabels(QList<QPair<LabelButton*, QAction*>>()) {
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
m_txtMessage = new WebBrowser(this);
|
m_txtMessage = new WebBrowser(this);
|
||||||
|
|
||||||
if (should_resize_to_fit) {
|
if (should_resize_to_fit) {
|
||||||
@ -82,14 +82,14 @@ void MessagePreviewer::reloadFontSettings() {
|
|||||||
void MessagePreviewer::setToolbarsVisible(bool visible) {
|
void MessagePreviewer::setToolbarsVisible(bool visible) {
|
||||||
m_toolBar->setVisible(visible);
|
m_toolBar->setVisible(visible);
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
m_txtMessage->setNavigationBarVisible(visible);
|
m_txtMessage->setNavigationBarVisible(visible);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qApp->settings()->setValue(GROUP(GUI), GUI::MessageViewerToolbarsVisible, visible);
|
qApp->settings()->setValue(GROUP(GUI), GUI::MessageViewerToolbarsVisible, visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
|
|
||||||
WebBrowser* MessagePreviewer::webBrowser() const {
|
WebBrowser* MessagePreviewer::webBrowser() const {
|
||||||
return m_txtMessage;
|
return m_txtMessage;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
class QGridLayout;
|
class QGridLayout;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
class WebBrowser;
|
class WebBrowser;
|
||||||
#else
|
#else
|
||||||
class MessageBrowser;
|
class MessageBrowser;
|
||||||
@ -41,7 +41,7 @@ class MessagePreviewer : public QWidget {
|
|||||||
|
|
||||||
void reloadFontSettings();
|
void reloadFontSettings();
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
WebBrowser* webBrowser() const;
|
WebBrowser* webBrowser() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ class MessagePreviewer : public QWidget {
|
|||||||
QGridLayout* m_layout;
|
QGridLayout* m_layout;
|
||||||
QToolBar* m_toolBar;
|
QToolBar* m_toolBar;
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
WebBrowser* m_txtMessage;
|
WebBrowser* m_txtMessage;
|
||||||
#else
|
#else
|
||||||
MessageBrowser* m_txtMessage;
|
MessageBrowser* m_txtMessage;
|
||||||
|
@ -25,7 +25,7 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
|
|||||||
initializeMessageDateFormats();
|
initializeMessageDateFormats();
|
||||||
GuiUtilities::setLabelAsNotice(*m_ui->label_9, false);
|
GuiUtilities::setLabelAsNotice(*m_ui->label_9, false);
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
m_ui->m_tabMessages->layout()->removeWidget(m_ui->m_checkDisplayPlaceholders);
|
m_ui->m_tabMessages->layout()->removeWidget(m_ui->m_checkDisplayPlaceholders);
|
||||||
m_ui->m_checkDisplayPlaceholders->hide();
|
m_ui->m_checkDisplayPlaceholders->hide();
|
||||||
#else
|
#else
|
||||||
|
@ -84,14 +84,11 @@ void SettingsGui::loadSettings() {
|
|||||||
onBeginLoadSettings();
|
onBeginLoadSettings();
|
||||||
|
|
||||||
// Load settings of tray icon.
|
// Load settings of tray icon.
|
||||||
if (SystemTrayIcon::isSystemTrayAvailable()) {
|
m_ui->m_grpTray->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::UseTrayIcon)).toBool());
|
||||||
m_ui->m_grpTray->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::UseTrayIcon)).toBool());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tray icon is not supported on this machine.
|
if (!SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
else {
|
m_ui->m_grpTray->setTitle(m_ui->m_grpTray->title() + QL1C(' ') + tr("(Your OS does not support tray icons at the moment.)"));
|
||||||
m_ui->m_grpTray->setTitle(m_ui->m_grpTray->title() + QL1C(' ') + tr("(Tray icon is not available.)"));
|
m_ui->m_grpTray->setEnabled(false);
|
||||||
m_ui->m_grpTray->setChecked(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->m_checkHidden->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::MainWindowStartsHidden)).toBool());
|
m_ui->m_checkHidden->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::MainWindowStartsHidden)).toBool());
|
||||||
@ -200,7 +197,7 @@ void SettingsGui::saveSettings() {
|
|||||||
m_ui->m_cmbToolbarButtonStyle->itemData(m_ui->m_cmbToolbarButtonStyle->currentIndex()));
|
m_ui->m_cmbToolbarButtonStyle->itemData(m_ui->m_cmbToolbarButtonStyle->currentIndex()));
|
||||||
|
|
||||||
// Save tray icon.
|
// Save tray icon.
|
||||||
if (SystemTrayIcon::isSystemTrayAvailable()) {
|
if (SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
settings()->setValue(GROUP(GUI), GUI::UseTrayIcon, m_ui->m_grpTray->isChecked());
|
settings()->setValue(GROUP(GUI), GUI::UseTrayIcon, m_ui->m_grpTray->isChecked());
|
||||||
|
|
||||||
if (m_ui->m_grpTray->isChecked()) {
|
if (m_ui->m_grpTray->isChecked()) {
|
||||||
|
@ -60,12 +60,12 @@ void SystemTrayIcon::onActivated(QSystemTrayIcon::ActivationReason reason) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemTrayIcon::isSystemTrayAvailable() {
|
bool SystemTrayIcon::isSystemTrayAreaAvailable() {
|
||||||
return QSystemTrayIcon::isSystemTrayAvailable() && QSystemTrayIcon::supportsMessages();
|
return QSystemTrayIcon::isSystemTrayAvailable() && QSystemTrayIcon::supportsMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemTrayIcon::isSystemTrayActivated() {
|
bool SystemTrayIcon::isSystemTrayDesired() {
|
||||||
return SystemTrayIcon::isSystemTrayAvailable() && qApp->settings()->value(GROUP(GUI), SETTING(GUI::UseTrayIcon)).toBool();
|
return qApp->settings()->value(GROUP(GUI), SETTING(GUI::UseTrayIcon)).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SystemTrayIcon::areNotificationsEnabled() {
|
bool SystemTrayIcon::areNotificationsEnabled() {
|
||||||
@ -92,8 +92,8 @@ void SystemTrayIcon::show() {
|
|||||||
showPrivate();
|
showPrivate();
|
||||||
#else
|
#else
|
||||||
// Delay avoids race conditions and tray icon is properly displayed.
|
// Delay avoids race conditions and tray icon is properly displayed.
|
||||||
qDebugNN << LOGSEC_GUI << "Showing tray icon with 1000 ms delay.";
|
qDebugNN << LOGSEC_GUI << "Showing tray icon with 3000 ms delay.";
|
||||||
QTimer::singleShot(1000, this, &SystemTrayIcon::showPrivate);
|
QTimer::singleShot(3000, this, &SystemTrayIcon::showPrivate);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,12 +46,11 @@ class SystemTrayIcon : public QSystemTrayIcon {
|
|||||||
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, std::function<void()> functor = nullptr);
|
int milliseconds_timeout_hint = TRAY_ICON_BUBBLE_TIMEOUT, std::function<void()> functor = nullptr);
|
||||||
|
|
||||||
// Returns true if tray icon CAN be constructed on this machine.
|
// Returns true if tray area is available and icon can be displayed.
|
||||||
static bool isSystemTrayAvailable();
|
static bool isSystemTrayAreaAvailable();
|
||||||
|
|
||||||
// Returns true if tray icon CAN be costructed and IS enabled in
|
// Returns true if user wants to have tray icon displayed.
|
||||||
// application settings.
|
static bool isSystemTrayDesired();
|
||||||
static bool isSystemTrayActivated();
|
|
||||||
|
|
||||||
// Determines whether balloon tips are enabled or not on tray icons.
|
// Determines whether balloon tips are enabled or not on tray icons.
|
||||||
static bool areNotificationsEnabled();
|
static bool areNotificationsEnabled();
|
||||||
|
@ -221,7 +221,7 @@ int TabWidget::addBrowser(bool move_after_current, bool make_active, const QUrl&
|
|||||||
int final_index;
|
int final_index;
|
||||||
QString browser_tab_name = tr("Web browser");
|
QString browser_tab_name = tr("Web browser");
|
||||||
|
|
||||||
#if defined (Q_OS_MACOSOS)
|
#if defined(Q_OS_MACOSOS)
|
||||||
browser_tab_name = browser_tab_name.prepend(QSL(" "));
|
browser_tab_name = browser_tab_name.prepend(QSL(" "));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -283,7 +283,7 @@ void TabWidget::gotoPreviousTab() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TabWidget::indentTabText(int index) {
|
void TabWidget::indentTabText(int index) {
|
||||||
#if defined (Q_OS_MACOSOS)
|
#if defined(Q_OS_MACOSOS)
|
||||||
if (tabBar()->tabType(index) != TabBar::FeedReader && !tabIcon(index).isNull()) {
|
if (tabBar()->tabType(index) != TabBar::FeedReader && !tabIcon(index).isNull()) {
|
||||||
// We have closable tab with some icon, fix the title.
|
// We have closable tab with some icon, fix the title.
|
||||||
const QString text = tabText(index);
|
const QString text = tabText(index);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QSessionManager>
|
#include <QSessionManager>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#if defined(USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
#include "network-web/adblock/adblockicon.h"
|
#include "network-web/adblock/adblockicon.h"
|
||||||
@ -122,7 +123,9 @@ void Application::reactOnForeignNotifications() {
|
|||||||
|
|
||||||
void Application::hideOrShowMainForm() {
|
void Application::hideOrShowMainForm() {
|
||||||
// Display main window.
|
// Display main window.
|
||||||
if (qApp->settings()->value(GROUP(GUI), SETTING(GUI::MainWindowStartsHidden)).toBool() && SystemTrayIcon::isSystemTrayActivated()) {
|
if (qApp->settings()->value(GROUP(GUI), SETTING(GUI::MainWindowStartsHidden)).toBool() &&
|
||||||
|
SystemTrayIcon::isSystemTrayDesired() &&
|
||||||
|
SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
qDebugNN << LOGSEC_CORE << "Hiding the main window when the application is starting.";
|
qDebugNN << LOGSEC_CORE << "Hiding the main window when the application is starting.";
|
||||||
mainForm()->switchVisibility(true);
|
mainForm()->switchVisibility(true);
|
||||||
}
|
}
|
||||||
@ -158,7 +161,7 @@ bool Application::isAlreadyRunning() {
|
|||||||
: sendMessage((QStringList() << APP_IS_RUNNING << Application::arguments().mid(1)).join(ARGUMENTS_LIST_SEPARATOR));
|
: sendMessage((QStringList() << APP_IS_RUNNING << Application::arguments().mid(1)).join(ARGUMENTS_LIST_SEPARATOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedReader* Application::feedReader() {
|
FeedReader* Application:: feedReader() {
|
||||||
return m_feedReader;
|
return m_feedReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +283,7 @@ QString Application::userDataHomeFolder() const {
|
|||||||
return home_folder;
|
return home_folder;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if defined (Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
return IOFactory::getSystemFolder(QStandardPaths::GenericDataLocation) + QDir::separator() + QSL(APP_NAME);
|
return IOFactory::getSystemFolder(QStandardPaths::GenericDataLocation) + QDir::separator() + QSL(APP_NAME);
|
||||||
#else
|
#else
|
||||||
return configFolder() + QDir::separator() + QSL(APP_NAME);
|
return configFolder() + QDir::separator() + QSL(APP_NAME);
|
||||||
@ -297,7 +300,7 @@ QString Application::documentsFolder() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString Application::homeFolder() const {
|
QString Application::homeFolder() const {
|
||||||
#if defined (Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
return IOFactory::getSystemFolder(QStandardPaths::GenericDataLocation);
|
return IOFactory::getSystemFolder(QStandardPaths::GenericDataLocation);
|
||||||
#else
|
#else
|
||||||
return IOFactory::getSystemFolder(QStandardPaths::HomeLocation);
|
return IOFactory::getSystemFolder(QStandardPaths::HomeLocation);
|
||||||
@ -412,8 +415,15 @@ QIcon Application::desktopAwareIcon() const {
|
|||||||
|
|
||||||
void Application::showTrayIcon() {
|
void Application::showTrayIcon() {
|
||||||
// Display tray icon if it is enabled and available.
|
// Display tray icon if it is enabled and available.
|
||||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
if (SystemTrayIcon::isSystemTrayDesired()) {
|
||||||
qDebugNN << LOGSEC_CORE << "Showing tray icon.";
|
#if !defined(Q_OS_LINUX)
|
||||||
|
if (!SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
|
qWarningNN << LOGSEC_GUI << "Tray icon area is not available.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
qDebugNN << LOGSEC_GUI << "Showing tray icon.";
|
||||||
trayIcon()->show();
|
trayIcon()->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,7 +443,9 @@ void Application::deleteTrayIcon() {
|
|||||||
void Application::showGuiMessage(const QString& title, const QString& message,
|
void Application::showGuiMessage(const QString& title, const QString& message,
|
||||||
QSystemTrayIcon::MessageIcon message_type, QWidget* parent,
|
QSystemTrayIcon::MessageIcon message_type, QWidget* parent,
|
||||||
bool show_at_least_msgbox, std::function<void()> functor) {
|
bool show_at_least_msgbox, std::function<void()> functor) {
|
||||||
if (SystemTrayIcon::areNotificationsEnabled() && SystemTrayIcon::isSystemTrayActivated()) {
|
if (SystemTrayIcon::areNotificationsEnabled() &&
|
||||||
|
SystemTrayIcon::isSystemTrayDesired() &&
|
||||||
|
SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||||
trayIcon()->showMessage(title, message, message_type, TRAY_ICON_BUBBLE_TIMEOUT, std::move(functor));
|
trayIcon()->showMessage(title, message, message_type, TRAY_ICON_BUBBLE_TIMEOUT, std::move(functor));
|
||||||
}
|
}
|
||||||
else if (show_at_least_msgbox) {
|
else if (show_at_least_msgbox) {
|
||||||
|
@ -2637,7 +2637,7 @@ QList<ServiceRoot*> DatabaseQueries::getFeedlyAccounts(const QSqlDatabase& db, b
|
|||||||
root->network()->setUsername(query.value(1).toString());
|
root->network()->setUsername(query.value(1).toString());
|
||||||
root->network()->setDeveloperAccessToken(query.value(2).toString());
|
root->network()->setDeveloperAccessToken(query.value(2).toString());
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
root->network()->oauth()->setRefreshToken(query.value(3).toString());
|
root->network()->oauth()->setRefreshToken(query.value(3).toString());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
|
|
||||||
// WebEngine.
|
// WebEngine.
|
||||||
DKEY WebEngineAttributes::ID = "web_engine_attributes";
|
DKEY WebEngineAttributes::ID = "web_engine_attributes";
|
||||||
@ -425,7 +425,7 @@ SettingsProperties Settings::determineProperties() {
|
|||||||
else {
|
else {
|
||||||
// We will use PORTABLE settings only and only if it is available and NON-PORTABLE
|
// We will use PORTABLE settings only and only if it is available and NON-PORTABLE
|
||||||
// settings was not initialized before.
|
// settings was not initialized before.
|
||||||
#if defined (Q_OS_LINUX) || defined (Q_OS_ANDROID) || defined (Q_OS_MACOSOS)
|
#if defined(Q_OS_LINUX) || defined (Q_OS_ANDROID) || defined (Q_OS_MACOSOS)
|
||||||
// DO NOT use portable settings for Linux, it is really not used on that platform.
|
// DO NOT use portable settings for Linux, it is really not used on that platform.
|
||||||
const bool will_we_use_portable_settings = false;
|
const bool will_we_use_portable_settings = false;
|
||||||
#else
|
#else
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#define DEFAULT_VALUE(x) x ## Def
|
#define DEFAULT_VALUE(x) x ## Def
|
||||||
#define GROUP(x) x::ID
|
#define GROUP(x) x::ID
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
namespace WebEngineAttributes {
|
namespace WebEngineAttributes {
|
||||||
KEY ID;
|
KEY ID;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
WebFactory::WebFactory(QObject* parent)
|
WebFactory::WebFactory(QObject* parent)
|
||||||
: QObject(parent) {
|
: QObject(parent) {
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
m_engineSettings = nullptr;
|
m_engineSettings = nullptr;
|
||||||
m_adBlock = new AdBlockManager(this);
|
m_adBlock = new AdBlockManager(this);
|
||||||
m_urlInterceptor = new NetworkUrlInterceptor(this);
|
m_urlInterceptor = new NetworkUrlInterceptor(this);
|
||||||
@ -41,7 +41,7 @@ WebFactory::WebFactory(QObject* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
WebFactory::~WebFactory() {
|
WebFactory::~WebFactory() {
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
if (m_engineSettings != nullptr && m_engineSettings->menu() != nullptr) {
|
if (m_engineSettings != nullptr && m_engineSettings->menu() != nullptr) {
|
||||||
m_engineSettings->menu()->deleteLater();
|
m_engineSettings->menu()->deleteLater();
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ void WebFactory::updateProxy() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
AdBlockManager* WebFactory::adBlock() {
|
AdBlockManager* WebFactory::adBlock() {
|
||||||
return m_adBlock;
|
return m_adBlock;
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
#include <QWebEngineSettings>
|
#include <QWebEngineSettings>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class AdBlockManager;
|
class AdBlockManager;
|
||||||
class NetworkUrlInterceptor;
|
class NetworkUrlInterceptor;
|
||||||
@ -35,7 +35,7 @@ class WebFactory : public QObject {
|
|||||||
// ∀ = ∀ (entity name), ∀ (base-10 entity), ∀ (base-16 entity)
|
// ∀ = ∀ (entity name), ∀ (base-10 entity), ∀ (base-16 entity)
|
||||||
QString unescapeHtml(const QString& html);
|
QString unescapeHtml(const QString& html);
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
QAction* engineSettingsAction();
|
QAction* engineSettingsAction();
|
||||||
AdBlockManager* adBlock();
|
AdBlockManager* adBlock();
|
||||||
NetworkUrlInterceptor* urlIinterceptor();
|
NetworkUrlInterceptor* urlIinterceptor();
|
||||||
@ -46,7 +46,7 @@ class WebFactory : public QObject {
|
|||||||
bool openUrlInExternalBrowser(const QString& url) const;
|
bool openUrlInExternalBrowser(const QString& url) const;
|
||||||
bool sendMessageViaEmail(const Message& message);
|
bool sendMessageViaEmail(const Message& message);
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
private slots:
|
private slots:
|
||||||
void createMenu(QMenu* menu = nullptr);
|
void createMenu(QMenu* menu = nullptr);
|
||||||
void webEngineSettingChanged(bool enabled);
|
void webEngineSettingChanged(bool enabled);
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "services/feedly/feedlyfeed.h"
|
#include "services/feedly/feedlyfeed.h"
|
||||||
#include "services/feedly/feedlyserviceroot.h"
|
#include "services/feedly/feedlyserviceroot.h"
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
#include "network-web/oauth2service.h"
|
#include "network-web/oauth2service.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
FeedlyNetwork::FeedlyNetwork(QObject* parent)
|
FeedlyNetwork::FeedlyNetwork(QObject* parent)
|
||||||
: QObject(parent), m_service(nullptr),
|
: QObject(parent), m_service(nullptr),
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
m_oauth(new OAuth2Service(QSL(FEEDLY_API_URL_BASE) + FEEDLY_API_URL_AUTH,
|
m_oauth(new OAuth2Service(QSL(FEEDLY_API_URL_BASE) + FEEDLY_API_URL_AUTH,
|
||||||
QSL(FEEDLY_API_URL_BASE) + FEEDLY_API_URL_TOKEN,
|
QSL(FEEDLY_API_URL_BASE) + FEEDLY_API_URL_TOKEN,
|
||||||
FEEDLY_CLIENT_ID,
|
FEEDLY_CLIENT_ID,
|
||||||
@ -36,7 +36,7 @@ FeedlyNetwork::FeedlyNetwork(QObject* parent)
|
|||||||
m_username(QString()),
|
m_username(QString()),
|
||||||
m_developerAccessToken(QString()), m_batchSize(FEEDLY_DEFAULT_BATCH_SIZE), m_downloadOnlyUnreadMessages(false) {
|
m_developerAccessToken(QString()), m_batchSize(FEEDLY_DEFAULT_BATCH_SIZE), m_downloadOnlyUnreadMessages(false) {
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
m_oauth->setRedirectUrl(QString(OAUTH_REDIRECT_URI) + QL1C(':') + QString::number(FEEDLY_API_REDIRECT_URI_PORT));
|
m_oauth->setRedirectUrl(QString(OAUTH_REDIRECT_URI) + QL1C(':') + QString::number(FEEDLY_API_REDIRECT_URI_PORT));
|
||||||
|
|
||||||
connect(m_oauth, &OAuth2Service::tokensRetrieveError, this, &FeedlyNetwork::onTokensError);
|
connect(m_oauth, &OAuth2Service::tokensRetrieveError, this, &FeedlyNetwork::onTokensError);
|
||||||
@ -490,7 +490,7 @@ void FeedlyNetwork::setBatchSize(int batch_size) {
|
|||||||
m_batchSize = batch_size;
|
m_batchSize = batch_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
|
|
||||||
void FeedlyNetwork::onTokensError(const QString& error, const QString& error_description) {
|
void FeedlyNetwork::onTokensError(const QString& error, const QString& error_description) {
|
||||||
Q_UNUSED(error)
|
Q_UNUSED(error)
|
||||||
@ -561,7 +561,7 @@ QString FeedlyNetwork::fullUrl(FeedlyNetwork::Service service) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString FeedlyNetwork::bearer() const {
|
QString FeedlyNetwork::bearer() const {
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
if (m_developerAccessToken.simplified().isEmpty()) {
|
if (m_developerAccessToken.simplified().isEmpty()) {
|
||||||
return m_oauth->bearer().toLocal8Bit();
|
return m_oauth->bearer().toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "network-web/networkfactory.h"
|
#include "network-web/networkfactory.h"
|
||||||
#include "services/abstract/feed.h"
|
#include "services/abstract/feed.h"
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
class OAuth2Service;
|
class OAuth2Service;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ class FeedlyNetwork : public QObject {
|
|||||||
|
|
||||||
void setService(FeedlyServiceRoot* service);
|
void setService(FeedlyServiceRoot* service);
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
OAuth2Service* oauth() const;
|
OAuth2Service* oauth() const;
|
||||||
void setOauth(OAuth2Service* oauth);
|
void setOauth(OAuth2Service* oauth);
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ class FeedlyNetwork : public QObject {
|
|||||||
private:
|
private:
|
||||||
FeedlyServiceRoot* m_service;
|
FeedlyServiceRoot* m_service;
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
OAuth2Service* m_oauth;
|
OAuth2Service* m_oauth;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "services/feedly/feedlynetwork.h"
|
#include "services/feedly/feedlynetwork.h"
|
||||||
#include "services/feedly/gui/formeditfeedlyaccount.h"
|
#include "services/feedly/gui/formeditfeedlyaccount.h"
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
#include "network-web/oauth2service.h"
|
#include "network-web/oauth2service.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ void FeedlyServiceRoot::saveAccountDataToDatabase(bool creating_new) {
|
|||||||
if (DatabaseQueries::overwriteFeedlyAccount(database,
|
if (DatabaseQueries::overwriteFeedlyAccount(database,
|
||||||
m_network->username(),
|
m_network->username(),
|
||||||
m_network->developerAccessToken(),
|
m_network->developerAccessToken(),
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
m_network->oauth()->refreshToken(),
|
m_network->oauth()->refreshToken(),
|
||||||
#else
|
#else
|
||||||
{},
|
{},
|
||||||
@ -221,7 +221,7 @@ void FeedlyServiceRoot::saveAccountDataToDatabase(bool creating_new) {
|
|||||||
if (DatabaseQueries::createFeedlyAccount(database,
|
if (DatabaseQueries::createFeedlyAccount(database,
|
||||||
m_network->username(),
|
m_network->username(),
|
||||||
m_network->developerAccessToken(),
|
m_network->developerAccessToken(),
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
m_network->oauth()->refreshToken(),
|
m_network->oauth()->refreshToken(),
|
||||||
#else
|
#else
|
||||||
{},
|
{},
|
||||||
|
@ -81,7 +81,7 @@ FeedlyAccountDetails::FeedlyAccountDetails(QWidget* parent) : QWidget(parent) {
|
|||||||
onDeveloperAccessTokenChanged();
|
onDeveloperAccessTokenChanged();
|
||||||
onUsernameChanged();
|
onUsernameChanged();
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
hookNetwork();
|
hookNetwork();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ void FeedlyAccountDetails::getDeveloperAccessToken() {
|
|||||||
qApp->web()->openUrlInExternalBrowser(FEEDLY_GENERATE_DAT);
|
qApp->web()->openUrlInExternalBrowser(FEEDLY_GENERATE_DAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
|
|
||||||
void FeedlyAccountDetails::hookNetwork() {
|
void FeedlyAccountDetails::hookNetwork() {
|
||||||
connect(m_oauth, &OAuth2Service::tokensRetrieved, this, &FeedlyAccountDetails::onAuthGranted);
|
connect(m_oauth, &OAuth2Service::tokensRetrieved, this, &FeedlyAccountDetails::onAuthGranted);
|
||||||
@ -121,7 +121,7 @@ void FeedlyAccountDetails::onAuthGranted() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void FeedlyAccountDetails::performTest(const QNetworkProxy& custom_proxy) {
|
void FeedlyAccountDetails::performTest(const QNetworkProxy& custom_proxy) {
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
m_oauth->logout(false);
|
m_oauth->logout(false);
|
||||||
|
|
||||||
if (m_ui.m_txtDeveloperAccessToken->lineEdit()->text().simplified().isEmpty()) {
|
if (m_ui.m_txtDeveloperAccessToken->lineEdit()->text().simplified().isEmpty()) {
|
||||||
@ -168,7 +168,7 @@ void FeedlyAccountDetails::onDeveloperAccessTokenChanged() {
|
|||||||
const QString token = m_ui.m_txtDeveloperAccessToken->lineEdit()->text();
|
const QString token = m_ui.m_txtDeveloperAccessToken->lineEdit()->text();
|
||||||
|
|
||||||
if (token.isEmpty()) {
|
if (token.isEmpty()) {
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
WidgetWithStatus::StatusType stat = WidgetWithStatus::StatusType::Ok;
|
WidgetWithStatus::StatusType stat = WidgetWithStatus::StatusType::Ok;
|
||||||
#else
|
#else
|
||||||
WidgetWithStatus::StatusType stat = WidgetWithStatus::StatusType::Error;
|
WidgetWithStatus::StatusType stat = WidgetWithStatus::StatusType::Error;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
class OAuth2Service;
|
class OAuth2Service;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ class FeedlyAccountDetails : public QWidget {
|
|||||||
void onUsernameChanged();
|
void onUsernameChanged();
|
||||||
void onDeveloperAccessTokenChanged();
|
void onDeveloperAccessTokenChanged();
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
private slots:
|
private slots:
|
||||||
void onAuthFailed();
|
void onAuthFailed();
|
||||||
void onAuthError(const QString& error, const QString& detailed_description);
|
void onAuthError(const QString& error, const QString& detailed_description);
|
||||||
@ -42,7 +42,7 @@ class FeedlyAccountDetails : public QWidget {
|
|||||||
private:
|
private:
|
||||||
Ui::FeedlyAccountDetails m_ui;
|
Ui::FeedlyAccountDetails m_ui;
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
OAuth2Service* m_oauth;
|
OAuth2Service* m_oauth;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "services/feedly/feedlyserviceroot.h"
|
#include "services/feedly/feedlyserviceroot.h"
|
||||||
#include "services/feedly/gui/feedlyaccountdetails.h"
|
#include "services/feedly/gui/feedlyaccountdetails.h"
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
#include "network-web/oauth2service.h"
|
#include "network-web/oauth2service.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ FormEditFeedlyAccount::FormEditFeedlyAccount(QWidget* parent)
|
|||||||
void FormEditFeedlyAccount::apply() {
|
void FormEditFeedlyAccount::apply() {
|
||||||
bool editing_account = !applyInternal<FeedlyServiceRoot>();
|
bool editing_account = !applyInternal<FeedlyServiceRoot>();
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
if (!editing_account) {
|
if (!editing_account) {
|
||||||
// We transfer refresh token to avoid the need to login once more,
|
// We transfer refresh token to avoid the need to login once more,
|
||||||
// then we delete testing OAuth service.
|
// then we delete testing OAuth service.
|
||||||
@ -60,7 +60,7 @@ void FormEditFeedlyAccount::apply() {
|
|||||||
void FormEditFeedlyAccount::setEditableAccount(ServiceRoot* editable_account) {
|
void FormEditFeedlyAccount::setEditableAccount(ServiceRoot* editable_account) {
|
||||||
FormAccountDetails::setEditableAccount(editable_account);
|
FormAccountDetails::setEditableAccount(editable_account);
|
||||||
|
|
||||||
#if defined (FEEDLY_OFFICIAL_SUPPORT)
|
#if defined(FEEDLY_OFFICIAL_SUPPORT)
|
||||||
if (m_details->m_oauth != nullptr) {
|
if (m_details->m_oauth != nullptr) {
|
||||||
// We will use live OAuth service for testing.
|
// We will use live OAuth service for testing.
|
||||||
m_details->m_oauth->logout(true);
|
m_details->m_oauth->logout(true);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <QtPlatformHeaders/QWindowsWindowFunctions>
|
#include <QtPlatformHeaders/QWindowsWindowFunctions>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (Q_OS_MACOS)
|
#if defined(Q_OS_MACOS)
|
||||||
extern void disableWindowTabbing();
|
extern void disableWindowTabbing();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -25,14 +25,14 @@ int main(int argc, char* argv[]) {
|
|||||||
QApplication::setAttribute(Qt::ApplicationAttribute::AA_EnableHighDpiScaling);
|
QApplication::setAttribute(Qt::ApplicationAttribute::AA_EnableHighDpiScaling);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
QApplication::setDesktopFileName(APP_DESKTOP_ENTRY_FILE);
|
QApplication::setDesktopFileName(APP_DESKTOP_ENTRY_FILE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Ensure that ini format is used as application settings storage on Mac OS.
|
// Ensure that ini format is used as application settings storage on Mac OS.
|
||||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||||
|
|
||||||
#if defined (Q_OS_MACOS)
|
#if defined(Q_OS_MACOS)
|
||||||
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
|
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||||
disableWindowTabbing();
|
disableWindowTabbing();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user