Esempio n. 1
0
/* static */ void Game::Uninitialize(bool keepConfig)
{
	Backup<CompanyByte> cur_company(_current_company, FILE_LINE);

	delete Game::instance;
	Game::instance = NULL;
	Game::info = NULL;

	cur_company.Restore();

	if (keepConfig) {
		Rescan();
	} else {
		delete Game::scanner_info;
		delete Game::scanner_library;
		Game::scanner_info = NULL;
		Game::scanner_library = NULL;

		if (_settings_game.game_config != NULL) {
			delete _settings_game.game_config;
			_settings_game.game_config = NULL;
		}
		if (_settings_newgame.game_config != NULL) {
			delete _settings_newgame.game_config;
			_settings_newgame.game_config = NULL;
		}
	}
}
Esempio n. 2
0
/* static */ void AI::Uninitialize(bool keepConfig)
{
	AI::KillAll();

	if (keepConfig) {
		/* Run a rescan, which indexes all AIInfos again, and check if we can
		 *  still load all the AIS, while keeping the configs in place */
		Rescan();
	} else {
		delete AI::scanner_info;
		delete AI::scanner_library;
		AI::scanner_info = NULL;
		AI::scanner_library = NULL;

		for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
			if (_settings_game.ai_config[c] != NULL) {
				delete _settings_game.ai_config[c];
				_settings_game.ai_config[c] = NULL;
			}
			if (_settings_newgame.ai_config[c] != NULL) {
				delete _settings_newgame.ai_config[c];
				_settings_newgame.ai_config[c] = NULL;
			}
		}
	}
}
void UWorldComposition::ReinitializeForPIE()
{
	Rescan();
#if WITH_EDITOR
	FixupForPIE(GetOutermost()->PIEInstanceID);
#endif// WITH_EDITOR
	GetWorld()->StreamingLevels.Empty();
	GetWorld()->StreamingLevels.Append(TilesStreaming);
}
void UWorldComposition::PostInitProperties()
{
	Super::PostInitProperties();

	if (!IsTemplate() && !GetOutermost()->HasAnyPackageFlags(PKG_PlayInEditor))
	{
		// Tiles information is not serialized to disk, and should be regenerated on world composition object construction
		Rescan();
	}
}
Esempio n. 5
0
void DeviceManager::Init()
{
    Rescan();

#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
#if defined(HAVE_DEVICE_CHANGE)
   DeviceChangeHandler::Enable(true);
#endif
#endif
}
void LibraryPlugin::MessageHandler(PluginMessage message) 
{
    switch(message)
    {
        case MESSAGE_LIBRARY_RESCAN_REQUEST:
            Rescan();
            break;
        default:
            break;
    }
}
Esempio n. 7
0
void	WED_LibraryMgr::ReceiveMessage(
						GUI_Broadcaster *		inSrc,
						intptr_t				inMsg,
						intptr_t				inParam)
{
	if (inMsg == msg_SystemFolderChanged ||
		inMsg == msg_SystemFolderUpdated)
	{
		Rescan();
	}
}
Esempio n. 8
0
void popup_browse_panel(Widget w)
{
    char *fval, *pval;

    set_temp_cursor(wait_cursor);
    XtSetSensitive(w, False);
    browse_parent = w;
    browse_up = True;
    file_viewed[0] = '\0';

    if (!browse_popup) {
	get_directory(local_dir);
    } else {
	strcpy(local_dir, cur_browse_dir);
    }

    /* move to the file directory  - if not the current dir
        and set up the file/directory values
    */
    pval = (char*) panel_get_value( pic_name_panel );
    fval = strrchr(pval, '/');
    if ( !fval ) {	/* no path in name so just use name */
      strcpy(browse_filename, pval);
    } else {		/* set us up in the same path as the file */
      strcpy(local_dir, pval);
      strcpy(browse_filename, fval+1);
      local_dir[strlen(pval) - strlen(fval)] = '\0';
      (void) change_directory(local_dir);
    }

    if (!browse_popup) {
	create_browse_panel(w);
    }

    FirstArg(XtNstring, local_dir);
    SetValues(browse_dir);
    FirstArg(XtNstring, browse_filename);
    SetValues(browse_selfile);	

    XtPopup(browse_popup, XtGrabNonexclusive);
    Rescan(0, 0, 0, 0);

    (void) XSetWMProtocols(tool_d, XtWindow(browse_popup), &wm_delete_window, 1);
    /* if the file message window is up add it to the grab */
    file_msg_add_grab();
    set_cmap(XtWindow(browse_popup));  /* ensure most recent cmap is installed */
    reset_cursor();
}
nsresult
sbWatchFolder::StartWatchingFolder()
{
  // Don't start if the service is not in the |eStarted| state or if the
  // watch path is empty.
  if (mWatchPath.IsEmpty() || mServiceState != eStarted) {
    return NS_OK;
  }

  nsresult rv;
  mFileSystemWatcher =
    do_CreateInstance("@songbirdnest.com/filesystem/watcher;1", &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  if (mFileSystemWatcherGUID.Equals(EmptyCString())) {
    // Init a new file-system watcher. The session GUID for the new watcher
    // will be saved in StopWatching().
    TRACE(("%s: initiating new FS watcher for [%s]",
           __FUNCTION__,
           NS_ConvertUTF16toUTF8(mWatchPath).get()));
    rv = mFileSystemWatcher->Init(this, mWatchPath, PR_TRUE);
    NS_ENSURE_SUCCESS(rv, rv);
  }
  else {
    TRACE(("%s: initiating saved session %s",
           __FUNCTION__, mFileSystemWatcherGUID.get()));
    rv = mFileSystemWatcher->InitWithSession(mFileSystemWatcherGUID, this);
    NS_ENSURE_SUCCESS(rv, rv);
  }

  if (mShouldSynchronize) {
    NS_ENSURE_STATE(mMediaList);
    mMediaList->Clear();
  }

  rv = mFileSystemWatcher->StartWatching();
  NS_ENSURE_SUCCESS(rv, rv);

  // The service is now watching
  mServiceState = eWatching;

  if (mShouldSynchronize) {
    mShouldSynchronize = PR_FALSE;
    Rescan();
  }
  return NS_OK;
}
Esempio n. 10
0
void DeviceManager::Init()
{
    Rescan();
}
Esempio n. 11
0
void		WED_PackageMgr::SetXPlaneFolder(const string& root)
{
	system_path = root;
	Rescan();
}
int Box_IP_routing ( int macx, int macy)
{

    ol::Rect Rescan(ol::Vec2D(macx+130,macy-67),ol::Vec2D(60,20));
    Rescan.SetRoundness(4);
    Rescan.Draw(CouleurFond.WithAlpha(0.4));
    Rescan.DrawOutline(CouleurLigne.WithAlpha(0.5));
    petitchiffre.Print("Rescan",macx+135,macy-55);

    if(window_focus_id==W_CFGMENU && mouse_x>macx+130 && mouse_x<macx+130+60 && mouse_y>macy-67 && mouse_y<macy-47)
    {
     Rescan.DrawOutline(CouleurLigne);
     if(mouse_button==1 && mouse_released==0)
     {
     //adresse locale et nom de machine
     gethostname(hostnamebuffer, sizeof(hostnamebuffer));
     phe = gethostbyname(hostnamebuffer);

     int Ipsearch = 0;
     while((phe->h_addr_list[Ipsearch+1])!=NULL)
     {
      Ipsearch++;
     }
     detection_reseaux();
     mouse_released=1;
     }
    }

    ol::Rect IPAdapt(ol::Vec2D(macx-10,macy-40),ol::Vec2D(200,200));
    IPAdapt.SetRoundness(7.5);
    IPAdapt.Draw(CouleurFond.WithAlpha(0.2));


   petitchiffre.Print("IP ROUTING",macx,macy-30);
    petitchiffre.Print("Art-Net",macx+100,macy-30);
    petitchiffre.Print("in",macx+100,macy-15);
    petitchiffre.Print("out",macx+125,macy-15);

    petitchiffre.Print("iCat",macx+155,macy-25);

   ol::Rect ArtnetBIn(ol::Vec2D(macx+200,macy-25),ol::Vec2D(10,10));
   ol::Rect ArtnetBOut(ol::Vec2D(macx+200,macy-25),ol::Vec2D(10,10));
   ol::Rect FS(ol::Vec2D(macx+200,macy-25),ol::Vec2D(10,10));

    for (int u=0;u<8;u++)
    {
    ol::Rect NetworkSelect(ol::Vec2D(macx,macy-15+(u*20)),ol::Vec2D(90,20));
    NetworkSelect.SetRoundness(7.5);

    ArtnetBIn.MoveTo(ol::Vec2D(macx+100,macy+(u*20)-10));
    ArtnetBIn.DrawOutline(CouleurLigne.WithAlpha(0.3));


    ArtnetBOut.MoveTo(ol::Vec2D(macx+130,macy+(u*20)-10));
    ArtnetBOut.DrawOutline(CouleurLigne.WithAlpha(0.3));

    FS.MoveTo(ol::Vec2D(macx+165,macy+(u*20)-10));
    FS.DrawOutline(CouleurLigne.WithAlpha(0.3));

     if(strcmp(IP_artnet_IN,IP_detected_dmxOUT[u])==0)
    {
     ArtnetBIn.Draw(CouleurFader);
    }

    if(strcmp(IP_artnet_OUT,IP_detected_dmxOUT[u])==0)
    {
     ArtnetBOut.Draw(CouleurGreen);
    }

    if(strcmp(IP_fantastick,IP_detected_dmxOUT[u])==0)
    {
     FS.Draw(CouleurBlind);
    }
    if(mouse_y>  macy-10+(u*20)&& mouse_y<macy+(u*20)  && window_focus_id==W_CFGMENU)
    {

    if(mouse_x>macx+100 && mouse_x<macx+110 )
    {
    if(mouse_button==1 && mouse_released==0 && strcmp(IP_detected_dmxOUT[u],"-")==1)
    {
    sprintf(IP_artnet_IN,IP_detected_dmxOUT[u]);
    index_re_init_serveur_artnet=1;
    mouse_released=1;
    }
    }


    else if(mouse_x>macx+130 && mouse_x<macx+140 )
    {
    if(mouse_button==1 && mouse_released==0 && strcmp(IP_detected_dmxOUT[u],"-")==1)
    {
    sprintf(IP_artnet_OUT,IP_detected_dmxOUT[u]);
    index_re_init_client_artnet=1;
    index_ask_confirm=1;
    mouse_released=1;
    }
    }

    else if(mouse_x>macx+165 && mouse_x<macx+175 )
    {
    if(mouse_button==1 && mouse_released==0 && strcmp(IP_detected_dmxOUT[u],"-")==1)
    {
    sprintf(IP_fantastick,IP_detected_dmxOUT[u]);
    index_ask_reinit_FS_client=1;
    index_ask_confirm=1;
    mouse_released=1;
    }
    }

    }




   petitchiffre.Print(IP_detected_dmxOUT[u],macx,macy+(20*u));
   }

return(0);
}
Esempio n. 13
0
//Library manager constructor
WED_LibraryMgr::WED_LibraryMgr(const string& ilocal_package) : local_package(ilocal_package)
{
	DebugAssert(gPackageMgr != NULL);
	gPackageMgr->AddListener(this);
	Rescan();
}
Esempio n. 14
0
void DeviceManager::DeviceChangeNotification()
{
   Rescan();
   return;
}
nsresult
sbWatchFolder::HandleSessionLoadError()
{
  NS_ASSERTION(NS_IsMainThread(),
      "HandleSessionLoadError() not called on main thread!");
  NS_ENSURE_STATE(mFileSystemWatcher);

  // If the unit tests are running, don't show the dialog (Don't bother
  // checking result of call too).
  nsresult rv;
  if (!mCanInteract) {
    return NS_OK;
  }

  // If this method gets called, than the watcher could not load the stored
  // session. The tree will need to be re-initialized, this time without
  // loading a session.
  if (!mFileSystemWatcherGUID.IsEmpty()) {
    // Attempt the remove the session data. Don't bother returning the result
    // if it fails, just warn about it.
    rv = mFileSystemWatcher->DeleteSession(mFileSystemWatcherGUID);
    if (NS_FAILED(rv)) {
      NS_WARNING("Could not delete the bad session data file!");
    }

    mFileSystemWatcherGUID.Truncate();
  }

  rv = mFileSystemWatcher->Init(this, mWatchPath, PR_TRUE);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = mFileSystemWatcher->StartWatching();
  NS_ENSURE_SUCCESS(rv, rv);

  sbStringBundle bundle;
  nsString dialogTitle =
    bundle.Get("watch_folder.session_load_error.rescan_title");

  nsTArray<nsString> params;
  params.AppendElement(mWatchPath);
  nsString dialogText =
    bundle.Format("watch_folder.session_load_error.rescan_text", params);

  nsCOMPtr<nsIDOMWindow> songbirdWindow;
  rv = GetSongbirdWindow(getter_AddRefs(songbirdWindow));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<sbIPrompter> prompter =
    do_CreateInstance("@songbirdnest.com/Songbird/Prompter;1", &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = prompter->SetWaitForWindow(PR_TRUE);
  NS_ENSURE_SUCCESS(rv, rv);

  PRBool shouldRescan = PR_FALSE;
  prompter->Confirm(songbirdWindow,
                    dialogTitle.BeginReading(),
                    dialogText.BeginReading(),
                    &shouldRescan);

  // Only start the scan if the user picked the YES button (option 0).
  if (shouldRescan) {
      // The user elected to rescan their watched directory.
      rv = Rescan();
      NS_ENSURE_SUCCESS(rv, rv);
  }

  return NS_OK;
}
Esempio n. 16
0
void 
CallbackRescan(Widget widget, XtPointer closure, XtPointer call_data)
{
     Rescan(0, 0, 0, 0);
}