void PreferenceEditorFrame::on_modulePreferencesToolButton_clicked() { on_cancelButton_clicked(); if (module_) { QString module_name = module_->name; emit showProtocolPreferences(module_name); } }
void FilterExpressionFrame::addExpression(const QString filter_text) { if (isVisible()) { on_cancelButton_clicked(); return; } ui->labelLineEdit->setText(tr("Apply this filter")); ui->displayFilterLineEdit->setText(filter_text); }
void FilterExpressionFrame::on_okButton_clicked() { QByteArray label_ba = ui->labelLineEdit->text().toUtf8(); QByteArray expr_ba = ui->displayFilterLineEdit->text().toUtf8(); filter_expression_new(label_ba.constData(), expr_ba.constData(), TRUE); on_cancelButton_clicked(); emit filterExpressionsChanged(); prefs_main_write(); }
void PreferenceEditorFrame::on_okButton_clicked() { bool apply = false; switch(pref_->type) { case PREF_UINT: if (pref_->stashed_val.uint != new_uint_) { pref_->stashed_val.uint = new_uint_; apply = true; } break; case PREF_STRING: if (new_str_.compare(pref_->stashed_val.string) != 0) { g_free(pref_->stashed_val.string); pref_->stashed_val.string = qstring_strdup(new_str_); apply = true; } break; case PREF_RANGE: if (!ranges_are_equal(pref_->stashed_val.range, new_range_)) { g_free(pref_->stashed_val.range); pref_->stashed_val.range = range_copy(new_range_); apply = true; } break; default: break; } if (apply && module_) { pref_unstash(pref_, &module_->prefs_changed); prefs_apply(module_); if (!prefs.gui_use_pref_save) { prefs_main_write(); } } on_cancelButton_clicked(); // Emit signals once UI is hidden if (apply) { wsApp->emitAppSignal(WiresharkApplication::PacketDissectionChanged); wsApp->emitAppSignal(WiresharkApplication::PreferencesChanged); } }
void ChangePassword::on_okButton_clicked() { bool passCheck = false, oldPassCheck = false; QMessageBox *popUpBox =new QMessageBox(this); QByteArray hash, newPassHash; QCryptographicHash crypto(QCryptographicHash::Sha1); hash = crypto.hash(ui->oldPasswordEdit->text().toUtf8(), QCryptographicHash::Sha1); int i = 0; while (records.at(i).name != mName) //move i to correct record ++i; if (records.at(i).digest != hash) { popUpBox->setText("Old password does not match, please re-enter"); popUpBox->exec(); oldPassCheck = false; } else oldPassCheck = true; if (ui->passwordEdit->text() != ui->rPasswordEdit->text() && oldPassCheck) { //do not check until old password is correct popUpBox->setText("Passwords do not match, please re-enter"); popUpBox->exec(); passCheck = false; } else if (ui->passwordEdit->text().length() == 0 && oldPassCheck) { popUpBox->setText("Your password must be at least 1 character"); popUpBox->exec(); passCheck = false; } else passCheck = true; if (oldPassCheck && passCheck) { newPassHash = crypto.hash(ui->passwordEdit->text().toUtf8(), QCryptographicHash::Sha1); records[i].digest = newPassHash; records[i].color = ui->colorComboBox->currentText(); on_cancelButton_clicked(); //use this slot to return to welcome screen } }
int InsuranceConfig::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: on_optionButton_clicked(); break; case 1: on_cancelButton_clicked(); break; case 2: saveInsurance(); break; case 3: loadInsurance(); break; case 4: createActions(); break; case 5: AboutApp(); break; case 6: ExitApp(); break; case 7: { QString _r = defaultText((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3])),(*reinterpret_cast< QString(*)>(_a[4]))); if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; } break; default: ; } _id -= 8; } return _id; }
WaitingGroupBox::WaitingGroupBox(QWidget *parent): QGroupBox(parent), waitingLabel(new QLabel(this)), cancelButton(new QPushButton(this)) { this->waitingLabel->setText("正在登录"); this->cancelButton->setText("取消"); QFont font = this->waitingLabel->font(); font.setPointSize(10); this->waitingLabel->setFont(font); this->waitingLabel->setGeometry(170, 100, 80, 30); this->cancelButton->setGeometry(175, 160, 50, 30); this->setGeometry(0, 0, 400, 280); this->hide(); this->setTabOrder(this->cancelButton, this->cancelButton); connect(this->cancelButton, SIGNAL(clicked()), this, SLOT(on_cancelButton_clicked())); }
void FilterExpressionFrame::on_filterExpressionPreferencesToolButton_clicked() { on_cancelButton_clicked(); emit showPreferencesDialog(PreferencesDialog::ppFilterExpressions); }
ProductDetailsWidget::ProductDetailsWidget(QWidget *parent, DatabaseManager *database) : QDialog(parent) { numberOfErrors = 0; error = 0; db = database; productNameLabel = new QLabel(trUtf8("Terméknév")); ownPartNumberLabel = new QLabel(trUtf8("Saját cikkszám")); foreignPartNumberLabel = new QLabel(trUtf8("Idegen cikkszám")); descriptionLabel = new QLabel(trUtf8("Termékleírás")); categoryLabel = new QLabel(trUtf8("Kategória")); categorySub1Label = new QLabel(trUtf8("Alkategória 1")); categorySub2Label = new QLabel(trUtf8("Alkategória 2")); packageUnitLabel = new QLabel(trUtf8("Csomagolási egység")); weightLabel = new QLabel(trUtf8("Súly (kg)")); purchasePriceLabel = new QLabel(trUtf8("Beszerzési ár (HUF)")); priceLabel = new QLabel(trUtf8("Ár (HUF)")); profitMarginLabel = new QLabel(trUtf8("Haszonkulcs")); discountLabel = new QLabel(trUtf8("Akció (%)")); discountValueLabel = new QLabel(trUtf8("Akció (%)")); discountedPriceLabel = new QLabel(trUtf8("Akciós ár (HUF)")); productNameLineEdit = new QLineEdit; ownProductIdLineEdit = new QLineEdit; foreignProductIdLineEdit = new QLineEdit; categoryComboBox = new QComboBox; categoryComboBox->setEditable(false); categorySub1ComboBox = new QComboBox; categorySub2ComboBox = new QComboBox; categoryComboBox->setModel(&categoryListModel); categorySub1ComboBox->setModel(&categorySub1ListModel); categorySub2ComboBox->setModel(&categorySub2ListModel); descriptionTextEdit = new QTextEdit; descriptionTextEdit->setFixedHeight(100); descriptionTextEdit->setAcceptRichText(false); packageUnitLineEdit = new QLineEdit; weightSpinBox = new QDoubleSpinBox; //weightSpinBox->setMaximum(200); weightSpinBox->setMinimum(0); // weightSpinBox->setSuffix(" kg"); purchasePriceSpinBox = new QDoubleSpinBox; purchasePriceSpinBox->setMaximum(999999.99); purchasePriceSpinBox->setMinimum(0); // purchasePriceSpinBox->setSuffix(" Ft"); roundingUpButton = new QPushButton("Kerekítés"); //QRegExp numberRegExp("[1-9]\\.?[0-9]{0,6}"); //ownPartNumberLineEdit->setValidator((new QRegExpValidator(numberRegExp, this))); //priceLineEdit->setValidator(new QRegExpValidator(numberRegExp, this)); priceSpinBox = new QDoubleSpinBox; // priceSpinBox->setSuffix(" Ft"); priceSpinBox->setMaximum(999999.99); priceSpinBox->setMinimum(0.00); profitMarginSpinBox = new QDoubleSpinBox; profitMarginSpinBox->setSuffix("%"); profitMarginSpinBox->setMaximum(999999.99); profitMarginSpinBox->setMinimum(-100.00); //profitMarginSpinBox->setDecimals(2); discountCheckBox = new QCheckBox; discountValueSpinBox = new QSpinBox; discountValueSpinBox->setMaximum(99); discountValueSpinBox->setMinimum(0); // discountValueSpinBox->setSuffix("%"); discountValueSpinBox->setMinimumWidth(50); discountedPriceSpinBox = new QDoubleSpinBox; discountedPriceSpinBox->setMaximum(999999.99); discountedPriceSpinBox->setMinimum(0.00); okButton = new QPushButton("Ok"); cancelButton = new QPushButton("Cancel"); errorDescriptionLabel = new QLabel; errorDescriptionLabel->setText(""); errorDescriptionLabel->setStyleSheet("QLabel { color : red; }"); errorIcon = new QLabel; errorIcon->setPixmap(QPixmap(":/images/error_icon.png").scaledToHeight(30, Qt::SmoothTransformation)); //QMetaObject::connectSlotsByName(this); buttonHLayout = new QHBoxLayout; buttonHLayout->addWidget(okButton); buttonHLayout->addWidget(cancelButton); productGridLayout = new QGridLayout; int rowNum = 0; productGridLayout->addWidget(productNameLabel, rowNum, 0); productGridLayout->addWidget(productNameLineEdit, rowNum++, 1); productGridLayout->addWidget(ownPartNumberLabel, rowNum, 0); productGridLayout->addWidget(ownProductIdLineEdit, rowNum++, 1); productGridLayout->addWidget(foreignPartNumberLabel, rowNum, 0); productGridLayout->addWidget(foreignProductIdLineEdit, rowNum++, 1); productGridLayout->addWidget(categoryLabel, rowNum, 0); productGridLayout->addWidget(categoryComboBox, rowNum++, 1); productGridLayout->addWidget(categorySub1Label, rowNum, 0); productGridLayout->addWidget(categorySub1ComboBox, rowNum++, 1); productGridLayout->addWidget(categorySub2Label, rowNum, 0); productGridLayout->addWidget(categorySub2ComboBox, rowNum++, 1); categorySub1Label->setHidden(true); categorySub1ComboBox->setHidden(true); categorySub2Label->setHidden(true); categorySub2ComboBox->setHidden(true); productGridLayout->addWidget(descriptionLabel, rowNum, 0); productGridLayout->addWidget(descriptionTextEdit, rowNum++, 1); productGridLayout->addWidget(packageUnitLabel, rowNum, 0); productGridLayout->addWidget(packageUnitLineEdit, rowNum++, 1); productGridLayout->addWidget(weightLabel, rowNum, 0); productGridLayout->addWidget(weightSpinBox, rowNum++, 1); priceGridLayout = new QGridLayout; rowNum = 0; priceGridLayout->addWidget(purchasePriceLabel, rowNum, 0); priceGridLayout->addWidget(purchasePriceSpinBox, rowNum++, 1); //priceGridLayout->addWidget(roundingUpButton, rowNum++, 1); priceGridLayout->addWidget(profitMarginLabel, rowNum, 0); priceGridLayout->addWidget(profitMarginSpinBox, rowNum++, 1); priceGridLayout->addWidget(priceLabel, rowNum, 0); priceGridLayout->addWidget(priceSpinBox, rowNum++, 1); /* discountHLayout = new QHBoxLayout; discountHLayout->addWidget(discountValueSpinBox); discountHLayout->addSpacing(10); //discountLayout->addWidget(discountValueLabel); discountHLayout->addWidget(discountCheckBox, 0, Qt::AlignHCenter); discountHLayout->addStretch(); //priceGridLayout->addWidget(discountLabel, rowNum, 0); //priceGridLayout->addLayout(discountLayout, rowNum++, 1); priceGridLayout->addWidget(discountValueLabel, rowNum, 1); priceGridLayout->addWidget(discountValueSpinBox, rowNum++, ); //priceGridLayout->addWidget(discountedPriceLabel, rowNum, 0); //priceGridLayout->addWidget(discountedPriceSpinBox, rowNum++, 1); */ //priceGridLayout->addWidget(errorDescriptionLabel, rowNum++, 0, 1, 2, Qt::AlignLeft); //priceGridLayout->addLayout(buttonHLayout, rowNum, 1, 2, 1, Qt::AlignBottom); QGroupBox *productGroupBox = new QGroupBox(trUtf8("Termék")); QGroupBox *priceGroupBox = new QGroupBox(trUtf8("Ár")); productGroupBox->setLayout(productGridLayout); priceGroupBox->setLayout(priceGridLayout); mainVLayout = new QVBoxLayout; mainVLayout->addWidget(productGroupBox); mainVLayout->addWidget(priceGroupBox); mainVLayout->addWidget(errorDescriptionLabel); mainVLayout->addLayout(buttonHLayout); this->setLayout(mainVLayout); //this->setFixedSize(this->sizeHint()); connect(okButton, SIGNAL(clicked()), this, SLOT(on_okButton_clicked())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(on_cancelButton_clicked())); connect(categoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentCategoryChange(int))); connect(categorySub1ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentCategorySub1Change(int))); connect(purchasePriceSpinBox, SIGNAL(editingFinished()), this, SLOT(on_purchasePriceSpinBox_valueChanged())); connect(profitMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(on_profitMarginSpinBox_valueChanged())); connect(priceSpinBox, SIGNAL(valueChanged(double)), this, SLOT(on_priceSpinBox_valueChanged())); connect(roundingUpButton, SIGNAL(clicked()), this, SLOT(on_roundingUpButton_clicked())); connect(discountCheckBox, SIGNAL(toggled(bool)), this, SLOT(on_discountCheckBox_toggled(bool))); }
void SettingsMenu::closeEvent(QCloseEvent* e) { on_cancelButton_clicked(); e->accept(); }
void BiliNameDialog::on_xButton_clicked() { on_cancelButton_clicked(); }