mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 22:37:59 +00:00
- Fixed behaviour options. Broke them a few commits ago
This commit is contained in:
parent
7e1f98cd46
commit
a4deec6cde
14
src/GUI.cpp
14
src/GUI.cpp
@ -814,13 +814,13 @@ void GUI::showAbout(){
|
|||||||
// Called when we close the program
|
// Called when we close the program
|
||||||
void GUI::closeEvent(QCloseEvent *e){
|
void GUI::closeEvent(QCloseEvent *e){
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
bool goToSystrayOnExit = settings.value("Options/Misc/GoToSystrayOnExit", false).toBool();
|
bool goToSystrayOnExit = settings.value("Options/Misc/Behaviour/GoToSystrayOnExit", false).toBool();
|
||||||
if(goToSystrayOnExit && !this->isHidden()){
|
if(goToSystrayOnExit && !this->isHidden()){
|
||||||
hide();
|
hide();
|
||||||
e->ignore();
|
e->ignore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(settings.value("Options/Misc/ConfirmOnExit", true).toBool()){
|
if(settings.value("Options/Misc/Behaviour/ConfirmOnExit", true).toBool()){
|
||||||
if(QMessageBox::question(this,
|
if(QMessageBox::question(this,
|
||||||
tr("Are you sure you want to quit?")+" -- "+tr("qBittorrent"),
|
tr("Are you sure you want to quit?")+" -- "+tr("qBittorrent"),
|
||||||
tr("Are you sure you want to quit qBittorrent?"),
|
tr("Are you sure you want to quit qBittorrent?"),
|
||||||
@ -831,7 +831,7 @@ void GUI::closeEvent(QCloseEvent *e){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Clean finished torrents on exit if asked for
|
// Clean finished torrents on exit if asked for
|
||||||
if(settings.value("Options/Misc/ClearFinishedDownloads", true).toBool()){
|
if(settings.value("Options/Misc/Behaviour/ClearFinishedDownloads", true).toBool()){
|
||||||
torrent_handle h;
|
torrent_handle h;
|
||||||
// XXX: Probably move this to the bittorrent part
|
// XXX: Probably move this to the bittorrent part
|
||||||
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
||||||
@ -869,7 +869,7 @@ void GUI::showCreateWindow(){
|
|||||||
// Called when we minimize the program
|
// Called when we minimize the program
|
||||||
void GUI::hideEvent(QHideEvent *e){
|
void GUI::hideEvent(QHideEvent *e){
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
if(settings.value("Options/Misc/GoToSystray", true).toBool()){
|
if(settings.value("Options/Misc/Behaviour/GoToSystray", true).toBool()){
|
||||||
// Hide window
|
// Hide window
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
@ -1346,7 +1346,7 @@ void GUI::finishedTorrent(torrent_handle& h){
|
|||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
QString fileName = QString(h.name().c_str());
|
QString fileName = QString(h.name().c_str());
|
||||||
setInfoBar(tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName));
|
setInfoBar(tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName));
|
||||||
bool useOSD = (settings.value("Options/Misc/OSDEnabled", 1).toInt() > 0);
|
bool useOSD = (settings.value("Options/OSDEnabled", 1).toInt() > 0);
|
||||||
if(useOSD && (isMinimized() || isHidden())) {
|
if(useOSD && (isMinimized() || isHidden())) {
|
||||||
myTrayIcon->showMessage(tr("Download finished"), tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName), QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
|
myTrayIcon->showMessage(tr("Download finished"), tr("%1 has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(fileName), QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
|
||||||
}
|
}
|
||||||
@ -1355,7 +1355,7 @@ void GUI::finishedTorrent(torrent_handle& h){
|
|||||||
// Notification when disk is full
|
// Notification when disk is full
|
||||||
void GUI::fullDiskError(torrent_handle& h){
|
void GUI::fullDiskError(torrent_handle& h){
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
bool useOSD = (settings.value("Options/Misc/OSDEnabled", 1).toInt() > 0);
|
bool useOSD = (settings.value("Options/OSDEnabled", 1).toInt() > 0);
|
||||||
if(useOSD && (isMinimized() || isHidden())) {
|
if(useOSD && (isMinimized() || isHidden())) {
|
||||||
myTrayIcon->showMessage(tr("I/O Error", "i.e: Input/Output Error"), tr("An error occured when trying to read or write %1. The disk is probably full, download has been paused", "e.g: An error occured when trying to read or write xxx.avi. The disk is probably full, download has been paused").arg(QString(h.name().c_str())), QSystemTrayIcon::Critical, TIME_TRAY_BALLOON);
|
myTrayIcon->showMessage(tr("I/O Error", "i.e: Input/Output Error"), tr("An error occured when trying to read or write %1. The disk is probably full, download has been paused", "e.g: An error occured when trying to read or write xxx.avi. The disk is probably full, download has been paused").arg(QString(h.name().c_str())), QSystemTrayIcon::Critical, TIME_TRAY_BALLOON);
|
||||||
}
|
}
|
||||||
@ -1732,7 +1732,7 @@ void GUI::on_update_nova_button_clicked(){
|
|||||||
// Error | Stopped by user | Finished normally
|
// Error | Stopped by user | Finished normally
|
||||||
void GUI::searchFinished(int exitcode,QProcess::ExitStatus){
|
void GUI::searchFinished(int exitcode,QProcess::ExitStatus){
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
bool useOSD = (settings.value("Options/Misc/OSDEnabled", 1).toInt() > 0);
|
bool useOSD = (settings.value("Options/OSDEnabled", 1).toInt() > 0);
|
||||||
if(useOSD && (isMinimized() || isHidden())) {
|
if(useOSD && (isMinimized() || isHidden())) {
|
||||||
myTrayIcon->showMessage(tr("Search Engine"), tr("Search has finished"), QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
|
myTrayIcon->showMessage(tr("Search Engine"), tr("Search has finished"), QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user