Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #664438 ยป EffectEditButtons.patch

Marko Lindqvist, 2017-05-25 10:14 PM

View differences:

freeciv/tools/ruledit/tab_extras.cpp 2017-05-26 01:08:58.140519954 +0300
#include "extras.h"
// ruledit
#include "effect_edit.h"
#include "ruledit.h"
#include "ruledit_qt.h"
#include "validity.h"
......
QVBoxLayout *main_layout = new QVBoxLayout(this);
QGridLayout *extra_layout = new QGridLayout();
QLabel *label;
QPushButton *effects_button;
QPushButton *add_button;
QPushButton *delete_button;
QPushButton *reqs_button;
......
connect(reqs_button, SIGNAL(pressed()), this, SLOT(edit_reqs()));
extra_layout->addWidget(reqs_button, 2, 2);
effects_button = new QPushButton(QString::fromUtf8(R__("Effects")), this);
connect(effects_button, SIGNAL(pressed()), this, SLOT(edit_effects()));
extra_layout->addWidget(effects_button, 3, 2);
show_experimental(effects_button);
add_button = new QPushButton(QString::fromUtf8(R__("Add Extra")), this);
connect(add_button, SIGNAL(pressed()), this, SLOT(add_now()));
extra_layout->addWidget(add_button, 5, 0);
extra_layout->addWidget(add_button, 4, 0);
show_experimental(add_button);
delete_button = new QPushButton(QString::fromUtf8(R__("Remove this Extra")), this);
connect(delete_button, SIGNAL(pressed()), this, SLOT(delete_now()));
extra_layout->addWidget(delete_button, 5, 2);
extra_layout->addWidget(delete_button, 4, 2);
show_experimental(delete_button);
refresh();
......
&selected->reqs);
}
}
/**************************************************************************
User wants to edit effects
**************************************************************************/
void tab_extras::edit_effects()
{
if (selected != nullptr) {
effect_edit *e_edit;
struct universal uni;
uni.value.extra = selected;
uni.kind = VUT_EXTRA;
e_edit = new effect_edit(ui, QString::fromUtf8(extra_rule_name(selected)),
&uni);
e_edit->show();
}
}
freeciv/tools/ruledit/tab_extras.h 2017-05-26 01:07:15.269219808 +0300
void delete_now();
void same_name_toggle(bool checked);
void edit_reqs();
void edit_effects();
};
#endif // FC__TAB_EXTRAS_H
freeciv/tools/ruledit/tab_good.cpp 2017-05-26 01:03:29.666728083 +0300
#include "improvement.h"
// ruledit
#include "effect_edit.h"
#include "req_edit.h"
#include "ruledit.h"
#include "ruledit_qt.h"
......
QVBoxLayout *main_layout = new QVBoxLayout(this);
QGridLayout *good_layout = new QGridLayout();
QLabel *label;
QPushButton *effects_button;
QPushButton *add_button;
QPushButton *delete_button;
QPushButton *reqs_button;
......
connect(reqs_button, SIGNAL(pressed()), this, SLOT(edit_reqs()));
good_layout->addWidget(reqs_button, 2, 2);
effects_button = new QPushButton(QString::fromUtf8(R__("Effects")), this);
connect(effects_button, SIGNAL(pressed()), this, SLOT(edit_effects()));
good_layout->addWidget(effects_button, 3, 2);
show_experimental(effects_button);
add_button = new QPushButton(QString::fromUtf8(R__("Add Good")), this);
connect(add_button, SIGNAL(pressed()), this, SLOT(add_now()));
good_layout->addWidget(add_button, 5, 0);
good_layout->addWidget(add_button, 4, 0);
show_experimental(add_button);
delete_button = new QPushButton(QString::fromUtf8(R__("Remove this Good")), this);
connect(delete_button, SIGNAL(pressed()), this, SLOT(delete_now()));
good_layout->addWidget(delete_button, 5, 2);
good_layout->addWidget(delete_button, 4, 2);
show_experimental(delete_button);
refresh();
......
redit->show();
}
}
/**************************************************************************
User wants to edit effects
**************************************************************************/
void tab_good::edit_effects()
{
if (selected != nullptr) {
effect_edit *e_edit;
struct universal uni;
uni.value.good = selected;
uni.kind = VUT_GOOD;
e_edit = new effect_edit(ui, QString::fromUtf8(goods_rule_name(selected)),
&uni);
e_edit->show();
}
}
freeciv/tools/ruledit/tab_good.h 2017-05-26 01:01:21.579562543 +0300
void delete_now();
void same_name_toggle(bool checked);
void edit_reqs();
void edit_effects();
};
#endif // FC__TAB_GOOD_H
freeciv/tools/ruledit/tab_gov.cpp 2017-05-26 01:06:10.517656849 +0300
#include "government.h"
// ruledit
#include "effect_edit.h"
#include "ruledit.h"
#include "ruledit_qt.h"
#include "validity.h"
......
QVBoxLayout *main_layout = new QVBoxLayout(this);
QGridLayout *gov_layout = new QGridLayout();
QLabel *label;
QPushButton *effects_button;
QPushButton *add_button;
QPushButton *delete_button;
QPushButton *reqs_button;
......
connect(reqs_button, SIGNAL(pressed()), this, SLOT(edit_reqs()));
gov_layout->addWidget(reqs_button, 2, 2);
effects_button = new QPushButton(QString::fromUtf8(R__("Effects")), this);
connect(effects_button, SIGNAL(pressed()), this, SLOT(edit_effects()));
gov_layout->addWidget(effects_button, 3, 2);
show_experimental(effects_button);
add_button = new QPushButton(QString::fromUtf8(R__("Add Government")), this);
connect(add_button, SIGNAL(pressed()), this, SLOT(add_now()));
gov_layout->addWidget(add_button, 3, 0);
gov_layout->addWidget(add_button, 4, 0);
show_experimental(add_button);
delete_button = new QPushButton(QString::fromUtf8(R__("Remove this Government")), this);
connect(delete_button, SIGNAL(pressed()), this, SLOT(delete_now()));
gov_layout->addWidget(delete_button, 3, 2);
gov_layout->addWidget(delete_button, 4, 2);
show_experimental(delete_button);
refresh();
......
&selected->reqs);
}
}
/**************************************************************************
User wants to edit effects
**************************************************************************/
void tab_gov::edit_effects()
{
if (selected != nullptr) {
effect_edit *e_edit;
struct universal uni;
uni.value.govern = selected;
uni.kind = VUT_GOVERNMENT;
e_edit = new effect_edit(ui, QString::fromUtf8(government_rule_name(selected)),
&uni);
e_edit->show();
}
}
freeciv/tools/ruledit/tab_gov.h 2017-05-26 01:04:21.642384451 +0300
void delete_now();
void same_name_toggle(bool checked);
void edit_reqs();
void edit_effects();
};
#endif // FC__TAB_GOV_H
freeciv/tools/ruledit/tab_tech.cpp 2017-05-26 00:54:35.526033415 +0300
#include "tech.h"
// ruledit
#include "effect_edit.h"
#include "ruledit.h"
#include "ruledit_qt.h"
#include "validity.h"
......
QVBoxLayout *main_layout = new QVBoxLayout(this);
QGridLayout *tech_layout = new QGridLayout();
QLabel *label;
QPushButton *effects_button;
QPushButton *add_button;
QPushButton *delete_button;
......
tech_layout->addWidget(label, 4, 0);
tech_layout->addWidget(root_req_button, 4, 2);
effects_button = new QPushButton(QString::fromUtf8(R__("Effects")), this);
connect(effects_button, SIGNAL(pressed()), this, SLOT(edit_effects()));
tech_layout->addWidget(effects_button, 5, 2);
show_experimental(effects_button);
add_button = new QPushButton(QString::fromUtf8(R__("Add tech")), this);
connect(add_button, SIGNAL(pressed()), this, SLOT(add_now()));
tech_layout->addWidget(add_button, 5, 0);
tech_layout->addWidget(add_button, 6, 0);
show_experimental(add_button);
delete_button = new QPushButton(QString::fromUtf8(R__("Remove this tech")), this);
connect(delete_button, SIGNAL(pressed()), this, SLOT(delete_now()));
tech_layout->addWidget(delete_button, 5, 2);
tech_layout->addWidget(delete_button, 6, 2);
show_experimental(delete_button);
refresh();
......
name->setText(rname->text());
}
}
/**************************************************************************
User wants to edit effects
**************************************************************************/
void tab_tech::edit_effects()
{
if (selected != nullptr) {
effect_edit *e_edit;
struct universal uni;
uni.value.advance = selected;
uni.kind = VUT_ADVANCE;
e_edit = new effect_edit(ui, QString::fromUtf8(advance_rule_name(selected)),
&uni);
e_edit->show();
}
}
freeciv/tools/ruledit/tab_tech.h 2017-05-26 00:53:15.622473246 +0300
void add_now();
void delete_now();
void same_name_toggle(bool checked);
void edit_effects();
};
freeciv/tools/ruledit/tab_terrains.cpp 2017-05-26 01:12:27.079082078 +0300
#include "terrain.h"
// ruledit
#include "effect_edit.h"
#include "req_edit.h"
#include "ruledit.h"
#include "ruledit_qt.h"
......
QVBoxLayout *main_layout = new QVBoxLayout(this);
QGridLayout *terrains_layout = new QGridLayout();
QLabel *label;
QPushButton *effects_button;
QPushButton *add_button;
QPushButton *delete_button;
......
terrains_layout->addWidget(same_name, 1, 1);
terrains_layout->addWidget(name, 1, 2);
effects_button = new QPushButton(QString::fromUtf8(R__("Effects")), this);
connect(effects_button, SIGNAL(pressed()), this, SLOT(edit_effects()));
terrains_layout->addWidget(effects_button, 2, 2);
show_experimental(effects_button);
add_button = new QPushButton(QString::fromUtf8(R__("Add Terrain")), this);
connect(add_button, SIGNAL(pressed()), this, SLOT(add_now()));
terrains_layout->addWidget(add_button, 2, 0);
terrains_layout->addWidget(add_button, 3, 0);
show_experimental(add_button);
delete_button = new QPushButton(QString::fromUtf8(R__("Remove this Terrain")), this);
connect(delete_button, SIGNAL(pressed()), this, SLOT(delete_now()));
terrains_layout->addWidget(delete_button, 2, 2);
terrains_layout->addWidget(delete_button, 3, 2);
show_experimental(delete_button);
refresh();
......
name->setText(rname->text());
}
}
/**************************************************************************
User wants to edit effects
**************************************************************************/
void tab_terrains::edit_effects()
{
if (selected != nullptr) {
effect_edit *e_edit;
struct universal uni;
uni.value.terrain = selected;
uni.kind = VUT_TERRAIN;
e_edit = new effect_edit(ui, QString::fromUtf8(terrain_rule_name(selected)),
&uni);
e_edit->show();
}
}
freeciv/tools/ruledit/tab_terrains.h 2017-05-26 01:10:09.504031043 +0300
void add_now();
void delete_now();
void same_name_toggle(bool checked);
void edit_effects();
};
#endif // FC__TAB_TERRAINS_H
freeciv/tools/ruledit/tab_unit.cpp 2017-05-26 00:59:30.196270838 +0300
#include "unittype.h"
// ruledit
#include "effect_edit.h"
#include "edit_utype.h"
#include "ruledit.h"
#include "ruledit_qt.h"
......
QVBoxLayout *main_layout = new QVBoxLayout(this);
QGridLayout *unit_layout = new QGridLayout();
QLabel *label;
QPushButton *effects_button;
QPushButton *add_button;
QPushButton *delete_button;
QPushButton *edit_button;
......
connect(edit_button, SIGNAL(pressed()), this, SLOT(edit_now()));
unit_layout->addWidget(edit_button, 2, 2);
effects_button = new QPushButton(QString::fromUtf8(R__("Effects")), this);
connect(effects_button, SIGNAL(pressed()), this, SLOT(edit_effects()));
unit_layout->addWidget(effects_button, 3, 2);
show_experimental(effects_button);
add_button = new QPushButton(QString::fromUtf8(R__("Add Unit")), this);
connect(add_button, SIGNAL(pressed()), this, SLOT(add_now()));
unit_layout->addWidget(add_button, 5, 0);
unit_layout->addWidget(add_button, 4, 0);
show_experimental(add_button);
delete_button = new QPushButton(QString::fromUtf8(R__("Remove this Unit")), this);
connect(delete_button, SIGNAL(pressed()), this, SLOT(delete_now()));
unit_layout->addWidget(delete_button, 5, 2);
unit_layout->addWidget(delete_button, 4, 2);
show_experimental(delete_button);
refresh();
......
name->setText(rname->text());
}
}
/**************************************************************************
User wants to edit effects
**************************************************************************/
void tab_unit::edit_effects()
{
if (selected != nullptr) {
effect_edit *e_edit;
struct universal uni;
uni.value.utype = selected;
uni.kind = VUT_UTYPE;
e_edit = new effect_edit(ui, QString::fromUtf8(utype_rule_name(selected)),
&uni);
e_edit->show();
}
}
freeciv/tools/ruledit/tab_unit.h 2017-05-26 00:56:30.709367508 +0300
void delete_now();
void edit_now();
void same_name_toggle(bool checked);
void edit_effects();
};
#endif // FC__TAB_UNIT_H
    (1-1/1)