feat(ManagedPackPage): add reload button when in a fail state
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
		@@ -61,6 +61,14 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi
 | 
			
		||||
    ui->setupUi(this);
 | 
			
		||||
 | 
			
		||||
    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()
 | 
			
		||||
@@ -154,7 +162,7 @@ void ManagedPackPage::setFailState()
 | 
			
		||||
    ui->updateButton->setText(tr("Cannot update!"));
 | 
			
		||||
    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)
 | 
			
		||||
 
 | 
			
		||||
@@ -179,6 +179,13 @@
 | 
			
		||||
     </item>
 | 
			
		||||
    </layout>
 | 
			
		||||
   </item>
 | 
			
		||||
   <item row="1" column="0">
 | 
			
		||||
    <widget class="QPushButton" name="reloadButton">
 | 
			
		||||
     <property name="text">
 | 
			
		||||
      <string>Reload page</string>
 | 
			
		||||
     </property>
 | 
			
		||||
    </widget>
 | 
			
		||||
   </item>
 | 
			
		||||
  </layout>
 | 
			
		||||
 </widget>
 | 
			
		||||
 <resources/>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user