diff options
Diffstat (limited to 'application/pages/modplatform/TwitchPage.h')
-rw-r--r-- | application/pages/modplatform/TwitchPage.h | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/application/pages/modplatform/TwitchPage.h b/application/pages/modplatform/TwitchPage.h index 8e072917..600913cd 100644 --- a/application/pages/modplatform/TwitchPage.h +++ b/application/pages/modplatform/TwitchPage.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2019 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include "pages/BasePage.h" #include <MultiMC.h> #include "tasks/Task.h" +#include "modplatform/flame/UrlResolvingTask.h" namespace Ui { @@ -30,32 +31,39 @@ class NewInstanceDialog; class TwitchPage : public QWidget, public BasePage { - Q_OBJECT + Q_OBJECT public: - explicit TwitchPage(NewInstanceDialog* dialog, QWidget *parent = 0); - virtual ~TwitchPage(); - virtual QString displayName() const override - { - return tr("Twitch"); - } - virtual QIcon icon() const override - { - return MMC->getThemedIcon("twitch"); - } - virtual QString id() const override - { - return "twitch"; - } - virtual QString helpPage() const override - { - return "Twitch-platform"; - } - virtual bool shouldDisplay() const override; - - void openedImpl() override; + explicit TwitchPage(NewInstanceDialog* dialog, QWidget *parent = 0); + virtual ~TwitchPage(); + virtual QString displayName() const override + { + return tr("Twitch URL"); + } + virtual QIcon icon() const override + { + return MMC->getThemedIcon("twitch"); + } + virtual QString id() const override + { + return "twitch"; + } + virtual QString helpPage() const override + { + return "Twitch-platform"; + } + virtual bool shouldDisplay() const override; + + void openedImpl() override; + + void setUrl(const QString & url); + +private slots: + void triggerCheck(bool checked); + void checkDone(); private: - Ui::TwitchPage *ui = nullptr; - NewInstanceDialog* dialog = nullptr; + Ui::TwitchPage *ui = nullptr; + NewInstanceDialog* dialog = nullptr; + shared_qobject_ptr<Flame::UrlResolvingTask> m_modIdResolver; }; |