20 setWindowTitle(tr(
"NPC possible messages"));
22 QVBoxLayout*
layout =
new QVBoxLayout(
this);
23 layout->addWidget(
new QLabel(tr(
"Messages:"),
this));
25 myItems =
new QListWidget(
this);
29 QHBoxLayout* buttons =
new QHBoxLayout();
31 QPushButton* add =
new QPushButton(tr(
"add"),
this);
33 buttons->addWidget(add);
35 QPushButton* remove =
new QPushButton(tr(
"remove"),
this);
37 buttons->addWidget(remove);
39 QPushButton* reset =
new QPushButton(tr(
"reset changes"),
this);
41 buttons->addWidget(reset);
43 layout->addLayout(buttons);
61 for (
int i = 0; i <
myItems->count(); i++)
68 QListWidgetItem* wi =
new QListWidgetItem(
text);
69 wi->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
88 if (QMessageBox::question(
this,
"Confirm reset",
"Reset the values, losing all changes?") != QMessageBox::StandardButton::Yes)