Massive renaming in the backend folder, all around restructure in the same.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
#define CONSOLEWINDOW_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "minecraftprocess.h"
|
||||
#include "MinecraftProcess.h"
|
||||
|
||||
namespace Ui {
|
||||
class ConsoleWindow;
|
||||
|
@ -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();
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include "kcategorizedsortfilterproxymodel.h"
|
||||
#include "instancelist.h"
|
||||
#include "lists/InstanceList.h"
|
||||
#include <QIcon>
|
||||
|
||||
class InstanceModel : public QAbstractListModel
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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:
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "lwjglselectdialog.h"
|
||||
#include "ui_lwjglselectdialog.h"
|
||||
|
||||
#include "lwjglversionlist.h"
|
||||
#include "lists/LwjglVersionList.h"
|
||||
|
||||
LWJGLSelectDialog::LWJGLSelectDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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),
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "settingsdialog.h"
|
||||
#include "ui_settingsdialog.h"
|
||||
|
||||
#include "appsettings.h"
|
||||
#include "AppSettings.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "task.h"
|
||||
#include "tasks/Task.h"
|
||||
|
||||
TaskDialog::TaskDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
@ -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),
|
||||
|
Reference in New Issue
Block a user