From d6d5c86a736537828a59ddc6389d5d0490942f8c Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 9 Jan 2013 12:22:22 -0600 Subject: Initial commit --- .gitignore | 1 + MultiMC.pro | 27 + MultiMC.pro.user | 239 ++++ data/instancebase.cpp | 45 + data/instancebase.h | 43 + gui/mainwindow.cpp | 77 ++ gui/mainwindow.h | 56 + gui/mainwindow.ui | 163 +++ main.cpp | 28 + multimc.qrc | 29 + resources/icons/console.svg | 228 +++ resources/icons/console_error.svg | 247 ++++ resources/icons/instances/clucker.svg | 404 ++++++ resources/icons/instances/creeper.svg | 775 +++++++++++ resources/icons/instances/enderpearl.svg | 271 ++++ resources/icons/instances/ftb-glow.svg | 606 ++++++++ resources/icons/instances/ftb-logo.svg | 257 ++++ resources/icons/instances/gear.svg | 434 ++++++ resources/icons/instances/herobrine.svg | 583 ++++++++ resources/icons/instances/magitech.svg | 886 ++++++++++++ resources/icons/instances/meat.svg | 371 +++++ resources/icons/instances/netherstar.svg | 342 +++++ resources/icons/instances/skeleton.svg | 636 +++++++++ resources/icons/instances/squarecreeper.svg | 828 +++++++++++ resources/icons/instances/steve.svg | 534 +++++++ resources/icons/multimc.svg | 1993 +++++++++++++++++++++++++++ resources/icons/toolbar/about.png | Bin 0 -> 1693 bytes resources/icons/toolbar/bug.svg | 387 ++++++ resources/icons/toolbar/centralmods.png | Bin 0 -> 1561 bytes resources/icons/toolbar/checkupdate.png | Bin 0 -> 1635 bytes resources/icons/toolbar/help.png | Bin 0 -> 1735 bytes resources/icons/toolbar/new.png | Bin 0 -> 1440 bytes resources/icons/toolbar/news.svg | 296 ++++ resources/icons/toolbar/refresh.png | Bin 0 -> 1843 bytes resources/icons/toolbar/settings.png | Bin 0 -> 1964 bytes resources/icons/toolbar/viewfolder.png | Bin 0 -> 1006 bytes util/pathutils.cpp | 32 + util/pathutils.h | 25 + 38 files changed, 10843 insertions(+) create mode 100644 .gitignore create mode 100644 MultiMC.pro create mode 100644 MultiMC.pro.user create mode 100644 data/instancebase.cpp create mode 100644 data/instancebase.h create mode 100644 gui/mainwindow.cpp create mode 100644 gui/mainwindow.h create mode 100644 gui/mainwindow.ui create mode 100644 main.cpp create mode 100644 multimc.qrc create mode 100644 resources/icons/console.svg create mode 100644 resources/icons/console_error.svg create mode 100644 resources/icons/instances/clucker.svg create mode 100644 resources/icons/instances/creeper.svg create mode 100644 resources/icons/instances/enderpearl.svg create mode 100644 resources/icons/instances/ftb-glow.svg create mode 100644 resources/icons/instances/ftb-logo.svg create mode 100644 resources/icons/instances/gear.svg create mode 100644 resources/icons/instances/herobrine.svg create mode 100644 resources/icons/instances/magitech.svg create mode 100644 resources/icons/instances/meat.svg create mode 100644 resources/icons/instances/netherstar.svg create mode 100644 resources/icons/instances/skeleton.svg create mode 100644 resources/icons/instances/squarecreeper.svg create mode 100644 resources/icons/instances/steve.svg create mode 100644 resources/icons/multimc.svg create mode 100644 resources/icons/toolbar/about.png create mode 100644 resources/icons/toolbar/bug.svg create mode 100644 resources/icons/toolbar/centralmods.png create mode 100644 resources/icons/toolbar/checkupdate.png create mode 100644 resources/icons/toolbar/help.png create mode 100644 resources/icons/toolbar/new.png create mode 100644 resources/icons/toolbar/news.svg create mode 100644 resources/icons/toolbar/refresh.png create mode 100644 resources/icons/toolbar/settings.png create mode 100644 resources/icons/toolbar/viewfolder.png create mode 100644 util/pathutils.cpp create mode 100644 util/pathutils.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..085e8baf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Thumbs.db diff --git a/MultiMC.pro b/MultiMC.pro new file mode 100644 index 00000000..6115627c --- /dev/null +++ b/MultiMC.pro @@ -0,0 +1,27 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2013-01-08T14:14:58 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = MultiMC +TEMPLATE = app + + +SOURCES += main.cpp\ + gui/mainwindow.cpp \ + data/instancebase.cpp \ + util/pathutils.cpp + +HEADERS += gui/mainwindow.h \ + data/instancebase.h \ + util/pathutils.h \ + +FORMS += gui/mainwindow.ui + +RESOURCES += \ + multimc.qrc diff --git a/MultiMC.pro.user b/MultiMC.pro.user new file mode 100644 index 00000000..c72c06aa --- /dev/null +++ b/MultiMC.pro.user @@ -0,0 +1,239 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + true + 1 + true + 2 + true + 1 + 8 + true + 1 + true + false + false + true + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.0.0 MSVC2010 32bit (SDK) + Desktop Qt 5.0.0 MSVC2010 32bit (SDK) + qt.500.win32_msvc2010.essentials_kit + 0 + 0 + 0 + + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + C:/Users/Andrew/Projects/MultiMC5/MultiMC-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug + true + + + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + true + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + C:/Users/Andrew/Projects/MultiMC5/MultiMC-build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Release + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + + false + false + false + false + true + 0.01 + 10 + true + 25 + + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + MultiMC + + Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Andrew/Projects/MultiMC5/MultiMC/MultiMC.pro + 2 + + MultiMC.pro + false + false + + + 3768 + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {d833f846-3a8b-4e2a-9d77-5f93cddd0a0f} + + + ProjectExplorer.Project.Updater.FileVersion + 12 + + diff --git a/data/instancebase.cpp b/data/instancebase.cpp new file mode 100644 index 00000000..2e0a65df --- /dev/null +++ b/data/instancebase.cpp @@ -0,0 +1,45 @@ +/* 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 "instancebase.h" + +#include "../util/pathutils.h" + +InstanceBase::InstanceBase(QString rootDir, QObject *parent) : + QObject(parent), + m_rootDir(rootDir), + m_config(PathCombine(rootDir, "instance.cfg"), QSettings::IniFormat) +{ + +} + +QString InstanceBase::GetRootDir() const +{ + return m_rootDir; +} + + +///////////// Config Values ///////////// + +// Name +QString InstanceBase::GetInstName() const +{ + return m_config.value("name", "Unnamed").toString(); +} + +void InstanceBase::SetInstName(QString name) +{ + m_config.setValue("name", name); +} diff --git a/data/instancebase.h b/data/instancebase.h new file mode 100644 index 00000000..df23b1b0 --- /dev/null +++ b/data/instancebase.h @@ -0,0 +1,43 @@ +/* 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 INSTANCEBASE_H +#define INSTANCEBASE_H + +#include +#include +#include + +class InstanceBase : public QObject +{ + Q_OBJECT +public: + explicit InstanceBase(QString rootDir, QObject *parent = 0); + + QString GetRootDir() const; + + QString GetInstName() const; + void SetInstName(QString name); + +protected: + + +private: + QString m_rootDir; + + QSettings m_config; +}; + +#endif // INSTANCEBASE_H diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp new file mode 100644 index 00000000..875cc256 --- /dev/null +++ b/gui/mainwindow.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 "mainwindow.h" +#include "ui_mainwindow.h" + +#include +#include + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::on_actionAddInstance_triggered() +{ + +} + +void MainWindow::on_actionViewInstanceFolder_triggered() +{ + +} + +void MainWindow::on_actionRefresh_triggered() +{ + +} + +void MainWindow::on_actionViewCentralModsFolder_triggered() +{ + +} + +void MainWindow::on_actionCheckUpdate_triggered() +{ + +} + +void MainWindow::on_actionSettings_triggered() +{ + +} + +void MainWindow::on_actionReportBug_triggered() +{ + +} + +void MainWindow::on_actionNews_triggered() +{ + +} + +void MainWindow::on_actionAbout_triggered() +{ + +} diff --git a/gui/mainwindow.h b/gui/mainwindow.h new file mode 100644 index 00000000..6d9a0216 --- /dev/null +++ b/gui/mainwindow.h @@ -0,0 +1,56 @@ +/* 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 MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private slots: + void on_actionAbout_triggered(); + + void on_actionAddInstance_triggered(); + + void on_actionViewInstanceFolder_triggered(); + + void on_actionRefresh_triggered(); + + void on_actionViewCentralModsFolder_triggered(); + + void on_actionCheckUpdate_triggered(); + + void on_actionSettings_triggered(); + + void on_actionReportBug_triggered(); + + void on_actionNews_triggered(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui new file mode 100644 index 00000000..0ef98d0e --- /dev/null +++ b/gui/mainwindow.ui @@ -0,0 +1,163 @@ + + + MainWindow + + + + 0 + 0 + 600 + 400 + + + + MultiMC 5 + + + + + false + + + Qt::TopToolBarArea + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + + + + :/icons/toolbar/new:/icons/toolbar/new + + + Add Instance + + + Add a new instance. + + + + + + :/icons/toolbar/viewfolder:/icons/toolbar/viewfolder + + + View Instance Folder + + + Open the instance folder in a file browser. + + + + + + :/icons/toolbar/refresh:/icons/toolbar/refresh + + + Refresh + + + Reload the instance list. + + + + + + :/icons/toolbar/centralmods:/icons/toolbar/centralmods + + + View Central Mods Folder + + + Open the central mods folder in a file browser. + + + + + + :/icons/toolbar/checkupdate:/icons/toolbar/checkupdate + + + Check for Updates + + + Check for new updates for MultiMC + + + + + + :/icons/toolbar/settings:/icons/toolbar/settings + + + Settings + + + Change settings. + + + QAction::PreferencesRole + + + + + + :/icons/toolbar/bug:/icons/toolbar/bug + + + Report a Bug + + + Open the bug tracker to report a bug with MultiMC. + + + + + + :/icons/toolbar/news:/icons/toolbar/news + + + News + + + Open the MultiMC dev blog to read news about MultiMC. + + + + + + :/icons/toolbar/about:/icons/toolbar/about + + + About MultiMC + + + View information about MultiMC. + + + QAction::AboutRole + + + + + + + + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 00000000..0d429c8d --- /dev/null +++ b/main.cpp @@ -0,0 +1,28 @@ +/* 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 "gui/mainwindow.h" +#include + + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + MainWindow mainWin; + mainWin.show(); + + return app.exec(); +} diff --git a/multimc.qrc b/multimc.qrc new file mode 100644 index 00000000..1e32170d --- /dev/null +++ b/multimc.qrc @@ -0,0 +1,29 @@ + + + resources/icons/toolbar/about.png + resources/icons/toolbar/bug.svg + resources/icons/toolbar/centralmods.png + resources/icons/toolbar/checkupdate.png + resources/icons/toolbar/help.png + resources/icons/toolbar/new.png + resources/icons/toolbar/news.svg + resources/icons/toolbar/refresh.png + resources/icons/toolbar/settings.png + resources/icons/toolbar/viewfolder.png + + + resources/icons/instances/clucker.svg + resources/icons/instances/creeper.svg + resources/icons/instances/enderpearl.svg + resources/icons/instances/ftb-glow.svg + resources/icons/instances/ftb-logo.svg + resources/icons/instances/gear.svg + resources/icons/instances/herobrine.svg + resources/icons/instances/magitech.svg + resources/icons/instances/meat.svg + resources/icons/instances/netherstar.svg + resources/icons/instances/skeleton.svg + resources/icons/instances/squarecreeper.svg + resources/icons/instances/steve.svg + + diff --git a/resources/icons/console.svg b/resources/icons/console.svg new file mode 100644 index 00000000..ec14ab68 --- /dev/null +++ b/resources/icons/console.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + MC + + + diff --git a/resources/icons/console_error.svg b/resources/icons/console_error.svg new file mode 100644 index 00000000..a71c6b35 --- /dev/null +++ b/resources/icons/console_error.svg @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/resources/icons/instances/clucker.svg b/resources/icons/instances/clucker.svg new file mode 100644 index 00000000..3ce6ad5c --- /dev/null +++ b/resources/icons/instances/clucker.svg @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + +