GH-1556 disable export for tracked FTB instances

This commit is contained in:
Petr Mrázek 2016-04-28 00:04:37 +02:00
parent 72c92893a5
commit 4392abfb8d
7 changed files with 24 additions and 1 deletions

View File

@ -1630,6 +1630,7 @@ void MainWindow::instanceChanged(const QModelIndex &current, const QModelIndex &
ui->instanceToolBar->setEnabled(true);
ui->actionLaunchInstance->setEnabled(m_selectedInstance->canLaunch());
ui->actionLaunchInstanceOffline->setEnabled(m_selectedInstance->canLaunch());
ui->actionExportInstance->setEnabled(m_selectedInstance->canExport());
renameButton->setText(m_selectedInstance->name());
m_statusLeft->setText(m_selectedInstance->getStatusbarDescription());
updateInstanceToolIcon(m_selectedInstance->iconKey());

View File

@ -206,6 +206,7 @@ public:
void unsetFlag(const InstanceFlag flag);
bool canLaunch() const;
virtual bool canExport() const = 0;
virtual bool reload();

View File

@ -83,4 +83,8 @@ public:
{
return "Null";
}
bool canExport() const override
{
return false;
}
};

View File

@ -10,4 +10,8 @@ public:
virtual QString id() const;
virtual void copy(const QDir &newDir);
virtual QString typeName() const;
bool canExport() const override
{
return false;
}
};

View File

@ -21,7 +21,10 @@ public:
QDir versionsPath() const override;
bool providesVersionFile() const override;
virtual QString typeName() const override;
bool canExport() const override
{
return false;
}
private:
SettingsObjectPtr m_globalSettings;
};

View File

@ -124,6 +124,11 @@ public:
virtual QString typeName() const override;
bool canExport() const override
{
return true;
}
protected:
mutable std::shared_ptr<ModList> jar_mod_list;
mutable std::shared_ptr<ModList> core_mod_list;

View File

@ -94,6 +94,11 @@ public:
virtual QString typeName() const override;
bool canExport() const override
{
return true;
}
signals:
void versionReloaded();