Feature #561 » 0069-Ruledit-Make-edit_extra-to-inherit-values_dlg.patch
tools/ruledit/edit_extra.cpp | ||
---|---|---|
#include <QCheckBox>
|
||
#include <QGridLayout>
|
||
#include <QLineEdit>
|
||
#include <QPushButton>
|
||
#include <QToolButton>
|
||
// common
|
||
... | ... | |
Setup edit_extra object
|
||
**************************************************************************/
|
||
edit_extra::edit_extra(ruledit_gui *ui_in, struct extra_type *extra_in)
|
||
: QDialog()
|
||
: values_dlg()
|
||
{
|
||
QHBoxLayout *main_layout = new QHBoxLayout(this);
|
||
QGridLayout *extra_layout = new QGridLayout();
|
||
QLabel *label;
|
||
QPushButton *button;
|
||
int row = 0;
|
||
int rowcount;
|
||
int column;
|
||
... | ... | |
extra_layout->addWidget(label, row, 0);
|
||
extra_layout->addWidget(rmact_gfx_alt2, row++, 1);
|
||
button = new QPushButton(QString::fromUtf8(R__("Helptext")), this);
|
||
connect(button, SIGNAL(pressed()), this, SLOT(helptext()));
|
||
extra_layout->addWidget(button, row++, 1);
|
||
label = new QLabel(QString::fromUtf8(R__("Native to")));
|
||
natives_layout->addWidget(label, 0, 0);
|
||
for (int i = 0; i < game.control.num_unit_classes; i++) {
|
||
... | ... | |
int rowcount;
|
||
int column;
|
||
close_help();
|
||
// Save values from text fields.
|
||
gfx_tag_given();
|
||
gfx_tag_alt_given();
|
||
... | ... | |
sz_strlcpy(extra->rmact_gfx_alt2, tag_bytes);
|
||
}
|
||
/**********************************************************************//**
|
||
User pressed helptext button
|
||
**************************************************************************/
|
||
void edit_extra::helptext()
|
||
{
|
||
open_help(&extra->helptext);
|
||
}
|
tools/ruledit/edit_extra.h | ||
---|---|---|
// Qt
|
||
#include <QDialog>
|
||
// ruledit
|
||
#include "values_dlg.h"
|
||
class QGridLayout;
|
||
class QLineEdit;
|
||
class QSpinBox;
|
||
class ruledit_gui;
|
||
class edit_extra : public QDialog
|
||
class edit_extra : public values_dlg
|
||
{
|
||
Q_OBJECT
|
||
... | ... | |
void rmact_gfx_given();
|
||
void rmact_gfx_alt_given();
|
||
void rmact_gfx_alt2_given();
|
||
void helptext();
|
||
};
|
||
#endif // FC__EDIT_EXTRA_H
|