Improved "delete torrents once they reach a given ratio"

Fix button order in exit confirmation dialog
This commit is contained in:
Christophe Dumez
2010-06-22 17:50:36 +00:00
parent 5a58ace305
commit 0de843911d
4 changed files with 4 additions and 5 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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

View File

@@ -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: {