Implemented LWJGL version lists.
The LWJGL list actually doesn't use tasks for loading. Instead, it takes advantage of the QNetworkAccessManager's asynchronous requests. This is a system that I may look to implement for other version lists and things such as the Minecraft version list and possibly even instance mod lists. Loading things this way means that code that wants to load a list can simply call the load list function, rather than having to get a task from the list and execute the task. Unfortunately, it also means we can't have task progress dialogs for loading lists, but it shouldn't really be too difficult to write one that works with this system. At some point in the future, I'll probably end up putting all the code for this method of loading lists into a base class and then update the other lists to support it.
This commit is contained in:
parent
159404f444
commit
3b38e5f924
9 changed files with 559 additions and 0 deletions
|
@ -40,6 +40,7 @@
|
|||
#include "gui/browserdialog.h"
|
||||
#include "gui/aboutdialog.h"
|
||||
#include "gui/versionselectdialog.h"
|
||||
#include "gui/lwjglselectdialog.h"
|
||||
#include "gui/consolewindow.h"
|
||||
|
||||
#include "kcategorizedview.h"
|
||||
|
@ -59,6 +60,7 @@
|
|||
#include "instancedelegate.h"
|
||||
|
||||
#include "minecraftversionlist.h"
|
||||
#include "lwjglversionlist.h"
|
||||
|
||||
// Opens the given file in the default application.
|
||||
// TODO: Move this somewhere.
|
||||
|
@ -140,6 +142,11 @@ MainWindow::MainWindow ( QWidget *parent ) :
|
|||
m_versionLoadTask = MinecraftVersionList::getMainList().getLoadTask();
|
||||
startTask(m_versionLoadTask);
|
||||
}
|
||||
|
||||
if (!LWJGLVersionList::get().isLoaded())
|
||||
{
|
||||
LWJGLVersionList::get().loadList();
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -460,3 +467,17 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
|
|||
inst->setIntendedVersion(vselect->selectedVersion()->descriptor());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionChangeInstLWJGLVersion_triggered()
|
||||
{
|
||||
Instance *inst = selectedInstance();
|
||||
|
||||
if (!inst)
|
||||
return;
|
||||
|
||||
LWJGLSelectDialog *lselect = new LWJGLSelectDialog(this);
|
||||
if (lselect->exec())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue