userDialog_t::userDialog_t(userInfo_t& ui, QWidget* p) : QDialog(p) { QString type("Edit User"); initWidget(type); signed int didx(-1); signed int aidx(-1); m_username->setText(ui.username); m_password->setText(ui.password); m_name->setText(ui.name); m_email->setText(ui.email); m_phone->setText(ui.phone); m_street->setText(ui.street); m_city->setText(ui.city); m_state->setText(ui.state); m_country->setText(ui.country); m_postal->setText(ui.postal); didx = m_domain->findText(ui.domain, Qt::MatchExactly); aidx = m_algorithm->findText(ui.algorithm, Qt::MatchExactly); if (-1 != didx) m_domain->setCurrentIndex(didx); if (-1 != aidx) m_algorithm->setCurrentIndex(aidx); m_domain->setDisabled(true); m_oldUser = ui; QObject::connect(m_buttons, SIGNAL(accepted()), this, SLOT(acceptEdit())); QObject::connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject())); return; }
void EditorColorDialog::applyColor() { QColorDialog color_dlg; color_dlg.setCurrentColor(current_); if (color_dlg.exec() == QDialog::Accepted) { current_ = color_dlg.currentColor(); emit acceptEdit(index_); } }
void EditorFileDialog::applyFilename() { QString file; if (mode_ == Directory) { file = WiresharkFileDialog::getExistingDirectory(this, caption_, directory_, options_); } else { file = WiresharkFileDialog::getOpenFileName(this, caption_, directory_, filter_, NULL, options_); } if (!file.isEmpty()) { setText(file); emit acceptEdit(index_); } }