feat(ManagedPackPage): add reload button when in a fail state

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-11-18 15:23:28 -03:00
parent cb12c51afc
commit feb6f285ce
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
2 changed files with 16 additions and 1 deletions

View File

@ -61,6 +61,14 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi
ui->setupUi(this); ui->setupUi(this);
ui->versionsComboBox->setStyle(new NoBigComboBoxStyle(ui->versionsComboBox->style())); ui->versionsComboBox->setStyle(new NoBigComboBoxStyle(ui->versionsComboBox->style()));
ui->reloadButton->setVisible(false);
connect(ui->reloadButton, &QPushButton::clicked, this, [this](bool){
ui->reloadButton->setVisible(false);
// Pretend we're opening the page again
openedImpl();
});
} }
ManagedPackPage::~ManagedPackPage() ManagedPackPage::~ManagedPackPage()
@ -154,7 +162,7 @@ void ManagedPackPage::setFailState()
ui->updateButton->setText(tr("Cannot update!")); ui->updateButton->setText(tr("Cannot update!"));
ui->updateButton->setDisabled(true); ui->updateButton->setDisabled(true);
// TODO: Perhaps start a timer here when m_loaded is false to try and reload. ui->reloadButton->setVisible(true);
} }
ModrinthManagedPackPage::ModrinthManagedPackPage(BaseInstance* inst, InstanceWindow* instance_window, QWidget* parent) ModrinthManagedPackPage::ModrinthManagedPackPage(BaseInstance* inst, InstanceWindow* instance_window, QWidget* parent)

View File

@ -179,6 +179,13 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0">
<widget class="QPushButton" name="reloadButton">
<property name="text">
<string>Reload page</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>