8 #include <QDataWidgetMapper> 10 #include <QRegularExpressionValidator> 11 #include <QPushButton> 31 setWindowTitle(tr(
"New contract info"));
34 setWindowTitle(tr(
"Edit contract info"));
38 mapper =
new QDataWidgetMapper(
this);
39 mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
44 QRegularExpression regEx;
46 QRegularExpressionValidator *addressValidator =
new QRegularExpressionValidator(
ui->
addressEdit);
47 addressValidator->setRegularExpression(regEx);
72 bool dataValid =
true;
96 mapper->setCurrentIndex(row);
124 return !
address.isEmpty() && !editError;
145 QMessageBox::warning(
this, windowTitle(),
146 tr(
"The entered address \"%1\" is already in the contract book.").arg(
ui->
addressEdit->text()),
147 QMessageBox::Ok, QMessageBox::Ok);
159 std::string json_data =
ui->
ABIEdit->toPlainText().toStdString();
#define SetObjectStyleSheet(object, name)
EditContractInfoDialog(Mode mode, QWidget *parent=0)
bool isValidInterfaceABI()
Address already in contract book.
Dialog for editing a contract information.
void setABI(const QString &ABI)
QValidatedTextEdit * ABIEdit
QString addRow(const QString &label, const QString &address, const QString &abi)
void setupUi(QDialog *EditContractInfoDialog)
void setIsValidManually(bool value)
ContractTableModel * model
No changes were made during edit operation.
QString getAddress() const
void setEmptyIsValid(bool value)
~EditContractInfoDialog()
QDataWidgetMapper * mapper
QDialogButtonBox * buttonBox
void setModel(ContractTableModel *model)
Qt model of the contract book in the core.
void setCheckValidator(const QValidator *v)
bool isValidContractAddress()
bool loads(const std::string &json_data)
QValidatedLineEdit * addressEdit
ContractABI * m_contractABI
EditStatus getEditStatus() const
Ui::EditContractInfoDialog * ui
void setAddress(const QString &address)