mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-21 11:17:16 +00:00
Various task related improvements.
* Errors are reported back to task users via Failure signals. * Lwjgl doesn't download on each legacy instance start anymore. * Tasks were unified when it comes to success/failure. * Task dialogs don't get spawned after short tasks finish anymore.
This commit is contained in:
@@ -37,11 +37,6 @@ int Task::getProgress() const
|
||||
return progress;
|
||||
}
|
||||
|
||||
void Task::calcProgress(int parts, int whole)
|
||||
{
|
||||
setProgress((int)((((float)parts) / ((float)whole))*100)); // Not sure if C++ or LISP...
|
||||
}
|
||||
|
||||
void Task::setProgress(int progress)
|
||||
{
|
||||
this->progress = progress;
|
||||
@@ -58,16 +53,21 @@ void Task::emitStarted()
|
||||
{
|
||||
running = true;
|
||||
emit started();
|
||||
emit started(this);
|
||||
}
|
||||
|
||||
void Task::emitEnded()
|
||||
void Task::emitFailed(QString reason)
|
||||
{
|
||||
running = false;
|
||||
emit ended();
|
||||
emit ended(this);
|
||||
emit failed(reason);
|
||||
}
|
||||
|
||||
void Task::emitSucceeded()
|
||||
{
|
||||
running = false;
|
||||
emit succeeded();
|
||||
}
|
||||
|
||||
|
||||
bool Task::isRunning() const
|
||||
{
|
||||
return running;
|
||||
|
||||
Reference in New Issue
Block a user