Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
UpdaterUI Class Reference

List of all members.

Public Member Functions

(void- awakeFromNib [implementation]
(void- updateProgressUI: [implementation]
(BOOL- applicationShouldTerminate: [implementation]

Protected Attributes

IBOutlet NSProgressIndicator * progressBar
IBOutlet NSTextField * progressTextField

Detailed Description

Definition at line 54 of file progressui_osx.mm.


Member Function Documentation

- (BOOL) applicationShouldTerminate: (NSApplication *)  sender [implementation]

Definition at line 105 of file progressui_osx.mm.

                                  :(NSApplication *)sender
{
  return sQuit;
}
- (void) awakeFromNib [implementation]

Definition at line 63 of file progressui_osx.mm.

{
  NSWindow *w = [progressBar window];
  [w center];
  
  [w setTitle:[NSString stringWithUTF8String:sLabels.title]];
  [progressTextField setStringValue:[NSString stringWithUTF8String:sLabels.info]];
  
  [progressBar setIndeterminate:NO];
  [progressBar setDoubleValue:0.0];
  
  [[NSTimer scheduledTimerWithTimeInterval:TIMER_INTERVAL target:self
                                  selector:@selector(updateProgressUI:)
                                  userInfo:nil repeats:YES] retain];

  // Make sure we are on top initially
  [NSApp activateIgnoringOtherApps:YES];
}
- (void) updateProgressUI: (NSTimer *)  aTimer [implementation]

Definition at line 83 of file progressui_osx.mm.

                       :(NSTimer *)aTimer
{
  if (sQuit) {
    [aTimer invalidate];
    [aTimer release];

    // It seems to be necessary to activate and hide ourselves before we stop,
    // otherwise the "run" method will not return until the user focuses some
    // other app.  The activate step is necessary if we are not the active app.
    // This is a big hack, but it seems to do the trick.
    [NSApp activateIgnoringOtherApps:YES];
    [NSApp hide:self];
    [NSApp stop:self];
  }
  
  float progress = sProgressVal;
  
  [progressBar setDoubleValue:(double)progress];
}

Member Data Documentation

- (IBOutlet NSProgressIndicator*) progressBar [protected]

Definition at line 56 of file progressui_osx.mm.

- (IBOutlet NSTextField*) progressTextField [protected]

Definition at line 57 of file progressui_osx.mm.


The documentation for this class was generated from the following file: