|
|
@ -316,6 +316,20 @@ MainWindow::MainWindow(QWidget *parent) |
|
|
|
activateWindow(); |
|
|
|
activateWindow(); |
|
|
|
raise(); |
|
|
|
raise(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
create(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
// Make sure the Window is visible if we don't have a tray icon
|
|
|
|
|
|
|
|
if (pref->startMinimized()) { |
|
|
|
|
|
|
|
showMinimized(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
show(); |
|
|
|
|
|
|
|
activateWindow(); |
|
|
|
|
|
|
|
raise(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
properties->readSettings(); |
|
|
|
properties->readSettings(); |
|
|
@ -351,18 +365,6 @@ MainWindow::MainWindow(QWidget *parent) |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
qt_mac_set_dock_menu(getTrayIconMenu()); |
|
|
|
qt_mac_set_dock_menu(getTrayIconMenu()); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Make sure the Window is visible if we don't have a tray icon
|
|
|
|
|
|
|
|
if (!systrayIcon) { |
|
|
|
|
|
|
|
if (pref->startMinimized()) { |
|
|
|
|
|
|
|
showMinimized(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
show(); |
|
|
|
|
|
|
|
activateWindow(); |
|
|
|
|
|
|
|
raise(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MainWindow::~MainWindow() |
|
|
|
MainWindow::~MainWindow() |
|
|
@ -882,6 +884,7 @@ void MainWindow::closeEvent(QCloseEvent *e) |
|
|
|
e->accept(); |
|
|
|
e->accept(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pref->confirmOnExit() && QBtSession::instance()->hasActiveTorrents()) { |
|
|
|
if (pref->confirmOnExit() && QBtSession::instance()->hasActiveTorrents()) { |
|
|
|
if (e->spontaneous() || force_exit) { |
|
|
|
if (e->spontaneous() || force_exit) { |
|
|
|
if (!isVisible()) |
|
|
|
if (!isVisible()) |
|
|
@ -905,12 +908,11 @@ void MainWindow::closeEvent(QCloseEvent *e) |
|
|
|
Preferences::instance()->setConfirmOnExit(false); |
|
|
|
Preferences::instance()->setConfirmOnExit(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
hide(); |
|
|
|
hide(); |
|
|
|
|
|
|
|
// Hide tray icon
|
|
|
|
if (systrayIcon) |
|
|
|
if (systrayIcon) |
|
|
|
// Hide tray icon
|
|
|
|
|
|
|
|
systrayIcon->hide(); |
|
|
|
systrayIcon->hide(); |
|
|
|
// Save window size, columns size
|
|
|
|
|
|
|
|
writeSettings(); |
|
|
|
|
|
|
|
// Accept exit
|
|
|
|
// Accept exit
|
|
|
|
e->accept(); |
|
|
|
e->accept(); |
|
|
|
qApp->exit(); |
|
|
|
qApp->exit(); |
|
|
|