NOISSUE add skeleton of the setup wizard
Very wizardly. Also very empty and opening on every start for now.
This commit is contained in:
parent
374710a87b
commit
476d641841
@ -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
|
||||
|
@ -17,6 +17,8 @@
|
||||
#include "themes/BrightTheme.h"
|
||||
#include "themes/CustomTheme.h"
|
||||
|
||||
#include "setupwizard/SetupWizard.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
|
26
application/setupwizard/SetupWizard.cpp
Normal file
26
application/setupwizard/SetupWizard.cpp
Normal file
@ -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;
|
||||
}
|
39
application/setupwizard/SetupWizard.h
Normal file
39
application/setupwizard/SetupWizard.h
Normal file
@ -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 <QWizard>
|
||||
|
||||
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;
|
||||
};
|
||||
|
255
application/setupwizard/SetupWizard.ui
Normal file
255
application/setupwizard/SetupWizard.ui
Normal file
@ -0,0 +1,255 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SetupWizard</class>
|
||||
<widget class="QWizard" name="SetupWizard">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>630</width>
|
||||
<height>667</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MultiMC Quick Setup</string>
|
||||
</property>
|
||||
<property name="options">
|
||||
<set>QWizard::NoCancelButtonOnLastPage</set>
|
||||
</property>
|
||||
<widget class="QWizardPage" name="welcomePage">
|
||||
<property name="title">
|
||||
<string>Welcome</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Hello and welcome the quick setup wizard!</string>
|
||||
</property>
|
||||
<attribute name="pageId">
|
||||
<string notr="true">Page::Language</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Choose your <s>adventure</s> language:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="languageView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="javaPage">
|
||||
<property name="title">
|
||||
<string>Java</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Your java settings need attention!</string>
|
||||
</property>
|
||||
<attribute name="pageId">
|
||||
<string notr="true">Page::Java</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="javaSettingsGroupBox">
|
||||
<property name="title">
|
||||
<string>Java Runtime</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="4" column="1">
|
||||
<widget class="QTreeView" name="javaView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="memoryGroupBox">
|
||||
<property name="title">
|
||||
<string>Memory</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="maxMemSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>The maximum amount of memory Minecraft is allowed to use.</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true"> MB</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>512</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65536</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>128</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1024</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelMinMem">
|
||||
<property name="text">
|
||||
<string>Minimum memory allocation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelMaxMem">
|
||||
<property name="text">
|
||||
<string>Maximum memory allocation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelPermGen">
|
||||
<property name="text">
|
||||
<string notr="true">PermGen:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="permGenSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>The amount of memory available to store loaded Java classes.</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true"> MB</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>64</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>64</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="minMemSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>The amount of memory Minecraft is started with.</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true"> MB</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>256</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65536</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>128</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>256</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="analyticsPage">
|
||||
<property name="title">
|
||||
<string>Analytics</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>We track some anonymous statistics about users.</string>
|
||||
</property>
|
||||
<attribute name="pageId">
|
||||
<string notr="true">Page::Analytics</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string><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></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="themePage">
|
||||
<property name="title">
|
||||
<string>Themes and icons</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Change how things look.</string>
|
||||
</property>
|
||||
<attribute name="pageId">
|
||||
<string notr="true">Page::Themes</string>
|
||||
</attribute>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>70</y>
|
||||
<width>151</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Put stuff here.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="accountsPage">
|
||||
<property name="title">
|
||||
<string>Minecraft accounts</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Add your account - or accounts.</string>
|
||||
</property>
|
||||
<attribute name="pageId">
|
||||
<string notr="true">Page::Accounts</string>
|
||||
</attribute>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>60</y>
|
||||
<width>311</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Put existing accounts page here.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in New Issue
Block a user