mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Improved "delete torrents once they reach a given ratio"
Fix button order in exit confirmation dialog
This commit is contained in:
@@ -541,8 +541,7 @@ void GUI::closeEvent(QCloseEvent *e) {
|
|||||||
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("Some files are currently transferring.\nAre you sure you want to quit qBittorrent?"),
|
tr("Some files are currently transferring.\nAre you sure you want to quit qBittorrent?"),
|
||||||
tr("&Yes"), tr("&No"),
|
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes) == QMessageBox::No) {
|
||||||
QString(), 0, 1)) {
|
|
||||||
e->ignore();
|
e->ignore();
|
||||||
force_exit = false;
|
force_exit = false;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ void Bittorrent::deleteBigRatios() {
|
|||||||
if(h.is_seed()) {
|
if(h.is_seed()) {
|
||||||
const QString hash = h.hash();
|
const QString hash = h.hash();
|
||||||
const float ratio = getRealRatio(hash);
|
const float ratio = getRealRatio(hash);
|
||||||
if(ratio <= MAX_RATIO && ratio > ratio_limit) {
|
if(ratio <= MAX_RATIO && ratio >= ratio_limit) {
|
||||||
addConsoleMessage(tr("%1 reached the maximum ratio you set.").arg(h.name()));
|
addConsoleMessage(tr("%1 reached the maximum ratio you set.").arg(h.name()));
|
||||||
deleteTorrent(hash);
|
deleteTorrent(hash);
|
||||||
//emit torrent_ratio_deleted(fileName);
|
//emit torrent_ratio_deleted(fileName);
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ void PropertiesWidget::loadDynamicData() {
|
|||||||
if(ratio > 100.)
|
if(ratio > 100.)
|
||||||
shareRatio->setText(QString::fromUtf8("∞"));
|
shareRatio->setText(QString::fromUtf8("∞"));
|
||||||
else
|
else
|
||||||
shareRatio->setText(QString(QByteArray::number(ratio, 'f', 1)));
|
shareRatio->setText(QString(QByteArray::number(ratio, 'f', 2)));
|
||||||
if(!h.is_seed()) {
|
if(!h.is_seed()) {
|
||||||
showPiecesDownloaded(true);
|
showPiecesDownloaded(true);
|
||||||
// Downloaded pieces
|
// Downloaded pieces
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public:
|
|||||||
if(ratio > 100.)
|
if(ratio > 100.)
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8("∞"));
|
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8("∞"));
|
||||||
else
|
else
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::number(ratio, 'f', 1));
|
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::number(ratio, 'f', 2));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TR_PRIORITY: {
|
case TR_PRIORITY: {
|
||||||
|
|||||||
Reference in New Issue
Block a user