示例#1
0
int  SeeDif::openDatabase()
{
  int i;

  if ((i = sdfopen()) != SDF_NOERROR)
  {

    if (i == SDFERROR_FILELOCK)
    {
      AcknowledgeDialog* cf = new AcknowledgeDialog(
          "ERROR: The seadif database is locked by another program.",
	  "       Try again later, because only one program can access it.");
      InsertDialog(cf);
      cf->Acknowledge();
      RemoveDialog(cf);
      delete cf;
    }
    else
    {
      AcknowledgeDialog* cf = new AcknowledgeDialog(
		    "ERROR: cannot open seadif database.","");
      InsertDialog(cf);
      cf->Acknowledge();
      RemoveDialog(cf);
      delete cf;
    }
    sdfclose();
    return 1;
  }
  return 0;
}
// -----------------------------------------------------------------------------
// CSTSCredentialManager::RemoveVerify
// Verifies that the certificate to be removed has correct issuer and serial
// -----------------------------------------------------------------------------
//
void CSTSCredentialManager::RemoveVerifyL()
{

    TPtr8 certPtr(iEncodedCert->Des());
    CX509Certificate* cert = CX509Certificate::NewLC(certPtr);

    // Check issuer
    const CX500DistinguishedName& certIssuer = cert->IssuerName();
    if (!certIssuer.ExactMatchL(iIssuerAndSerialNumber->IssuerName()))
    {
        // remove current certificate from array, fetch next
        (*iCertInfoArray)[ 0 ]->Release();
        iCertInfoArray->Remove(0);
        RemoveRetrieveL();
    }
    // check serialNumber
    else if (cert->SerialNumber() != iIssuerAndSerialNumber->SerialNumber())
    {
        // remove current certificate from array, fetch next
        (*iCertInfoArray)[ 0 ]->Release();
        iCertInfoArray->Remove(0);
        RemoveRetrieveL();
    }
    else
    {
        // We have a match, show dialog
        RemoveDialog();
    }
    CleanupStack::PopAndDestroy(cert);

}
void ShowDlls()
{

  /***************************************************************************/
  /* As the actual dimensions of the dialog box is determined at a later     */
  /* point of time, the display of the dialog is also deferred until that    */
  /* point (INIT_DIALOG in the dialog function of the dialog).               */
  /***************************************************************************/
  ProcessDialog( &Dia_Dll, &Dia_Dll_Choices, TRUE, NULL );
  RemoveDialog( &Dia_Dll );
}
示例#4
0
void Sted::Save() {
    static SaveDialog* dialog;
    if (dialog == nil) dialog = new SaveDialog("saveDialog");
    InsertDialog(dialog);
    boolean accepted = dialog->Accept();
    RemoveDialog(dialog);

    if (accepted) {
        const char* name = dialog->GetStringEditor()->Text();
        _mgr->Save(name);
    }
}
示例#5
0
void Sted::Open() {
    static OpenDialog* dialog;
    if (dialog == nil) dialog = new OpenDialog("openDialog");
    InsertDialog(dialog);

    FileBrowser* fb = dialog->GetFileBrowser();
    boolean accepted = dialog->Accept();

    RemoveDialog(dialog);

    if (accepted && fb->Selections() != 0) {
        _mgr->Open(fb->String(fb->Selection()));
        editor->Edit(_mgr->GetTextBuffer());
    }
}
void SetExceptions()
{
  /***************************************************************************/
  /*  - Get the Screen write access.                                         */
  /*  - Display the Exceptions Dialog.                                       */
  /*  - Process the Events in the Exceptions Dialog.                         */
  /*  - Remove the Exceptions Dialog.                                        */
  /*  - Restore the Screen write access.                                     */
  /***************************************************************************/
  GetScrAccess();
  DisplayDialog( &Dia_Excep, TRUE );
  ProcessDialog( &Dia_Excep, &Dia_Excep_Choices, TRUE, NULL );
  RemoveDialog( &Dia_Excep );
  SetScrAccess();
  xSetExceptions(ExceptionMap,sizeof(ExceptionMap) );
}
示例#7
0
void Sted::Search() {
    static SearchDialog* dialog;
    if (dialog == nil) dialog = new SearchDialog("searchDialog");
    InsertDialog(dialog);
    boolean accept = dialog->Accept();
    RemoveDialog(dialog);

    if (accept) {
        int beg = editor->Mark(), end;

        if (_mgr->FwdSearch(dialog->GetStringEditor()->Text(), beg, end)) {
            editor->Select(beg, end);
        } 
            
        editor->ScrollToSelection();
    }
}
uint Cua_ActiveProcsMenu( AFILE **fpp )                                 /*701*/
{                                                                       /*701*/
  int     i, rc, MaxSymLen, SymLen, LongSymLen;                    /*811  701*/
  uint    key;                                                          /*701*/
  uchar   *cp, *buf, *SaveBuffer = NULL;                                /*701*/
  DEBFILE *pdf;                                                         /*701*/
  DIALOGCHOICE  *chptr;                                                 /*701*/
  CALLSTACKPARAM ClstkParam;                                            /*701*/
  int     buflen;
  int     ScrollBar;                                                    /*701*/

  for( ;; )                                                             /*701*/
  {                                                                     /*701*/
    chptr = &Dia_Clstk_Choices;                                         /*701*/

    MaxSymLen = VideoCols - 6;                                          /*811*/
    buflen = ( (NActFrames + 1)*(MaxSymLen+2) ) + 1 ;
    cp = buf = Talloc( buflen);                                    /*811  701*/

    LongSymLen = 0;                                                     /*811*/
    SymLen    = 0;                                                      /*811*/
    for( i = (short)NActFrames; --i >= 0;  )                            /*701*/
    {                                                                   /*701*/
     pdf = FindExeOrDllWithAddr( ActFaddrs[i] );                        /*701*/
     if(pdf != NULL )
      FormatProcName( cp, ActFaddrs[i], ActScopes[i], pdf,              /*824*/
                               ActCSAtrs[i], MaxSymLen);                /*824*/
     else
      sprintf(cp,"%08X Invalid Frame Address",ActFaddrs[i]);

     SymLen = strlen(cp);                                               /*824*/
     if( SymLen > MaxSymLen )                                           /*824*/
     {                                                                  /*824*/
      SymLen = MaxSymLen;                                               /*824*/
      cp[SymLen] = '\0';                                                /*824*/
     }                                                                  /*824*/
     if( SymLen > LongSymLen )                                          /*824*/
      LongSymLen = SymLen;                                              /*824*/
     cp += SymLen + 1;                                                  /*824*/
    }                                                                   /*824*/
    /* 906 if terminating check was removed */                          /*701*/
    {                                                                   /*824*/

     pdf = FindExeOrDllWithAddr( GetExecAddr() );                       /*901*/
     if( pdf != NULL )
      FormatProcName( cp, GetExecAddr(), ExecScope, pdf,                /*901*/
                           AppPTB.CSAtr, MaxSymLen);                    /*824*/
     else
      sprintf(cp,"%08X Invalid Frame Address",GetExecAddr() );
     SymLen = strlen(cp);                                               /*824*/
     if( SymLen > MaxSymLen )                                           /*824*/
     {                                                                  /*824*/
      SymLen = MaxSymLen;                                               /*824*/
      cp[SymLen] = '\0';                                                /*824*/
     }                                                                  /*824*/
     if( SymLen > LongSymLen )                                          /*824*/
      LongSymLen = SymLen;                                              /*824*/
    }                                                                   /*824*/

    chptr->entries = NActFrames + 1;
    chptr->labels  = buf;

    if( chptr->entries > 10 )
    {
      chptr->MaxRows = 10;
      Dia_Clstk.length = chptr->MaxRows + 8;
      ScrollBar = TRUE;
    }
    else
    {
      Dia_Clstk.length = chptr->entries + 8;
      chptr->MaxRows = chptr->entries;
      ScrollBar = FALSE;
    }

    /*************************************************************************/
    /* At this point, LongSymLen <= MaxSymLen.                               */
    /*************************************************************************/
    Dia_Clstk.width = LongSymLen + 6;
    if( Dia_Clstk.width < 36 )
      Dia_Clstk.width = 36;
    Dia_Clstk.row = (VideoRows - Dia_Clstk.length) / 2;
    Dia_Clstk.col = (VideoCols - Dia_Clstk.width) / 2;
    Dia_Clstk.Buttons[0].row = Dia_Clstk.row + chptr->MaxRows + 4;
    Dia_Clstk.Buttons[0].col = Dia_Clstk.col + 5;
    Dia_Clstk.Buttons[1].row = Dia_Clstk.row + chptr->MaxRows + 4;
    Dia_Clstk.Buttons[1].col = Dia_Clstk.col + Dia_Clstk.width - 16;
    Dia_Clstk.Buttons[2].row = Dia_Clstk.row + chptr->MaxRows + 5;
    Dia_Clstk.Buttons[2].col = Dia_Clstk.col + 5;
    Dia_Clstk.Buttons[3].row = Dia_Clstk.row + chptr->MaxRows + 5;
    Dia_Clstk.Buttons[3].col = Dia_Clstk.col + Dia_Clstk.width - 16;
    Dia_Clstk.Buttons[4].row = Dia_Clstk.row + chptr->MaxRows + 6;
    Dia_Clstk.Buttons[4].col = Dia_Clstk.col + 5;
    Dia_Clstk.Buttons[5].row = Dia_Clstk.row + chptr->MaxRows + 6;
    Dia_Clstk.Buttons[5].col = Dia_Clstk.col + Dia_Clstk.width - 16;

    if( SaveBuffer )
    {
      RemoveMsgBox( "Unwinding...", SaveBuffer );
      SaveBuffer = NULL;
    }
    DisplayDialog( &Dia_Clstk, ScrollBar );
    rc = 0;
    ClstkParam.rc = &rc;
    ClstkParam.fpp= fpp;
    key = ProcessDialog( &Dia_Clstk, &Dia_Clstk_Choices, ScrollBar,
                         (void *)&ClstkParam );
    RemoveDialog( &Dia_Clstk );

    if( rc != RECIRCULATE )
      return( key );
    else
    {
      SaveBuffer = SayMsgBox4( "Unwinding..." );
      if( key == key_a || key == key_A )
      {
        SetShowAll( TRUE );
        SetActFrames();
        SetShowAll( FALSE );
      }
      else
      {
        SetActFrames();
      }
    }
  }
}
示例#9
0
void SeeDif::doDelete() {
  int value;
  deleteBS->GetValue(value);
  if (value!=0)
  {
    /* first ask for confirmation */

    DeleteDialog* dialog = new DeleteDialog("Delete Dialog");

    InsertDialog(dialog);

    Boolean accepted= dialog->Accept();

    RemoveDialog(dialog);

    delete dialog;

    if (accepted)
    {
      sdfmakelockfiles=1;
      if (openDatabase())
      {
	deleteBS->SetValue(0);
	return;
      }


      int selNum=seadifBrowser->Selections();

      for(int i=0;i<selNum;i++)
      {
	int curSelected=seadifBrowser->Selection(0); /* always take first */
	char bName[200],fName[200],cName[200],lName[200];

	getSelectedName(curSelected,bName,fName,cName,lName);

	/* now we have right names - let\'s  */
	/* delete this thing. */

	int out;
	outSelBS->GetValue(out);

	switch (out)
	{
	case 1 :
	  sdfremovelib(cs(bName));
	  break;
	case 2 :
	  sdfremovefun(cs(fName),cs(bName));
	  break;
	case 3 :
	  sdfremovecir(cs(cName),cs(fName),cs(bName));
	  break;
	case 4 :
	  sdfremovelay(cs(lName),cs(cName),cs(fName),cs(bName));
	  break;
	}
	seadifBrowser->Remove(curSelected);
      }
      closeDatabase();
    }
    
    deleteBS->SetValue(0);
  } 
}