| 180 | } |
| 181 | |
| 182 | void ModPage::onSelectionChanged(QModelIndex curr, QModelIndex prev) |
| 183 | { |
| 184 | ui->versionSelectionBox->clear(); |
| 185 | |
| 186 | if (!curr.isValid()) { return; } |
| 187 | |
| 188 | current = listModel->data(curr, Qt::UserRole).value<ModPlatform::IndexedPack>(); |
| 189 | |
| 190 | if (!current.versionsLoaded) { |
| 191 | qDebug() << QString("Loading %1 mod versions").arg(debugName()); |
| 192 | |
| 193 | ui->modSelectionButton->setText(tr("Loading versions...")); |
| 194 | ui->modSelectionButton->setEnabled(false); |
| 195 | |
| 196 | listModel->requestModVersions(current, curr); |
| 197 | } else { |
| 198 | for (int i = 0; i < current.versions.size(); i++) { |
| 199 | ui->versionSelectionBox->addItem(current.versions[i].version, QVariant(i)); |
| 200 | } |
| 201 | if (ui->versionSelectionBox->count() == 0) { ui->versionSelectionBox->addItem(tr("No valid version found."), QVariant(-1)); } |
| 202 | |
| 203 | updateSelectionButton(); |
| 204 | } |
| 205 | |
| 206 | if(!current.extraDataLoaded){ |
| 207 | qDebug() << QString("Loading %1 mod info").arg(debugName()); |
| 208 | |
| 209 | listModel->requestModInfo(current, curr); |
| 210 | } |
| 211 | |
| 212 | updateUi(); |
| 213 | } |
| 214 | |
| 215 | void ModPage::onVersionSelectionChanged(QString data) |
| 216 | { |
nothing calls this directly
no test coverage detected