MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / onDisableUpdatesChange

Method onDisableUpdatesChange

launcher/ui/pages/instance/ModFolderPage.cpp:288–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288void ModFolderPage::onDisableUpdatesChange()
289{
290 auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
291 auto mods_list = m_model->selectedMods(selection);
292
293 if(ui->treeView->selectionModel()->hasSelection()){
294 if(mods_list.length() > 1) {
295 ui->actionDisableUpdates->setText(tr("Invert Update Check"));
296 } else if (mods_list.first()->metadata() && mods_list.first()->metadata()->hasDoUpdates() && mods_list.first()->metadata()->do_updates == "true") {
297 ui->actionDisableUpdates->setText(tr("Disable Update Check"));
298 } else if (!mods_list.first()->metadata()) {
299 ui->actionDisableUpdates->setText(tr("Generate Metadata"));
300 } else {
301 ui->actionDisableUpdates->setText(tr("Enable Update Check"));
302 }
303 } else {
304 ui->actionDisableUpdates->setText(tr("Disable Update Check"));
305 }
306}
307
308CoreModFolderPage::CoreModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel> mods, QWidget* parent)
309 : ModFolderPage(inst, mods, parent)

Callers

nothing calls this directly

Calls 6

selectedModsMethod · 0.80
lengthMethod · 0.80
metadataMethod · 0.80
firstMethod · 0.80
hasDoUpdatesMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected