Move signal/slot connections out of .ui files

This unify the place (.cpp file) where we handle signal/slot connections.
This commit is contained in:
Chocobo1 2023-07-12 05:08:36 +08:00
parent 20f4d0c4e3
commit b17307f283
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
36 changed files with 115 additions and 768 deletions

View file

@ -300,6 +300,9 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
// TODO: set dialog file properties using m_torrentParams.filePriorities
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
m_ui->lblMetaLoading->setVisible(false);
m_ui->progMetaLoading->setVisible(false);
m_ui->buttonSave->setVisible(false);
@ -339,6 +342,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
m_ui->comboTTM->blockSignals(true); // the TreeView size isn't correct if the slot does its job at this point
m_ui->comboTTM->setCurrentIndex(session->isAutoTMMDisabledByDefault() ? 0 : 1);
m_ui->comboTTM->blockSignals(false);
connect(m_ui->comboTTM, &QComboBox::currentIndexChanged, this, &AddNewTorrentDialog::TMMChanged);
connect(m_ui->savePath, &FileSystemPathEdit::selectedPathChanged, this, &AddNewTorrentDialog::onSavePathChanged);
connect(m_ui->downloadPath, &FileSystemPathEdit::selectedPathChanged, this, &AddNewTorrentDialog::onDownloadPathChanged);
@ -373,6 +377,8 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
m_ui->categoryComboBox->addItem(category);
}
connect(m_ui->categoryComboBox, &QComboBox::currentIndexChanged, this, &AddNewTorrentDialog::categoryChanged);
m_ui->tagsLineEdit->setText(m_torrentParams.tags.join(u", "_s));
connect(m_ui->tagsEditButton, &QAbstractButton::clicked, this, [this]
{

View file

@ -664,75 +664,5 @@
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AddNewTorrentDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>928</x>
<y>855</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AddNewTorrentDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>928</x>
<y>855</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>comboTTM</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>AddNewTorrentDialog</receiver>
<slot>TMMChanged(int)</slot>
<hints>
<hint type="sourcelabel">
<x>250</x>
<y>53</y>
</hint>
<hint type="destinationlabel">
<x>467</x>
<y>249</y>
</hint>
</hints>
</connection>
<connection>
<sender>categoryComboBox</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>AddNewTorrentDialog</receiver>
<slot>categoryChanged(int)</slot>
<hints>
<hint type="sourcelabel">
<x>266</x>
<y>231</y>
</hint>
<hint type="destinationlabel">
<x>467</x>
<y>249</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>savingModeChanged(bool)</slot>
<slot>categoryChanged(int)</slot>
<slot>TMMChanged(int)</slot>
</slots>
<connections/>
</ui>

View file

@ -37,6 +37,9 @@ AutoExpandableDialog::AutoExpandableDialog(QWidget *parent)
, m_ui(new Ui::AutoExpandableDialog)
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
AutoExpandableDialog::~AutoExpandableDialog()

View file

@ -27,38 +27,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AutoExpandableDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AutoExpandableDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -48,6 +48,8 @@ BanListOptionsDialog::BanListOptionsDialog(QWidget *parent)
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
m_sortFilter = new QSortFilterProxyModel(this);
m_sortFilter->setDynamicSortFilter(true);
m_sortFilter->setSourceModel(m_model);

View file

@ -109,22 +109,5 @@
<tabstop>buttonDeleteIP</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>BanListOptionsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>179</x>
<y>427</y>
</hint>
<hint type="destinationlabel">
<x>179</x>
<y>224</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -52,11 +52,18 @@ CookiesDialog::CookiesDialog(QWidget *parent)
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
setWindowIcon(UIThemeManager::instance()->getIcon(u"browser-cookies"_s));
m_ui->buttonAdd->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_s));
m_ui->buttonDelete->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_s));
m_ui->buttonAdd->setIconSize(Utils::Gui::mediumIconSize());
connect(m_ui->buttonAdd, &QToolButton::clicked, this, &CookiesDialog::onButtonAddClicked);
m_ui->buttonDelete->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_s));
m_ui->buttonDelete->setIconSize(Utils::Gui::mediumIconSize());
connect(m_ui->buttonDelete, &QToolButton::clicked, this, &CookiesDialog::onButtonDeleteClicked);
m_ui->treeView->setModel(m_cookiesModel);
if (m_cookiesModel->rowCount() > 0)

View file

@ -96,74 +96,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>CookiesDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>257</x>
<y>406</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>CookiesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>325</x>
<y>406</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonAdd</sender>
<signal>clicked()</signal>
<receiver>CookiesDialog</receiver>
<slot>onButtonAddClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>484</x>
<y>174</y>
</hint>
<hint type="destinationlabel">
<x>486</x>
<y>93</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonDelete</sender>
<signal>clicked()</signal>
<receiver>CookiesDialog</receiver>
<slot>onButtonDeleteClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>483</x>
<y>226</y>
</hint>
<hint type="destinationlabel">
<x>485</x>
<y>296</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>onButtonAddClicked()</slot>
<slot>onButtonDeleteClicked()</slot>
</slots>
<connections/>
</ui>

View file

@ -57,6 +57,9 @@ DeletionConfirmationDialog::DeletionConfirmationDialog(QWidget *parent, const in
connect(m_ui->checkPermDelete, &QCheckBox::clicked, this, &DeletionConfirmationDialog::updateRememberButtonState);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Remove"));
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setFocus();
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
DeletionConfirmationDialog::~DeletionConfirmationDialog()

View file

@ -113,38 +113,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DeletionConfirmationDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DeletionConfirmationDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -47,6 +47,8 @@ IPSubnetWhitelistOptionsDialog::IPSubnetWhitelistOptionsDialog(QWidget *parent)
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
QStringList authSubnetWhitelistStringList;
for (const Utils::Net::Subnet &subnet : asConst(Preferences::instance()->getWebUiAuthSubnetWhitelist()))
authSubnetWhitelistStringList << Utils::Net::subnetToString(subnet);

View file

@ -93,22 +93,5 @@
<tabstop>buttonDeleteIPSubnet</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>IPSubnetWhitelistOptionsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>179</x>
<y>427</y>
</hint>
<hint type="destinationlabel">
<x>179</x>
<y>224</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -624,6 +624,8 @@ void OptionsDialog::loadDownloadsTabOptions()
connect(m_ui->stopConditionComboBox, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkMergeTrackers, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkConfirmMergeTrackers, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->deleteTorrentBox, &QGroupBox::toggled, m_ui->deleteTorrentWarningIcon, &QWidget::setVisible);
connect(m_ui->deleteTorrentBox, &QGroupBox::toggled, m_ui->deleteTorrentWarningLabel, &QWidget::setVisible);
connect(m_ui->deleteTorrentBox, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->deleteCancelledTorrentBox, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
@ -844,9 +846,13 @@ void OptionsDialog::loadConnectionTabOptions()
connect(m_ui->spinPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkUPnP, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, m_ui->spinMaxConnec, &QWidget::setEnabled);
connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerTorrent, &QWidget::setEnabled);
connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, m_ui->spinMaxUploads, &QWidget::setEnabled);
connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxUploadsPerTorrent, &QWidget::setEnabled);
connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxConnec, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
@ -1073,12 +1079,14 @@ void OptionsDialog::loadBittorrentTabOptions()
connect(m_ui->spinUploadRateForSlowTorrents, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinSlowTorrentsInactivityTimer, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxRatio, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxRatio, &QAbstractButton::toggled, m_ui->spinMaxRatio, &QWidget::setEnabled);
connect(m_ui->checkMaxRatio, &QAbstractButton::toggled, this, &ThisType::toggleComboRatioLimitAct);
connect(m_ui->checkMaxRatio, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxRatio, qOverload<double>(&QDoubleSpinBox::valueChanged),this, &ThisType::enableApplyButton);
connect(m_ui->comboRatioLimitAct, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, m_ui->spinMaxSeedingMinutes, &QWidget::setEnabled);
connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, this, &ThisType::toggleComboRatioLimitAct);
connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxSeedingMinutes, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkEnableAddTrackers, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
@ -1226,7 +1234,7 @@ void OptionsDialog::loadWebUITabOptions()
connect(m_ui->checkBypassLocalAuth, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkBypassAuthSubnetWhitelist, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkBypassAuthSubnetWhitelist, &QAbstractButton::toggled, m_ui->IPSubnetWhitelistButton, &QPushButton::setEnabled);
connect(m_ui->checkBypassAuthSubnetWhitelist, &QAbstractButton::toggled, m_ui->IPSubnetWhitelistButton, &QWidget::setEnabled);
connect(m_ui->spinBanCounter, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinBanDuration, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinSessionTimeout, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);

View file

@ -245,7 +245,7 @@
<string>Shows a confirmation dialog upon pausing/resuming all the torrents</string>
</property>
<property name="text">
<string>Confirm "Pause/Resume all" actions</string>
<string>Confirm &quot;Pause/Resume all&quot; actions</string>
</property>
<property name="checked">
<bool>true</bool>
@ -3910,134 +3910,5 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
<tabstop>DNSPasswordTxt</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>checkMaxConnections</sender>
<signal>toggled(bool)</signal>
<receiver>spinMaxConnec</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>604</x>
<y>205</y>
</hint>
<hint type="destinationlabel">
<x>677</x>
<y>206</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkMaxConnectionsPerTorrent</sender>
<signal>toggled(bool)</signal>
<receiver>spinMaxConnecPerTorrent</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>604</x>
<y>238</y>
</hint>
<hint type="destinationlabel">
<x>677</x>
<y>239</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkMaxUploadsPerTorrent</sender>
<signal>toggled(bool)</signal>
<receiver>spinMaxUploadsPerTorrent</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>604</x>
<y>304</y>
</hint>
<hint type="destinationlabel">
<x>677</x>
<y>305</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkMaxUploads</sender>
<signal>toggled(bool)</signal>
<receiver>spinMaxUploads</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>547</x>
<y>415</y>
</hint>
<hint type="destinationlabel">
<x>642</x>
<y>414</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkMaxRatio</sender>
<signal>toggled(bool)</signal>
<receiver>spinMaxRatio</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>395</x>
<y>203</y>
</hint>
<hint type="destinationlabel">
<x>496</x>
<y>204</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkMaxSeedingMinutes</sender>
<signal>toggled(bool)</signal>
<receiver>spinMaxSeedingMinutes</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>395</x>
<y>170</y>
</hint>
<hint type="destinationlabel">
<x>496</x>
<y>171</y>
</hint>
</hints>
</connection>
<connection>
<sender>deleteTorrentBox</sender>
<signal>toggled(bool)</signal>
<receiver>deleteTorrentWarningIcon</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>554</x>
<y>153</y>
</hint>
<hint type="destinationlabel">
<x>324</x>
<y>214</y>
</hint>
</hints>
</connection>
<connection>
<sender>deleteTorrentBox</sender>
<signal>toggled(bool)</signal>
<receiver>deleteTorrentWarningLabel</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>646</x>
<y>158</y>
</hint>
<hint type="destinationlabel">
<x>629</x>
<y>207</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -40,7 +40,9 @@ PeersAdditionDialog::PeersAdditionDialog(QWidget *parent)
, m_ui(new Ui::PeersAdditionDialog())
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &PeersAdditionDialog::validateInput);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
PeersAdditionDialog::~PeersAdditionDialog()

View file

@ -47,22 +47,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PeersAdditionDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>183</x>
<y>251</y>
</hint>
<hint type="destinationlabel">
<x>183</x>
<y>136</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -53,10 +53,13 @@ TrackersAdditionDialog::TrackersAdditionDialog(QWidget *parent, BitTorrent::Torr
{
m_ui->setupUi(this);
m_ui->downloadButton->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_s, u"download"_s));
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Add"));
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
m_ui->downloadButton->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_s, u"download"_s));
connect(m_ui->downloadButton, &QAbstractButton::clicked, this, &TrackersAdditionDialog::onDownloadButtonClicked);
connect(this, &QDialog::accepted, this, &TrackersAdditionDialog::onAccepted);
loadSettings();

View file

@ -65,38 +65,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>TrackersAdditionDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>TrackersAdditionDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -76,6 +76,10 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
#endif
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
m_ui->torrentParametersGroupBox->layout()->addWidget(m_addTorrentParamsWidget);
m_ui->prioritySpinBox->setMinimum(std::numeric_limits<int>::min());

View file

@ -442,38 +442,5 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
<tabstop>exportBtn</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AutomatedRssDownloader</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>750</x>
<y>483</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AutomatedRssDownloader</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>805</x>
<y>483</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -63,6 +63,9 @@ ShutdownConfirmDialog::ShutdownConfirmDialog(QWidget *parent, const ShutdownDial
cancelButton->setFocus();
cancelButton->setDefault(true);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
// Always on top
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
move(Utils::Gui::screenCenter(this));

View file

@ -90,38 +90,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ShutdownConfirmDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ShutdownConfirmDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -56,6 +56,9 @@ SpeedLimitDialog::SpeedLimitDialog(QWidget *parent)
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
m_ui->labelGlobalSpeedIcon->setPixmap(
UIThemeManager::instance()->getScaledPixmap(u"slow_off"_s, Utils::Gui::mediumIconSize(this).height()));
m_ui->labelAltGlobalSpeedIcon->setPixmap(

View file

@ -177,38 +177,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>SpeedLimitDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>221</x>
<y>73</y>
</hint>
<hint type="destinationlabel">
<x>221</x>
<y>82</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>SpeedLimitDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>277</x>
<y>59</y>
</hint>
<hint type="destinationlabel">
<x>343</x>
<y>80</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -51,6 +51,8 @@ TorrentCategoryDialog::TorrentCategoryDialog(QWidget *parent)
// disable save button
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_ui->textCategoryName, &QLineEdit::textChanged, this, &TorrentCategoryDialog::categoryNameChanged);
connect(m_ui->comboUseDownloadPath, &QComboBox::currentIndexChanged, this, &TorrentCategoryDialog::useDownloadPathChanged);

View file

@ -180,38 +180,5 @@
<tabstop>comboDownloadPath</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>TorrentCategoryDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>TorrentCategoryDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -86,7 +86,9 @@ TorrentCreatorDialog::TorrentCreatorDialog(QWidget *parent, const Path &defaultP
connect(m_ui->addFileButton, &QPushButton::clicked, this, &TorrentCreatorDialog::onAddFileButtonClicked);
connect(m_ui->addFolderButton, &QPushButton::clicked, this, &TorrentCreatorDialog::onAddFolderButtonClicked);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &TorrentCreatorDialog::onCreateButtonClicked);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_ui->buttonCalcTotalPieces, &QPushButton::clicked, this, &TorrentCreatorDialog::updatePiecesCount);
connect(m_ui->checkStartSeeding, &QCheckBox::clicked, m_ui->checkIgnoreShareLimits, &QWidget::setEnabled);
connect(m_creatorThread, &BitTorrent::TorrentCreatorThread::creationSuccess, this, &TorrentCreatorDialog::handleCreationSuccess);
connect(m_creatorThread, &BitTorrent::TorrentCreatorThread::creationFailure, this, &TorrentCreatorDialog::handleCreationFailure);

View file

@ -492,38 +492,5 @@
<tabstop>txtComment</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>checkStartSeeding</sender>
<signal>clicked(bool)</signal>
<receiver>checkIgnoreShareLimits</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>295</x>
<y>532</y>
</hint>
<hint type="destinationlabel">
<x>295</x>
<y>555</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>TorrentCreatorDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>295</x>
<y>635</y>
</hint>
<hint type="destinationlabel">
<x>295</x>
<y>328</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -69,6 +69,9 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTor
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
m_ui->savePath->setMode(FileSystemPathEdit::Mode::DirectorySave);
m_ui->savePath->setDialogCaption(tr("Choose save path"));
m_ui->downloadPath->setMode(FileSystemPathEdit::Mode::DirectorySave);
@ -385,8 +388,8 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTor
connect(m_ui->spinDownloadLimit, qOverload<int>(&QSpinBox::valueChanged)
, this, [this](const int value) { updateSliderValue(m_ui->sliderDownloadLimit, value); });
connect(m_ui->checkMaxRatio, &QCheckBox::toggled, m_ui->spinRatioLimit, &QDoubleSpinBox::setEnabled);
connect(m_ui->checkMaxTime, &QCheckBox::toggled, m_ui->spinTimeLimit, &QSpinBox::setEnabled);
connect(m_ui->checkMaxRatio, &QCheckBox::toggled, m_ui->spinRatioLimit, &QWidget::setEnabled);
connect(m_ui->checkMaxTime, &QCheckBox::toggled, m_ui->spinTimeLimit, &QWidget::setEnabled);
connect(m_ui->buttonGroup, &QButtonGroup::idClicked, this, &TorrentOptionsDialog::handleRatioTypeChanged);

View file

@ -326,40 +326,7 @@
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>TorrentOptionsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>221</x>
<y>73</y>
</hint>
<hint type="destinationlabel">
<x>221</x>
<y>82</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>TorrentOptionsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>277</x>
<y>59</y>
</hint>
<hint type="destinationlabel">
<x>343</x>
<y>80</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
</buttongroups>

View file

@ -49,6 +49,9 @@ TorrentTagsDialog::TorrentTagsDialog(const TagSet &initialTags, QWidget *parent)
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
auto *tagsLayout = new FlowLayout(m_ui->scrollArea);
for (const QString &tag : asConst(initialTags.united(BitTorrent::Session::instance()->tags())))
{

View file

@ -44,38 +44,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>TorrentTagsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>241</x>
<y>291</y>
</hint>
<hint type="destinationlabel">
<x>241</x>
<y>156</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>TorrentTagsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>241</x>
<y>291</y>
</hint>
<hint type="destinationlabel">
<x>241</x>
<y>156</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -220,6 +220,9 @@ UIThemeDialog::UIThemeDialog(QWidget *parent)
{
m_ui->setupUi(this);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
loadColors();
loadIcons();

View file

@ -249,38 +249,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>UIThemeDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>UIThemeDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View file

@ -44,6 +44,9 @@ WatchedFolderOptionsDialog::WatchedFolderOptionsDialog(
m_ui->setupUi(this);
m_ui->groupBoxParameters->layout()->addWidget(m_addTorrentParamsWidget);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
loadState();
}

View file

@ -89,38 +89,5 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>WatchedFolderOptionsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>928</x>
<y>855</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>WatchedFolderOptionsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>928</x>
<y>855</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>