Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables File Reference
#import <Cocoa/Cocoa.h>
#include <stdio.h>
#include <unistd.h>
#include "progressui.h"
#include "readstrings.h"
#include "errors.h"

Go to the source code of this file.


class  UpdaterUI


#define TIMER_INTERVAL   0.2


int InitProgressUI (int *pargc, char ***pargv)
int ShowProgressUI ()
void QuitProgressUI ()
void UpdateProgressUI (float progress)


static float sProgressVal
static BOOL sQuit = FALSE
static StringTable sLabels
static const char * sProgramPath

Define Documentation

Definition at line 47 of file

Function Documentation

int InitProgressUI ( int pargc,
char ***  pargv 

Definition at line 113 of file

  sProgramPath = (*pargv)[0];
  return 0;

Definition at line 145 of file

  sQuit = TRUE;

Definition at line 121 of file

  // Only show the Progress UI if the process is taking significant time.
  // Here we measure significant time as taking more than one second.
  if (sQuit || sProgressVal > 50.0f)
    return 0;

  char path[PATH_MAX];
  snprintf(path, sizeof(path), "%s.ini", sProgramPath);
  if (ReadStrings(path, &sLabels) != OK)
    return -1;
  [NSApplication sharedApplication];
  [NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
  [NSApp run];

  return 0;

Here is the call graph for this function:

void UpdateProgressUI ( float  progress)

Definition at line 152 of file

  sProgressVal = progress;  // 32-bit writes are atomic

Variable Documentation

StringTable sLabels [static]

Definition at line 51 of file

const char* sProgramPath [static]

Definition at line 52 of file

float sProgressVal [static]

Definition at line 49 of file

BOOL sQuit = FALSE [static]

Definition at line 50 of file