Skip to content

Commit

Permalink
Check for empty install path.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeathByDenim committed Mar 10, 2015
1 parent 79c8b2c commit 94793bc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions paalternativelauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions paalternativelauncher.rc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
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
BLOCK "080904E4"
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

Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION "0.5.1"
#define VERSION "0.5.2"

0 comments on commit 94793bc

Please sign in to comment.