Exemplo n.º 1
0
bool CommandLineParser::HasContradictoryOptions() const
{		
	if(IsSilent() && IsQuiet())
		return true;

	int iActions=0;
	
	if (IsInstall())
		iActions++;

	if (IsUninstall())
		iActions++;

	if (IsReinstall())
		iActions++;

	if (IsRepair())
		iActions++;

	if(IsUserInit())
		iActions++;

	if (iActions!=1)
		return true;

	if (IsInstall() || IsReinstall() || IsUserInit())
	{
		return false;
	}

	return false;
}
void CHUDMissionObjective::NotifyStatusChange()
{
	assert (m_pMOS != 0);

	SHUDEvent objectiveEvent(eHUDEvent_OnObjectiveChanged);
	objectiveEvent.AddData(SHUDEventData((void*)this));
	objectiveEvent.AddData(SHUDEventData(IsSilent()));
	CHUDEventDispatcher::CallEvent(objectiveEvent);

	SendRadarEvent();

	m_lastTimeChanged = gEnv->pTimer->GetFrameStartTime().GetSeconds();
}
void
JTextUserNotification::ReportError
	(
	const JCharacter* message
	)
{
	if (!IsSilent())
		{
		cout << endl;
		cout << "Error: " << message;
		JWaitForReturn();
		}
}
void
JTextUserNotification::DisplayMessage
	(
	const JCharacter* message
	)
{
	if (!IsSilent())
		{
		cout << endl;
		cout << message;
		JWaitForReturn();
		}
}
void
JXUserNotification::ReportError
	(
	const JCharacter* message
	)
{
	assert( itsCurrentDialog == NULL );

	if (!IsSilent())
		{
		(JXGetApplication())->PrepareForBlockingWindow();

		itsCurrentDialog = new JXErrorDialog(JXGetApplication(), message);
		assert( itsCurrentDialog != NULL );
		WaitForResponse();
		}
}
Exemplo n.º 6
0
void StepStatus()
{
     static char string[100];

     sprintf(string,"time = %f ; step = %d          ",
	     simulation_time,
	     current_step);
     /*
     ** try printing to the status line
     */
     if (IsSilent() < 2) {
#ifdef STATUSLINE
         if (!StatusMessage(string, 30, 0)) {
	     printf("%s\n", string);
         }
#else
       printf("%s\n", string);
#endif /* STATUSLINE */
     }
}
Exemplo n.º 7
0
BOOL CWSConfigAssistantApp::InitInstance()
{
    CLimitSingleInstance lsi(SINGLE_INSTANCE_MUTEX_NAME);
    if ( lsi.IsAnotherInstanceRunning() )
    {
        MessageBox(NULL, _T("An instance of Workshare Configuration Assistant is already running. Please close that to run another instance."), _T("Workshare"), MB_OK | MB_ICONWARNING);
        return FALSE;
    }

    if( m_pInstallAgent )
    {
        m_pInstallAgent->Initialize();

        // workaround for imanage f*****g up our current path
        // stores path internally.
        m_pInstallAgent->GetInstallDir();
    }

    // Ensure Windows Message box displayed when can not load Workshare Message component has correct title
    free((void*)m_pszAppName);
    m_pszAppName =_tcsdup(_T("Workshare Configuration Assistant"));

    CStdString sCmdLine(GetCommandLine());
    sCmdLine.MakeLower();

    bool bRunTests(sCmdLine.Find(_T("runtests")) != -1);
    bool bAutoRunTests(sCmdLine.Find(_T("autoruntests")) != -1);
    bool bRunFunctionalTests(sCmdLine.Find(_T("functionaltests")) != -1);

    if(bRunTests)
    {
        m_iRetCode = RunAppTestsEx(bAutoRunTests, bRunFunctionalTests, false, _T(""), false);
        CoFreeUnusedLibraries();
        return FALSE;
    }

    if( m_pInstallAgent && !m_pInstallAgent->WasCommandLineValid())
    {
        AfxMessageBox(m_pInstallAgent->GetCommandLineHelp(),MB_OK);
        return FALSE;
    }

    if(m_pInstallAgent && m_pInstallAgent->IsQuiet())
    {
        if(GetInstallAgent())
            GetInstallAgent()->LogEvent(_T("CWSConfigAssistantApp::OnInitDialog - Quiet Silent version of the application."));

        SafeDeleteSingleItem(m_pInstallAgent);
        m_pInstallAgent = NULL;

        CQuietProgressDlg dlg;
        dlg.DoModal();
        m_iRetCode = dlg.GetResult();
    }
    else if (!IsSilent())
    {
        if(GetInstallAgent())
            GetInstallAgent()->LogEvent(_T("CWSConfigAssistantApp::OnInitDialog - Running UI version of the application."));

        CWSConfigAssistantDlg dlg(_T("Workshare"));
        dlg.SetWizardMode();
        m_pMainWnd = &dlg;

        if( ::IsWindow(dlg.m_hWnd) )
            dlg.SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

        INT_PTR ret = dlg.DoModal();
        if (ret == IDCANCEL)
        {
            m_iRetCode = 1602;
        }
    }
    else
    {
        if(GetInstallAgent())
            GetInstallAgent()->LogEvent(_T("CWSConfigAssistantApp::OnInitDialog - Running Silent version of the application."));

        SafeDeleteSingleItem(m_pInstallAgent);
        m_pInstallAgent = NULL;

        CStdString sResult;
        m_iRetCode = InstallAgent::Run(GetCommandLine(), sResult);
    }

    return FALSE;
}