diff --git a/src/apps/haiku-depot/PackageInfo.cpp b/src/apps/haiku-depot/PackageInfo.cpp index 2a752a5f81..4a7ae891bb 100644 --- a/src/apps/haiku-depot/PackageInfo.cpp +++ b/src/apps/haiku-depot/PackageInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013, Stephan Aßmus . + * Copyright 2013-2014, Stephan Aßmus . * Copyright 2013, Rene Gollent . * All rights reserved. Distributed under the terms of the MIT License. */ diff --git a/src/apps/haiku-depot/PackageInfo.h b/src/apps/haiku-depot/PackageInfo.h index 5cd9a2694f..d57429f67a 100644 --- a/src/apps/haiku-depot/PackageInfo.h +++ b/src/apps/haiku-depot/PackageInfo.h @@ -1,5 +1,5 @@ /* - * Copyright 2013, Stephan Aßmus . + * Copyright 2013-2014, Stephan Aßmus . * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef PACKAGE_INFO_H @@ -193,6 +193,7 @@ enum PackageState { DOWNLOADING = 2, ACTIVATED = 3, UNINSTALLED = 4, + PENDING = 5, }; diff --git a/src/apps/haiku-depot/PackageListView.cpp b/src/apps/haiku-depot/PackageListView.cpp index 780e2b4f3d..9be0d83357 100644 --- a/src/apps/haiku-depot/PackageListView.cpp +++ b/src/apps/haiku-depot/PackageListView.cpp @@ -23,6 +23,8 @@ static const char* skPackageStateAvailable = B_TRANSLATE_MARK("Available"); static const char* skPackageStateUninstalled = B_TRANSLATE_MARK("Uninstalled"); static const char* skPackageStateActive = B_TRANSLATE_MARK("Active"); static const char* skPackageStateInactive = B_TRANSLATE_MARK("Inactive"); +static const char* skPackageStatePending = B_TRANSLATE_MARK( + "Pending" B_UTF8_ELLIPSIS); inline BString @@ -43,6 +45,8 @@ package_state_to_string(PackageInfoRef ref) data.SetToFormat("%3.2f%%", ref->DownloadProgress() * 100.0); return data; } + case PENDING: + return B_TRANSLATE(skPackageStatePending); } return B_TRANSLATE("Unknown"); diff --git a/src/apps/haiku-depot/PackageManager.cpp b/src/apps/haiku-depot/PackageManager.cpp index 80442706ec..b9b1226848 100644 --- a/src/apps/haiku-depot/PackageManager.cpp +++ b/src/apps/haiku-depot/PackageManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013, Haiku, Inc. All Rights Reserved. + * Copyright 2013-2014, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -108,6 +108,7 @@ public: | BPackageManager::B_ADD_REMOTE_REPOSITORIES | BPackageManager::B_REFRESH_REPOSITORIES); PackageInfoRef ref(Package()); + ref->SetState(PENDING); fPackageManager->SetCurrentActionPackage(ref, true); fPackageManager->AddProgressListener(this); const char* packageName = ref->Title().String(); @@ -310,7 +311,7 @@ PackageManager::GetPackageActions(PackageInfoRef package, Model* model) if (state == ACTIVATED || state == INSTALLED) { actionList.Add(PackageActionRef(new UninstallPackageAction( package, model), true)); - } else { + } else if (state == NONE || state == UNINSTALLED) { actionList.Add(PackageActionRef(new InstallPackageAction(package, model), true)); }