Merge branch 'master' of github.com:OoliteProject/oolite
This commit is contained in:
commit
5e01396e78
@ -1073,8 +1073,8 @@
|
||||
"oolite-oxzmanager-firstrun" = "Before Oolite can install your requested expansions automatically, it needs to retrieve the expansions list. You will need to be connected to the internet for this to work. Use the 'Download expansions list' option when you are ready, or 'Return to Menu' if you do not have internet access now or would rather download and install expansions yourself.";
|
||||
"oolite-oxzmanager-intro" = "Oolite can automatically install some expansions for you if you are connected to the internet. Use the 'Update expansions list' option to retrieve the latest expansions list, and the 'Install expansions' and 'Remove expansions' options to add and remove expansion packs.\n\nThere are also many more expansion packs not available through the automatic installer.\n\nCalculations of conflicts and dependencies between expansion packs are based on your currently running packs. So, if pack A requires pack B to work, and you install pack B, pack A will still show up as having unmet requirements until you have exited and re-entered the manager, which will restart all the packs. You can, if you know you just installed pack B, install pack A anyway - both packs will then be loaded at once when you exit the manager.";
|
||||
"oolite-oxzmanager-nothing-removable" = "Oolite can only remove expansion packs which have been added through this system, and there are currently none installed. Expansion packs which you have installed manually must also be removed manually.";
|
||||
"oolite-oxzmanager-restart" = "As you have changed the expansion packs you have installed, Oolite now needs to reload the game data. This may take a few seconds or several minutes depending on how fast your computer is and how many packs you have installed. Please be patient while this reload completes: Oolite will not respond to the keyboard or mouse until this is done.";
|
||||
"oolite-oxzmanager-progress-@-of-@" = "Downloading: %lu of %lu";
|
||||
"oolite-oxzmanager-restart" = "As you have changed the expansion packs you have installed, Oolite now needs to reload the game data. This may take a few seconds or several minutes depending on how fast your computer is and how many packs you have installed. Please be patient while this reload completes: Oolite will not respond to the keyboard or mouse until this is done.";
|
||||
"oolite-oxzmanager-progress-@-of-@" = "Downloading: %@ of %@";
|
||||
"oolite-oxzmanager-progress-done" = "Download complete";
|
||||
"oolite-oxzmanager-removal-done" = "Expansion pack removed";
|
||||
"oolite-oxzmanager-progress-error" = "Download failed! See Latest.log for more details.";
|
||||
@ -1082,6 +1082,8 @@
|
||||
"oolite-oxzmanager-heading-title" = "Title";
|
||||
"oolite-oxzmanager-heading-version" = "Version";
|
||||
"oolite-oxzmanager-heading-installed" = "Installed";
|
||||
"oolite-oxzmanager-infoline-url" = "URL: ";
|
||||
"oolite-oxzmanager-infoline-size" = "Download size: ";
|
||||
"oolite-oxzmanager-missing-field" = "Unknown";
|
||||
"oolite-oxzmanager-version-none" = "-";
|
||||
"oolite-oxzmanager-installable-okay" = "Status: Ready to download and install.";
|
||||
|
@ -35,8 +35,10 @@ static NSString * const kOOManifestConflictOXPs = @"conflict_oxps";
|
||||
static NSString * const kOOManifestDescription = @"description";
|
||||
static NSString * const kOOManifestCategory = @"category";
|
||||
static NSString * const kOOManifestDownloadURL = @"download_url";
|
||||
// this property is not contained in the manifest.plist but is
|
||||
// calculated by Oolite
|
||||
static NSString * const kOOManifestFileSize = @"file_size";
|
||||
static NSString * const kOOManifestInformationURL = @"information_url";
|
||||
/* this property is not contained in the manifest.plist (and would be
|
||||
overwritten if it was...) but is calculated by Oolite */
|
||||
static NSString * const kOOManifestFilePath = @"file_path";
|
||||
// following manifest.plist properties not (yet?) used by Oolite
|
||||
// but may be used by other manifest reading applications
|
||||
@ -45,7 +47,6 @@ static NSString * const kOOManifestTags = @"tags";
|
||||
static NSString * const kOOManifestAuthor = @"author";
|
||||
static NSString * const kOOManifestLicense = @"license";
|
||||
static NSString * const kOOManifestOptionalOXPs = @"optional_oxps";
|
||||
static NSString * const kOOManifestInformationURL = @"information_url";
|
||||
#endif
|
||||
|
||||
// properties for within requires/optional/conflicts entries
|
||||
|
@ -73,6 +73,8 @@ enum {
|
||||
OXZ_GUI_ROW_LISTNEXT = 13,
|
||||
OXZ_GUI_ROW_LISTSTATUS = 15,
|
||||
OXZ_GUI_ROW_LISTDESC = 17,
|
||||
OXZ_GUI_ROW_LISTINFO1 = 21,
|
||||
OXZ_GUI_ROW_LISTINFO2 = 22,
|
||||
OXZ_GUI_ROW_INSTALL = 24,
|
||||
OXZ_GUI_ROW_REMOVE = 25,
|
||||
OXZ_GUI_ROW_UPDATE = 26,
|
||||
@ -94,6 +96,7 @@ static OOOXZManager *sSingleton = nil;
|
||||
- (NSString *) manifestPath;
|
||||
- (NSString *) downloadPath;
|
||||
- (NSString *) dataURL;
|
||||
- (NSString *) humanSize:(NSUInteger)bytes;
|
||||
|
||||
- (BOOL) ensureInstallPath;
|
||||
|
||||
@ -252,6 +255,22 @@ static OOOXZManager *sSingleton = nil;
|
||||
}
|
||||
|
||||
|
||||
- (NSString *) humanSize:(NSUInteger)bytes
|
||||
{
|
||||
if (bytes < 1024)
|
||||
{
|
||||
return @"<1 kb";
|
||||
}
|
||||
else if (bytes < 1024*1024)
|
||||
{
|
||||
return [NSString stringWithFormat:@"%lu kb",bytes>>10];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [NSString stringWithFormat:@"%lu Mb",bytes>>20];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void) setOXZList:(NSArray *)list
|
||||
{
|
||||
@ -585,7 +604,7 @@ static OOOXZManager *sSingleton = nil;
|
||||
case OXZ_STATE_INSTALLING:
|
||||
[gui setTitle:DESC(@"oolite-oxzmanager-title-downloading")];
|
||||
|
||||
[gui addLongText:[NSString stringWithFormat:DESC(@"oolite-oxzmanager-progress-@-of-@"),_downloadProgress,_downloadExpected] startingAtRow:OXZ_GUI_ROW_PROGRESS align:GUI_ALIGN_LEFT];
|
||||
[gui addLongText:[NSString stringWithFormat:DESC(@"oolite-oxzmanager-progress-@-of-@"),[self humanSize:_downloadProgress],[self humanSize:_downloadExpected]] startingAtRow:OXZ_GUI_ROW_PROGRESS align:GUI_ALIGN_LEFT];
|
||||
|
||||
[gui setText:DESC(@"oolite-oxzmanager-cancel") forRow:OXZ_GUI_ROW_UPDATE align:GUI_ALIGN_CENTER];
|
||||
[gui setKey:@"_CANCEL" forRow:OXZ_GUI_ROW_UPDATE];
|
||||
@ -919,7 +938,21 @@ static OOOXZManager *sSingleton = nil;
|
||||
[gui setText:[self installStatusForManifest:manifest] forRow:OXZ_GUI_ROW_LISTSTATUS];
|
||||
[gui setColor:[OOColor greenColor] forRow:OXZ_GUI_ROW_LISTSTATUS];
|
||||
[gui addLongText:[manifest oo_stringForKey:kOOManifestDescription] startingAtRow:OXZ_GUI_ROW_LISTDESC align:GUI_ALIGN_LEFT];
|
||||
|
||||
NSString *infoUrl = [manifest oo_stringForKey:kOOManifestInformationURL];
|
||||
if (infoUrl != nil)
|
||||
{
|
||||
[gui setArray:[NSArray arrayWithObjects:DESC(@"oolite-oxzmanager-infoline-url"),infoUrl,nil] forRow:OXZ_GUI_ROW_LISTINFO1];
|
||||
}
|
||||
NSUInteger size = [manifest oo_unsignedIntForKey:kOOManifestFileSize defaultValue:0];
|
||||
if (size > 0)
|
||||
{
|
||||
[gui setArray:[NSArray arrayWithObjects:DESC(@"oolite-oxzmanager-infoline-size"),[self humanSize:size],nil] forRow:OXZ_GUI_ROW_LISTINFO2];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
row++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user