mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-15 01:00:17 +00:00
Implement an option to disable confirmation of torrent recheck
This commit is contained in:
parent
647140c7c7
commit
7474c05209
@ -1894,6 +1894,16 @@ void Preferences::setConfirmTorrentDeletion(bool enabled)
|
|||||||
setValue("Preferences/Advanced/confirmTorrentDeletion", enabled);
|
setValue("Preferences/Advanced/confirmTorrentDeletion", enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Preferences::confirmTorrentRecheck() const
|
||||||
|
{
|
||||||
|
return value("Preferences/Advanced/confirmTorrentRecheck", true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Preferences::setConfirmTorrentRecheck(bool enabled)
|
||||||
|
{
|
||||||
|
setValue("Preferences/Advanced/confirmTorrentRecheck", enabled);
|
||||||
|
}
|
||||||
|
|
||||||
TrayIcon::Style Preferences::trayIconStyle() const
|
TrayIcon::Style Preferences::trayIconStyle() const
|
||||||
{
|
{
|
||||||
return TrayIcon::Style(value("Preferences/Advanced/TrayIconStyle", TrayIcon::NORMAL).toInt());
|
return TrayIcon::Style(value("Preferences/Advanced/TrayIconStyle", TrayIcon::NORMAL).toInt());
|
||||||
|
@ -424,6 +424,8 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
bool confirmTorrentDeletion() const;
|
bool confirmTorrentDeletion() const;
|
||||||
void setConfirmTorrentDeletion(bool enabled);
|
void setConfirmTorrentDeletion(bool enabled);
|
||||||
|
bool confirmTorrentRecheck() const;
|
||||||
|
void setConfirmTorrentRecheck(bool enabled);
|
||||||
TrayIcon::Style trayIconStyle() const;
|
TrayIcon::Style trayIconStyle() const;
|
||||||
void setTrayIconStyle(TrayIcon::Style style);
|
void setTrayIconStyle(TrayIcon::Style style);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ enum AdvSettingsRows {DISK_CACHE, DISK_CACHE_TTL, OS_CACHE, SAVE_RESUME_DATA_INT
|
|||||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))
|
||||||
USE_ICON_THEME,
|
USE_ICON_THEME,
|
||||||
#endif
|
#endif
|
||||||
CONFIRM_DELETE_TORRENT, TRACKER_EXCHANGE,
|
CONFIRM_DELETE_TORRENT, CONFIRM_RECHECK_TORRENT, TRACKER_EXCHANGE,
|
||||||
ANNOUNCE_ALL_TRACKERS,
|
ANNOUNCE_ALL_TRACKERS,
|
||||||
ROW_COUNT};
|
ROW_COUNT};
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ private:
|
|||||||
QSpinBox spin_cache, spin_save_resume_data_interval, outgoing_ports_min, outgoing_ports_max, spin_list_refresh, spin_maxhalfopen, spin_tracker_port;
|
QSpinBox spin_cache, spin_save_resume_data_interval, outgoing_ports_min, outgoing_ports_max, spin_list_refresh, spin_maxhalfopen, spin_tracker_port;
|
||||||
QCheckBox cb_os_cache, cb_ignore_limits_lan, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts,
|
QCheckBox cb_os_cache, cb_ignore_limits_lan, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts,
|
||||||
cb_super_seeding, cb_program_notifications, cb_tracker_status, cb_confirm_torrent_deletion,
|
cb_super_seeding, cb_program_notifications, cb_tracker_status, cb_confirm_torrent_deletion,
|
||||||
cb_enable_tracker_ext, cb_listen_ipv6;
|
cb_confirm_torrent_recheck, cb_enable_tracker_ext, cb_listen_ipv6;
|
||||||
QComboBox combo_iface;
|
QComboBox combo_iface;
|
||||||
QSpinBox spin_cache_ttl;
|
QSpinBox spin_cache_ttl;
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||||
@ -121,6 +121,7 @@ public slots:
|
|||||||
pref->useSystemIconTheme(cb_use_icon_theme.isChecked());
|
pref->useSystemIconTheme(cb_use_icon_theme.isChecked());
|
||||||
#endif
|
#endif
|
||||||
pref->setConfirmTorrentDeletion(cb_confirm_torrent_deletion.isChecked());
|
pref->setConfirmTorrentDeletion(cb_confirm_torrent_deletion.isChecked());
|
||||||
|
pref->setConfirmTorrentRecheck(cb_confirm_torrent_recheck.isChecked());
|
||||||
// Tracker exchange
|
// Tracker exchange
|
||||||
pref->setTrackerExchangeEnabled(cb_enable_tracker_ext.isChecked());
|
pref->setTrackerExchangeEnabled(cb_enable_tracker_ext.isChecked());
|
||||||
pref->setAnnounceToAllTrackers(cb_announce_all_trackers.isChecked());
|
pref->setAnnounceToAllTrackers(cb_announce_all_trackers.isChecked());
|
||||||
@ -287,6 +288,9 @@ private slots:
|
|||||||
// Torrent deletion confirmation
|
// Torrent deletion confirmation
|
||||||
cb_confirm_torrent_deletion.setChecked(pref->confirmTorrentDeletion());
|
cb_confirm_torrent_deletion.setChecked(pref->confirmTorrentDeletion());
|
||||||
setRow(CONFIRM_DELETE_TORRENT, tr("Confirm torrent deletion"), &cb_confirm_torrent_deletion);
|
setRow(CONFIRM_DELETE_TORRENT, tr("Confirm torrent deletion"), &cb_confirm_torrent_deletion);
|
||||||
|
// Torrent recheck confirmation
|
||||||
|
cb_confirm_torrent_recheck.setChecked(pref->confirmTorrentRecheck());
|
||||||
|
setRow(CONFIRM_RECHECK_TORRENT, tr("Confirm torrent recheck"), &cb_confirm_torrent_recheck);
|
||||||
// Tracker exchange
|
// Tracker exchange
|
||||||
cb_enable_tracker_ext.setChecked(pref->trackerExchangeEnabled());
|
cb_enable_tracker_ext.setChecked(pref->trackerExchangeEnabled());
|
||||||
setRow(TRACKER_EXCHANGE, tr("Exchange trackers with other peers"), &cb_enable_tracker_ext);
|
setRow(TRACKER_EXCHANGE, tr("Exchange trackers with other peers"), &cb_enable_tracker_ext);
|
||||||
|
@ -478,8 +478,10 @@ void TransferListWidget::setMaxRatioSelectedTorrents()
|
|||||||
|
|
||||||
void TransferListWidget::recheckSelectedTorrents()
|
void TransferListWidget::recheckSelectedTorrents()
|
||||||
{
|
{
|
||||||
|
if (Preferences::instance()->confirmTorrentRecheck()) {
|
||||||
QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Recheck confirmation"), tr("Are you sure you want to recheck the selected torrent(s)?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Recheck confirmation"), tr("Are you sure you want to recheck the selected torrent(s)?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
||||||
if (ret != QMessageBox::Yes) return;
|
if (ret != QMessageBox::Yes) return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents())
|
foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents())
|
||||||
torrent->forceRecheck();
|
torrent->forceRecheck();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user