refector: move download action to ExternalResourcesPage

This commit is contained in:
Sefa Eyeoglu 2022-05-30 16:36:30 +02:00 committed by flow
parent d394235ee0
commit e25cdd9d12
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
2 changed files with 19 additions and 6 deletions

View File

@ -136,6 +136,17 @@
<string>View &amp;Folder</string> <string>View &amp;Folder</string>
</property> </property>
</action> </action>
<action name="actionDownloadItem">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Download</string>
</property>
<property name="toolTip">
<string>Download a new resource</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

@ -69,13 +69,15 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel>
// This is structured like that so that these changes // This is structured like that so that these changes
// do not affect the Resource pack and Shader pack tabs // do not affect the Resource pack and Shader pack tabs
{ {
auto act = new QAction(tr("Download mods"), this); ui->actionDownloadItem->setText(tr("Download mods"));
act->setToolTip(tr("Download mods from online mod platforms")); ui->actionDownloadItem->setToolTip(tr("Download mods from online mod platforms"));
ui->actionsToolbar->insertActionBefore(ui->actionAddItem, act); ui->actionDownloadItem->setEnabled(true);
connect(act, &QAction::triggered, this, &ModFolderPage::installMods); ui->actionAddItem->setText(tr("Add file"));
ui->actionAddItem->setToolTip(tr("Add a locally downloaded file"));
ui->actionAddItem->setText(tr("Add .jar")); ui->actionsToolbar->insertActionBefore(ui->actionAddItem, ui->actionDownloadItem);
ui->actionAddItem->setToolTip(tr("Add mods via local file"));
connect(ui->actionDownloadItem, &QAction::triggered, this, &ModFolderPage::installMods);
} }
} }