Some changes to the package manager:

- use a single button for install/upgrade
 - show versions of installed package and installer
Named actions in enum PACKAGE_ACT_* to avoid confusion with the status enum.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1186 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-31 18:57:55 +00:00
parent 7e60aab603
commit 20b40585f6
7 changed files with 173 additions and 113 deletions
+3 -3
View File
@@ -162,7 +162,7 @@ void PackageManager::findAllInstalledPackages(vector<InstallablePackageP>& packa
}
bool PackageManager::install(const InstallablePackage& package) {
bool install_local = package.action & PACKAGE_LOCAL;
bool install_local = package.has(PACKAGE_ACT_LOCAL);
return (install_local ? local : global).install(package);
}
@@ -321,10 +321,10 @@ String PackageDirectory::databaseFile() {
bool PackageDirectory::install(const InstallablePackage& package) {
String n = name(package.description->name);
if (package.action & PACKAGE_REMOVE) {
if (package.action & PACKAGE_ACT_REMOVE) {
if (!remove_file_or_dir(n)) return false;
removeFromDatabase(package.description->name);
} else if (package.action & PACKAGE_INSTALL) {
} else if (package.action & PACKAGE_ACT_INSTALL) {
if (!remove_file_or_dir(n + _(".new"))) return false;
bool ok = actual_install(package, n + _(".new"));
if (!ok) return false;