From fce0f5df045f1d956cabeda41406001a037c9ab7 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 14 Jan 2013 17:42:38 -0600 Subject: Added stuff. --- gui/mainwindow.cpp | 6 +++++- gui/mainwindow.h | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 875cc256..ff9d0461 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -24,6 +24,10 @@ MainWindow::MainWindow(QWidget *parent) : ui(new Ui::MainWindow) { ui->setupUi(this); + instList.loadInstances("instances"); + + model.setInstanceList(&instList); + ui->instListView->setModel(&model); } MainWindow::~MainWindow() @@ -43,7 +47,7 @@ void MainWindow::on_actionViewInstanceFolder_triggered() void MainWindow::on_actionRefresh_triggered() { - + instList.loadInstances("instances"); } void MainWindow::on_actionViewCentralModsFolder_triggered() diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 6d9a0216..a735d78e 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -18,6 +18,9 @@ #include +#include "../data/instancelist.h" +#include "../data/instancelistmodel.h" + namespace Ui { class MainWindow; } @@ -51,6 +54,9 @@ private slots: private: Ui::MainWindow *ui; + + InstanceList instList; + InstanceListModel model; }; #endif // MAINWINDOW_H -- cgit From f7e9a7523fdd8c9e2aaaf59f36fc4a702690b760 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 15 Jan 2013 18:46:27 -0600 Subject: Added settings dialog. --- gui/mainwindow.cpp | 8 +- gui/mainwindow.h | 5 +- gui/settingsdialog.cpp | 77 +++++++ gui/settingsdialog.h | 50 +++++ gui/settingsdialog.ui | 541 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 674 insertions(+), 7 deletions(-) create mode 100644 gui/settingsdialog.cpp create mode 100644 gui/settingsdialog.h create mode 100644 gui/settingsdialog.ui (limited to 'gui') diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index ff9d0461..8f7372c8 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -19,15 +19,14 @@ #include #include +#include "../gui/settingsdialog.h" + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); instList.loadInstances("instances"); - - model.setInstanceList(&instList); - ui->instListView->setModel(&model); } MainWindow::~MainWindow() @@ -62,7 +61,8 @@ void MainWindow::on_actionCheckUpdate_triggered() void MainWindow::on_actionSettings_triggered() { - + SettingsDialog dialog(this); + dialog.exec(); } void MainWindow::on_actionReportBug_triggered() diff --git a/gui/mainwindow.h b/gui/mainwindow.h index a735d78e..09cd0817 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -19,9 +19,9 @@ #include #include "../data/instancelist.h" -#include "../data/instancelistmodel.h" -namespace Ui { +namespace Ui +{ class MainWindow; } @@ -56,7 +56,6 @@ private: Ui::MainWindow *ui; InstanceList instList; - InstanceListModel model; }; #endif // MAINWINDOW_H diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp new file mode 100644 index 00000000..46569340 --- /dev/null +++ b/gui/settingsdialog.cpp @@ -0,0 +1,77 @@ +/* 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 "settingsdialog.h" +#include "ui_settingsdialog.h" + +#include + +SettingsDialog::SettingsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::SettingsDialog) +{ + ui->setupUi(this); +} + +SettingsDialog::~SettingsDialog() +{ + delete ui; +} + +void SettingsDialog::updateCheckboxStuff() +{ + ui->minMemSpinBox->setEnabled(!(ui->compatModeCheckBox->isChecked() || + ui->maximizedCheckBox->isChecked())); + ui->maxMemSpinBox->setEnabled(!(ui->compatModeCheckBox->isChecked() || + ui->maximizedCheckBox->isChecked())); + + ui->maximizedCheckBox->setEnabled(!ui->compatModeCheckBox->isChecked()); +} + +void SettingsDialog::on_instDirBrowseBtn_clicked() +{ + QString dir = QFileDialog::getExistingDirectory(this, "Instance Directory", + ui->instDirTextBox->text()); + if (!dir.isEmpty()) + ui->instDirTextBox->setText(dir); +} + +void SettingsDialog::on_modsDirBrowseBtn_clicked() +{ + QString dir = QFileDialog::getExistingDirectory(this, "Mods Directory", + ui->modsDirTextBox->text()); + if (!dir.isEmpty()) + ui->modsDirTextBox->setText(dir); +} + +void SettingsDialog::on_lwjglDirBrowseBtn_clicked() +{ + QString dir = QFileDialog::getExistingDirectory(this, "LWJGL Directory", + ui->lwjglDirTextBox->text()); + if (!dir.isEmpty()) + ui->lwjglDirTextBox->setText(dir); +} + +void SettingsDialog::on_compatModeCheckBox_clicked(bool checked) +{ + Q_UNUSED(checked); + updateCheckboxStuff(); +} + +void SettingsDialog::on_maximizedCheckBox_clicked(bool checked) +{ + Q_UNUSED(checked); + updateCheckboxStuff(); +} diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h new file mode 100644 index 00000000..3e9d9e0f --- /dev/null +++ b/gui/settingsdialog.h @@ -0,0 +1,50 @@ +/* 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 SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include + +namespace Ui { +class SettingsDialog; +} + +class SettingsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SettingsDialog(QWidget *parent = 0); + ~SettingsDialog(); + + void updateCheckboxStuff(); + +private slots: + void on_instDirBrowseBtn_clicked(); + + void on_modsDirBrowseBtn_clicked(); + + void on_lwjglDirBrowseBtn_clicked(); + + void on_compatModeCheckBox_clicked(bool checked); + + void on_maximizedCheckBox_clicked(bool checked); + +private: + Ui::SettingsDialog *ui; +}; + +#endif // SETTINGSDIALOG_H diff --git a/gui/settingsdialog.ui b/gui/settingsdialog.ui new file mode 100644 index 00000000..315686ca --- /dev/null +++ b/gui/settingsdialog.ui @@ -0,0 +1,541 @@ + + + SettingsDialog + + + + 0 + 0 + 400 + 420 + + + + Settings + + + + :/icons/toolbar/settings:/icons/toolbar/settings + + + true + + + + + + QTabWidget::Rounded + + + 0 + + + + General + + + + + + true + + + Sorting Mode + + + + + + By last launched + + + + + + + By name + + + + + + + + + + Update Settings + + + + + + Use development builds? + + + + + + + Check for updates when MultiMC starts? + + + + + + + + + + Folders + + + + + + Instances: + + + + + + + + + + ... + + + + + + + Mods: + + + + + + + + + + ... + + + + + + + LWJGL: + + + + + + + + + + ... + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Console + + + + + + Console Settings + + + + + + Show console while the game is running? + + + + + + + Automatically close console when the game quits? + + + + + + + + + + Instance Console Colors + + + + + + System message color: + + + + + + + + + + Output message color: + + + + + + + + + + Error message color: + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Minecraft + + + + + + Window Size + + + + + + Compatibility mode? + + + + + + + Start Minecraft maximized? + + + + + + + + + Window height: + + + + + + + Window width: + + + + + + + 854 + + + 65536 + + + 1 + + + 854 + + + + + + + 480 + + + 65536 + + + 480 + + + + + + + + + + + + Login automatically when an instance launches? + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Java + + + + + + Memory + + + + + + 512 + + + 65536 + + + 128 + + + 1024 + + + + + + + Minimum memory allocation: + + + + + + + Maximum memory allocation: + + + + + + + 256 + + + 65536 + + + 128 + + + 256 + + + + + + + + + + Java Settings + + + + + + Java path: + + + + + + + + + + JVM arguments: + + + + + + + Auto-detect + + + + + + + + + + + + + Custom Commands + + + + + + Post-exit command: + + + + + + + Pre-launch command: + + + + + + + + + + + + + Pre-launch command runs before the instance launches and post-exit command runs after it exits. Both will be run in MultiMC's working directory with INST_ID, INST_DIR, and INST_NAME as environment variables. + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + SettingsDialog + accept() + + + 257 + 410 + + + 157 + 274 + + + + + buttonBox + rejected() + SettingsDialog + reject() + + + 325 + 410 + + + 286 + 274 + + + + + -- cgit From b371ee1de22be6d846aa53ae5574555ca012f1c3 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 15 Jan 2013 19:04:10 -0600 Subject: Added mod edit window. --- gui/modeditwindow.cpp | 29 ++++++ gui/modeditwindow.h | 37 ++++++++ gui/modeditwindow.ui | 241 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 307 insertions(+) create mode 100644 gui/modeditwindow.cpp create mode 100644 gui/modeditwindow.h create mode 100644 gui/modeditwindow.ui (limited to 'gui') diff --git a/gui/modeditwindow.cpp b/gui/modeditwindow.cpp new file mode 100644 index 00000000..e457252a --- /dev/null +++ b/gui/modeditwindow.cpp @@ -0,0 +1,29 @@ +/* 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 "modeditwindow.h" +#include "ui_modeditwindow.h" + +ModEditWindow::ModEditWindow(QWidget *parent) : + QDialog(parent), + ui(new Ui::ModEditWindow) +{ + ui->setupUi(this); +} + +ModEditWindow::~ModEditWindow() +{ + delete ui; +} diff --git a/gui/modeditwindow.h b/gui/modeditwindow.h new file mode 100644 index 00000000..c669e0b1 --- /dev/null +++ b/gui/modeditwindow.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 MODEDITWINDOW_H +#define MODEDITWINDOW_H + +#include + +namespace Ui { +class ModEditWindow; +} + +class ModEditWindow : public QDialog +{ + Q_OBJECT + +public: + explicit ModEditWindow(QWidget *parent = 0); + ~ModEditWindow(); + +private: + Ui::ModEditWindow *ui; +}; + +#endif // MODEDITWINDOW_H diff --git a/gui/modeditwindow.ui b/gui/modeditwindow.ui new file mode 100644 index 00000000..c35c35d1 --- /dev/null +++ b/gui/modeditwindow.ui @@ -0,0 +1,241 @@ + + + ModEditWindow + + + + 0 + 0 + 540 + 420 + + + + Dialog + + + + + + 0 + + + + Jar Mods + + + + + + + + + + + &Add + + + + + + + &Remove + + + + + + + MCForge + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Move &Up + + + + + + + Move &Down + + + + + + + + + + Mods + + + + + + + + + + + &Add + + + + + + + &Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + &View Folder + + + + + + + + + + Core Mods + + + + + + + + + + + &Add + + + + + + + &Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + &View Folder + + + + + + + + + + Texture Packs + + + + + + + + + + + &Add + + + + + + + &Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + &View Folder + + + + + + + + + + + + + QDialogButtonBox::Close + + + + + + + + -- cgit