Finish off basic interface, a bit of cleanup

This commit is contained in:
cim 2014-01-13 18:27:43 +00:00
parent 5483a170cc
commit fe4192029e
5 changed files with 38 additions and 22 deletions

@ -1 +1 @@
Subproject commit 6061dd4b058110411d3a183fc9e67a6b1c0469d0
Subproject commit 3df6ed027e4ef6955cb530e98b459870a68fc652

@ -1 +1 @@
Subproject commit 6c120f7a1b6e60e4c12d8facd3c39b4fc4b9c299
Subproject commit b671a39b1c5f60db7d4a7a063e47aca59f519df9

View File

@ -1064,6 +1064,7 @@
"oolite-oxzmanager-title-remove" = "Select pack to remove";
"oolite-oxzmanager-exit" = "Return to Menu";
"oolite-oxzmanager-acknowledge" = "Continue";
"oolite-oxzmanager-cancel" = "Cancel Download";
"oolite-oxzmanager-download-list" = "Download expansions list";
"oolite-oxzmanager-update-list" = "Update expansions list";
"oolite-oxzmanager-install" = "Install expansion pack";

View File

@ -60,6 +60,21 @@ typedef enum {
} OXZInstallableState;
enum {
OXZ_GUI_ROW_FIRSTRUN = 1,
OXZ_GUI_ROW_PROGRESS = 1,
OXZ_GUI_ROW_LISTHEAD = 1,
OXZ_GUI_ROW_LISTPREV = 2,
OXZ_GUI_ROW_LISTSTART = 3,
OXZ_GUI_NUM_LISTROWS = 10,
OXZ_GUI_ROW_LISTNEXT = 13,
OXZ_GUI_ROW_LISTDESC = 15,
OXZ_GUI_ROW_INSTALL = 24,
OXZ_GUI_ROW_REMOVE = 25,
OXZ_GUI_ROW_UPDATE = 26,
OXZ_GUI_ROW_EXIT = 27
};
static OOOXZManager *sSingleton = nil;
@ -450,19 +465,6 @@ static OOOXZManager *sSingleton = nil;
}
// TODO: move these constants somewhere better and use an enum instead
#define OXZ_GUI_ROW_FIRSTRUN 1
#define OXZ_GUI_ROW_PROGRESS 1
#define OXZ_GUI_ROW_LISTHEAD 1
#define OXZ_GUI_ROW_LISTPREV 2
#define OXZ_GUI_ROW_LISTSTART 3
#define OXZ_GUI_NUM_LISTROWS 10
#define OXZ_GUI_ROW_LISTNEXT 13
#define OXZ_GUI_ROW_LISTDESC 15
#define OXZ_GUI_ROW_INSTALL 24
#define OXZ_GUI_ROW_REMOVE 25
#define OXZ_GUI_ROW_UPDATE 26
#define OXZ_GUI_ROW_EXIT 27
- (void) gui
@ -503,8 +505,11 @@ static OOOXZManager *sSingleton = nil;
[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];
// no options yet
// TODO: cancel option
[gui setText:DESC(@"oolite-oxzmanager-cancel") forRow:OXZ_GUI_ROW_UPDATE align:GUI_ALIGN_CENTER];
[gui setKey:@"_CANCEL" forRow:OXZ_GUI_ROW_UPDATE];
startRow = OXZ_GUI_ROW_UPDATE;
break;
case OXZ_STATE_REMOVING:
[gui addLongText:DESC(@"oolite-oxzmanager-removal-done") startingAtRow:OXZ_GUI_ROW_PROGRESS align:GUI_ALIGN_LEFT];
@ -589,6 +594,12 @@ static OOOXZManager *sSingleton = nil;
_interfaceState = OXZ_STATE_MAIN;
_downloadStatus = OXZ_DOWNLOAD_NONE;
}
else if (_interfaceState == OXZ_STATE_INSTALLING || _interfaceState == OXZ_STATE_UPDATING)
{
[self cancelUpdate];
_interfaceState = OXZ_STATE_MAIN;
_downloadStatus = OXZ_DOWNLOAD_NONE;
}
else
{
[self updateManifests];
@ -895,11 +906,15 @@ static OOOXZManager *sSingleton = nil;
[manifest oo_stringForKey:kOOManifestTitle defaultValue:DESC(@"oolite-oxzmanager-missing-field")],
[manifest oo_stringForKey:kOOManifestVersion defaultValue:DESC(@"oolite-oxzmanager-missing-field")],
nil] forRow:row];
[gui setKey:[manifest oo_stringForKey:kOOManifestIdentifier] forRow:row];
NSString *identifier = [manifest oo_stringForKey:kOOManifestIdentifier];
[gui setKey:identifier forRow:row];
/* TODO: yellow for normal, orange for 'broken'
[gui setColor:[self colorForUninstall:manifest] forRow:row];
*/
if ([ResourceManager manifestForIdentifier:identifier] == nil)
{
// if not currently active, show as orange
[gui setColor:[OOColor orangeColor] forRow:row];
}
if (row == [gui selectedRow])
{
[gui addLongText:[manifest oo_stringForKey:kOOManifestDescription] startingAtRow:OXZ_GUI_ROW_LISTDESC align:GUI_ALIGN_LEFT];

2
tests

@ -1 +1 @@
Subproject commit 77c24f589c171774f1f133a50e2bf3d9ae6821ba
Subproject commit 3426ffc6da5f93b49ab3982cc416dfb50e2618b8