Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsXInstaller.h File Reference
#include "XIDefines.h"
#include "XIErrors.h"
#include "nsINIParser.h"
#include "nsLicenseDlg.h"
#include "nsXIContext.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nsXInstaller

Defines

#define CONFIG   "config"
#define DUMP(_msg)

Functions

int main (int argc, char **argv)
 The Xalan testcases app.
int ErrorHandler (int aErr, const char *aErrMsg=NULL)
void ErrDlgOK (GtkWidget *aWidget, gpointer aData)
int IsErrFatal (int aErr)

Variables

nsXIContextgCtx

Define Documentation

#define CONFIG   "config"

Definition at line 79 of file nsXInstaller.h.

#define DUMP (   _msg)

Definition at line 87 of file nsXInstaller.h.


Function Documentation

void ErrDlgOK ( GtkWidget *  aWidget,
gpointer  aData 
)

Definition at line 502 of file nsXInstaller.cpp.

{
  int err = NS_PTR_TO_INT32(aData);

  if (sErrDlg) {
    gtk_widget_destroy(sErrDlg);
    sErrDlg = NULL;
  }

  gtk_main_quit();

  if (IsErrFatal(err))
    exit(err);
}
int ErrorHandler ( int  aErr,
const char *  aErrMsg = NULL 
)

Definition at line 452 of file nsXInstaller.cpp.

{
  GtkWidget *okButton, *label;
  char msg[256];
  char newmsg[256];
  char errStr[16];
    
  sprintf(errStr, "%d", aErr); 
  if (!IsErrFatal(aErr)) {
       if (aErr == E_INSTALL) {
      if (aErrMsg) {
              sprintf(newmsg, gCtx->Res(errStr), aErrMsg);
              sprintf(msg, gCtx->Res("ERROR"), aErr, newmsg);
      }
       } else {
      sprintf(msg, gCtx->Res("ERROR"), aErr, gCtx->Res(errStr));
    }
  } else {
    sprintf(msg, gCtx->Res("FATAL_ERROR"), aErr, gCtx->Res(errStr));
  }
    
  // lack of gCtx->window indicates we have not yet run RunWizard
  // and gtk_init
  if (gCtx->opt->mMode == nsXIOptions::MODE_SILENT || !gCtx->window) {
    fprintf (stderr, "%s\n", msg);
    return aErr;
  }

  sErrDlg = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(sErrDlg), gCtx->Res("ERROR_TITLE"));
  okButton = gtk_button_new_with_label(gCtx->Res("OK_LABEL"));
  label = gtk_label_new(msg);

  gtk_window_set_position(GTK_WINDOW(sErrDlg), GTK_WIN_POS_CENTER);
  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(sErrDlg)->action_area), okButton);
  gtk_signal_connect(GTK_OBJECT(okButton), "clicked",
                     GTK_SIGNAL_FUNC(ErrDlgOK), (void*)aErr);

  gtk_container_add(GTK_CONTAINER(GTK_DIALOG(sErrDlg)->vbox), label);

  GTK_WIDGET_SET_FLAGS(okButton, GTK_CAN_DEFAULT);
  gtk_widget_grab_default(okButton);
  gtk_widget_show_all(sErrDlg);

  gtk_main();

  return aErr;
}
int IsErrFatal ( int  aErr)

Definition at line 518 of file nsXInstaller.cpp.

{
  int bFatal = TRUE;

  /* non-fatal errors */
  switch (aErr) {
  case -620:
  case -621:
  case -624:
  case -625:
    bFatal = FALSE;
  default:
    break; 
  }

  return bFatal;
}
int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 4 of file arm-wince-as.c.

{  
  char* args[1000];
  int i = 0;
  
  args[i++] = ASM_PATH;
  args[i++] = "-I\"" WCE_INC "\""; 

  i += argpath_conv(&argv[1], &args[i]);

  dumpargs(args);

  run(args);
  return 0;
}

Variable Documentation

Definition at line 45 of file nsXInstaller.cpp.