Tidy status messages a bit

This commit is contained in:
Sky 2013-12-23 15:46:01 +00:00
parent 86284196de
commit 027aafc3c1
10 changed files with 35 additions and 37 deletions

View File

@ -76,7 +76,7 @@ void LegacyUpdate::lwjglStart()
return; return;
} }
setStatus("Downloading new LWJGL."); setStatus(tr("Downloading new LWJGL..."));
auto version = list->getVersion(lwjglVersion); auto version = list->getVersion(lwjglVersion);
if (!version) if (!version)
{ {
@ -144,7 +144,7 @@ void LegacyUpdate::lwjglFinished(QNetworkReply *reply)
saveMe.open(QIODevice::WriteOnly); saveMe.open(QIODevice::WriteOnly);
saveMe.write(m_reply->readAll()); saveMe.write(m_reply->readAll());
saveMe.close(); saveMe.close();
setStatus("Installing new LWJGL..."); setStatus(tr("Installing new LWJGL..."));
extractLwjgl(); extractLwjgl();
jarStart(); jarStart();
} }
@ -220,7 +220,7 @@ void LegacyUpdate::extractLwjgl()
// Now if destFileName is still empty, go to the next file. // Now if destFileName is still empty, go to the next file.
if (!destFileName.isEmpty()) if (!destFileName.isEmpty())
{ {
setStatus("Installing new LWJGL - Extracting " + name); setStatus(tr("Installing new LWJGL - extracting ") + name + "...");
QFile output(destFileName); QFile output(destFileName);
output.open(QIODevice::WriteOnly); output.open(QIODevice::WriteOnly);
output.write(file.readAll()); // FIXME: wste of memory!? output.write(file.readAll()); // FIXME: wste of memory!?
@ -250,7 +250,7 @@ void LegacyUpdate::jarStart()
return; return;
} }
setStatus("Checking for jar updates..."); setStatus(tr("Checking for jar updates..."));
// Make directories // Make directories
QDir binDir(inst->binDir()); QDir binDir(inst->binDir());
if (!binDir.exists() && !binDir.mkpath(".")) if (!binDir.exists() && !binDir.mkpath("."))
@ -260,7 +260,7 @@ void LegacyUpdate::jarStart()
} }
// Build a list of URLs that will need to be downloaded. // Build a list of URLs that will need to be downloaded.
setStatus("Downloading new minecraft.jar"); setStatus(tr("Downloading new minecraft.jar ..."));
QString version_id = inst->intendedVersionId(); QString version_id = inst->intendedVersionId();
QString localPath = version_id + "/" + version_id + ".jar"; QString localPath = version_id + "/" + version_id + ".jar";
@ -294,7 +294,7 @@ void LegacyUpdate::jarFailed()
bool LegacyUpdate::MergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, bool LegacyUpdate::MergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained,
MetainfAction metainf) MetainfAction metainf)
{ {
setStatus("Installing mods - Adding " + from.fileName()); setStatus(tr("Installing mods: Adding ") + from.fileName() + " ...");
QuaZip modZip(from.filePath()); QuaZip modZip(from.filePath());
modZip.open(QuaZip::mdUnzip); modZip.open(QuaZip::mdUnzip);
@ -380,7 +380,7 @@ void LegacyUpdate::ModTheJar()
return; return;
} }
setStatus("Installing mods - backing up minecraft.jar..."); setStatus(tr("Installing mods: Backing up minecraft.jar ..."));
if (!baseJar.exists() && !QFile::copy(runnableJar.filePath(), baseJar.filePath())) if (!baseJar.exists() && !QFile::copy(runnableJar.filePath(), baseJar.filePath()))
{ {
emitFailed("It seems both the active and base jar are gone. A fresh base jar will " emitFailed("It seems both the active and base jar are gone. A fresh base jar will "
@ -405,7 +405,7 @@ void LegacyUpdate::ModTheJar()
} }
// TaskStep(); // STEP 1 // TaskStep(); // STEP 1
setStatus("Installing mods - Opening minecraft.jar"); setStatus(tr("Installing mods: Opening minecraft.jar ..."));
QuaZip zipOut(runnableJar.filePath()); QuaZip zipOut(runnableJar.filePath());
if (!zipOut.open(QuaZip::mdCreate)) if (!zipOut.open(QuaZip::mdCreate))
@ -419,7 +419,7 @@ void LegacyUpdate::ModTheJar()
QSet<QString> addedFiles; QSet<QString> addedFiles;
// Modify the jar // Modify the jar
setStatus("Installing mods - Adding mod files..."); setStatus(tr("Installing mods: Adding mod files..."));
for (int i = modList->size() - 1; i >= 0; i--) for (int i = modList->size() - 1; i >= 0; i--)
{ {
auto &mod = modList->operator[](i); auto &mod = modList->operator[](i);

View File

@ -57,7 +57,7 @@ void OneSixUpdate::executeTask()
/* /*
* FIXME: in offline mode, do not proceed! * FIXME: in offline mode, do not proceed!
*/ */
setStatus("Testing the Java installation."); setStatus(tr("Testing the Java installation..."));
QString java_path = m_inst->settings().get("JavaPath").toString(); QString java_path = m_inst->settings().get("JavaPath").toString();
checker.reset(new JavaChecker()); checker.reset(new JavaChecker());
@ -89,7 +89,7 @@ void OneSixUpdate::executeTask()
void OneSixUpdate::checkJavaOnline() void OneSixUpdate::checkJavaOnline()
{ {
setStatus("Testing the Java installation."); setStatus(tr("Testing the Java installation..."));
QString java_path = m_inst->settings().get("JavaPath").toString(); QString java_path = m_inst->settings().get("JavaPath").toString();
checker.reset(new JavaChecker()); checker.reset(new JavaChecker());
@ -128,7 +128,7 @@ void OneSixUpdate::checkFinishedOffline(JavaCheckResult result)
void OneSixUpdate::versionFileStart() void OneSixUpdate::versionFileStart()
{ {
QLOG_INFO() << m_inst->name() << ": getting version file."; QLOG_INFO() << m_inst->name() << ": getting version file.";
setStatus("Getting the version files from Mojang."); setStatus(tr("Getting the version files from Mojang..."));
QString urlstr = "http://" + URLConstants::AWS_DOWNLOAD_VERSIONS + targetVersion->descriptor() + "/" + targetVersion->descriptor() + ".json"; QString urlstr = "http://" + URLConstants::AWS_DOWNLOAD_VERSIONS + targetVersion->descriptor() + "/" + targetVersion->descriptor() + ".json";
auto job = new NetJob("Version index"); auto job = new NetJob("Version index");
@ -196,7 +196,7 @@ void OneSixUpdate::versionFileFailed()
void OneSixUpdate::assetIndexStart() void OneSixUpdate::assetIndexStart()
{ {
setStatus("Updating asset index."); setStatus(tr("Updating assets index..."));
OneSixInstance *inst = (OneSixInstance *)m_inst; OneSixInstance *inst = (OneSixInstance *)m_inst;
std::shared_ptr<OneSixVersion> version = inst->getFullVersion(); std::shared_ptr<OneSixVersion> version = inst->getFullVersion();
QString assetName = version->assets; QString assetName = version->assets;
@ -247,7 +247,7 @@ void OneSixUpdate::assetIndexFinished()
} }
if(dls.size()) if(dls.size())
{ {
setStatus("Getting the assets files from Mojang..."); setStatus(tr("Getting the assets files from Mojang..."));
auto job = new NetJob("Assets for " + inst->name()); auto job = new NetJob("Assets for " + inst->name());
for(auto dl: dls) for(auto dl: dls)
job->addNetAction(dl); job->addNetAction(dl);
@ -281,7 +281,7 @@ void OneSixUpdate::assetsFailed()
void OneSixUpdate::jarlibStart() void OneSixUpdate::jarlibStart()
{ {
setStatus("Getting the library files from Mojang."); setStatus(tr("Getting the library files from Mojang..."));
QLOG_INFO() << m_inst->name() << ": downloading libraries"; QLOG_INFO() << m_inst->name() << ": downloading libraries";
OneSixInstance *inst = (OneSixInstance *)m_inst; OneSixInstance *inst = (OneSixInstance *)m_inst;
bool successful = inst->reloadFullVersion(); bool successful = inst->reloadFullVersion();
@ -369,7 +369,7 @@ void OneSixUpdate::jarlibFailed()
void OneSixUpdate::prepareForLaunch() void OneSixUpdate::prepareForLaunch()
{ {
setStatus("Preparing for launch."); setStatus(tr("Preparing for launch..."));
QLOG_INFO() << m_inst->name() << ": preparing for launch"; QLOG_INFO() << m_inst->name() << ": preparing for launch";
auto onesix_inst = (OneSixInstance *)m_inst; auto onesix_inst = (OneSixInstance *)m_inst;

View File

@ -172,10 +172,10 @@ QString YggdrasilTask::getStateMessage(const YggdrasilTask::State state) const
switch (state) switch (state)
{ {
case STATE_SENDING_REQUEST: case STATE_SENDING_REQUEST:
return tr("Sending request to auth servers."); return tr("Sending request to auth servers...");
case STATE_PROCESSING_RESPONSE: case STATE_PROCESSING_RESPONSE:
return tr("Processing response from servers."); return tr("Processing response from servers...");
default: default:
return tr("Processing. Please wait."); return tr("Processing. Please wait...");
} }
} }

View File

@ -194,9 +194,9 @@ QString AuthenticateTask::getStateMessage(const YggdrasilTask::State state) cons
switch (state) switch (state)
{ {
case STATE_SENDING_REQUEST: case STATE_SENDING_REQUEST:
return tr("Authenticating: Sending request."); return tr("Authenticating: Sending request...");
case STATE_PROCESSING_RESPONSE: case STATE_PROCESSING_RESPONSE:
return tr("Authenticating: Processing response."); return tr("Authenticating: Processing response...");
default: default:
return YggdrasilTask::getStateMessage(state); return YggdrasilTask::getStateMessage(state);
} }

View File

@ -145,9 +145,9 @@ QString RefreshTask::getStateMessage(const YggdrasilTask::State state) const
switch (state) switch (state)
{ {
case STATE_SENDING_REQUEST: case STATE_SENDING_REQUEST:
return tr("Refreshing login token."); return tr("Refreshing login token...");
case STATE_PROCESSING_RESPONSE: case STATE_PROCESSING_RESPONSE:
return tr("Refreshing login token: Processing response."); return tr("Refreshing login token: Processing response...");
default: default:
return YggdrasilTask::getStateMessage(state); return YggdrasilTask::getStateMessage(state);
} }

View File

@ -55,9 +55,9 @@ QString ValidateTask::getStateMessage(const YggdrasilTask::State state) const
switch (state) switch (state)
{ {
case STATE_SENDING_REQUEST: case STATE_SENDING_REQUEST:
return tr("Validating Access Token: Sending request."); return tr("Validating access token: Sending request...");
case STATE_PROCESSING_RESPONSE: case STATE_PROCESSING_RESPONSE:
return tr("Validating Access Token: Processing response."); return tr("Validating access token: Processing response...");
default: default:
return YggdrasilTask::getStateMessage(state); return YggdrasilTask::getStateMessage(state);
} }

View File

@ -158,7 +158,7 @@ ForgeListLoadTask::ForgeListLoadTask(ForgeVersionList *vlist) : Task()
void ForgeListLoadTask::executeTask() void ForgeListLoadTask::executeTask()
{ {
setStatus(tr("Fetching Forge version list")); setStatus(tr("Fetching Forge version lists..."));
auto job = new NetJob("Version index"); auto job = new NetJob("Version index");
// we do not care if the version is stale or not. // we do not care if the version is stale or not.
auto forgeListEntry = MMC->metacache()->resolveEntry("minecraftforge", "list.json"); auto forgeListEntry = MMC->metacache()->resolveEntry("minecraftforge", "list.json");

View File

@ -172,7 +172,7 @@ JavaListLoadTask::~JavaListLoadTask()
void JavaListLoadTask::executeTask() void JavaListLoadTask::executeTask()
{ {
setStatus("Detecting Java installations..."); setStatus(tr("Detecting Java installations..."));
JavaUtils ju; JavaUtils ju;
QList<QString> candidate_paths = ju.FindJavaPaths(); QList<QString> candidate_paths = ju.FindJavaPaths();

View File

@ -139,7 +139,7 @@ MCVListLoadTask::~MCVListLoadTask()
void MCVListLoadTask::executeTask() void MCVListLoadTask::executeTask()
{ {
setStatus("Loading instance version list..."); setStatus(tr("Loading instance version list..."));
auto worker = MMC->qnam(); auto worker = MMC->qnam();
vlistReply = worker->get(QNetworkRequest(QUrl("http://" + URLConstants::AWS_DOWNLOAD_VERSIONS + "versions.json"))); vlistReply = worker->get(QNetworkRequest(QUrl("http://" + URLConstants::AWS_DOWNLOAD_VERSIONS + "versions.json")));
connect(vlistReply, SIGNAL(finished()), this, SLOT(list_downloaded())); connect(vlistReply, SIGNAL(finished()), this, SLOT(list_downloaded()));

View File

@ -77,7 +77,7 @@ void DownloadUpdateTask::processChannels()
void DownloadUpdateTask::findCurrentVersionInfo() void DownloadUpdateTask::findCurrentVersionInfo()
{ {
setStatus(tr("Finding information about the current version.")); setStatus(tr("Finding information about the current version..."));
auto checker = MMC->updateChecker(); auto checker = MMC->updateChecker();
@ -98,7 +98,7 @@ void DownloadUpdateTask::findCurrentVersionInfo()
void DownloadUpdateTask::loadVersionInfo() void DownloadUpdateTask::loadVersionInfo()
{ {
setStatus(tr("Loading version information.")); setStatus(tr("Loading version information..."));
// Create the net job for loading version info. // Create the net job for loading version info.
NetJob *netJob = new NetJob("Version Info"); NetJob *netJob = new NetJob("Version Info");
@ -153,10 +153,8 @@ void DownloadUpdateTask::vinfoDownloadFailed()
void DownloadUpdateTask::parseDownloadedVersionInfo() void DownloadUpdateTask::parseDownloadedVersionInfo()
{ {
setStatus(tr("Reading file lists.")); setStatus(tr("Reading file list for new version..."));
QLOG_DEBUG() << "Reading file list for new version...";
setStatus(tr("Reading file list for new version."));
QLOG_DEBUG() << "Reading file list for new version.";
QString error; QString error;
if (!parseVersionInfo( if (!parseVersionInfo(
std::dynamic_pointer_cast<ByteArrayDownload>(m_vinfoNetJob->first())->m_data, std::dynamic_pointer_cast<ByteArrayDownload>(m_vinfoNetJob->first())->m_data,
@ -170,8 +168,8 @@ void DownloadUpdateTask::parseDownloadedVersionInfo()
// info. // info.
if (m_vinfoNetJob->size() >= 2 && m_vinfoNetJob->operator[](1)->m_status != Job_Failed) if (m_vinfoNetJob->size() >= 2 && m_vinfoNetJob->operator[](1)->m_status != Job_Failed)
{ {
setStatus(tr("Reading file list for current version.")); setStatus(tr("Reading file list for current version..."));
QLOG_DEBUG() << "Reading file list for current version."; QLOG_DEBUG() << "Reading file list for current version...";
QString error; QString error;
parseVersionInfo( parseVersionInfo(
std::dynamic_pointer_cast<ByteArrayDownload>(m_vinfoNetJob->operator[](1))->m_data, std::dynamic_pointer_cast<ByteArrayDownload>(m_vinfoNetJob->operator[](1))->m_data,
@ -278,7 +276,7 @@ DownloadUpdateTask::processFileLists(NetJob *job,
const DownloadUpdateTask::VersionFileList &newVersion, const DownloadUpdateTask::VersionFileList &newVersion,
DownloadUpdateTask::UpdateOperationList &ops) DownloadUpdateTask::UpdateOperationList &ops)
{ {
setStatus(tr("Processing file lists. Figuring out how to install the update.")); setStatus(tr("Processing file lists - figuring out how to install the update..."));
// First, if we've loaded the current version's file list, we need to iterate through it and // First, if we've loaded the current version's file list, we need to iterate through it and
// delete anything in the current one version's list that isn't in the new version's list. // delete anything in the current one version's list that isn't in the new version's list.