Exemplo n.º 1
0
int CModEntry::getModStatus() const
{
	return
	(isEnabled()   ? ModStatus::ENABLED    : 0) |
	(isInstalled() ? ModStatus::INSTALLED  : 0) |
	(isUpdateable()? ModStatus::UPDATEABLE : 0);
}
Exemplo n.º 2
0
void CModListView::selectMod(int index)
{
	if (index < 0)
	{
		disableModInfo();
	}
	else
	{
		enableModInfo();

		auto mod = modModel->getMod(modModel->modIndexToName(index));

		ui->textBrowser->setHtml(genModInfoText(mod));

		bool hasInvalidDeps = !findInvalidDependencies(modModel->modIndexToName(index)).empty();
		bool hasBlockingMods = !findBlockingMods(modModel->modIndexToName(index)).empty();
		bool hasDependentMods = !findDependentMods(modModel->modIndexToName(index), true).empty();

		ui->disableButton->setVisible(mod.isEnabled());
		ui->enableButton->setVisible(mod.isDisabled());
		ui->installButton->setVisible(mod.isAvailable());
		ui->uninstallButton->setVisible(mod.isInstalled());
		ui->updateButton->setVisible(mod.isUpdateable());

		// Block buttons if action is not allowed at this time
		// TODO: automate handling of some of these cases instead of forcing player
		// to resolve all conflicts manually.
		ui->disableButton->setEnabled(!hasDependentMods);
		ui->enableButton->setEnabled(!hasBlockingMods && !hasInvalidDeps);
		ui->installButton->setEnabled(!hasInvalidDeps);
		ui->uninstallButton->setEnabled(!hasDependentMods);
		ui->updateButton->setEnabled(!hasInvalidDeps && !hasDependentMods);
	}
}
Exemplo n.º 3
0
int CModEntry::getModStatus() const
{
	int status = 0;
	if(isEnabled())
		status |= ModStatus::ENABLED;
	if(isInstalled())
		status |= ModStatus::INSTALLED;
	if(isUpdateable())
		status |= ModStatus::UPDATEABLE;

	return status;
}
Exemplo n.º 4
0
void CModListView::on_updateButton_clicked()
{
    QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();

    assert(findInvalidDependencies(modName).empty());

    for (auto & name : modModel->getRequirements(modName))
    {
        auto mod = modModel->getMod(name);
        // update required mod, install missing (can be new dependency)
        if (mod.isUpdateable() || !mod.isInstalled())
            downloadFile(name + ".zip", mod.getValue("download").toString(), "mods");
    }
}
Exemplo n.º 5
0
void Flama_SectorA::Update()
{
    if(m_ShrdMem == NULL)
        return;
    if(!isUpdateable())  //Verificar metodo para saber si
        return;                // la ventana que contiene el widget es "visible" (para el usuario)
    if(indice< 0){
        indice = m_ShrdMem->getVar(id);
        if(indice < 0){
            return;
        }
    }
    //Logica para definir atributos y comportamiento del widget
    value = m_ShrdMem->getI(indice);
    //Por consistencia UTILIZAMOS TIPO
    update(); //Llamamos al metodo wPaintEvent
}
Exemplo n.º 6
0
void CModListView::selectMod(const QModelIndex & index)
{
    if (!index.isValid())
    {
        disableModInfo();
    }
    else
    {
        auto mod = modModel->getMod(index.data(ModRoles::ModNameRole).toString());

        ui->modInfoBrowser->setHtml(genModInfoText(mod));
        ui->changelogBrowser->setHtml(genChangelogText(mod));

        bool hasInvalidDeps = !findInvalidDependencies(index.data(ModRoles::ModNameRole).toString()).empty();
        bool hasBlockingMods = !findBlockingMods(index.data(ModRoles::ModNameRole).toString()).empty();
        bool hasDependentMods = !findDependentMods(index.data(ModRoles::ModNameRole).toString(), true).empty();

        ui->hideModInfoButton->setEnabled(true);
        ui->showInfoButton->setVisible(!ui->modInfoWidget->isVisible());
        ui->disableButton->setVisible(mod.isEnabled());
        ui->enableButton->setVisible(mod.isDisabled());
        ui->installButton->setVisible(mod.isAvailable() && !mod.getName().contains('.'));
        ui->uninstallButton->setVisible(mod.isInstalled() && !mod.getName().contains('.'));
        ui->updateButton->setVisible(mod.isUpdateable());

        // Block buttons if action is not allowed at this time
        // TODO: automate handling of some of these cases instead of forcing player
        // to resolve all conflicts manually.
        ui->disableButton->setEnabled(!hasDependentMods);
        ui->enableButton->setEnabled(!hasBlockingMods && !hasInvalidDeps);
        ui->installButton->setEnabled(!hasInvalidDeps);
        ui->uninstallButton->setEnabled(!hasDependentMods);
        ui->updateButton->setEnabled(!hasInvalidDeps && !hasDependentMods);

        loadScreenshots();
    }
}