Android: Update Apply button in AndroidSdkManagerDialog

Disable Apply button on successful installation / uninstallation
of packages.

Change-Id: I267fa0ff897f3eb25733ba1114a6d683a754821d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Jarek Kobus
2024-10-29 15:47:30 +01:00
parent 377f56294e
commit 089e1b0d2d

View File

@@ -187,10 +187,11 @@ AndroidSdkManagerDialog::AndroidSdkManagerDialog(AndroidSdkManager *sdkManager,
buttonBox,
}.attachTo(this);
connect(m_sdkModel, &AndroidSdkModel::dataChanged, this, [this, buttonBox] {
buttonBox->button(QDialogButtonBox::Apply)
->setEnabled(m_sdkModel->installationChange().count());
});
const auto updateApplyButton = [this, buttonBox] {
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(m_sdkModel->installationChange().count());
};
connect(m_sdkModel, &AndroidSdkModel::modelReset, this, updateApplyButton);
connect(m_sdkModel, &AndroidSdkModel::dataChanged, this, updateApplyButton);
connect(expandCheck, &QCheckBox::stateChanged, this, [packagesView](int state) {
if (state == Qt::Checked)