diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index 2cf6b3b5..2198e815 100644 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -111,6 +111,10 @@ SET(MULTIMC_SOURCES InstanceWindow.h InstanceWindow.cpp + # GUI - setup wizard + setupwizard/SetupWizard.h + setupwizard/SetupWizard.cpp + # GUI - themes themes/FusionTheme.cpp themes/FusionTheme.h @@ -298,6 +302,9 @@ SET(MULTIMC_UIS # Widgets/other widgets/MCModInfoFrame.ui + + # The Setup Wizard + setupwizard/SetupWizard.ui ) set(MULTIMC_QRCS diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index 49c1d2c4..f176a64b 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -17,6 +17,8 @@ #include "themes/BrightTheme.h" #include "themes/CustomTheme.h" +#include "setupwizard/SetupWizard.h" + #include #include #include @@ -318,6 +320,13 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv) initAnalytics(); + if(SetupWizard::isRequired()) + { + m_setupWizard = new SetupWizard(nullptr); + int result = m_setupWizard->exec(); + qDebug() << "Wizard result =" << result; + } + if(!m_instanceIdToLaunch.isEmpty()) { auto inst = instances()->getInstanceById(m_instanceIdToLaunch); diff --git a/application/MultiMC.h b/application/MultiMC.h index 9c9d0c8a..f166a30a 100644 --- a/application/MultiMC.h +++ b/application/MultiMC.h @@ -14,6 +14,7 @@ class LaunchController; class LocalPeer; class InstanceWindow; class MainWindow; +class SetupWizard; class FolderInstanceProvider; class GenericPageProvider; class QFile; @@ -225,6 +226,7 @@ private: LocalPeer * m_peerInstance = nullptr; GAnalytics * m_analytics = nullptr; + SetupWizard * m_setupWizard = nullptr; public: QString m_instanceIdToLaunch; bool m_liveCheck = false; diff --git a/application/setupwizard/SetupWizard.cpp b/application/setupwizard/SetupWizard.cpp new file mode 100644 index 00000000..b51b34a7 --- /dev/null +++ b/application/setupwizard/SetupWizard.cpp @@ -0,0 +1,26 @@ +#include "SetupWizard.h" + +enum Page +{ + Language, + Java, + Analytics, + Themes, + Accounts +}; +#include "ui_SetupWizard.h" + + +SetupWizard::SetupWizard(QWidget *parent):QWizard(parent), ui(new Ui::SetupWizard) +{ + ui->setupUi(this); +} + +SetupWizard::~SetupWizard() +{ +} + +bool SetupWizard::isRequired() +{ + return true; +} diff --git a/application/setupwizard/SetupWizard.h b/application/setupwizard/SetupWizard.h new file mode 100644 index 00000000..5dbe90a9 --- /dev/null +++ b/application/setupwizard/SetupWizard.h @@ -0,0 +1,39 @@ +/* Copyright 2016 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace Ui +{ +class SetupWizard; +} + +class SetupWizard : public QWizard +{ + Q_OBJECT + +public: /* con/destructors */ + explicit SetupWizard(QWidget *parent = 0); + virtual ~SetupWizard(); + +public: /* methods */ +static bool isRequired(); + +private: /* data */ + Ui::SetupWizard *ui = nullptr; +}; + diff --git a/application/setupwizard/SetupWizard.ui b/application/setupwizard/SetupWizard.ui new file mode 100644 index 00000000..5a4eb558 --- /dev/null +++ b/application/setupwizard/SetupWizard.ui @@ -0,0 +1,255 @@ + + + SetupWizard + + + + 0 + 0 + 630 + 667 + + + + MultiMC Quick Setup + + + QWizard::NoCancelButtonOnLastPage + + + + Welcome + + + Hello and welcome the quick setup wizard! + + + Page::Language + + + + + + <html><head/><body><p>Choose your <s>adventure</s> language:</p></body></html> + + + + + + + + + + + Java + + + Your java settings need attention! + + + Page::Java + + + + + + Java Runtime + + + + + + + + + + + + Memory + + + + + + The maximum amount of memory Minecraft is allowed to use. + + + MB + + + 512 + + + 65536 + + + 128 + + + 1024 + + + + + + + Minimum memory allocation: + + + + + + + Maximum memory allocation: + + + + + + + PermGen: + + + + + + + The amount of memory available to store loaded Java classes. + + + MB + + + 64 + + + 999999999 + + + 8 + + + 64 + + + + + + + The amount of memory Minecraft is started with. + + + MB + + + 256 + + + 65536 + + + 128 + + + 256 + + + + + + + + + + + Analytics + + + We track some anonymous statistics about users. + + + Page::Analytics + + + + + + <html><head/><body> +<p>MultiMC sends anonymous usage statistics on every start of the application. This helps us decide what platforms and issues to focus on.</p> +<p>The data is processed by Google Analytics, see their <a href="https://support.google.com/analytics/answer/6004245?hl=en">article on the matter</a>.</p> +<p>The following data is collected:</p> +<ul> +<li>A random unique ID of the MultiMC installation.<br />It is stored in the application settings (multimc.cfg).</li> +<li>Anonymized IP address.<br />Last octet is set to 0 by Google and not stored.</li> +<li>MultiMC version.</li> +<li>Operating system name, version and architecture.</li> +<li>CPU architecture (kernel architecture on linux).</li> +<li>Size of system memory.</li> +<li>Java version, architecture and memory settings.</li> +</ul> +<p>The analytics will activate on next start, unless you disable them in the settings.</p> +<p>If we change the tracked information, analytics won't be active for the first run and you will see this page again.</p> +</body></html> + + + true + + + true + + + + + + + + Themes and icons + + + Change how things look. + + + Page::Themes + + + + + 230 + 70 + 151 + 71 + + + + Put stuff here. + + + + + + Minecraft accounts + + + Add your account - or accounts. + + + Page::Accounts + + + + + 60 + 60 + 311 + 131 + + + + Put existing accounts page here. + + + + + + +