From 3c8a12aded03e6e3f4a0c50cbb7a7ef4e57fab07 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 1 Feb 2013 13:07:36 -0600 Subject: Added new instance dialog. --- gui/mainwindow.cpp | 7 +- gui/newinstancedialog.cpp | 33 +++++++++ gui/newinstancedialog.h | 37 +++++++++++ gui/newinstancedialog.ui | 166 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 gui/newinstancedialog.cpp create mode 100644 gui/newinstancedialog.h create mode 100644 gui/newinstancedialog.ui (limited to 'gui') diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 3a5e3d86..1ff633b2 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -17,12 +17,16 @@ #include "ui_mainwindow.h" #include +#include #include #include #include "util/osutils.h" + #include "gui/settingsdialog.h" +#include "gui/newinstancedialog.h" + #include "data/appsettings.h" #include "data/version.h" @@ -48,7 +52,8 @@ MainWindow::~MainWindow() void MainWindow::on_actionAddInstance_triggered() { - + NewInstanceDialog *newInstDlg = new NewInstanceDialog(this); + newInstDlg->exec(); } void MainWindow::on_actionViewInstanceFolder_triggered() 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 + +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 + +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 @@ + + + NewInstanceDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 220 + 230 + + + + New Instance + + + + :/icons/toolbar/new:/icons/toolbar/new + + + true + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + :/icons/instances/infinity:/icons/instances/infinity + + + + 80 + 80 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Name + + + + + + + Qt::Horizontal + + + + + + + + + Version: + + + + + + + true + + + + + + + ... + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + NewInstanceDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + NewInstanceDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + -- cgit v1.2.3