summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-07-29 00:59:35 +0200
committerPetr Mrázek <peterix@gmail.com>2013-07-29 00:59:35 +0200
commit2e0cbf393a5320dbf5448ca44a9b5905314b0be8 (patch)
tree4baac9cf015ca7b15d83de33c705e0d8d4497d30 /gui
parent8808a8b108b82916eaf30f9aca50cd3ab16af230 (diff)
downloadMultiMC-2e0cbf393a5320dbf5448ca44a9b5905314b0be8.tar
MultiMC-2e0cbf393a5320dbf5448ca44a9b5905314b0be8.tar.gz
MultiMC-2e0cbf393a5320dbf5448ca44a9b5905314b0be8.tar.lz
MultiMC-2e0cbf393a5320dbf5448ca44a9b5905314b0be8.tar.xz
MultiMC-2e0cbf393a5320dbf5448ca44a9b5905314b0be8.zip
Massive renaming in the backend folder, all around restructure in the same.
Diffstat (limited to 'gui')
-rw-r--r--gui/consolewindow.h2
-rw-r--r--gui/instancemodel.cpp6
-rw-r--r--gui/instancemodel.h2
-rw-r--r--gui/legacymodeditdialog.cpp4
-rw-r--r--gui/legacymodeditdialog.h4
-rw-r--r--gui/lwjglselectdialog.cpp2
-rw-r--r--gui/mainwindow.cpp78
-rw-r--r--gui/mainwindow.h14
-rw-r--r--gui/modeditdialog.cpp4
-rw-r--r--gui/modeditdialog.h4
-rw-r--r--gui/modeditwindow.cpp4
-rw-r--r--gui/newinstancedialog.cpp10
-rw-r--r--gui/settingsdialog.cpp2
-rw-r--r--gui/taskdialog.cpp2
-rw-r--r--gui/versionselectdialog.cpp6
15 files changed, 72 insertions, 72 deletions
diff --git a/gui/consolewindow.h b/gui/consolewindow.h
index 5490bc92..3ea02ad9 100644
--- a/gui/consolewindow.h
+++ b/gui/consolewindow.h
@@ -2,7 +2,7 @@
#define CONSOLEWINDOW_H
#include <QDialog>
-#include "minecraftprocess.h"
+#include "MinecraftProcess.h"
namespace Ui {
class ConsoleWindow;
diff --git a/gui/instancemodel.cpp b/gui/instancemodel.cpp
index 8db985e8..6f130fd5 100644
--- a/gui/instancemodel.cpp
+++ b/gui/instancemodel.cpp
@@ -53,7 +53,7 @@ QVariant InstanceModel::data ( const QModelIndex& index, int role ) const
{
return QVariant();
}
- Instance *pdata = static_cast<Instance*> ( index.internalPointer() );
+ BaseInstance *pdata = static_cast<BaseInstance*> ( index.internalPointer() );
switch ( role )
{
case InstancePointerRole:
@@ -114,8 +114,8 @@ InstanceProxyModel::InstanceProxyModel ( QObject *parent )
bool InstanceProxyModel::subSortLessThan (
const QModelIndex& left, const QModelIndex& right ) const
{
- Instance *pdataLeft = static_cast<Instance*> ( left.internalPointer() );
- Instance *pdataRight = static_cast<Instance*> ( right.internalPointer() );
+ BaseInstance *pdataLeft = static_cast<BaseInstance*> ( left.internalPointer() );
+ BaseInstance *pdataRight = static_cast<BaseInstance*> ( right.internalPointer() );
//kDebug() << *pdataLeft << *pdataRight;
return QString::localeAwareCompare(pdataLeft->name(), pdataRight->name()) < 0;
//return pdataLeft->name() < pdataRight->name();
diff --git a/gui/instancemodel.h b/gui/instancemodel.h
index 208ee68e..3938da45 100644
--- a/gui/instancemodel.h
+++ b/gui/instancemodel.h
@@ -2,7 +2,7 @@
#include <QAbstractListModel>
#include "kcategorizedsortfilterproxymodel.h"
-#include "instancelist.h"
+#include "lists/InstanceList.h"
#include <QIcon>
class InstanceModel : public QAbstractListModel
diff --git a/gui/legacymodeditdialog.cpp b/gui/legacymodeditdialog.cpp
index 83d36218..319705f9 100644
--- a/gui/legacymodeditdialog.cpp
+++ b/gui/legacymodeditdialog.cpp
@@ -15,9 +15,9 @@
#include "legacymodeditdialog.h"
#include "ui_legacymodeditdialog.h"
-#include "instance.h"
+#include "BaseInstance.h"
-LegacyModEditDialog::LegacyModEditDialog(QWidget *parent, Instance* m_inst) :
+LegacyModEditDialog::LegacyModEditDialog(QWidget *parent, BaseInstance* m_inst) :
QDialog(parent),
ui(new Ui::LegacyModEditDialog)
{
diff --git a/gui/legacymodeditdialog.h b/gui/legacymodeditdialog.h
index 5310f769..54dceffe 100644
--- a/gui/legacymodeditdialog.h
+++ b/gui/legacymodeditdialog.h
@@ -18,7 +18,7 @@
#include <QDialog>
-#include "instance.h"
+#include "BaseInstance.h"
namespace Ui {
class LegacyModEditDialog;
@@ -29,7 +29,7 @@ class LegacyModEditDialog : public QDialog
Q_OBJECT
public:
- explicit LegacyModEditDialog(QWidget *parent = 0, Instance* m_inst = 0);
+ explicit LegacyModEditDialog(QWidget *parent = 0, BaseInstance* m_inst = 0);
~LegacyModEditDialog();
private slots:
diff --git a/gui/lwjglselectdialog.cpp b/gui/lwjglselectdialog.cpp
index ded299cf..d4a42b59 100644
--- a/gui/lwjglselectdialog.cpp
+++ b/gui/lwjglselectdialog.cpp
@@ -16,7 +16,7 @@
#include "lwjglselectdialog.h"
#include "ui_lwjglselectdialog.h"
-#include "lwjglversionlist.h"
+#include "lists/LwjglVersionList.h"
LWJGLSelectDialog::LWJGLSelectDialog(QWidget *parent) :
QDialog(parent),
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index 341fa7bf..c403ea25 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -48,22 +48,22 @@
#include "kcategorizedview.h"
#include "kcategorydrawer.h"
-#include "instancelist.h"
-#include "appsettings.h"
-#include "version.h"
+#include "lists/InstanceList.h"
+#include "AppSettings.h"
+#include "AppVersion.h"
-#include "logintask.h"
-#include "gameupdatetask.h"
+#include "tasks/LoginTask.h"
+#include "tasks/GameUpdateTask.h"
-#include "instance.h"
-#include "instanceloader.h"
-#include "minecraftprocess.h"
+#include "BaseInstance.h"
+#include "InstanceFactory.h"
+#include "MinecraftProcess.h"
#include "instancemodel.h"
#include "instancedelegate.h"
-#include "minecraftversionlist.h"
-#include "lwjglversionlist.h"
+#include "lists/MinecraftVersionList.h"
+#include "lists/LwjglVersionList.h"
// Opens the given file in the default application.
// TODO: Move this somewhere.
@@ -89,16 +89,16 @@ MainWindow::MainWindow ( QWidget *parent ) :
view->setPalette(pal);
*/
-// view->setStyleSheet(
-// "QListView\
-// {\
-// background-image: url(:/backgrounds/kitteh);\
-// background-attachment: fixed;\
-// background-clip: padding;\
-// background-position: top right;\
-// background-repeat: none;\
-// background-color:palette(base);\
-// }");
+ view->setStyleSheet(
+ "QListView\
+ {\
+ background-image: url(:/backgrounds/kitteh);\
+ background-attachment: fixed;\
+ background-clip: padding;\
+ background-position: top right;\
+ background-repeat: none;\
+ background-color:palette(base);\
+ }");
view->setSelectionMode ( QAbstractItemView::SingleSelection );
//view->setSpacing( KDialog::spacingHint() );
@@ -168,7 +168,7 @@ void MainWindow::instanceActivated ( QModelIndex index )
{
if(!index.isValid())
return;
- Instance * inst = (Instance *) index.data(InstanceModel::InstancePointerRole).value<void *>();
+ BaseInstance * inst = (BaseInstance *) index.data(InstanceModel::InstancePointerRole).value<void *>();
doLogin();
}
@@ -186,29 +186,29 @@ void MainWindow::on_actionAddInstance_triggered()
if (!newInstDlg->exec())
return;
- Instance *newInstance = NULL;
+ BaseInstance *newInstance = NULL;
QString instDirName = DirNameFromString(newInstDlg->instName());
QString instDir = PathCombine(globalSettings->get("InstanceDir").toString(), instDirName);
- auto &loader = InstanceLoader::get();
+ auto &loader = InstanceFactory::get();
auto error = loader.createInstance(newInstance, instDir);
QString errorMsg = QString("Failed to create instance %1: ").arg(instDirName);
switch (error)
{
- case InstanceLoader::NoCreateError:
+ case InstanceFactory::NoCreateError:
newInstance->setName(newInstDlg->instName());
newInstance->setIntendedVersion(newInstDlg->selectedVersion()->descriptor());
instList.add(InstancePtr(newInstance));
return;
- case InstanceLoader::InstExists:
+ case InstanceFactory::InstExists:
errorMsg += "An instance with the given directory name already exists.";
QMessageBox::warning(this, "Error", errorMsg);
break;
- case InstanceLoader::CantCreateDir:
+ case InstanceFactory::CantCreateDir:
errorMsg += "Failed to create the instance directory.";
QMessageBox::warning(this, "Error", errorMsg);
break;
@@ -222,7 +222,7 @@ void MainWindow::on_actionAddInstance_triggered()
void MainWindow::on_actionChangeInstGroup_triggered()
{
- Instance* inst = selectedInstance();
+ BaseInstance* inst = selectedInstance();
if(inst)
{
bool ok = false;
@@ -291,7 +291,7 @@ void MainWindow::on_mainToolBar_visibilityChanged ( bool )
void MainWindow::on_actionDeleteInstance_triggered()
{
- Instance* inst = selectedInstance();
+ BaseInstance* inst = selectedInstance();
if (inst)
{
int response = QMessageBox::question(this, "CAREFUL",
@@ -306,7 +306,7 @@ void MainWindow::on_actionDeleteInstance_triggered()
void MainWindow::on_actionRenameInstance_triggered()
{
- Instance* inst = selectedInstance();
+ BaseInstance* inst = selectedInstance();
if(inst)
{
bool ok = false;
@@ -324,7 +324,7 @@ void MainWindow::on_actionRenameInstance_triggered()
void MainWindow::on_actionViewSelectedInstFolder_triggered()
{
- Instance* inst = selectedInstance();
+ BaseInstance* inst = selectedInstance();
if(inst)
{
QString str = inst->rootDir();
@@ -335,7 +335,7 @@ void MainWindow::on_actionViewSelectedInstFolder_triggered()
void MainWindow::on_actionEditInstMods_triggered()
{
//TODO: Needs to do current ModEditDialog too
- Instance* inst = selectedInstance();
+ BaseInstance* inst = selectedInstance();
if (inst)
{
LegacyModEditDialog dialog ( this, inst );
@@ -362,7 +362,7 @@ void MainWindow::on_instanceView_customContextMenuRequested ( const QPoint &pos
instContextMenu->exec ( view->mapToGlobal ( pos ) );
}
-Instance* MainWindow::selectedInstance()
+BaseInstance* MainWindow::selectedInstance()
{
QAbstractItemView * iv = view;
auto smodel = iv->selectionModel();
@@ -375,7 +375,7 @@ Instance* MainWindow::selectedInstance()
if(mindex.isValid())
{
- return (Instance *) mindex.data(InstanceModel::InstancePointerRole).value<void *>();
+ return (BaseInstance *) mindex.data(InstanceModel::InstancePointerRole).value<void *>();
}
else
return nullptr;
@@ -384,7 +384,7 @@ Instance* MainWindow::selectedInstance()
void MainWindow::on_actionLaunchInstance_triggered()
{
- Instance* inst = selectedInstance();
+ BaseInstance* inst = selectedInstance();
if(inst)
{
doLogin();
@@ -450,12 +450,12 @@ void MainWindow::launchInstance(LoginResponse response)
void MainWindow::launchInstance(QString instID, LoginResponse response)
{
- Instance *instance = instList.getInstanceById(instID).data();
+ BaseInstance *instance = instList.getInstanceById(instID).data();
Q_ASSERT_X(instance != NULL, "launchInstance", "instance ID does not correspond to a valid instance");
launchInstance(instance, response);
}
-void MainWindow::launchInstance(Instance *instance, LoginResponse response)
+void MainWindow::launchInstance(BaseInstance *instance, LoginResponse response)
{
Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL");
@@ -531,7 +531,7 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
if (view->selectionModel()->selectedIndexes().count() < 1)
return;
- Instance *inst = selectedInstance();
+ BaseInstance *inst = selectedInstance();
VersionSelectDialog *vselect = new VersionSelectDialog(inst->versionList(), this);
if (vselect->exec() && vselect->selectedVersion())
@@ -542,7 +542,7 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
void MainWindow::on_actionChangeInstLWJGLVersion_triggered()
{
- Instance *inst = selectedInstance();
+ BaseInstance *inst = selectedInstance();
if (!inst)
return;
@@ -559,7 +559,7 @@ void MainWindow::on_actionInstanceSettings_triggered()
if (view->selectionModel()->selectedIndexes().count() < 1)
return;
- Instance *inst = selectedInstance();
+ BaseInstance *inst = selectedInstance();
SettingsObject *s;
s = &inst->settings();
InstanceSettings settings(s, this);
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index a10d570c..67ae859e 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -18,9 +18,9 @@
#include <QMainWindow>
-#include "instancelist.h"
-#include "loginresponse.h"
-#include "instance.h"
+#include "lists/InstanceList.h"
+#include "tasks/LoginResponse.h"
+#include "BaseInstance.h"
class InstanceModel;
class InstanceProxyModel;
@@ -41,7 +41,7 @@ class MainWindow : public QMainWindow
/*!
* The currently selected instance.
*/
- Q_PROPERTY(Instance* selectedInstance READ selectedInstance STORED false)
+ Q_PROPERTY(BaseInstance* selectedInstance READ selectedInstance STORED false)
public:
explicit MainWindow(QWidget *parent = 0);
@@ -53,7 +53,7 @@ public:
void openWebPage(QUrl url);
- Instance *selectedInstance();
+ BaseInstance *selectedInstance();
private slots:
void on_actionAbout_triggered();
@@ -119,7 +119,7 @@ public slots:
void launchInstance(LoginResponse response);
void launchInstance(QString instID, LoginResponse response);
- void launchInstance(Instance *inst, LoginResponse response);
+ void launchInstance(BaseInstance *inst, LoginResponse response);
private:
Ui::MainWindow *ui;
@@ -134,7 +134,7 @@ private:
// A pointer to the instance we are actively doing stuff with.
// This is set when the user launches an instance and is used to refer to that
// instance throughout the launching process.
- Instance *m_activeInst;
+ BaseInstance *m_activeInst;
Task *m_versionLoadTask;
};
diff --git a/gui/modeditdialog.cpp b/gui/modeditdialog.cpp
index 945a5a91..2f437101 100644
--- a/gui/modeditdialog.cpp
+++ b/gui/modeditdialog.cpp
@@ -15,9 +15,9 @@
#include "modeditdialog.h"
#include "ui_modeditdialog.h"
-#include "instance.h"
+#include "BaseInstance.h"
-ModEditDialog::ModEditDialog(QWidget *parent, Instance* m_inst) :
+ModEditDialog::ModEditDialog(QWidget *parent, BaseInstance* m_inst) :
QDialog(parent),
ui(new Ui::ModEditDialog)
{
diff --git a/gui/modeditdialog.h b/gui/modeditdialog.h
index 648b9c08..329a1b4e 100644
--- a/gui/modeditdialog.h
+++ b/gui/modeditdialog.h
@@ -18,7 +18,7 @@
#include <QDialog>
-#include "instance.h"
+#include "BaseInstance.h"
namespace Ui {
class ModEditDialog;
@@ -29,7 +29,7 @@ class ModEditDialog : public QDialog
Q_OBJECT
public:
- explicit ModEditDialog(QWidget *parent = 0, Instance* m_inst = 0);
+ explicit ModEditDialog(QWidget *parent = 0, BaseInstance* m_inst = 0);
~ModEditDialog();
private slots:
diff --git a/gui/modeditwindow.cpp b/gui/modeditwindow.cpp
index 322197ef..a7d4fbbb 100644
--- a/gui/modeditwindow.cpp
+++ b/gui/modeditwindow.cpp
@@ -15,11 +15,11 @@
#include "modeditwindow.h"
#include "ui_modeditwindow.h"
-#include "instance.h"
+#include "BaseInstance.h"
#include <QDebug>
-ModEditWindow::ModEditWindow(QWidget *parent, Instance* m_inst) :
+ModEditWindow::ModEditWindow(QWidget *parent, BaseInstance* m_inst) :
QDialog(parent),
ui(new Ui::ModEditWindow)
{
diff --git a/gui/newinstancedialog.cpp b/gui/newinstancedialog.cpp
index cf005429..a5c902b4 100644
--- a/gui/newinstancedialog.cpp
+++ b/gui/newinstancedialog.cpp
@@ -16,12 +16,12 @@
#include "newinstancedialog.h"
#include "ui_newinstancedialog.h"
-#include "instanceloader.h"
+#include "InstanceFactory.h"
-#include "instversionlist.h"
-#include "instversion.h"
+#include <lists/MinecraftVersionList.h>
+#include "InstanceVersion.h"
-#include "task.h"
+#include "tasks/Task.h"
#include "versionselectdialog.h"
#include "taskdialog.h"
@@ -29,7 +29,7 @@
#include <QLayout>
#include <QPushButton>
-#include <minecraftversionlist.h>
+
NewInstanceDialog::NewInstanceDialog(QWidget *parent) :
QDialog(parent),
diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp
index 38844509..52867169 100644
--- a/gui/settingsdialog.cpp
+++ b/gui/settingsdialog.cpp
@@ -16,7 +16,7 @@
#include "settingsdialog.h"
#include "ui_settingsdialog.h"
-#include "appsettings.h"
+#include "AppSettings.h"
#include <QFileDialog>
#include <QMessageBox>
diff --git a/gui/taskdialog.cpp b/gui/taskdialog.cpp
index a74b7718..efa64256 100644
--- a/gui/taskdialog.cpp
+++ b/gui/taskdialog.cpp
@@ -18,7 +18,7 @@
#include <QKeyEvent>
-#include "task.h"
+#include "tasks/Task.h"
TaskDialog::TaskDialog(QWidget *parent) :
QDialog(parent),
diff --git a/gui/versionselectdialog.cpp b/gui/versionselectdialog.cpp
index 63a2ac26..9f1a8653 100644
--- a/gui/versionselectdialog.cpp
+++ b/gui/versionselectdialog.cpp
@@ -22,9 +22,9 @@
#include <gui/taskdialog.h>
-#include <instversionlist.h>
-#include <instversion.h>
-#include <task.h>
+#include <lists/InstVersionList.h>
+#include <InstanceVersion.h>
+#include <tasks/Task.h>
VersionSelectDialog::VersionSelectDialog(InstVersionList *vlist, QWidget *parent) :
QDialog(parent),