Ejemplo n.º 1
0
void ReactionTreeItem::updateConditionItem(Reaction* reaction) {
    if (!reaction->waitFor() && !mEmptyTriggerConditionItem) {
        mEmptyTriggerConditionItem = new TextTreeItem(this);
        mEmptyTriggerConditionItem->setText(
                                        i18nc("@item", "(No condition set)"));

        replaceItem(child(0), mEmptyTriggerConditionItem);
    } else if (reaction->waitFor()) {
        mTriggerConditionItem =
                WaitForTreeItem::treeItemForWaitFor(reaction->waitFor(), this);

        replaceItem(child(0), mTriggerConditionItem);
    }
}
Ejemplo n.º 2
0
void LLTeleportHistoryPanel::onTeleportHistoryChange(S32 removed_index)
{
	mLastSelectedItemIndex = -1;

	if (-1 == removed_index)
		showTeleportHistory(); // recreate all items
	else
	{
		replaceItem(removed_index); // replace removed item by most recent
		updateVerbs();
	}
}
Ejemplo n.º 3
0
void PlaylistWindow::replaceItem(QUuid list, QUuid item, const QList<QUrl> &urls)
{
    auto pl = PlaylistCollection::getSingleton()->playlistOf(list);
    if (!pl)
        return;
    QList<QUuid> addedItems = pl->replaceItem(item, urls);

    auto listWidget = widgets[list];
    if (listWidget)
        listWidget->addItemsAfter(item, addedItems);

    auto qdp = currentPlaylistWidget();
    if (qdp->uuid() == list)
        qdp->viewport()->update();
}
Ejemplo n.º 4
0
void ReactionTreeItem::updateOptionItem(Reaction* reaction) {
    if (!mTriggerOptionItem) {
        mTriggerOptionItem = new TextTreeItem(this);

        replaceItem(child(0), mTriggerOptionItem);
    }

    QString optionName = reaction->optionName();
    if (optionName.isEmpty()) {
        optionName = i18nc("@item:intext", "(option name not set)");
    } else {
        optionName = '"' + reaction->optionName() + '"';
    }

    mTriggerOptionItem->setText(
                i18nc("@item", "When the option %1 is selected", optionName));
}
Ejemplo n.º 5
0
void ReactionTreeItem::updateCustomCodeItem(Reaction* reaction) {
    if (!mResponseCustomCodeItem) {
        TextTreeItem* parent = new TextTreeItem(this);
        parent->setText(i18nc("@item", "Execute the following code:"));

        mResponseCustomCodeItem = new TextTreeItem(parent);
        parent->appendChild(mResponseCustomCodeItem);

        replaceItem(child(1), parent);
    }

    if (reaction->customCode().isEmpty()) {
        mResponseCustomCodeItem->setText(i18nc("@item", "(No code set)"));
    } else {
        mResponseCustomCodeItem->setText(reaction->customCode());
    }
}
Ejemplo n.º 6
0
void ReactionTreeItem::updateNextStepItem(Reaction* reaction) {
    if (!mResponseNextStepItem) {
        mResponseNextStepItem = new TextTreeItem(this);

        replaceItem(child(1), mResponseNextStepItem);
    }

    QString nextStepId = reaction->nextStepId();
    if (nextStepId.isEmpty()) {
        nextStepId = i18nc("@item:intext", "(step id not set)");
    } else {
        nextStepId = '"' + reaction->nextStepId() + '"';
    }

    mResponseNextStepItem->setText(
                            i18nc("@item", "Change to step %1", nextStepId));
}
Ejemplo n.º 7
0
/** function to replace the value of a line */
long FileIO::FileIni::replaceline(char * cSection, char * cKey, std::string strReplaceValue)
{
	char cTempSection[STR_LONG];

	memset(cTempSection, 0x00, STR_LONG);
	sprintf(cTempSection,"[%s]\n",cSection);

	std::string value = "";
	int iIndexLine = 0;
	if(getline(cSection, cKey, &value, &iIndexLine) == 0)
	{
		std::string strNewLine = cKey;
		strNewLine += "=";
		strNewLine += strReplaceValue;

		replaceItem(iIndexLine, strReplaceValue);
	}
	return FILE_KEY_NOT_FOUND;
}
Ejemplo n.º 8
0
void LayoutSquare::addWidget( QWidget *widget )
{
	if ( !hasItem() ) replaceItem( new QWidgetItem( widget ) );
}
Ejemplo n.º 9
0
void LayoutSquare::addItem( QLayoutItem *item )
{
	if ( !hasItem() ) replaceItem( item );
}
/* Adds widget if place isn't already taken. */
void SquareItemWithSidePaneLayout::addWidget(QWidget* widget) {
	if(!hasItemOfType(widget)) {
		replaceItem(new QWidgetItem(widget));
	}
}
/* Adds item if place isn't already taken. */
void SquareItemWithSidePaneLayout::addItem(QLayoutItem* item) {
	if(!hasItemOfType(item)) {
		replaceItem(item);
	}
}
Ejemplo n.º 12
0
/* Adds widget if place isn't already taken. */
void QAspectRatioLayout::addWidget(QWidget* widget) {
        if(!hasItem()) {
                replaceItem(new QWidgetItem(widget));
        }
}
Ejemplo n.º 13
0
/* Adds item if place isn't already taken. */
void QAspectRatioLayout::addItem(QLayoutItem* item) {
        if(!hasItem()) {
                replaceItem(item);
        }
}