Ejemplo n.º 1
0
void
QvisLightingWindow::Apply(bool ignore)
{
    // This is a little different from how it is normally done in a window
    // but we're setting attributes for an individual object in a list of 
    // objects and we have to get the current values all the time in case
    // some of them changed because a full update is going to cause all
    // light attributes for the active light to be selected, which could
    // cause text widgets like the light direction to get reset.
    GetCurrentValues(-1);

    if(AutoUpdate() || ignore)
    {
        lights->Notify();

        LightAttributes &light = lights->GetLight(activeLight);
        if (light.GetEnabledFlag() == false && !enableToggledSinceApply)
        {
            // User modified a light, but the light is not enabled.  Let them
            // know.
            Error("You have modified the properties of a disabled light.  This "
                  "will have no effect.");
        }
        GetViewerMethods()->SetLightList();
    }
    else
        lights->Notify();

    enableToggledSinceApply = false;
}
Ejemplo n.º 2
0
bool CServerList::Init()
{
	// auto update the list by using an url
	if (thePrefs.GetAutoUpdateServerList())
		AutoUpdate();
	
	// Load Metfile
	CString strPath;
	strPath.Format(_T("%s") SERVER_MET_FILENAME, thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	bool bRes = AddServerMetToList(strPath, false);
	if (thePrefs.GetAutoUpdateServerList())
	{
		strPath.Format(_T("%sserver_met.download"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
		bool bRes2 = AddServerMetToList(strPath, true);
		if (!bRes && bRes2)
			bRes = true;
	}

	// insert static servers from textfile
	strPath.Format(_T("%sstaticservers.dat"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	AddServersFromTextFile(strPath);

    CGlobalVariable::serverlist->GiveServersForTraceRoute();
    
	m_bHasInit = true;
    return bRes;
}
Ejemplo n.º 3
0
bool CServerList::Init()
{
	// auto update the list by using an url
	if (thePrefs.GetAutoUpdateServerList())
	{
		if(theApp.IsSplash()) theApp.DestroySplash(); //Xman new slpash-screen arrangement
		AutoUpdate();
	} //Xman

	// Load Metfile
	CString strPath;
	strPath.Format(_T("%s") SERVER_MET_FILENAME, thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	bool bRes = AddServerMetToList(strPath, false);
	if (thePrefs.GetAutoUpdateServerList())
	{
		strPath.Format(_T("%sserver_met.download"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
		bool bRes2 = AddServerMetToList(strPath, true);
		if (!bRes && bRes2)
			bRes = true;
	}

	// insert static servers from textfile
	strPath.Format(_T("%sstaticservers.dat"), thePrefs.GetMuleDirectory(EMULE_CONFIGDIR));
	AddServersFromTextFile(strPath);

	//Xman auto update IPFilter
	if(thePrefs.AutoUpdateIPFilter())
	{
		bool update=false;
		if (thePrefs.m_last_ipfilter_check!=0) {
			CTime last(thePrefs.m_last_ipfilter_check);
			struct tm tmTemp;
			time_t tLast=safe_mktime(last.GetLocalTm(&tmTemp));
			time_t tNow=safe_mktime(CTime::GetCurrentTime().GetLocalTm(&tmTemp));
			if ( (difftime(tNow,tLast) / 86400)>=thePrefs.GetUpdateDays() )
			{
				update=true;
			}
		}
		else
			update=true;
		if(update)
		{
			if(theApp.IsSplash()) theApp.DestroySplash(); //Xman new slpash-screen arrangement
			theApp.ipfilter->UpdateIPFilterURL();
		}
	}
	//Xman end

	//X-Ray :: Fincan Hash Detection :: Start
	if(thePrefs.GetAntiLeecherFincan())
		theApp.dlp->LoadFincanHashes(thePrefs.m_antileecherFincanURL, true);
	//X-Ray :: Fincan Hash Detection :: End	

    theApp.serverlist->GiveServersForTraceRoute();
    
    return bRes;
}
Ejemplo n.º 4
0
void
QvisAppearanceWindow::Apply(bool ignore)
{
    if(AutoUpdate() || ignore)
    {
        GetCurrentValues(-1);

        emit changeAppearance(true);
    }
}
void
QvisTruecolorPlotWindow::Apply(bool ignore)
{
    if(AutoUpdate() || ignore)
    {
        GetCurrentValues(-1);
        atts->Notify();

        GetViewerMethods()->SetPlotOptions(plotType);
    }
    else
        atts->Notify();
}
void
QvisLegacyStreamlinePlotWindow::Apply(bool ignore)
{
    if(AutoUpdate() || ignore)
    {
        GetCurrentValues(-1);
        streamAtts->Notify();

        GetViewerMethods()->SetPlotOptions(plotType);
    }
    else
        streamAtts->Notify();
}
Ejemplo n.º 7
0
int CLuzj_ZTEDlg::CheckUpdate()
{
	int ret = AutoUpdate();
	if(ret == 0) {
		if(this->m_bAuth) {
			this->OnLogoff();
		}
		this->PostMessage(WM_QUIT);
	//	Sleep(1000);
		TerminateProcess(GetCurrentProcess(), 0);
	} else if(ret == 4) { return 2; }

	return 1;
}
void
QvisOperatorWindow::Apply(bool ignore)
{
    if(AutoUpdate() || ignore)
    {
        // Get the current aslice attributes and tell the other
        // observers about them.
        GetCurrentValues(-1);
        subject->Notify();

        // Tell the viewer to set the operator attributes.
        SetOperatorOptions();
    }
    else
        subject->Notify();
}
Ejemplo n.º 9
0
void
QvisTensorPlotWindow::Apply(bool ignore)
{
    if(AutoUpdate() || ignore)
    {
        // Get the current aslice attributes and tell the other
        // observers about them.
        GetCurrentValues(-1);
        tensorAtts->Notify();

        // Tell the viewer to set the tensor attributes.
        GetViewerMethods()->SetPlotOptions(plotType);
    }
    else
        tensorAtts->Notify();
}
Ejemplo n.º 10
0
void CCamera::Update(vector3d	positionEntity)
{
	switch (CCamera::getInstance()->getStateCamera())
	{
	case CAMERA_NORMAL:
		NormalUpdate(positionEntity);
		break;
	case CAMERA_AUTO:
		AutoUpdate(positionEntity);
		break;
	case CAMERA_STOP:
		break;
	default:
		break;
	}
}
Ejemplo n.º 11
0
bool CServerList::Init()
{
	// Load Metfile
	bool bRes = LoadServerMet(CPath(theApp->ConfigDir + wxT("server.met")));

	// insert static servers from textfile
	m_staticServersConfig = theApp->ConfigDir + wxT("staticservers.dat");
	LoadStaticServers();
	
	// Send the auto-update of server.met via HTTPThread requests
	current_url_index = 0;
	if ( thePrefs::AutoServerlist()) {
		AutoUpdate();
	}	
	
	m_initialized = true;
	return bRes;
}
Ejemplo n.º 12
0
void
QvisAnimationWindow::Apply(bool ignore)
{
    if(AutoUpdate() || ignore)
    {
        // Tell the viewer to set the animation attributes.
        if(animationAtts->NumAttributesSelected() > 0 || ignore)
        {
            animationAtts->Notify();
            GetViewerMethods()->SetAnimationAttributes();
        }
    }
    else
    {
        // Send the new state to the viewer.
        animationAtts->Notify();
    }
}
void
QvisKeyframeWindow::Apply(bool ignore)
{
    if(AutoUpdate() || ignore)
    {
        //
        // If the user changed the number of frames then send it. Otherwise,
        // don't set the number of frames so the number can be determined
        // automatically.
        //
        if(kfAtts->GetNFramesWasUserSet())
            GetCurrentValues(-1);

        kfAtts->Notify();

        GetViewerMethods()->SetKeyframeAttributes();
    }
    else
        kfAtts->Notify();
}
Ejemplo n.º 14
0
void
SetAutoUpdateTimer()
{

    if ( clockInterval > 0 )
    {

        timer_id = XtAppAddTimeOut (
                       XtWidgetToApplicationContext (main_shell),
                       clockInterval,
                       (XtTimerCallbackProc) SetAutoUpdateTimer,
                       (XtPointer) NULL );

        if ( first )
            first = False;
        else
            AutoUpdate();

    }

}
Ejemplo n.º 15
0
void CServerList::AutoDownloadFinished(uint32 result) 
{
	if (result == HTTP_Success) {
		CPath tempFilename = CPath(theApp->ConfigDir + wxT("server_auto.met"));
		
		// curl succeeded. proceed with server.met loading
		LoadServerMet(tempFilename);
		SaveServerMet();
		
		// So, file is loaded and merged, and also saved
		CPath::RemoveFile(tempFilename);
	} else {
		AddLogLineC(CFormat(_("Failed to download the server list from %s") ) % m_URLUpdate);
	}
	
	++current_url_index;
	
	if (current_url_index < theApp->glob_prefs->adresses_list.GetCount()) {		
		// Next!	
		AutoUpdate();
	}
}
Ejemplo n.º 16
0
bool CServerList::Init()
{
	// auto update the list by using an url
	if (thePrefs.GetAutoUpdateServerList())
		AutoUpdate();
	
	// Load Metfile
	CString strPath;
	strPath.Format(_T("%s") SERVER_MET_FILENAME, thePrefs.GetConfigDir());
	bool bRes = AddServerMetToList(strPath, false);
	if (thePrefs.GetAutoUpdateServerList())
	{
		strPath.Format(_T("%sserver_met.download"), thePrefs.GetConfigDir());
		bool bRes2 = AddServerMetToList(strPath, true);
		if (!bRes && bRes2)
			bRes = true;
	}

	// insert static servers from textfile
	strPath.Format(_T("%sstaticservers.dat"), thePrefs.GetConfigDir());
	AddServersFromTextFile(strPath);
        //Ip to Country
	//Commander - Added: IP2Country auto-updating - Start
	if (thePrefs.IsAutoUPdateIP2CountryEnabled())
	theApp.ip2country->UpdateIP2CountryURL();
	//Commander - Added: IP2Country auto-updating - End
	//Ip to Country
 //MORPH START added by Yun.SF3: Ipfilter.dat update
	if (thePrefs.IsAutoUPdateIPFilterEnabled())
	theApp.ipfilter->UpdateIPFilterURL();
	//MORPH END added by Yun.SF3: Ipfilter.dat update
//MORPH START - Added by milobac, FakeCheck, FakeReport, Auto-updating
	if (thePrefs.IsUpdateFakeStartupEnabled())
	theApp.FakeCheck->DownloadFakeList();
//MORPH END - Added by milobac, FakeCheck, FakeReport, Auto-updating 
    theApp.serverlist->GiveServersForTraceRoute();
    
    return bRes;
}