25 setWindowTitle(tr(
"Filter parameters"));
27 QGridLayout*
layout =
new QGridLayout(
this);
29 myList =
new QListWidget(
this);
32 QPushButton* add =
new QPushButton(tr(
"Add"),
this);
34 layout->addWidget(add, 4, 0, 1, 1);
36 QPushButton* del =
new QPushButton(tr(
"Remove"),
this);
38 layout->addWidget(del, 4, 1, 1, 1);
40 layout->addWidget(
new QLabel(tr(
"Name:"),
this), 0, 2, 1, 3);
42 myName =
new QLineEdit(
this);
45 layout->addWidget(
new QLabel(tr(
"Filter:"),
this), 2, 2, 1, 3);
50 QDialogButtonBox* buttons =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Close | QDialogButtonBox::Help, Qt::Horizontal,
this);
53 connect(buttons, SIGNAL(helpRequested()),
this, SLOT(
onHelp()));
55 layout->addWidget(buttons, 4, 2, 3, 1);
72 if (QMessageBox::question(
this, tr(
"Discard changes?"), tr(
"You are about to discard all changes!\nAre you sure?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
80 QMessageBox::information(
this, tr(
"Filter help"), tr(
"Enter the script expression with which to filter items in the view. Current item is <b>item</b>, and it has the following properties:<br /><ul><li>for an archetype: name, clone, head, more<ul><li>clone has the following properties: name, race, type, level, isMonster, isAlive, experience, attacktype, ac, wc, </li><li>head and more are archetypes if not null</li></ul></li><li>for a formulae: title, chance, difficulty, archs</li><li>for an artifact: item, chance, difficulty, allowed</li></ul><br />An item is shown if the expression evaluates to <i>true</i>. If a property is not defined for the current item, it will not be shown.<br /><br />Examples:<ul><li>archetypes of type 5: <i>item.clone.type == 5</i></li><li>artifact allowed for all items of the type: <i>item.allowed.length == 0</i></il></ul>"));
87 filter->setName(tr(
"<new filter>"));
99 if (QMessageBox::question(
this, tr(
"Delete filter?"), tr(
"Really delete filter '%1'?").arg(
filter->name()), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)