diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-01-25 10:43:23 +0100 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2023-01-25 10:43:23 +0100 |
commit | 199a7df807994ded1469cc893e6c68c21307444f (patch) | |
tree | 9e7e5f464fca32cf6578cf58a73b09870d845d87 /launcher/ui | |
parent | cd893e18d24d61c62f048d0c82c85b981f6e9a65 (diff) | |
download | PrismLauncher-199a7df807994ded1469cc893e6c68c21307444f.tar.gz PrismLauncher-199a7df807994ded1469cc893e6c68c21307444f.tar.bz2 PrismLauncher-199a7df807994ded1469cc893e6c68c21307444f.zip |
refactor: add error handling to component import
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/pages/instance/VersionPage.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp index bce50a09..f92a7660 100644 --- a/launcher/ui/pages/instance/VersionPage.cpp +++ b/launcher/ui/pages/instance/VersionPage.cpp @@ -384,8 +384,12 @@ void VersionPage::on_actionImport_Components_triggered() QStringList list = GuiUtil::BrowseForFiles("component", tr("Select components"), tr("Components (*.json)"), APPLICATION->settings()->get("CentralModsDir").toString(), this->parentWidget()); - if (!list.isEmpty()) - m_profile->installComponents(list); + if (!list.isEmpty()) { + if (!m_profile->installComponents(list)) { + QMessageBox::warning(this, tr("Failed to import components"), + tr("Some components could not be imported. Check logs for details")); + } + } updateButtons(); } |