void VarManager::changeBank(int row) { QPair<quint8, quint8> banks = banksFromRow(row); quint8 b = banks.first, b2 = banks.second; bank->setValue(b); liste2->blockSignals(true); QTreeWidgetItemIterator it(liste2); while(*it) { QTreeWidgetItem *item = *it; quint16 addressID = itemAddress(item); QString varName1 = local_var_names.value(addressID | (b << 8)), varName2 = local_var_names.value(addressID | (b2 << 8)), varName; if (varName1.isEmpty()) { varName = varName2; } else if (varName2.isEmpty()) { varName = varName1; } else { varName = QString("%1, %2").arg(varName1, varName2); } item->setText(1, varName); colorizeItem(item, FF7Var(b, addressID)); ++it; } fillForm(); liste2->blockSignals(false); }
personForm::personForm(sqlI *_db, Person *p, QWidget *parent) : QDialog(parent), addingNew(false), _person(p), ownPerson(true), db(_db) { createForm(); fillForm(); setWindowTitle(tr("Edit person")); btnSubmit->setText(tr("&Save")); }
contractForm::contractForm(sqlI *_db,Contract *c, QWidget *parent) : QDialog(parent),addingNew(false),db(_db),_contract(c),ownContract(true) { createForm(); fillForm(); setWindowTitle(tr("Edit contract")); btnSubmit->setText(tr("&Save")); }
TransakceForm::TransakceForm(sqlI *_db, Transakce *t, QWidget *parent) : db(_db),transakce(t), QDialog(parent), ui(new Ui::TransakceForm),addingNew(false),ownTransakce(true) { ui->setupUi(this); setWindowTitle(tr("Edit transaction")); ui->buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save); fillForm(); }
TransakceForm::TransakceForm(sqlI *_db, QWidget *parent) : db(_db), QDialog(parent), ui(new Ui::TransakceForm),addingNew(true),ownTransakce(false) { ui->setupUi(this); setWindowTitle(tr("Add transaction")); ui->buttonBox->setStandardButtons(QDialogButtonBox::Cancel); ui->buttonBox->addButton(tr("Insert"),QDialogButtonBox::AcceptRole); fillForm(); }
void NoteView::insertData(int ticketID, int agentID){ this->_controller->insertData(ticketID, agentID); fillForm(); int ticketsAgent = this->_controller->getAgentOfTicket(this->_controller->getCurrentTicket()); if (this->_controller->getCurrentAgent() != ticketsAgent){ this->ui->addButton->setEnabled(false); ui->addButton->setStyleSheet("QPushButton { background: grey; }"); this->ui->editButton->setEnabled(false); ui->editButton->setStyleSheet("QPushButton { background: grey; }"); this->ui->deleteButton->setEnabled(false); ui->deleteButton->setStyleSheet("QPushButton { background: grey; }"); } }
PortViewer::PortViewer(QWidget* parent) : QDialog(parent), ports((QSerialPortInfo::availablePorts())), lbPort(new QLabel("Port:", this)), cbPorts(new QComboBox(this)), pbSelect(new QPushButton("Select", this)), lbManfLb(new QLabel("Manufacturer:", this)), lbDescLb(new QLabel("Description:", this)), lbBusyLb(new QLabel("Busy:", this)), lbManf(new QLabel(this)), lbDesc(new QLabel(this)), lbBusy(new QLabel(this)) { initForm(); initWigets(); initConnect(); fillForm(); }
VarManager::VarManager(FieldArchive *fieldArchive, QWidget *parent) : QWidget(parent, Qt::Tool) { setWindowTitle(tr("Gestionnaire de variables")); QFont font; font.setPointSize(8); QGridLayout *globalLayout = new QGridLayout(this); QHBoxLayout *layout1 = new QHBoxLayout(); bank = new QSpinBox(this); bank->setRange(1,15); adress = new QSpinBox(this); adress->setRange(0,255); name = new QLineEdit(this); name->setMaxLength(50); rename = new QPushButton(tr("Renommer"), this); layout1->addWidget(bank); layout1->addWidget(adress); layout1->addWidget(name); layout1->addWidget(rename); QHBoxLayout *layout2 = new QHBoxLayout(); liste1 = new QListWidget(this); liste1->setFixedWidth(40); liste1->setFont(font); liste2 = new QTreeWidget(this); liste2->setColumnCount(4); liste2->setHeaderLabels(QStringList() << tr("Adresse") << tr("Surnom") << tr("Opération") << tr("Taille")); liste2->setIndentation(0); liste2->setItemsExpandable(false); liste2->setSortingEnabled(true); liste2->setFont(font); layout2->addWidget(liste1); layout2->addWidget(liste2); QHBoxLayout *layout3 = new QHBoxLayout(); searchButton = new QPushButton(tr("Adresses utilisées"), this); ok = new QPushButton(QApplication::style()->standardIcon(QStyle::SP_DialogSaveButton), tr("Enregistrer"), this); ok->setEnabled(false); layout3->addWidget(searchButton); layout3->addStretch(); layout3->addWidget(ok); globalLayout->addLayout(layout1, 0, 0); globalLayout->addLayout(layout2, 1, 0); globalLayout->addLayout(layout3, 2, 0); setFieldArchive(fieldArchive); local_var_names = Var::get(); fillList1(); fillList2(); liste1->setCurrentRow(0); liste2->setCurrentItem(liste2->topLevelItem(0)); changeBank(0); fillForm(); connect(bank, SIGNAL(valueChanged(int)), SLOT(scrollToList1(int))); connect(adress, SIGNAL(valueChanged(int)), SLOT(scrollToList2(int))); connect(liste1, SIGNAL(currentRowChanged(int)), SLOT(changeBank(int))); connect(liste2, SIGNAL(itemSelectionChanged()), SLOT(fillForm())); connect(name, SIGNAL(returnPressed()), SLOT(renameVar())); connect(rename, SIGNAL(released()), SLOT(renameVar())); connect(ok, SIGNAL(released()), SLOT(save())); connect(searchButton, SIGNAL(released()), SLOT(search())); adjustSize(); }