Code for Progress Indicators for Tab Loading

An RSS/Atom newsreader with features comparable to commercial newsreaders.
inflector
Muffin
Posts: 42
Joined: Sun Feb 28, 2010 4:59 am

Code for Progress Indicators for Tab Loading

Postby inflector » Fri Mar 12, 2010 9:07 am

I'm trying to implement a progress indicator for the loading of the web pages for the new feature for loading full HTML articles for a given feed. It works fine but the delay can be too long without any visible indication that something is loading. So I thought I'd do the same thing that tabs do when loading URLs, first they display "Loading..." with a spinner progress indicator, then when the page is loaded the tab get's the Page Title and the spinner goes away.

The tabs do this by hooking the WebView's WebFrameLoadDelegate Protocol via a call to setFrameLoadDelegate: then they intercept the call in didStartProvisionalLoadForFrame:, didFinishLoadForFrame:, and didReceiveTitle: to set the tabs title and perform cleanup action. However, I can't seem to find any code related to starting and stopping the spinner for the TabView.

I know how the refresh feeds spinner works since I just finished a bug in that code, so I can create a spinner no problem, but I want to make sure I hook the right parts of the protocol.

Does anyone remember how this works or where I might look?

- Curtis

User avatar
Michael Ströck
Vienna Team
Posts: 303
Joined: Mon Mar 06, 2006 9:21 am
Location: Vienna, Austria
Contact:

Re: Code for Progress Indicators for Tab Loading

Postby Michael Ströck » Fri Mar 12, 2010 12:00 pm

Hi Curtis,

I am travelling at the moment and can't look at the code - I'll try to give you some hints on the weekend.

User avatar
Michael Ströck
Vienna Team
Posts: 303
Joined: Mon Mar 06, 2006 9:21 am
Location: Vienna, Austria
Contact:

Re: Code for Progress Indicators for Tab Loading

Postby Michael Ströck » Sun Mar 14, 2010 10:27 pm

Hi Curtis,

I just had a look at it. You do mean the spinner that appears in the individual tab, right? It appears we do it in BrowserPane.m, by exposing bindings that PSMTabBarControl probably listens to. At least I think so :-) Remember that Vienna has been in Development for a very long time, with three main devs and many contributors, so nobody really knows all the code well.

Code: Select all

+ (void)load
{
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

   if (self == [BrowserPane class]) {
      //These are synonyms
      [self exposeBinding:@"isLoading"];
      [self exposeBinding:@"isProcessing"];

      [self setKeys:[NSArray arrayWithObject:@"isLoading"] triggerChangeNotificationsForDependentKey:@"isProcessing"];
   }
   
   [pool release];
}

inflector
Muffin
Posts: 42
Joined: Sun Feb 28, 2010 4:59 am

Re: Code for Progress Indicators for Tab Loading

Postby inflector » Mon Mar 15, 2010 4:46 am

Thanks, I saw that code but couldn't find any references in the code for anyone listening to changes for those bindings. I didn't think about code in frameworks.

- Curtis


Return to “Vienna”

Who is online

Users browsing this forum: No registered users