58 QGridLayout *main_layout =
new QGridLayout(
this);
60 QLabel *save_ver_label;
63 QLabel *version_label;
66 QTableWidgetItem *
item;
71 main_layout->setSizeConstraint(QLayout::SetMaximumSize);
73 name_label =
new QLabel(QString::fromUtf8(
R__(
"Ruleset name")));
74 name_label->setParent(
this);
75 main_layout->addWidget(name_label, row, 0);
76 name =
new QLineEdit(
this);
77 main_layout->addWidget(
name, row++, 1);
78 version_label =
new QLabel(QString::fromUtf8(
R__(
"Ruleset version")));
79 version_label->setParent(
this);
80 main_layout->addWidget(version_label, row, 0);
82 main_layout->addWidget(
version, row++, 1);
83 save_label =
new QLabel(QString::fromUtf8(
R__(
"Save to directory")));
84 save_label->setParent(
this);
85 main_layout->addWidget(save_label, row, 0);
88#ifdef FREECIV_MSWINDOWS
91 if (SHGetKnownFolderPath(FOLDERID_Documents, KF_FLAG_DEFAULT,
92 NULL, &folder_path) == S_OK) {
93 savedir->setText(QString::fromWCharArray(folder_path) +
"\\ruledit-tmp");
95 savedir->setText(
"ruledit-tmp");
99 savedir->setText(
"ruledit-tmp");
105 R__(
"If you want to be able to load the ruleset directly "
106 "to freeciv, place it as a subdirectory under %s%s%s\n"
107 "Use server command \"/rulesetdir <subdirectory>\" "
108 "to load it to freeciv."),
113 main_layout->addWidget(
savedir, row++, 1);
114 save_ver_label =
new QLabel(QString::fromUtf8(
R__(
"Version suffix to directory name")));
115 save_ver_label->setParent(
this);
116 main_layout->addWidget(save_ver_label, row, 0);
119 button =
new QPushButton(QString::fromUtf8(
R__(
"Save now")),
this);
120 connect(button, SIGNAL(pressed()),
this, SLOT(
save_now()));
121 main_layout->addWidget(button, row++, 1);
123 label =
new QLabel(QString::fromUtf8(
R__(
"Description from file")));
124 label->setParent(
this);
125 main_layout->addWidget(label, row, 0);
130 label =
new QLabel(QString::fromUtf8(
R__(
"Description file")));
131 label->setParent(
this);
132 main_layout->addWidget(label, row, 0);
134 main_layout->addWidget(
desc_file, row++, 1);
136 button =
new QPushButton(QString::fromUtf8(
R__(
"Sanity check rules")),
this);
137 connect(button, SIGNAL(pressed()),
this, SLOT(
sanity_check()));
138 main_layout->addWidget(button, row++, 1);
140 button =
new QPushButton(QString::fromUtf8(
R__(
"Always active Effects")),
this);
142 main_layout->addWidget(button, row++, 1);
143 button =
new QPushButton(QString::fromUtf8(
R__(
"All Effects")),
this);
145 main_layout->addWidget(button, row++, 1);
147 stats =
new QTableWidget(
this);
148 stats->setColumnCount(8);
149 stats->setRowCount(7);
150 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Terrains")));
152 item =
new QTableWidgetItem(
"-");
154 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Resources")));
156 item =
new QTableWidgetItem(
"-");
158 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Tech Classes")));
160 item =
new QTableWidgetItem(
"-");
162 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Techs")));
164 item =
new QTableWidgetItem(
"-");
166 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Unit Classes")));
168 item =
new QTableWidgetItem(
"-");
170 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Unit Types")));
172 item =
new QTableWidgetItem(
"-");
174 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Enablers")));
176 item =
new QTableWidgetItem(
"-");
178 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Buildings")));
180 item =
new QTableWidgetItem(
"-");
182 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Nations")));
184 item =
new QTableWidgetItem(
"-");
186 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Styles")));
188 item =
new QTableWidgetItem(
"-");
190 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Specialists")));
192 item =
new QTableWidgetItem(
"-");
194 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Governments")));
196 item =
new QTableWidgetItem(
"-");
198 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Disasters")));
200 item =
new QTableWidgetItem(
"-");
202 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Achievements")));
204 item =
new QTableWidgetItem(
"-");
206 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Extras")));
208 item =
new QTableWidgetItem(
"-");
210 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Bases")));
212 item =
new QTableWidgetItem(
"-");
214 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Roads")));
216 item =
new QTableWidgetItem(
"-");
218 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Goods")));
220 item =
new QTableWidgetItem(
"-");
222 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Multipliers")));
224 item =
new QTableWidgetItem(
"-");
226 item =
new QTableWidgetItem(QString::fromUtf8(
RQ_(
"?stat:Effects")));
228 item =
new QTableWidgetItem(
"-");
230 stats->verticalHeader()->setVisible(
false);
231 stats->horizontalHeader()->setVisible(
false);
232 stats->setEditTriggers(QAbstractItemView::NoEditTriggers);
233 main_layout->addWidget(
stats, row++, 0, 1, 2);
234 button =
new QPushButton(QString::fromUtf8(
R__(
"Refresh Stats")),
this);
235 connect(button, SIGNAL(pressed()),
this, SLOT(
refresh_stats()));
236 main_layout->addWidget(button, row++, 0, 1, 2);
240 setLayout(main_layout);
343 stats->item(row++, 1)->setText(QString::number(count));
351 stats->item(row++, 1)->setText(QString::number(count));
357 stats->item(row++, 1)->setText(QString::number(count));
363 stats->item(row++, 1)->setText(QString::number(count));
369 stats->item(row++, 1)->setText(QString::number(count));
377 stats->item(row++, 1)->setText(QString::number(count));
385 stats->item(row++, 4)->setText(QString::number(count));
393 stats->item(row++, 4)->setText(QString::number(count));
399 stats->item(row++, 4)->setText(QString::number(count));
405 stats->item(row++, 4)->setText(QString::number(count));
416 stats->item(row++, 7)->setText(QString::number(count));
430 stats->item(row++, 7)->setText(QString::number(count));
438 stats->item(row++, 7)->setText(QString::number(count));
444 stats->item(row++, 7)->setText(QString::number(count));
448 stats->item(row++, 7)->setText(QString::number(count));
450 stats->resizeColumnsToContents();