aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-02-06 07:09:32 +0100
committerPetr Mrázek <peterix@gmail.com>2013-02-06 07:09:32 +0100
commit18b087e99280d2c8d5a6115a178f9e6f03606656 (patch)
treefbf58928dabbae4540de3d7725f9ac70274fa586 /gui
parent4e9006769e3554524096d45f8a1ce16ccfa78bfc (diff)
parente475f5d51251ae57da0480bbadc9cb32a8bc72b2 (diff)
downloadPrismLauncher-18b087e99280d2c8d5a6115a178f9e6f03606656.tar.gz
PrismLauncher-18b087e99280d2c8d5a6115a178f9e6f03606656.tar.bz2
PrismLauncher-18b087e99280d2c8d5a6115a178f9e6f03606656.zip
Merge https://github.com/Forkk/MultiMC5
Conflicts: gui/mainwindow.ui
Diffstat (limited to 'gui')
-rw-r--r--gui/logindialog.cpp51
-rw-r--r--gui/logindialog.h40
-rw-r--r--gui/logindialog.ui146
-rw-r--r--gui/mainwindow.cpp87
-rw-r--r--gui/mainwindow.h17
-rw-r--r--gui/mainwindow.ui223
-rw-r--r--gui/newinstancedialog.cpp33
-rw-r--r--gui/newinstancedialog.h37
-rw-r--r--gui/newinstancedialog.ui166
-rw-r--r--gui/settingsdialog.cpp112
-rw-r--r--gui/settingsdialog.h7
-rw-r--r--gui/settingsdialog.ui107
-rw-r--r--gui/taskdialog.cpp109
-rw-r--r--gui/taskdialog.h63
-rw-r--r--gui/taskdialog.ui53
15 files changed, 1155 insertions, 96 deletions
diff --git a/gui/logindialog.cpp b/gui/logindialog.cpp
new file mode 100644
index 00000000..426757a9
--- /dev/null
+++ b/gui/logindialog.cpp
@@ -0,0 +1,51 @@
+/* Copyright 2013 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.
+ */
+
+#include "logindialog.h"
+#include "ui_logindialog.h"
+
+LoginDialog::LoginDialog(QWidget *parent, const QString& loginErrMsg) :
+ QDialog(parent),
+ ui(new Ui::LoginDialog)
+{
+ ui->setupUi(this);
+
+ if (loginErrMsg.isEmpty())
+ ui->loginErrorLabel->setVisible(false);
+ else
+ {
+ ui->loginErrorLabel->setVisible(true);
+ ui->loginErrorLabel->setText(QString("<span style=\" color:#ff0000;\">%1</span>").
+ arg(loginErrMsg));
+ }
+
+ resize(minimumSizeHint());
+ layout()->setSizeConstraint(QLayout::SetFixedSize);
+}
+
+LoginDialog::~LoginDialog()
+{
+ delete ui;
+}
+
+QString LoginDialog::getUsername() const
+{
+ return ui->usernameTextBox->text();
+}
+
+QString LoginDialog::getPassword() const
+{
+ return ui->passwordTextBox->text();
+}
diff --git a/gui/logindialog.h b/gui/logindialog.h
new file mode 100644
index 00000000..1b70dcd5
--- /dev/null
+++ b/gui/logindialog.h
@@ -0,0 +1,40 @@
+/* Copyright 2013 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.
+ */
+
+#ifndef LOGINDIALOG_H
+#define LOGINDIALOG_H
+
+#include <QDialog>
+
+namespace Ui {
+class LoginDialog;
+}
+
+class LoginDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit LoginDialog(QWidget *parent = 0, const QString& loginErrMsg = "");
+ ~LoginDialog();
+
+ QString getUsername() const;
+ QString getPassword() const;
+
+private:
+ Ui::LoginDialog *ui;
+};
+
+#endif // LOGINDIALOG_H
diff --git a/gui/logindialog.ui b/gui/logindialog.ui
new file mode 100644
index 00000000..ce41d2f5
--- /dev/null
+++ b/gui/logindialog.ui
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LoginDialog</class>
+ <widget class="QDialog" name="LoginDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>365</width>
+ <height>145</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Login</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="loginErrorLabel">
+ <property name="text">
+ <string>&lt;span style=&quot; color:#ff0000;&quot;&gt;Error&lt;/span&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="usernameLabel">
+ <property name="text">
+ <string>Username:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="usernameTextBox">
+ <property name="placeholderText">
+ <string>Username</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="passwordLabel">
+ <property name="text">
+ <string>Password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="passwordTextBox">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ <property name="placeholderText">
+ <string>Password</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="checkboxLayout">
+ <item>
+ <widget class="QPushButton" name="forceUpdateButton">
+ <property name="text">
+ <string>&amp;Force Update</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="rememberUsernameCheckbox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Remember Username?</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="rememberPasswordCheckbox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>R&amp;emember Password?</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="loginButtonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>loginButtonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>LoginDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>loginButtonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>LoginDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index 87a1dcc0..bc0840a0 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -16,16 +16,35 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
+#include <QMenu>
+#include <QMessageBox>
+
#include <QDesktopServices>
#include <QUrl>
-#include "../gui/settingsdialog.h"
+#include "util/osutils.h"
+
+#include "gui/settingsdialog.h"
+#include "gui/newinstancedialog.h"
+#include "gui/logindialog.h"
+#include "gui/taskdialog.h"
+
+#include "data/appsettings.h"
+#include "data/version.h"
+
+#include "tasks/logintask.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
+
+ setWindowTitle(QString("MultiMC %1").arg(Version::current.toString()));
+
+ restoreGeometry(settings->getConfig().value("MainWindowGeometry", saveGeometry()).toByteArray());
+ restoreState(settings->getConfig().value("MainWindowState", saveState()).toByteArray());
+
instList.initialLoad("instances");
ui->instanceView->setModel(&instList);
}
@@ -37,12 +56,13 @@ MainWindow::~MainWindow()
void MainWindow::on_actionAddInstance_triggered()
{
-
+ NewInstanceDialog *newInstDlg = new NewInstanceDialog(this);
+ newInstDlg->exec();
}
void MainWindow::on_actionViewInstanceFolder_triggered()
{
-
+ openInDefaultProgram(settings->getInstanceDir());
}
void MainWindow::on_actionRefresh_triggered()
@@ -52,7 +72,7 @@ void MainWindow::on_actionRefresh_triggered()
void MainWindow::on_actionViewCentralModsFolder_triggered()
{
-
+ openInDefaultProgram(settings->getCentralModsDir());
}
void MainWindow::on_actionCheckUpdate_triggered()
@@ -68,15 +88,70 @@ void MainWindow::on_actionSettings_triggered()
void MainWindow::on_actionReportBug_triggered()
{
-
+ QDesktopServices::openUrl(QUrl("http://bugs.forkk.net/"));
}
void MainWindow::on_actionNews_triggered()
{
-
+ QDesktopServices::openUrl(QUrl("http://news.forkk.net/"));
}
void MainWindow::on_actionAbout_triggered()
{
}
+
+void MainWindow::on_mainToolBar_visibilityChanged(bool)
+{
+ // Don't allow hiding the main toolbar.
+ // This is the only way I could find to prevent it... :/
+ ui->mainToolBar->setVisible(true);
+}
+
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+ // Save the window state and geometry.
+ settings->getConfig().setValue("MainWindowGeometry", saveGeometry());
+ settings->getConfig().setValue("MainWindowState", saveState());
+ QMainWindow::closeEvent(event);
+}
+
+void MainWindow::on_instanceView_customContextMenuRequested(const QPoint &pos)
+{
+ QMenu *instContextMenu = new QMenu("Instance", this);
+
+ // Add the actions from the toolbar to the context menu.
+ instContextMenu->addActions(ui->instanceToolBar->actions());
+
+ instContextMenu->exec(ui->instanceView->mapToGlobal(pos));
+}
+
+
+void MainWindow::on_actionLaunchInstance_triggered()
+{
+ doLogin();
+}
+
+void MainWindow::doLogin(const QString &errorMsg)
+{
+ LoginDialog* loginDlg = new LoginDialog(this, errorMsg);
+ if (loginDlg->exec())
+ {
+ UserInfo uInfo(loginDlg->getUsername(), loginDlg->getPassword());
+
+ TaskDialog* tDialog = new TaskDialog(this);
+ LoginTask* loginTask = new LoginTask(uInfo, tDialog);
+ connect(loginTask, SIGNAL(loginComplete(LoginResponse)),
+ SLOT(onLoginComplete(LoginResponse)), Qt::QueuedConnection);
+ connect(loginTask, SIGNAL(loginFailed(QString)),
+ SLOT(doLogin(QString)), Qt::QueuedConnection);
+ tDialog->exec(loginTask);
+ }
+}
+
+void MainWindow::onLoginComplete(LoginResponse response)
+{
+ QMessageBox::information(this, "Login Successful",
+ QString("Logged in as %1 with session ID %2.").
+ arg(response.getUsername(), response.getSessionID()));
+}
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 77245531..28ca341a 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -18,7 +18,8 @@
#include <QMainWindow>
-#include "../data/instancemodel.h"
+#include "data/instancemodel.h"
+#include "data/loginresponse.h"
namespace Ui
{
@@ -33,6 +34,8 @@ public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
+ void closeEvent(QCloseEvent *event);
+
private slots:
void on_actionAbout_triggered();
@@ -52,6 +55,18 @@ private slots:
void on_actionNews_triggered();
+ void on_mainToolBar_visibilityChanged(bool);
+
+ void on_instanceView_customContextMenuRequested(const QPoint &pos);
+
+ void on_actionLaunchInstance_triggered();
+
+
+ void doLogin(const QString& errorMsg = "");
+
+
+ void onLoginComplete(LoginResponse response);
+
private:
Ui::MainWindow *ui;
diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui
index 5abfb37d..137f7e97 100644
--- a/gui/mainwindow.ui
+++ b/gui/mainwindow.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>739</width>
- <height>657</height>
+ <width>600</width>
+ <height>400</height>
</rect>
</property>
<property name="windowTitle">
@@ -44,11 +44,17 @@
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
+ <property name="contextMenuPolicy">
+ <enum>Qt::CustomContextMenu</enum>
+ </property>
</widget>
</item>
</layout>
</widget>
<widget class="QToolBar" name="mainToolBar">
+ <property name="windowTitle">
+ <string>Main Toolbar</string>
+ </property>
<property name="movable">
<bool>false</bool>
</property>
@@ -74,6 +80,38 @@
<addaction name="actionAbout"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
+ <widget class="QToolBar" name="instanceToolBar">
+ <property name="windowTitle">
+ <string>Instance Toolbar</string>
+ </property>
+ <property name="floatable">
+ <bool>false</bool>
+ </property>
+ <attribute name="toolBarArea">
+ <enum>RightToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ <addaction name="actionLaunchInstance"/>
+ <addaction name="separator"/>
+ <addaction name="actionRenameInstance"/>
+ <addaction name="actionChangeInstGroup"/>
+ <addaction name="actionChangeInstIcon"/>
+ <addaction name="actionChangeInstMCVersion"/>
+ <addaction name="actionChangeInstLWJGLVersion"/>
+ <addaction name="actionEditInstNotes"/>
+ <addaction name="separator"/>
+ <addaction name="actionEditInstMods"/>
+ <addaction name="actionManageInstSaves"/>
+ <addaction name="actionRebuildInstJar"/>
+ <addaction name="separator"/>
+ <addaction name="actionInstanceSettings"/>
+ <addaction name="actionMakeDesktopShortcut"/>
+ <addaction name="actionViewSelectedInstFolder"/>
+ <addaction name="separator"/>
+ <addaction name="actionDeleteInstance"/>
+ </widget>
<action name="actionAddInstance">
<property name="icon">
<iconset resource="../multimc.qrc">
@@ -85,6 +123,9 @@
<property name="toolTip">
<string>Add a new instance.</string>
</property>
+ <property name="statusTip">
+ <string>Add a new instance.</string>
+ </property>
</action>
<action name="actionViewInstanceFolder">
<property name="icon">
@@ -97,6 +138,9 @@
<property name="toolTip">
<string>Open the instance folder in a file browser.</string>
</property>
+ <property name="statusTip">
+ <string>Open the instance folder in a file browser.</string>
+ </property>
</action>
<action name="actionRefresh">
<property name="icon">
@@ -109,6 +153,9 @@
<property name="toolTip">
<string>Reload the instance list.</string>
</property>
+ <property name="statusTip">
+ <string>Reload the instance list.</string>
+ </property>
</action>
<action name="actionViewCentralModsFolder">
<property name="icon">
@@ -121,6 +168,9 @@
<property name="toolTip">
<string>Open the central mods folder in a file browser.</string>
</property>
+ <property name="statusTip">
+ <string>Open the central mods folder in a file browser.</string>
+ </property>
</action>
<action name="actionCheckUpdate">
<property name="icon">
@@ -133,6 +183,9 @@
<property name="toolTip">
<string>Check for new updates for MultiMC</string>
</property>
+ <property name="statusTip">
+ <string>Check for new updates for MultiMC</string>
+ </property>
</action>
<action name="actionSettings">
<property name="icon">
@@ -145,6 +198,9 @@
<property name="toolTip">
<string>Change settings.</string>
</property>
+ <property name="statusTip">
+ <string>Change settings.</string>
+ </property>
<property name="menuRole">
<enum>QAction::PreferencesRole</enum>
</property>
@@ -160,6 +216,9 @@
<property name="toolTip">
<string>Open the bug tracker to report a bug with MultiMC.</string>
</property>
+ <property name="statusTip">
+ <string>Open the bug tracker to report a bug with MultiMC.</string>
+ </property>
</action>
<action name="actionNews">
<property name="icon">
@@ -172,6 +231,9 @@
<property name="toolTip">
<string>Open the MultiMC dev blog to read news about MultiMC.</string>
</property>
+ <property name="statusTip">
+ <string>Open the MultiMC dev blog to read news about MultiMC.</string>
+ </property>
</action>
<action name="actionAbout">
<property name="icon">
@@ -184,10 +246,167 @@
<property name="toolTip">
<string>View information about MultiMC.</string>
</property>
+ <property name="statusTip">
+ <string>About MultiMC</string>
+ </property>
<property name="menuRole">
<enum>QAction::AboutRole</enum>
</property>
</action>
+ <action name="actionLaunchInstance">
+ <property name="text">
+ <string>Play</string>
+ </property>
+ <property name="toolTip">
+ <string>Launch the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Launch the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionRenameInstance">
+ <property name="text">
+ <string>Rename</string>
+ </property>
+ <property name="toolTip">
+ <string>Rename the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Rename the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionChangeInstGroup">
+ <property name="text">
+ <string>Change Group</string>
+ </property>
+ <property name="toolTip">
+ <string>Change the selected instance's group.</string>
+ </property>
+ <property name="statusTip">
+ <string>Change the selected instance's group.</string>
+ </property>
+ </action>
+ <action name="actionChangeInstIcon">
+ <property name="text">
+ <string>Change Icon</string>
+ </property>
+ <property name="toolTip">
+ <string>Change the selected instance's icon.</string>
+ </property>
+ <property name="statusTip">
+ <string>Change the selected instance's icon.</string>
+ </property>
+ </action>
+ <action name="actionEditInstNotes">
+ <property name="text">
+ <string>Edit Notes</string>
+ </property>
+ <property name="toolTip">
+ <string>Edit the notes for the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Edit the notes for the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionInstanceSettings">
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ <property name="toolTip">
+ <string>Change settings for the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Change settings for the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionMakeDesktopShortcut">
+ <property name="text">
+ <string>Make Shortcut</string>
+ </property>
+ <property name="toolTip">
+ <string>Make a shortcut on the desktop for the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Make a shortcut on the desktop for the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionManageInstSaves">
+ <property name="text">
+ <string>Manage Saves</string>
+ </property>
+ <property name="toolTip">
+ <string>Manage saves for the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Manage saves for the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionEditInstMods">
+ <property name="text">
+ <string>Edit Mods</string>
+ </property>
+ <property name="toolTip">
+ <string>Edit the mods for the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Edit the mods for the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionChangeInstMCVersion">
+ <property name="text">
+ <string>Change Version</string>
+ </property>
+ <property name="toolTip">
+ <string>Change the selected instance's Minecraft version.</string>
+ </property>
+ <property name="statusTip">
+ <string>Change the selected instance's Minecraft version.</string>
+ </property>
+ </action>
+ <action name="actionChangeInstLWJGLVersion">
+ <property name="text">
+ <string>Change LWJGL</string>
+ </property>
+ <property name="toolTip">
+ <string>Change the version of LWJGL for the selected instance to use.</string>
+ </property>
+ <property name="statusTip">
+ <string>Change the version of LWJGL for the selected instance to use.</string>
+ </property>
+ </action>
+ <action name="actionRebuildInstJar">
+ <property name="text">
+ <string>Rebuild Jar</string>
+ </property>
+ <property name="toolTip">
+ <string>Reinstall the mods for the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Reinstall the mods for the selected instance.</string>
+ </property>
+ </action>
+ <action name="actionViewSelectedInstFolder">
+ <property name="text">
+ <string>View Folder</string>
+ </property>
+ <property name="toolTip">
+ <string>Open the selected instance's root folder in a file browser.</string>
+ </property>
+ <property name="statusTip">
+ <string>Open the selected instance's root folder in a file browser.</string>
+ </property>
+ </action>
+ <action name="actionDeleteInstance">
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ <property name="toolTip">
+ <string>Delete the selected instance.</string>
+ </property>
+ <property name="statusTip">
+ <string>Delete the selected instance.</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
diff --git a/gui/newinstancedialog.cpp b/gui/newinstancedialog.cpp
new file mode 100644
index 00000000..400b42d8
--- /dev/null
+++ b/gui/newinstancedialog.cpp
@@ -0,0 +1,33 @@
+/* Copyright 2013 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.
+ */
+
+#include "newinstancedialog.h"
+#include "ui_newinstancedialog.h"
+
+#include <QLayout>
+
+NewInstanceDialog::NewInstanceDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::NewInstanceDialog)
+{
+ ui->setupUi(this);
+ resize(minimumSizeHint());
+ layout()->setSizeConstraint(QLayout::SetFixedSize);
+}
+
+NewInstanceDialog::~NewInstanceDialog()
+{
+ delete ui;
+}
diff --git a/gui/newinstancedialog.h b/gui/newinstancedialog.h
new file mode 100644
index 00000000..263136f1
--- /dev/null
+++ b/gui/newinstancedialog.h
@@ -0,0 +1,37 @@
+/* Copyright 2013 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.
+ */
+
+#ifndef NEWINSTANCEDIALOG_H
+#define NEWINSTANCEDIALOG_H
+
+#include <QDialog>
+
+namespace Ui {
+class NewInstanceDialog;
+}
+
+class NewInstanceDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit NewInstanceDialog(QWidget *parent = 0);
+ ~NewInstanceDialog();
+
+private:
+ Ui::NewInstanceDialog *ui;
+};
+
+#endif // NEWINSTANCEDIALOG_H
diff --git a/gui/newinstancedialog.ui b/gui/newinstancedialog.ui
new file mode 100644
index 00000000..865f6301
--- /dev/null
+++ b/gui/newinstancedialog.ui
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>NewInstanceDialog</class>
+ <widget class="QDialog" name="NewInstanceDialog">
+ <property name="windowModality">
+ <enum>Qt::ApplicationModal</enum>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>220</width>
+ <height>230</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>New Instance</string>
+ </property>
+ <property name="windowIcon">
+ <iconset resource="../multimc.qrc">
+ <normaloff>:/icons/toolbar/new</normaloff>:/icons/toolbar/new</iconset>
+ </property>
+ <property name="modal">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="iconBtnLayout">
+ <item>
+ <spacer name="iconBtnLeftSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="iconButton">
+ <property name="icon">
+ <iconset resource="../multimc.qrc">
+ <normaloff>:/icons/instances/infinity</normaloff>:/icons/instances/infinity</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>80</width>
+ <height>80</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="iconBtnRightSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="instNameTextBox">
+ <property name="placeholderText">
+ <string>Name</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="labelVersion">
+ <property name="text">
+ <string>Version:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="versionTextBox">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>