void AddresseeEditorWidget::nameButtonClicked() { // show the name dialog. NameEditDialog dialog( mAddressee, mFormattedNameType, mReadOnly, this ); if ( dialog.exec() ) { if ( dialog.changed() ) { mAddressee.setFamilyName( dialog.familyName() ); mAddressee.setGivenName( dialog.givenName() ); mAddressee.setPrefix( dialog.prefix() ); mAddressee.setSuffix( dialog.suffix() ); mAddressee.setAdditionalName( dialog.additionalName() ); mFormattedNameType = dialog.formattedNameType(); if ( mFormattedNameType == NameEditDialog::CustomName ) { mFormattedNameLabel->setText( dialog.customFormattedName() ); mAddressee.setFormattedName( dialog.customFormattedName() ); } // Update the name edit. bool block = mNameEdit->signalsBlocked(); mNameEdit->blockSignals( true ); mNameEdit->setText( mAddressee.assembledName() ); mNameEdit->blockSignals( block ); // Update the combo box. nameBoxChanged(); emitModified(); } } }
void AddresseeEditorWidget::nameTextChanged( const QString &text ) { // use the addressee class to parse the name for us AddresseeConfig config( mAddressee ); if ( config.automaticNameParsing() ) { if ( !mAddressee.formattedName().isEmpty() ) { QString fn = mAddressee.formattedName(); mAddressee.setNameFromString( text ); mAddressee.setFormattedName( fn ); } else { // use extra addressee to avoid a formatted name assignment Addressee addr; addr.setNameFromString( text ); mAddressee.setPrefix( addr.prefix() ); mAddressee.setGivenName( addr.givenName() ); mAddressee.setAdditionalName( addr.additionalName() ); mAddressee.setFamilyName( addr.familyName() ); mAddressee.setSuffix( addr.suffix() ); } } nameBoxChanged(); emitModified(); }
void AddresseeEditorWidget::organizationTextChanged( const QString &text ) { AddresseeConfig config( mAddressee ); if ( config.automaticNameParsing() ) mAddressee.setOrganization( text ); nameBoxChanged(); mAddressEditWidget->updateAddressee( mAddressee ); emitModified(); }
clientWid1::clientWid1(QWidget *parent) : QWidget(parent), ui(new Ui::clientWid1) { ipChanged = false; portChanged = false; nameChanged = false; ui->setupUi(this); connect(ui->ipBox,SIGNAL(textChanged(QString)),this,SLOT(ipBoxChanged())); connect(ui->portBox,SIGNAL(textChanged(QString)),this,SLOT(portBoxChanged())); connect(ui->nameBox,SIGNAL(textChanged(QString)),this,SLOT(nameBoxChanged())); connect(ui->connectButton,SIGNAL(pressed()),this,SLOT(sendButtonPushed())); }