diff options
author | Petr Mrázek <peterix@gmail.com> | 2019-06-29 01:13:39 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2019-06-29 01:13:39 +0200 |
commit | f74e3db804f2fb3d73cbf7ab5fbdb12ecea0f259 (patch) | |
tree | 11e91448dd85a701142fbbd11b7b3d3f4bc1372b /application/pages/modplatform | |
parent | fde43c993e0a143b9dddcaff2190c91f4e5e3cb9 (diff) | |
download | MultiMC-f74e3db804f2fb3d73cbf7ab5fbdb12ecea0f259.tar MultiMC-f74e3db804f2fb3d73cbf7ab5fbdb12ecea0f259.tar.gz MultiMC-f74e3db804f2fb3d73cbf7ab5fbdb12ecea0f259.tar.lz MultiMC-f74e3db804f2fb3d73cbf7ab5fbdb12ecea0f259.tar.xz MultiMC-f74e3db804f2fb3d73cbf7ab5fbdb12ecea0f259.zip |
NOISSUE Import page is now a MultiMC pack page
Diffstat (limited to 'application/pages/modplatform')
-rw-r--r-- | application/pages/modplatform/MultiMCPage.cpp (renamed from application/pages/modplatform/ImportPage.cpp) | 29 | ||||
-rw-r--r-- | application/pages/modplatform/MultiMCPage.h (renamed from application/pages/modplatform/ImportPage.h) | 18 | ||||
-rw-r--r-- | application/pages/modplatform/MultiMCPage.ui (renamed from application/pages/modplatform/ImportPage.ui) | 4 |
3 files changed, 23 insertions, 28 deletions
diff --git a/application/pages/modplatform/ImportPage.cpp b/application/pages/modplatform/MultiMCPage.cpp index 3910dfda..c98596c2 100644 --- a/application/pages/modplatform/ImportPage.cpp +++ b/application/pages/modplatform/MultiMCPage.cpp @@ -1,5 +1,5 @@ -#include "ImportPage.h" -#include "ui_ImportPage.h" +#include "MultiMCPage.h" +#include "ui_MultiMCPage.h" #include "MultiMC.h" #include "dialogs/NewInstanceDialog.h" @@ -30,30 +30,30 @@ public: } }; -ImportPage::ImportPage(NewInstanceDialog* dialog, QWidget *parent) - : QWidget(parent), ui(new Ui::ImportPage), dialog(dialog) +MultiMCPage::MultiMCPage(NewInstanceDialog* dialog, QWidget *parent) + : QWidget(parent), ui(new Ui::MultiMCPage), dialog(dialog) { ui->setupUi(this); ui->modpackEdit->setValidator(new UrlValidator(ui->modpackEdit)); - connect(ui->modpackEdit, &QLineEdit::textChanged, this, &ImportPage::updateState); + connect(ui->modpackEdit, &QLineEdit::textChanged, this, &MultiMCPage::updateState); } -ImportPage::~ImportPage() +MultiMCPage::~MultiMCPage() { delete ui; } -bool ImportPage::shouldDisplay() const +bool MultiMCPage::shouldDisplay() const { return true; } -void ImportPage::openedImpl() +void MultiMCPage::openedImpl() { updateState(); } -void ImportPage::updateState() +void MultiMCPage::updateState() { if(!isOpened) { @@ -75,11 +75,6 @@ void ImportPage::updateState() } else { - if(input.endsWith("?client=y")) { - input.chop(9); - input.append("/file"); - url = QUrl::fromUserInput(input); - } // hook, line and sinker. QFileInfo fi(url.fileName()); dialog->setSuggestedPack(fi.completeBaseName(), new InstanceImportTask(url)); @@ -91,13 +86,13 @@ void ImportPage::updateState() } } -void ImportPage::setUrl(const QString& url) +void MultiMCPage::setUrl(const QString& url) { ui->modpackEdit->setText(url); updateState(); } -void ImportPage::on_modpackBtn_clicked() +void MultiMCPage::on_modpackBtn_clicked() { const QUrl url = QFileDialog::getOpenFileUrl(this, tr("Choose modpack"), modpackUrl(), tr("Zip (*.zip)")); if (url.isValid()) @@ -114,7 +109,7 @@ void ImportPage::on_modpackBtn_clicked() } -QUrl ImportPage::modpackUrl() const +QUrl MultiMCPage::modpackUrl() const { const QUrl url(ui->modpackEdit->text()); if (url.isValid() && !url.isRelative() && !url.host().isEmpty()) diff --git a/application/pages/modplatform/ImportPage.h b/application/pages/modplatform/MultiMCPage.h index 3afb0045..1d9b7744 100644 --- a/application/pages/modplatform/ImportPage.h +++ b/application/pages/modplatform/MultiMCPage.h @@ -23,33 +23,33 @@ namespace Ui { -class ImportPage; +class MultiMCPage; } class NewInstanceDialog; -class ImportPage : public QWidget, public BasePage +class MultiMCPage : public QWidget, public BasePage { Q_OBJECT public: - explicit ImportPage(NewInstanceDialog* dialog, QWidget *parent = 0); - virtual ~ImportPage(); + explicit MultiMCPage(NewInstanceDialog* dialog, QWidget *parent = 0); + virtual ~MultiMCPage(); virtual QString displayName() const override { - return tr("Import from zip"); + return tr("MultiMC"); } virtual QIcon icon() const override { - return MMC->getThemedIcon("viewfolder"); + return MMC->getThemedIcon("multimc"); } virtual QString id() const override { - return "import"; + return "multimc"; } virtual QString helpPage() const override { - return "Zip-import"; + return "MultiMC-packs"; } virtual bool shouldDisplay() const override; @@ -64,7 +64,7 @@ private: QUrl modpackUrl() const; private: - Ui::ImportPage *ui = nullptr; + Ui::MultiMCPage *ui = nullptr; NewInstanceDialog* dialog = nullptr; }; diff --git a/application/pages/modplatform/ImportPage.ui b/application/pages/modplatform/MultiMCPage.ui index eb63cbe9..dc329c4c 100644 --- a/application/pages/modplatform/ImportPage.ui +++ b/application/pages/modplatform/MultiMCPage.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>ImportPage</class> - <widget class="QWidget" name="ImportPage"> + <class>MultiMCPage</class> + <widget class="QWidget" name="MultiMCPage"> <property name="geometry"> <rect> <x>0</x> |