|
|
@ -40,6 +40,7 @@ |
|
|
|
#include <QFileSystemWatcher> |
|
|
|
#include <QFileSystemWatcher> |
|
|
|
#include <QKeyEvent> |
|
|
|
#include <QKeyEvent> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QMessageBox> |
|
|
|
|
|
|
|
#include <QMetaObject> |
|
|
|
#include <QMimeData> |
|
|
|
#include <QMimeData> |
|
|
|
#include <QProcess> |
|
|
|
#include <QProcess> |
|
|
|
#include <QPushButton> |
|
|
|
#include <QPushButton> |
|
|
@ -348,8 +349,7 @@ MainWindow::MainWindow(QWidget *parent) |
|
|
|
on_actionWarningMessages_triggered(m_ui->actionWarningMessages->isChecked()); |
|
|
|
on_actionWarningMessages_triggered(m_ui->actionWarningMessages->isChecked()); |
|
|
|
on_actionCriticalMessages_triggered(m_ui->actionCriticalMessages->isChecked()); |
|
|
|
on_actionCriticalMessages_triggered(m_ui->actionCriticalMessages->isChecked()); |
|
|
|
if (m_ui->actionSearchWidget->isChecked()) |
|
|
|
if (m_ui->actionSearchWidget->isChecked()) |
|
|
|
QTimer::singleShot(0, this, &MainWindow::on_actionSearchWidget_triggered); |
|
|
|
QMetaObject::invokeMethod(this, &MainWindow::on_actionSearchWidget_triggered, Qt::QueuedConnection); |
|
|
|
|
|
|
|
|
|
|
|
// Auto shutdown actions
|
|
|
|
// Auto shutdown actions
|
|
|
|
auto *autoShutdownGroup = new QActionGroup(this); |
|
|
|
auto *autoShutdownGroup = new QActionGroup(this); |
|
|
|
autoShutdownGroup->setExclusive(true); |
|
|
|
autoShutdownGroup->setExclusive(true); |
|
|
@ -1195,7 +1195,7 @@ void MainWindow::closeEvent(QCloseEvent *e) |
|
|
|
if (!m_forceExit && m_systrayIcon && goToSystrayOnExit && !this->isHidden()) |
|
|
|
if (!m_forceExit && m_systrayIcon && goToSystrayOnExit && !this->isHidden()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
e->ignore(); |
|
|
|
e->ignore(); |
|
|
|
QTimer::singleShot(0, this, &QWidget::hide); |
|
|
|
QMetaObject::invokeMethod(this, &QWidget::hide, Qt::QueuedConnection); |
|
|
|
if (!pref->closeToTrayNotified()) |
|
|
|
if (!pref->closeToTrayNotified()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
showNotificationBalloon(tr("qBittorrent is closed to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); |
|
|
|
showNotificationBalloon(tr("qBittorrent is closed to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); |
|
|
@ -1292,7 +1292,7 @@ bool MainWindow::event(QEvent *e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug("Minimize to Tray enabled, hiding!"); |
|
|
|
qDebug("Minimize to Tray enabled, hiding!"); |
|
|
|
e->ignore(); |
|
|
|
e->ignore(); |
|
|
|
QTimer::singleShot(0, this, &QWidget::hide); |
|
|
|
QMetaObject::invokeMethod(this, &QWidget::hide, Qt::QueuedConnection); |
|
|
|
if (!pref->minimizeToTrayNotified()) |
|
|
|
if (!pref->minimizeToTrayNotified()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
showNotificationBalloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); |
|
|
|
showNotificationBalloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); |
|
|
|