From 94793bc97c6a86633e734266c88d955405510e60 Mon Sep 17 00:00:00 2001 From: DeathByDenim Date: Tue, 10 Mar 2015 09:33:57 -0400 Subject: [PATCH] Check for empty install path. --- CMakeLists.txt | 2 +- paalternativelauncher.cpp | 21 +++++++++++++++++++++ paalternativelauncher.rc | 8 ++++---- version.h | 2 +- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a33076..6b87ffd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.11) set(MAJOR_VERSION "0") set(MINOR_VERSION "5") -set(PATCH_VERSION "1") +set(PATCH_VERSION "2") # Tell CMake to run moc when necessary: set(CMAKE_AUTOMOC ON) diff --git a/paalternativelauncher.cpp b/paalternativelauncher.cpp index 2cca80b..e8b0376 100644 --- a/paalternativelauncher.cpp +++ b/paalternativelauncher.cpp @@ -394,6 +394,13 @@ void PAAlternativeLauncher::installPathButtonClicked(bool) void PAAlternativeLauncher::downloadPushButtonClicked(bool) { + if(mInstallPathLineEdit->text().isEmpty()) + { + info.critical(tr("Download"), tr("Install path is empty.")); + mInstallPathLineEdit->setFocus(); + return; + } + QVariantMap object = mStreamsComboBox->currentData().toMap(); QString downloadurl = object["DownloadUrl"].toString(); QString titlefolder = object["TitleFolder"].toString(); @@ -468,6 +475,13 @@ void PAAlternativeLauncher::launchOfflinePushButtonClicked(bool) mExtraParameters = settings.value("stable/extraparameters").toString(); mUseOptimus = (AdvancedDialog::optimus_t)settings.value("stable/useoptirun").toInt(); + if(install_path.isEmpty()) + { + info.critical(tr("Launch offline"), tr("Install path is empty. It looks like this launcher never downloaded PA.\nPlease log in and download PA.")); + return; + } + + QString command; QStringList parameters; @@ -511,6 +525,13 @@ void PAAlternativeLauncher::launchOfflinePushButtonClicked(bool) void PAAlternativeLauncher::launchPushButtonClicked(bool) { + if(mInstallPathLineEdit->text().isEmpty()) + { + info.critical(tr("Launch"), tr("Install path is empty.")); + mInstallPathLineEdit->setFocus(); + return; + } + QString command; QStringList parameters; diff --git a/paalternativelauncher.rc b/paalternativelauncher.rc index c8cd150..33e153d 100644 --- a/paalternativelauncher.rc +++ b/paalternativelauncher.rc @@ -1,8 +1,8 @@ id ICON "img/icon.ico" 1 VERSIONINFO -FILEVERSION 0,5,1,0 -PRODUCTVERSION 0,5,1,0 +FILEVERSION 0,5,2,0 +PRODUCTVERSION 0,5,2,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -10,11 +10,11 @@ BEGIN BEGIN VALUE "CompanyName", "DeathByDenim" VALUE "FileDescription", "Alternative launcher for Planetary Annihilation" - VALUE "FileVersion", "0.5.1" + VALUE "FileVersion", "0.5.2" VALUE "InternalName", "paalternativelauncher" VALUE "OriginalFilename", "paalternativelauncher.exe" VALUE "ProductName", "PA Alternative Launcher" - VALUE "ProductVersion", "0.5.1" + VALUE "ProductVersion", "0.5.2" END END diff --git a/version.h b/version.h index 114686f..0652d25 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define VERSION "0.5.1" +#define VERSION "0.5.2"