Allow to set custom suffix to window title

This is to allow users to differentiate qbt instances when there are multiple running.
PR #20429.
Closes #17905.
This commit is contained in:
Chocobo1 2024-02-27 12:41:12 +08:00 committed by GitHub
parent 364bcf73ee
commit 46e8ee50c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 98 additions and 27 deletions

View file

@ -79,6 +79,7 @@ namespace
CONFIRM_RECHECK_TORRENT,
RECHECK_COMPLETED,
// UI related
APP_INSTANCE_NAME,
LIST_REFRESH,
RESOLVE_HOSTS,
RESOLVE_COUNTRIES,
@ -280,6 +281,8 @@ void AdvancedSettings::saveAdvancedSettings() const
session->setBlockPeersOnPrivilegedPorts(m_checkBoxBlockPeersOnPrivilegedPorts.isChecked());
// Recheck torrents on completion
pref->recheckTorrentsOnCompletion(m_checkBoxRecheckCompleted.isChecked());
// Customize application instance name
app()->setInstanceName(m_lineEditAppInstanceName.text());
// Transfer list refresh interval
session->setRefreshInterval(m_spinBoxListRefresh.value());
// Peer resolution
@ -723,6 +726,10 @@ void AdvancedSettings::loadAdvancedSettings()
// Recheck completed torrents
m_checkBoxRecheckCompleted.setChecked(pref->recheckTorrentsOnCompletion());
addRow(RECHECK_COMPLETED, tr("Recheck torrents on completion"), &m_checkBoxRecheckCompleted);
// Customize application instance name
m_lineEditAppInstanceName.setText(app()->instanceName());
m_lineEditAppInstanceName.setToolTip(tr("It appends the text to the window title to help distinguish qBittorent instances"));
addRow(APP_INSTANCE_NAME, tr("Customize application instance name"), &m_lineEditAppInstanceName);
// Refresh interval
m_spinBoxListRefresh.setMinimum(30);
m_spinBoxListRefresh.setMaximum(99999);