19#include <QApplication>
26#include <QStackedLayout>
76 qapp =
new QApplication(argc, argv);
77 central =
new QWidget;
82 main_window->setCentralWidget(central);
83 main_window->setVisible(
true);
108 QVBoxLayout *full_layout =
new QVBoxLayout();
109 QVBoxLayout *edit_layout =
new QVBoxLayout();
110 QWidget *edit_widget =
new QWidget();
111 QPushButton *ruleset_accept;
113 QLabel *version_label;
126 mode =
R__(
"built in Qt6 mode.");
128 mode =
R__(
"built in Qt5 mode.");
131 if (rev_ver == NULL) {
133 VERSION_STRING, mode);
142 QVBoxLayout *preload_layout =
new QVBoxLayout();
143 QWidget *preload_widget =
new QWidget();
145 preload_layout->setSizeConstraint(QLayout::SetMaximumSize);
146 version_label =
new QLabel(verbuf);
147 version_label->setAlignment(Qt::AlignHCenter);
148 version_label->setParent(
central);
149 preload_layout->addWidget(version_label);
150 rs_label =
new QLabel(QString::fromUtf8(
R__(
"Give ruleset to use as starting point.")));
151 rs_label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
152 preload_layout->addWidget(rs_label);
158 ruleset_accept =
new QPushButton(QString::fromUtf8(
R__(
"Start editing")));
160 preload_layout->addWidget(ruleset_accept);
162 preload_widget->setLayout(preload_layout);
173 stack->addTab(
bldg, QString::fromUtf8(
R__(
"Buildings")));
177 stack->addTab(
ach, QString::fromUtf8(
R__(
"Achievements")));
181 stack->addTab(
gov, QString::fromUtf8(
R__(
"Governments")));
193 edit_layout->addWidget(
stack);
195 edit_widget->setLayout(edit_layout);
200 msg_dspl =
new QLabel(QString::fromUtf8(
R__(
"Welcome to freeciv-ruledit")));
203 msg_dspl->setAlignment(Qt::AlignHCenter);
207 central->setLayout(full_layout);
291 msg_dspl->setText(QString::fromUtf8(msg));
336 if (old_edit->req_vector == preqs) {
342 redit =
new req_edit(
this, target, preqs);
369 if (old_fixer->item() == item_info->
item()) {
383 SIGNAL(rec_veq_may_have_changed(
const requirement_vector *)),
406 struct universal *old = old_edit->filter_get();
408 if (uni !=
nullptr) {
413 }
else if (old->
kind == VUT_NONE && old_edit->efmc == efmc) {
449 QPixmap *pm =
new QPixmap;
451 const QString
title = QString::fromUtf8(
R__(
"Freeciv Ruleset Editor"));
452 const QString fip = QString(full_icon_path);
458 qapp_in->setWindowIcon(QIcon(*pm));
463 setWindowTitle(
title);
467 width = old_size.width();
468 height = old_size.height();
484 ask.setText(
R__(
"Are you sure you want to quit?"));
485 ask.setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
486 ask.setDefaultButton(QMessageBox::Cancel);
487 ask.setIcon(QMessageBox::Warning);
488 ask.setWindowTitle(
R__(
"Quit?"));
492 case QMessageBox::Cancel:
495 case QMessageBox::Ok:
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
void add(const char *msg)
virtual const void * item()=0
void clear(const char *title)
void add(const char *msg)
void req_vec_may_have_changed(const requirement_vector *vec)
void open_req_vec_fix(req_vec_fix_item *item_info)
void unregister_effect_edit(class effect_edit *e_edit)
tab_multiplier * multipliers
QStackedLayout * main_layout
struct effect_edit_list * effect_edits
void incoming_req_vec_change(const requirement_vector *vec)
void display_msg(const char *msg)
void refresh_effect_edits()
void setup(QWidget *central_in)
void open_req_edit(QString target, struct requirement_vector *preqs)
void unregister_req_vec_fix(req_vec_fix *fixer)
requirers_dlg * create_requirers(const char *title)
struct req_edit_list * req_edits
struct req_vec_fix_list * req_vec_fixers
void show_required(requirers_dlg *requirers, const char *msg)
void open_effect_edit(QString target, struct universal *uni, enum effect_filter_main_class efmc)
QLineEdit * ruleset_select
void unregister_req_edit(class req_edit *redit)
ruledit_main(QApplication *qapp_in, QWidget *central_in)
void closeEvent(QCloseEvent *cevent)
#define GAME_DEFAULT_RULESETDIR
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
struct ruledit_arguments reargs
void ruledit_qt_display_requirers(const char *msg, void *data)
static QApplication * qapp
int ruledit_qt_run(int argc, char **argv)
static void conversion_log_cb(const char *msg)
static conversion_log * convlog
#define RULEDIT_WINHEIGHT
#define effect_edit_list_iterate_end
#define req_edit_list_iterate(reqeditlist, preqedit)
#define req_vec_fix_list_iterate(reqvecfixlist, preqvecfix)
#define effect_edit_list_iterate(effecteditlist, peffectedit)
#define req_edit_list_iterate_end
#define req_vec_fix_list_iterate_end
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
const char * fileinfoname(const struct strvec *dirs, const char *filename)
const struct strvec * get_data_dirs(void)
struct civ_game::@30::@34 server
char rulesetdir[MAX_LEN_NAME]
struct civ_game::@30::@34::@39 ruledit
int fc_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
const char * fc_git_revision(void)
const char * word_version(void)