23 QGridLayout*
layout =
new QGridLayout(
this);
29 QPushButton* addSubItem =
new QPushButton(tr(
"add"),
this);
31 layout->addWidget(addSubItem, 1, 0);
33 QPushButton* delSubItem =
new QPushButton(tr(
"delete"),
this);
35 layout->addWidget(delSubItem, 1, 1);
37 connect(
mySubItems->itemDelegate(), SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)),
this, SLOT(
endEdition(QWidget*, QAbstractItemDelegate::EndEditHint)));
42 QListWidgetItem* wi =
new QListWidgetItem(
item);
43 wi->setFlags(wi->flags() | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable);
52 for (
const QString&
item : d)
90 QVBoxLayout*
layout =
new QVBoxLayout(
this);
92 layout->addWidget(
new QLabel(tr(
"Connection number:"),
this));
93 myEdit =
new QLineEdit(
this);
94 myEdit->setValidator(
new QIntValidator(1, 65000,
myEdit));
113 if (!ok || value <= 0 || value > 65000)
115 showWarning(tr(
"Invalid number %1, must be a number between 1 and 65000").arg(
data[1]));
133 if (!ok || value <= 0 || value > 65000)
135 showWarning(tr(
"Invalid number %1, must be a number between 1 and 65000").arg(
text));
147 QVBoxLayout*
layout =
new QVBoxLayout(
this);
149 layout->addWidget(
new QLabel(tr(
"Quest:"),
this));
156 myAtStep =
new QRadioButton(tr(
"at step"),
this);
158 myBelowStep =
new QRadioButton(tr(
"below step"),
this);
161 myFromStep =
new QRadioButton(tr(
"from step"),
this);
164 myStepRange =
new QRadioButton(tr(
"from step to step"),
this);
174 layout->addWidget(
new QLabel(tr(
"New step:"),
this));
198 myQuestList->setItemIcon(myQuestList->count() - 1, CREPixmap::getIcon(quest->face->number));
233 QString steps =
data[2];
234 int idx = steps.indexOf(
'-');
239 if (steps.startsWith(
"<="))
283 auto it =
quest->steps.cbegin();
284 while (it !=
quest->steps.cend()) {
286 desc = tr(
"%1 (%2)").arg(QString(step->step_description).left(50), QString::number(step->step));
287 if (step->is_completion_step)
289 myFirstStep->addItem(desc, QString::number(step->step));
292 mySecondStep->addItem(desc, QString::number(step->step));
337 if (checked ==
false)
354 QVBoxLayout*
layout =
new QVBoxLayout(
this);
356 layout->addWidget(
new QLabel(tr(
"Token:"),
this));
363 layout->addWidget(
new QLabel(tr(
"Values the token can be (one per line):"),
this));
372 layout->addWidget(
new QLabel(tr(
"Value to set for the token:"),
this));
383 QStringList copy(
data);
396 myToken->setText(copy.takeFirst());
399 else if (copy.size() > 0)
408 values.append(
myToken->text());
410 values.append(
myValues->toPlainText().split(
"\n"));
412 values.append(
myValue->text());
431 setWindowTitle(tr(
"Message pre-condition"));
434 setWindowTitle(tr(
"Message post-condition"));
437 setWindowTitle(tr(
"Step set when"));
441 QVBoxLayout*
layout =
new QVBoxLayout(
this);
443 layout->addWidget(
new QLabel(tr(
"Script:"),
this));
450 for(
int script = 0; script <
scripts.size(); script++)
455 myChoices->setItemData(script,
scripts[script]->comment(), Qt::ToolTipRole);
463 QPushButton* reset =
new QPushButton(tr(
"reset changes"),
this);
471 layout->itemAt(0)->widget()->setVisible(
false);
488 myData.push_front(
"quest");
521 if (script->
name() ==
"quest")
524 if (script->
name() ==
"token" || script->
name() ==
"settoken" || script->
name() ==
"npctoken" || script->
name() ==
"setnpctoken")
532 if (QMessageBox::question(
this,
"Confirm reset",
"Reset the condition to initial initial values, losing all changes?") != QMessageBox::StandardButton::Yes)