Skip to content

Commit

Permalink
Prepare for multiple import tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
hcwilhelm committed Jun 12, 2012
1 parent fde5f55 commit c421a0e
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 40 deletions.
6 changes: 6 additions & 0 deletions EVEATSFrontend/AppController.j
Expand Up @@ -34,6 +34,12 @@ var CharSelectorToolbarItem = "CharSelectorToolbarItem";
var ManageAccountToolbarItem = "ManageAccountToolbarItem";
var AssetsToolbarItem = "AssetsToolbarItem";

// =================
// = Notifications =
// =================

AppControllerCharChanged = @"AppControllerCharChanged";

// =======================
// = Class AppController =
// =======================
Expand Down
61 changes: 35 additions & 26 deletions EVEATSFrontend/Controllers/AssetsController.j
Expand Up @@ -11,13 +11,7 @@
@import "../Utils/BackendURLS.j"
@import "../Views/EVMarketGroupOutlineView.j"
@import "../Views/EVTableColumnIconView.j"


// =================
// = Notifications =
// =================

AppControllerCharChanged = @"AppControllerCharChanged";
@import "../Views/EVProgressView.j"


@implementation AssetsController : CPViewController
Expand Down Expand Up @@ -45,6 +39,7 @@ AppControllerCharChanged = @"AppControllerCharChanged";
CPOutlineView _assetDetailOutlineView;

CPProgressIndicator _progressIndicator;
EVProgressView _progressView;

CPButton _hideButton;
CPImage _hideButtonImageDisable;
Expand All @@ -54,6 +49,7 @@ AppControllerCharChanged = @"AppControllerCharChanged";
CPDictionary _treeData;
CPDictionary _assetData;
CPDictionary _assetDetailData;
CPDictionary _progressDict;

CPURLConnection _treeDataConnection;
CPURLConnection _assetDataConnection;
Expand Down Expand Up @@ -242,24 +238,6 @@ AppControllerCharChanged = @"AppControllerCharChanged";
_progressIndicator = [[CPProgressIndicator alloc] initWithFrame:CGRectMake(0,0,256,16)];
[_progressIndicator setStyle:CPProgressIndicatorBarStyle];

//var progress = [[CPProgressIndicator alloc] initWithFrame:CGRectMakeZero()];
//[progress setStyle:CPProgressIndicatorSpinningStyle];
//[progress sizeToFit];

//[progressIndicator addSubview: progress];

//var p = [[CPProgressIndicator alloc] initWithFrame:CGRectMake(100,100,256,16)];
//[p setStyle:CPProgressIndicatorBarStyle];
//[p setMaxValue: 1000.0];
//[p setMinValue: 0.0];
//[p setDoubleValue: 344.0];
//[p setIndeterminate:YES];
//[p startAnimation:self];

//[p sizeToFit];

//[asserDetailView addSubview: p];

// =============================
// = Load the MarketGroup Tree =
// =============================
Expand All @@ -285,12 +263,38 @@ AppControllerCharChanged = @"AppControllerCharChanged";

-(void) appControllerCharChanged:(id)sender
{
// ===================
// = Reset all data =
// ===================

_assetData = [[CPDictionary alloc] init];
_assetDetailData = [[CPDictionary alloc] init];

[_assetTableView reloadData];
[_assetDetailOutlineView reloadData];
[searchField setStringValue:@""];

// =========================================================================================
// = Check if we need to display a progress for the current selected Character/Corporation =
// =========================================================================================

if ([_progressDict objectForKey:EVSelectedCharacter] != nil)
{
var progressView = [_progressDict objectsForKey:EVSelectedCharacter];

if ([progressView isPending])
{
[assetView replaceSubview:_assetScrollView with:progressView];
}

}
}

-(void) progressViewDidFinish:(id)sender
{
// ===========================
// = Needs to be implemented =
// ===========================
}

-(@action) toggleMetaInfoView:(id)sender
Expand Down Expand Up @@ -344,8 +348,13 @@ AppControllerCharChanged = @"AppControllerCharChanged";

[_progressIndicator setFrame: CGRectMake(containerSize.width/2.0 - elementSize.width/2.0, containerSize.height/2.0 - elementSize.height/2.0, 256, 16)];
[_progressIndicator setAutoresizingMask: CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];



//_progressView = [[EVProgressView alloc] initWithFrame:[assetView frame] forTaskID: json.taskID];
//[_progressView setAutoresizingMask: CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];

[assetView replaceSubview:_assetScrollView with:_progressIndicator];
//[assetView replaceSubview:_assetScrollView with:_progressView];

var request = [CPURLRequest requestWithURL:baseURL + "/tasks/" + json.taskID + "/status"];
_taskProgressConnection = [CPURLConnection connectionWithRequest:request delegate:self];
Expand Down
26 changes: 13 additions & 13 deletions EVEATSFrontend/Utils/BackendURLS.j
Expand Up @@ -19,21 +19,21 @@ baseURL = "http://" + [[bundle bundleURL] host] + ":" + [[bundle bundleURL] port
// = Backend URL's =
// =================================================================================

userInfoURL = "/accounts/info/";
userInfoURL = "/accounts/info/";

eveAddAPIKeyURL = "/eve/addAPIKey/";
eveRemoveAPIKeyURL = "/eve/removeAPIKey/";
eveAPIKeyURL = "/eve/apiKeys/";
eveAddAPIKeyURL = "/eve/addAPIKey/";
eveRemoveAPIKeyURL = "/eve/removeAPIKey/";
eveAPIKeyURL = "/eve/apiKeys/";

eveCharactersURL = "/eve/characters/";
eveCorporationsURL = "/eve/corporations/";
eveCharactersURL = "/eve/characters/";
eveCorporationsURL = "/eve/corporations/";

eveCharacterAssetsByGroup = "/eve/characterAssetsByMarketGroup/";
eveCharacterAssetsByName = "/eve/characterAssetsByTypeName/";
eveCharacterAssetsDetailTree = "/eve/characterAssetsDetailTree/";
eveCharacterAssetsByGroup = "/eve/characterAssetsByMarketGroup/";
eveCharacterAssetsByName = "/eve/characterAssetsByTypeName/";
eveCharacterAssetsDetailTree = "/eve/characterAssetsDetailTree/";

eveCorporationAssetsByGroup = "/eve/corporationAssetsByMarketGroup/";
eveCorporationAssetsByName = "/eve/corporationAssetsByTypeName/";
eveCorporationAssetsDetailTree = "/eve/corporationAssetsDetailTree/";
eveCorporationAssetsByGroup = "/eve/corporationAssetsByMarketGroup/";
eveCorporationAssetsByName = "/eve/corporationAssetsByTypeName/";
eveCorporationAssetsDetailTree = "/eve/corporationAssetsDetailTree/";

eveMarketGroupTreeURL = "/evedb/invMarketGroupTree/";
eveMarketGroupTreeURL = "/evedb/invMarketGroupTree/";
3 changes: 2 additions & 1 deletion EVEATSFrontend/Views/EVMenuItem.j
Expand Up @@ -18,5 +18,6 @@
@implementation EVMenuItem : CPMenuItem
{
id modelObject @accessors;
CPView progressView @accessors;
}

@end

0 comments on commit c421a0e

Please sign in to comment.