Beispiel #1
0
void setLogFilePath(char *path){
    int i;
    logging=0;
    if(path !=NULL)
        strcpy(statlog,path);
	if(strlen(statlog)>0)
	    logging=1;
    checkLogEntry(StatusVal,"RESTART");
}
bool TGJVQSOEditFrame::doGJVCancelButtonClick( TObject */*Sender*/ )
{
    if ( checkLogEntry() )
    {
        DateEdit->ReadOnly = !contest->isPostEntry();
        TimeEdit->ReadOnly = !contest->isPostEntry();
        SerTXEdit->ReadOnly = true;

        return true;
    }

    return false;
}
void __fastcall TGJVQSOEditFrame::PriorButtonClick( TObject */*Sender*/ )
{
   current = 0;            // make sure the focus moves off this button
   if ( !checkLogEntry(true) )
   {
      return ;
   }
   BaseContact *lct = getPriorContact();
   if ( lct )
   {
      selectEntry( lct );
   }
   else
   {
      ShowMessage( "Start of QSOs" );
   }
}
void __fastcall TGJVQSOEditFrame::FirstUnfilledButtonClick( TObject */*Sender*/ )
{
   current = 0;            // make sure the focus moves off this button
   if ( !checkLogEntry(true) )
   {
      return ;
   }
   for ( LogIterator i = contest->ctList.begin(); i != contest->ctList.end(); i++ )
   {
      if ( ( *i ) ->contactFlags.getValue() & TO_BE_ENTERED )
      {
         selectEntry( ( *i ) );
         return ;
      }
   }
   ShowMessage( "No more unfilled contacts found" );
}
void __fastcall TGJVQSOEditFrame::NextButtonClick( TObject */*Sender*/ )
{
    current = 0;            // make sure the focus moves off this button
    if ( !checkLogEntry() )
    {
        return ;
    }
    for ( LogIterator i = contest->ctList.begin(); i != contest->ctList.end(); i++ )
    {
        if ( ( *i ) ->getLogSequence() == screenContact.getLogSequence() )
        {
            i++;
            if ( i == contest->ctList.end() )
            {
                ShowMessage( "End of QSOs" );
                i--;
            }
            selectEntry( ( *i ) );
            return ;
        }
    }
    ShowMessage( "End of QSOs" );
}
//---------------------------------------------------------------------------
bool TGJVEditFrame::doGJVOKButtonClick( TObject *Sender )
{
   DateEdit->ReadOnly = !contest->isPostEntry();
   TimeEdit->ReadOnly = !contest->isPostEntry();
   SerTXEdit->ReadOnly = true;
   SerTXEdit->Color = clBtnFace;

   if ( contest->isReadOnly() )
   {
      return true;
   }
   GJVEditChange( Sender );   // start the match thread

   getScreenEntry(); // make sure it is saved

   if ( screenContact.contactFlags & ( LOCAL_COMMENT | DONT_PRINT | COMMENT_ONLY ) )
   {
      logCurrentContact( false );
      return true;
   }

   // validate the entry; if still invalid, spin round the invalid
   // controls (this should really be the job of tab, but...)

   TWinControl *currn = current;
   if ( !valid( cmCheckValid ) || ( currn == RSTTXEdit ) || ( currn == RSTRXEdit ) )
      // make sure all single and cross field
      // validation has been done
   {
      doAutofill();
   }
   bool was_unfilled = screenContact.contactFlags & TO_BE_ENTERED;
   if ( !valid( cmCheckValid ) )   // make sure all single and cross field
      // validation has been done
   {
      TWinControl * firstInvalid = 0;
      TWinControl *nextInvalid = 0;
      bool onCurrent = false;
      bool pastCurrent = false;
      for ( std::vector <ValidatedControl *>::iterator vcp = vcs.begin(); vcp != vcs.end(); vcp++ )
      {
         if ( ( *vcp ) ->wc->ReadOnly || !( *vcp ) ->wc->Visible )
         {
            continue;
         }
         if ( onCurrent )
            pastCurrent = true;
         if ( ( *vcp ) ->wc == current )
            onCurrent = true;
         if ( !( *vcp ) ->valid( cmValidStatus ) )
         {
            if ( !firstInvalid )
               firstInvalid = ( *vcp ) ->wc;
            if ( pastCurrent )
            {
               if ( !nextInvalid )
               {
                  nextInvalid = ( *vcp ) ->wc;
                  break;
               }
            }
         }
      }

      // make sure we go to the invalid field

      TWinControl *nextf = ( nextInvalid ) ? nextInvalid : firstInvalid;

      // but if it is DTG, probably want CS instead (Unless post entry)

      if ( ( nextf == TimeEdit ) || ( nextf == DateEdit ) )
      {
         bool pe = contest->isPostEntry();
         if ( !pe && screenContact.time.notEntered() == 0 )
         {
            selectField( CallsignEdit );
            nextf = 0;			// dont show silly errors!
            if ( screenContact.cs.validate( ) == CS_OK )
            {
               doAutofill();
               //??????????????????????
               return doGJVOKButtonClick( Sender );
            }
         }
      }

      if ( nextf )
      {
         if ( nextf == current )
         {
            if ( firstInvalid != nextf )
               selectField( firstInvalid );
            else
               dlgForced();   // repeated attack on same faulty field
         }
         else
            selectField( nextf );
      }
      // Show on errList on multdisp frame
      MinosParameters::getMinosParameters() ->showErrorList( );
      return false ;
   }
   else
   {
      screenContact.contactFlags &= ~( TO_BE_ENTERED | FORCE_LOG );
   }

   // all is OK (or we will have executed a return statement)
   // so do it!

   // we have to check if we need to save it
   // checkLogEntry does the log action as well

   if ( !was_unfilled && selectedContact )  // AND if we are logging "current" then we don't want to do this
   {
      if ( !checkLogEntry() )  // if it is the same, then don't log
      {
         return false;
      }
   }
   else
   {
      logCurrentContact( false );
   }
   selectField( 0 );             // make sure we move off the "Log" default button
   return true;
}
void TGJVQSOEditFrame::doGJVCancelButtonClick( TObject */*Sender*/ )
{
   catchup = false;
   checkLogEntry(false);
}