Beispiel #1
0
void KstEventMonitorI::vectorChanged(const QString& strVector) {
  QString    			str;
  int							iButton;
  
  if( _bChanged ) {
    iButton = QMessageBox::information( this, 
                                        i18n("Accept changes?"),
                                        i18n("You have made changes to the event monitor entries for the vector %1\nDo you wish to accept or discard your changes?").arg( _strVector ),
                                        i18n("Accept"),
                                        i18n("Discard") );
    if( iButton == 0 ) {
      acceptChanges( );
    }
  }
  
  lineEditEquation->setText( "" );
  displayEvents( strVector );
  
  if( _eventMonitors.size( ) > 0 ) {
    enableEditing( TRUE );    
    
    tableEvents->setCurrentCell( 0, 0 );
  } else {
    enableEditing( FALSE );    
  }
  
  setChanged( FALSE );
}
void LLPanelClassifiedEdit::onOpen(const LLSD& key)
{
	mIsNew = key.isUndefined();
	
	scrollToTop();

	// classified is not created yet
	bool is_new = isNew() || isNewWithErrors();

	if(is_new)
	{
		resetData();
		resetControls();

		fillIn(key);

		if(isNew())
		{
			LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
		}
	}
	else
	{
		LLPanelClassifiedInfo::onOpen(key);
	}

	std::string save_btn_label = is_new ? getString("publish_label") : getString("save_label");
	getChild<LLUICtrl>("save_changes_btn")->setLabelArg("[LABEL]", save_btn_label);

	enableVerbs(is_new);
	enableEditing(is_new);
	showEditing(!is_new);
	resetDirty();
	setInfoLoaded(false);
}
void HippoPanelGridsImpl::loadCurGrid()
{
	HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
	if (gridInfo && (mState != ADD_NEW)) {
		LLComboBox *platform = getChild<LLComboBox>("platform");
		if (platform) platform->setCurrentByIndex(gridInfo->getPlatform());
		childSetText("gridname", gridInfo->getGridName());
		childSetText("loginuri", gridInfo->getLoginUri());
		childSetText("loginpage", gridInfo->getLoginPage());
		childSetText("helperuri", gridInfo->getHelperUri());
		childSetText("website", gridInfo->getWebSite());
		childSetText("support", gridInfo->getSupportUrl());
		childSetText("search", gridInfo->getSearchUrl());
		childSetText("register", gridInfo->getRegisterUrl());
		childSetText("password", gridInfo->getPasswordUrl());
		childSetValue("render_compat", gridInfo->isRenderCompat());
		enableEditing(!gridInfo->getLocked());
	} else {
		std::string empty = "";
		LLComboBox *platform = getChild<LLComboBox>("platform");
		if (platform) platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER);
		childSetText("gridname", empty);
		childSetText("loginuri", empty);
		childSetText("loginpage", empty);
		childSetText("helperuri", empty);
		childSetText("website", empty);
		childSetText("support", empty);
		childSetText("search", empty);
		childSetText("register", empty);
		childSetText("password", empty);
		childSetValue("render_compat", true);
		enableEditing(true);
	}

	if (mState == ADD_NEW) {
		std::string required = "<required>";
		childSetText("gridname", required);
		childSetText("loginuri", required);
	} else if (mState == ADD_COPY) {
		childSetText("gridname", std::string("<required>"));
		enableEditing(true);
	} else if (mState != NORMAL) {
		llwarns << "Illegal state " << mState << '.' << llendl;
	}
	
	refresh();
}
Beispiel #4
0
void LLPanelMyProfileEdit::onOpen(const LLSD& key)
{
	resetData();

	// Disable editing until data is loaded, or edited fields will be overwritten when data
	// is loaded.
	enableEditing(false);
	LLPanelMyProfile::onOpen(getAvatarId());
}
Beispiel #5
0
void RKEditorDataFrame::waitForLoad () {
	RK_TRACE (EDITOR);
	flushEdit ();

	enableEditing (false);

	RCommand *command = new RCommand (QString (), RCommand::EmptyCommand | RCommand::Sync | RCommand::GetStringVector, QString (), this, LOAD_COMPLETE_COMMAND);
	RKGlobals::rInterface ()->issueCommand (command, open_chain);
}
Beispiel #6
0
void RKEditorDataFrame::rCommandDone (RCommand *command) {
	RK_TRACE (EDITOR);

	if (command->getFlags () == LOAD_COMPLETE_COMMAND) {
		RKGlobals::rInterface ()->closeChain (open_chain);
		open_chain = 0;

		enableEditing (true);
	}
}
Beispiel #7
0
void KstEventMonitorI::addEvent() {
  EventMonitorEntry	event;

  _eventMonitors.append( event );
  
  updateTable( );
  
  if( _eventMonitors.size() == 1 ) {
    enableEditing( TRUE );  
  }
  tableEvents->setCurrentCell( tableEvents->numRows( ), 0 );
}
Beispiel #8
0
void LLFloaterEditSky::onRegionInfoUpdate()
{
	bool can_edit = true;

	// If we've selected a region sky preset for editing.
	if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION)
	{
		// check whether we have the access
		can_edit = LLEnvManagerNew::canEditRegionSettings();
	}

	enableEditing(can_edit);
}
Beispiel #9
0
void KstEventMonitorI::deleteEvent() {
  int row;
  
  row = tableEvents->currentRow( );
  if( row >= 0 && row < (int)_eventMonitors.size() ) {
    _eventMonitors.erase( _eventMonitors.at(row) );  
    updateTable( );
  }
  
  if( _eventMonitors.size() == 0 ) {
    enableEditing( FALSE );  
  }
}
void LLPanelMyProfileEdit::processProperties(void* data, EAvatarProcessorType type)
{
	if(APT_PROPERTIES == type)
	{
		const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
		if(avatar_data && getAvatarId() == avatar_data->avatar_id)
		{
			// *TODO dzaporozhan
			// Workaround for ticket EXT-1099, waiting for fix for ticket EXT-1128
			enableEditing(true);
			processProfileProperties(avatar_data);
			LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
		}
	}
}
Beispiel #11
0
void LLFloaterEditSky::reset()
{
	if (isNewPreset())
	{
		mSkyPresetNameEditor->setValue(LLSD());
		mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name
	}
	else
	{
		refreshSkyPresetsList();

		// Disable controls until a sky preset to edit is selected.
		enableEditing(false);
	}
}
Beispiel #12
0
void KstEventMonitorI::displayEvents( const QString& strVector ) {
  KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
  KstRVectorPtr rvector;
  int i;
  
  rvector = *rvl.findTag(strVector);
  if( rvector != NULL ) {
    _eventMonitors = *(rvector->getEventMonitors());
    tableEvents->setEventMonitors( &_eventMonitors );
    _strVector = strVector;
    for( i=0; i<(int)_eventMonitors.size(); i++ ) {
      _eventMonitors[i].setExpression( NULL );
    }
    pushButtonAdd->setEnabled( TRUE );
    pushButtonDelete->setEnabled( TRUE );
    enableEditing( TRUE );  
  } else {
    _strVector = "";
    tableEvents->setEventMonitors( NULL );
    pushButtonAdd->setEnabled( FALSE );
    pushButtonDelete->setEnabled( FALSE );
    enableEditing( FALSE );  
  }
}
void PaletteBoxButton::contextMenuEvent(QContextMenuEvent* event)
      {
      QMenu menu;

      QAction* actionProperties = menu.addAction(tr("Palette Properties…"));
      QAction* actionInsert     = menu.addAction(tr("Insert New Palette…"));
      QAction* actionUp         = menu.addAction(tr("Move Palette Up"));
      QAction* actionDown       = menu.addAction(tr("Move Palette Down"));
      QAction* actionEdit       = menu.addAction(tr("Enable Editing"));
      actionEdit->setCheckable(true);
      actionEdit->setChecked(!palette->readOnly());
      if (palette->isFilterActive())
            actionEdit->setVisible(false);

      bool _systemPalette = palette->systemPalette();
      actionProperties->setDisabled(_systemPalette);
      actionInsert->setDisabled(_systemPalette);
      actionUp->setDisabled(_systemPalette);
      actionDown->setDisabled(_systemPalette);
      actionEdit->setDisabled(_systemPalette);

      menu.addSeparator();
      QAction* actionSave = menu.addAction(tr("Save Palette…"));
      QAction* actionLoad = menu.addAction(tr("Load Palette…"));
      actionLoad->setDisabled(_systemPalette);

      menu.addSeparator();
      QAction* actionDelete = menu.addAction(tr("Delete Palette"));
      actionDelete->setDisabled(_systemPalette);

      QAction* action = menu.exec(mapToGlobal(event->pos()));
      if (action == actionProperties)
            propertiesTriggered();
      else if (action == actionInsert)
            newTriggered();
      else if (action == actionUp)
            upTriggered();
      else if (action == actionDown)
            downTriggered();
      else if (action == actionEdit)
            enableEditing(action->isChecked());
      else if (action == actionSave)
            saveTriggered();
      else if (action == actionLoad)
            loadTriggered();
      else if (action == actionDelete)
            deleteTriggered();
      }
void LLPanelMyProfileEdit::onOpen(const LLSD& key)
{
	resetData();

	// Disable editing until data is loaded, or edited fields will be overwritten when data
	// is loaded.
	enableEditing(false);

	// force new avatar name fetch so we have latest update time
	LLAvatarNameCache::fetch(gAgent.getID()); 
	LLPanelMyProfile::onOpen(getAvatarId());
	
	LLAvatarName av_name;	
	if (LLAvatarNameCache::useDisplayNames())
	{
		if (LLAvatarNameCache::get(gAgent.getID(), &av_name) && av_name.mIsDisplayNameDefault)  	
		{
			LLFirstUse::setDisplayName();
		}
		else
		{
			LLFirstUse::setDisplayName(false);
		}
	}

	if (LLAvatarNameCache::useDisplayNames())
	{
		getChild<LLUICtrl>("user_label")->setVisible( true );
		getChild<LLUICtrl>("user_slid")->setVisible( true );
		getChild<LLUICtrl>("display_name_label")->setVisible( true );
		getChild<LLUICtrl>("set_name")->setVisible( true );
		getChild<LLUICtrl>("set_name")->setEnabled( true );
		getChild<LLUICtrl>("solo_user_name")->setVisible( false );
		getChild<LLUICtrl>("solo_username_label")->setVisible( false );
	}
	else
	{
		getChild<LLUICtrl>("user_label")->setVisible( false );
		getChild<LLUICtrl>("user_slid")->setVisible( false );
		getChild<LLUICtrl>("display_name_label")->setVisible( false );
		getChild<LLUICtrl>("set_name")->setVisible( false );
		getChild<LLUICtrl>("set_name")->setEnabled( false );
		getChild<LLUICtrl>("solo_user_name")->setVisible( true );
		getChild<LLUICtrl>("solo_username_label")->setVisible( true );
	}
}
Beispiel #15
0
void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType type)
{
	if(APT_CLASSIFIED_INFO == type)
	{
		LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data);
		if(c_info && getClassifiedId() == c_info->classified_id)
		{
			// see LLPanelClassifiedEdit::sendUpdate() for notes
			mIsNewWithErrors = false;
			// for just created classified - panel will probably be closed when we get here.
			if(!getVisible())
			{
				return;
			}

			enableEditing(true);

			setClassifiedName(c_info->name);
			setDescription(c_info->description);
			setSnapshotId(c_info->snapshot_id);
			setPosGlobal(c_info->pos_global);

			setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global));
			// *HACK see LLPanelClassifiedEdit::sendUpdate()
			setCategory(c_info->category - 1);

			bool mature = is_cf_mature(c_info->flags);
			bool auto_renew = is_cf_auto_renew(c_info->flags);

			setContentType(mature ? CB_ITEM_MATURE : CB_ITEM_PG);
			getChild<LLUICtrl>("auto_renew")->setValue(auto_renew);
			getChild<LLUICtrl>("price_for_listing")->setValue(c_info->price_for_listing);
			getChildView("price_for_listing")->setEnabled(isNew());

			resetDirty();
			setInfoLoaded(true);
			enableVerbs(false);

			// for just created classified - in case user opened edit panel before processProperties() callback 
			getChild<LLUICtrl>("save_changes_btn")->setLabelArg("[LABEL]", getString("save_label"));
		}
	}
}
Beispiel #16
0
void LLFloaterEditSky::onSkyPresetSelected()
{
	LLWLParamKey key = getSelectedSkyPreset();
	LLWLParamSet sky_params;

	if (!LLWLParamManager::instance().getParamSet(key, sky_params))
	{
		// Manually entered string?
		LL_WARNS("Windlight") << "No sky preset named " << key.toString() << LL_ENDL;
		return;
	}

	LLEnvManagerNew::instance().useSkyParams(sky_params.getAll());
	//syncControls();

	bool can_edit = (key.scope == LLEnvKey::SCOPE_LOCAL || LLEnvManagerNew::canEditRegionSettings());
	enableEditing(can_edit);

	mMakeDefaultCheckBox->setEnabled(key.scope == LLEnvKey::SCOPE_LOCAL);
}