Example #1
0
void MediaBrowser::handleSelectionChange()
{
	// Update the preview if a texture is selected
	if (!isDirectorySelected())
	{
		_preview->SetTexture(getSelectedName());
		GlobalShaderClipboard().setSource(getSelectedName());
	}
	else
	{
		_preview->SetTexture("");
		// Nothing selected, clear the clipboard
		GlobalShaderClipboard().clear();
	}
}
Example #2
0
// Check if a single non-directory texture is selected (used by multiple menu
// options).
bool MediaBrowser::_testSingleTexSel()
{
	if (!isDirectorySelected() && !getSelectedName().empty())
		return true;
	else
		return false;
}
Example #3
0
void MediaBrowser::_onShowShaderDefinition()
{
	std::string shaderName = getSelectedName();

	// Construct a shader view and pass the shader name
	ShaderDefinitionView::ShowDialog(shaderName);
}
Example #4
0
void SeeDif::doRunTrout() {
  int value;
  troutBS->GetValue(value);
  if (value!=0)
  {
    if (!troutDialog->isStarted())
    {
      char lib[200],fun[200],cir[200],lay[200];

      lib[0]='\0';
      fun[0]='\0';
      cir[0]='\0';
      lay[0]='\0';

    
      getSelectedName(seadifBrowser->Selection(0),lib,fun,cir,lay);
      troutDialog->setNames(lib,fun,cir,lay);


      World *w=GetWorld();
      w->InsertApplication(troutDialog);
      troutDialog->markAsStarted();
    }
    troutBS->SetValue(0);    
  } 
}
void KSaneDeviceDialog::setAvailable(bool avail)
{
    enableButtonOk(avail);
    if(avail) {
        m_selectedDevice = getSelectedName();
        setButtonFocus(KDialog::Ok);
    }
}
Example #6
0
bool PanelRadar::isImpDev(const LLUUID& agent_id)
{
	// We use strings here as avatar keys change across grids. 
	// Feel free to add/remove yourself.
	std::string agent_name = getSelectedName(agent_id);
	return (agent_name == "McCabe Maxsted" || 
	        agent_name == "Jacek Antonelli" ||
	        agent_name == "Armin Weatherwax");
}
Example #7
0
void SeeDif::doSelect(){

  char lib[200],fun[200],cir[200],lay[200];

  lib[0]='\0';
  fun[0]='\0';
  cir[0]='\0';
  lay[0]='\0';

  getSelectedName(seadifBrowser->Selection(0),lib,fun,cir,lay);
  madonnaDialog->setNames(lib,fun,cir,lay);
  troutDialog->setNames(lib,fun,cir,lay);
}
Example #8
0
void MediaBrowser::_onLoadInTexView()
{
	// Use a TextureDirectoryLoader functor to search the directory. This
	// may throw an exception if cancelled by user.
	TextureDirectoryLoader loader(getSelectedName());

	try
	{
		GlobalMaterialManager().foreachShaderName(boost::bind(&TextureDirectoryLoader::visit, &loader, _1));
	}
	catch (wxutil::ModalProgressDialog::OperationAbortedException&)
	{
		// Ignore the error and return from the function normally
	}
}
void cmd_run(const char* prog, uchar selectedFile) {  
  char *p, *c;

  if(selectedFile) getSelectedName(cmdline);

  // Если указано имя програмы, то ком строка передается полностью 
  c = cmdLine;

  // Если не указано имя програмы
  if(prog == 0)  {

    // Преобразование относительного пути в абсолютный
    absolutePath();

    // Разделение ком строки по первому пробелу
    prog = cmdLine;
    c = strchr(prog, 32);
    if(c) *c=0, ++c; else c="";
  }

  cmd_run2(prog, c);
}
Example #10
0
void PanelRadar::updateRadarInfo()
{
	if (!getVisible())
	{
		return;
	}

	// find what avatars we can know about
	std::vector<LLUUID> avatar_ids;
	std::vector<LLVector3d> positions;
	LLWorld::getInstance()->getAvatars(&avatar_ids, &positions);

	if (!avatar_ids.empty())
	{
		for (U32 i=0; i<avatar_ids.size(); i++)
		{
			// This actually happens sometimes O.o
			if (avatar_ids[i] == gAgent.getID() || avatar_ids[i].isNull())
			{
				continue;
			}

			// Determine if they're in the list already--getEntry checks for null keys
			PanelRadarEntry* entry = getEntry(avatar_ids[i]);

			// If they aren't, create a new entry
			// If they are, see if we need to update any values
			// List them as "(Unknown)" if we can't get their name
			if (!entry)
			{
				mAvatars.insert(std::pair<LLUUID, PanelRadarEntry>(avatar_ids[i], PanelRadarEntry(avatar_ids[i], 
																	getSelectedName(avatar_ids[i]),
																	calculateDistance(avatar_ids[i], positions[i]),
																	positions[i],
																	RADAR_STATUS_NONE,
																	RADAR_NOTIFIED_NONE)
																	));
			}
			else
			{
				if (entry->getName() == getString("unknown_avatar"))
				{
					// Try to find the name again
					entry->setName(getSelectedName(avatar_ids[i]));
				}
				if (entry->getPosition() != positions[i])
				{
					entry->setPosition(positions[i]);
				}
				if (entry->getStatusTimer().hasExpired())
				{
					entry->setStatus(RADAR_STATUS_NONE);
				}
				entry->setDistance(calculateDistance(avatar_ids[i], positions[i]));
			}
		}
		removeDeadEntries(avatar_ids);
	}
	else // avatar_ids empty
	{
		mRadarList->deleteAllItems();
		mRadarList->addCommentText(getString("no_one_near"), ADD_TOP);
		LLUIString av_count_string = getString("avatars_in_plural");
		av_count_string.setArg("[COUNT]", "0");
		childSetText("avatar_count", av_count_string.getString());
		return;
	}

	updateRadarDisplay();
}
Example #11
0
void MediaBrowser::_onApplyToSel()
{
	// Pass shader name to the selection system
	selection::algorithm::applyShaderToSelection(getSelectedName());
}
Example #12
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);
  } 
}