|
|
@ -496,7 +496,7 @@ void GUI::on_actionAbout_triggered() { |
|
|
|
|
|
|
|
|
|
|
|
// Called when we close the program
|
|
|
|
// Called when we close the program
|
|
|
|
void GUI::closeEvent(QCloseEvent *e) { |
|
|
|
void GUI::closeEvent(QCloseEvent *e) { |
|
|
|
qDebug("Mainwindow received closeEvent"); |
|
|
|
|
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool(); |
|
|
|
bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool(); |
|
|
|
if(!force_exit && systrayIntegration && goToSystrayOnExit && !this->isHidden()) { |
|
|
|
if(!force_exit && systrayIntegration && goToSystrayOnExit && !this->isHidden()) { |
|
|
@ -508,6 +508,7 @@ void GUI::closeEvent(QCloseEvent *e) { |
|
|
|
show(); |
|
|
|
show(); |
|
|
|
if(!isMaximized()) |
|
|
|
if(!isMaximized()) |
|
|
|
showNormal(); |
|
|
|
showNormal(); |
|
|
|
|
|
|
|
if(e->spontaneous() == true || force_exit == true) { |
|
|
|
if(QMessageBox::question(this, |
|
|
|
if(QMessageBox::question(this, |
|
|
|
tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"), |
|
|
|
tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"), |
|
|
|
tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"), |
|
|
|
tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"), |
|
|
@ -518,6 +519,7 @@ void GUI::closeEvent(QCloseEvent *e) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
hide(); |
|
|
|
hide(); |
|
|
|
if(systrayIntegration) { |
|
|
|
if(systrayIntegration) { |
|
|
|
// Hide tray icon
|
|
|
|
// Hide tray icon
|
|
|
@ -533,6 +535,7 @@ void GUI::closeEvent(QCloseEvent *e) { |
|
|
|
qApp->exit(); |
|
|
|
qApp->exit(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Display window to create a torrent
|
|
|
|
// Display window to create a torrent
|
|
|
|
void GUI::on_actionCreate_torrent_triggered() { |
|
|
|
void GUI::on_actionCreate_torrent_triggered() { |
|
|
|
createtorrent *ct = new createtorrent(this); |
|
|
|
createtorrent *ct = new createtorrent(this); |
|
|
|