-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 0c90510..66e94ef 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -171,352 +171,352 @@ void ContactEditor::init() { // slDynamicEntries->remove( it ); continue; } if ( *it == tr( "Gender" ) ) { hasGender = TRUE; // slDynamicEntries->remove( it ); continue; } if ( *it == tr( "Job Title" ) ) { hasTitle = TRUE; // slDynamicEntries->remove( it ); continue; } if ( *it == tr( "Company" ) ) { hasCompany = TRUE; // slDynamicEntries->remove( it ); continue; } if ( *it == tr( "Notes" ) ) { hasNotes = TRUE; // slDynamicEntries->remove( it ); continue; } if ( *it == tr( "Groups" ) ) { // slDynamicEntries->remove( it ); continue; } if ( (*it).right( 6 ) == tr( "Street" ) ) { hasStreet = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it).right( 8 ) == tr( "Street 2" ) ) { hasStreet2 = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it).right( 8 ) == tr( "P.O. Box" ) ) { hasPOBox = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it).right( 4 ) == tr( "City" ) ) { hasCity = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it).right( 5 ) == tr( "State" ) ) { hasState = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it).right( 3 ) == tr( "Zip" ) ) { hasZip = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it).right( 7 ) == tr( "Country" ) ) { hasCountry = TRUE; // slDynamicEntries->remove( it ); continue; } slDynamicEntries->append( *it ); } } QVBoxLayout *vb = new QVBoxLayout( this ); tabMain = new QTabWidget( this ); vb->addWidget( tabMain ); QWidget *tabViewport = new QWidget ( tabMain ); vb = new QVBoxLayout( tabViewport ); svGeneral = new QScrollView( tabViewport ); vb->addWidget( svGeneral, 0, 0 ); svGeneral->setResizePolicy( QScrollView::AutoOneFit ); svGeneral->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( svGeneral->viewport() ); svGeneral->addChild( container ); - QGridLayout *gl = new QGridLayout( container ); + QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 3 ); gl->setResizeMode( QLayout::FreeResize ); btnFullName = new QPushButton( tr( "Full Name..." ), container ); gl->addWidget( btnFullName, 0, 0 ); txtFullName = new QLineEdit( container ); gl->addWidget( txtFullName, 0, 1 ); QLabel *l = new QLabel( tr( "Job Title" ), container ); gl->addWidget( l, 1, 0 ); txtJobTitle = new QLineEdit( container ); gl->addWidget( txtJobTitle, 1, 1 ); l = new QLabel( tr( "Organization" ), container ); gl->addWidget( l, 2, 0 ); txtOrganization = new QLineEdit( container ); gl->addWidget( txtOrganization, 2, 1 ); cmbChooserField1 = new QComboBox( FALSE, container ); cmbChooserField1->setMaximumWidth( 100 ); gl->addWidget( cmbChooserField1, 3, 0 ); txtChooserField1 = new QLineEdit( container ); gl->addWidget( txtChooserField1, 3, 1 ); cmbChooserField2 = new QComboBox( FALSE, container ); cmbChooserField2->setMaximumWidth( 100 ); gl->addWidget( cmbChooserField2, 4, 0 ); txtChooserField2 = new QLineEdit( container ); gl->addWidget( txtChooserField2, 4, 1 ); cmbChooserField3 = new QComboBox( FALSE, container ); cmbChooserField3->setMaximumWidth( 100 ); gl->addWidget( cmbChooserField3, 5, 0 ); txtChooserField3 = new QLineEdit( container ); gl->addWidget( txtChooserField3, 5, 1 ); l = new QLabel( tr( "File As" ), container ); gl->addWidget( l, 6, 0 ); cmbFileAs = new QComboBox( TRUE, container ); gl->addWidget( cmbFileAs, 6, 1 ); l = new QLabel( tr( "Category" ), container ); gl->addWidget( l, 7, 0 ); cmbCat = new CategorySelect( container ); gl->addWidget( cmbCat, 7, 1 ); btnNote = new QPushButton( tr( "Notes..." ), container ); gl->addWidget( btnNote, 8, 1 ); tabMain->insertTab( tabViewport, tr( "General" ) ); tabViewport = new QWidget ( tabMain ); vb = new QVBoxLayout( tabViewport ); svAddress = new QScrollView( tabViewport ); vb->addWidget( svAddress, 0, 0 ); svAddress->setResizePolicy( QScrollView::AutoOneFit ); svAddress->setFrameStyle( QFrame::NoFrame ); container = new QWidget( svAddress->viewport() ); svAddress->addChild( container ); - gl = new QGridLayout( container, 5, 3, 0, 1 ); + gl = new QGridLayout( container, 5, 3, 2, 3 ); cmbAddress = new QComboBox( FALSE, container ); cmbAddress->insertItem( tr( "Business" ) ); cmbAddress->insertItem( tr( "Home" ) ); gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); l = new QLabel( tr( "Address" ), container ); gl->addWidget( l, 1, 0 ); txtAddress = new QLineEdit( container ); gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); /* l = new QLabel( tr( "Address 2" ), container ); gl->addWidget( l, 2, 0 ); txtAddress2 = new QLineEdit( container ); gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 ); l = new QLabel( tr( "P.O. Box" ), container ); gl->addWidget( l, 3, 0 ); txtPOBox = new QLineEdit( container ); gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 ); */ l = new QLabel( tr( "City" ), container ); gl->addWidget( l, 2, 0 ); txtCity = new QLineEdit( container ); gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); l = new QLabel( tr( "State" ), container ); gl->addWidget( l, 3, 0 ); txtState = new QLineEdit( container ); gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); l = new QLabel( tr( "Zip Code" ), container ); gl->addWidget( l, 4, 0 ); txtZip = new QLineEdit( container ); gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); l = new QLabel( tr( "Country" ), container ); gl->addWidget( l, 5, 0 ); cmbCountry = new QComboBox( TRUE, container ); cmbCountry->insertItem( tr( "" ) ); cmbCountry->insertItem( tr( "United States" ) ); cmbCountry->insertItem( tr( "United Kingdom" ) ); cmbCountry->insertItem( tr( "Japan" ) ); cmbCountry->insertItem( tr( "France" ) ); cmbCountry->insertItem( tr( "Germany" ) ); cmbCountry->insertItem( tr( "Norway" ) ); cmbCountry->insertItem( tr( "Canada" ) ); gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); tabMain->insertTab( tabViewport, tr( "Address" ) ); tabViewport = new QWidget ( tabMain ); vb = new QVBoxLayout( tabViewport ); svDetails = new QScrollView( tabViewport ); vb->addWidget( svDetails, 0, 0 ); svDetails->setResizePolicy( QScrollView::AutoOneFit ); svDetails->setFrameStyle( QFrame::NoFrame ); container = new QWidget( svDetails->viewport() ); svDetails->addChild( container ); - gl = new QGridLayout( container, 1, 2, 0, 1 ); + gl = new QGridLayout( container, 1, 2, 2, 3 ); QStringList::ConstIterator it = slDynamicEntries->begin(); for (i = 0; it != slDynamicEntries->end(); i++, ++it) { l = new QLabel( *it, container ); listName.append( l ); gl->addWidget( l, i, 0 ); QLineEdit *e = new QLineEdit( container ); listValue.append( e ); gl->addWidget( e, i, 1); } l = new QLabel( tr("Gender"), container ); gl->addWidget( l, slDynamicEntries->count(), 0 ); cmbGender = new QComboBox( container ); cmbGender->insertItem( "", 0 ); cmbGender->insertItem( tr("Male"), 1); cmbGender->insertItem( tr("Female"), 2); gl->addWidget( cmbGender, slDynamicEntries->count(), 1 ); tabMain->insertTab( tabViewport, tr( "Details" ) ); dlgNote = new QDialog( this, "Note Dialog", TRUE ); dlgNote->setCaption( tr("Enter Note") ); QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); txtNote = new QMultiLineEdit( dlgNote ); vbNote->addWidget( txtNote ); connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); dlgName = new QDialog( this, "Name Dialog", TRUE ); dlgName->setCaption( tr("Edit Name") ); - gl = new QGridLayout( dlgName, 4, 2, 0, 1 ); + gl = new QGridLayout( dlgName, 4, 2, 2, 3 ); l = new QLabel( tr("First Name"), dlgName ); gl->addWidget( l, 0, 0 ); txtFirstName = new QLineEdit( dlgName ); gl->addWidget( txtFirstName, 0, 1 ); l = new QLabel( tr("Middle Name"), dlgName ); gl->addWidget( l, 1, 0 ); txtMiddleName = new QLineEdit( dlgName ); gl->addWidget( txtMiddleName, 1, 1 ); l = new QLabel( tr("Last Name"), dlgName ); gl->addWidget( l, 2, 0 ); txtLastName = new QLineEdit( dlgName ); gl->addWidget( txtLastName, 2, 1 ); l = new QLabel( tr("Suffix"), dlgName ); gl->addWidget( l, 3, 0 ); txtSuffix = new QLineEdit( dlgName ); gl->addWidget( txtSuffix, 3, 1 ); cmbChooserField1->insertStringList( *slChooserNames ); cmbChooserField2->insertStringList( *slChooserNames ); cmbChooserField3->insertStringList( *slChooserNames ); cmbChooserField1->setCurrentItem( 1 ); cmbChooserField2->setCurrentItem( 2 ); cmbChooserField3->setCurrentItem( 3 ); connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) ); connect( txtChooserField2, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser2Change(const QString &)) ); connect( txtChooserField3, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser3Change(const QString &)) ); connect( txtAddress, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddressChange(const QString &)) ); //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); connect( txtCity, SIGNAL(textChanged(const QString &)), this, SLOT(slotCityChange(const QString &)) ); connect( txtState, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChange(const QString &)) ); connect( txtZip, SIGNAL(textChanged(const QString &)), this, SLOT(slotZipChange(const QString &)) ); connect( cmbCountry, SIGNAL(textChanged(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); connect( cmbCountry, SIGNAL(activated(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); connect( cmbChooserField1, SIGNAL(activated(int)), this, SLOT(slotCmbChooser1Change(int)) ); connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) ); connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) ); connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) ); new QPEDialogListener(this); } void ContactEditor::initMap() { /* // since the fields and the XML fields exist, create a map // between them... Config cfg1( "AddressBook" ); Config cfg2( "AddressBook" ); QString strCfg1, strCfg2; int i; // This stuff better exist... cfg1.setGroup( "AddressFields" ); o cfg2.setGroup( "XMLFields" ); i = 0; strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), QString::null ); while ( !strCfg1.isNull() && !strCfg2.isNull() ) { mapField.insert( strCfg1, strCfg2 ); strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), QString::null ); } */ } void ContactEditor::slotChooser1Change( const QString &textChanged ) { int index = cmbChooserField1->currentItem(); (*slChooserValues)[index] = textChanged; } void ContactEditor::slotChooser2Change( const QString &textChanged ) { int index = cmbChooserField2->currentItem(); (*slChooserValues)[index] = textChanged; } void ContactEditor::slotChooser3Change( const QString &textChanged ) { |