feat(ManagedPackPage): add reload button when in a fail state
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
cb12c51afc
commit
feb6f285ce
@ -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)
|
||||||
|
@ -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/>
|
||||||
|
Loading…
Reference in New Issue
Block a user