summaryrefslogtreecommitdiffabout
path: root/kaddressbook/nameeditdialog.cpp
Unidiff
Diffstat (limited to 'kaddressbook/nameeditdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/nameeditdialog.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp
index fb7eb22..8213c2b 100644
--- a/kaddressbook/nameeditdialog.cpp
+++ b/kaddressbook/nameeditdialog.cpp
@@ -80,65 +80,65 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
80 layout->addWidget( label, 2, 0 ); 80 layout->addWidget( label, 2, 0 );
81 mAdditionalNameEdit = new KLineEdit( page ); 81 mAdditionalNameEdit = new KLineEdit( page );
82 label->setBuddy( mAdditionalNameEdit ); 82 label->setBuddy( mAdditionalNameEdit );
83 layout->addMultiCellWidget( mAdditionalNameEdit, 2, 2, 1, 2 ); 83 layout->addMultiCellWidget( mAdditionalNameEdit, 2, 2, 1, 2 );
84 84
85 label = new QLabel( i18n( "Family names:" ), page ); 85 label = new QLabel( i18n( "Family names:" ), page );
86 layout->addWidget( label, 3, 0 ); 86 layout->addWidget( label, 3, 0 );
87 mFamilyNameEdit = new KLineEdit( page ); 87 mFamilyNameEdit = new KLineEdit( page );
88 label->setBuddy( mFamilyNameEdit ); 88 label->setBuddy( mFamilyNameEdit );
89 layout->addMultiCellWidget( mFamilyNameEdit, 3, 3, 1, 2 ); 89 layout->addMultiCellWidget( mFamilyNameEdit, 3, 3, 1, 2 );
90 90
91 label = new QLabel( i18n( "Honorific suffixes:" ), page ); 91 label = new QLabel( i18n( "Honorific suffixes:" ), page );
92 layout->addWidget( label, 4, 0 ); 92 layout->addWidget( label, 4, 0 );
93 mSuffixCombo = new KComboBox( page ); 93 mSuffixCombo = new KComboBox( page );
94 mSuffixCombo->setDuplicatesEnabled( false ); 94 mSuffixCombo->setDuplicatesEnabled( false );
95 mSuffixCombo->setEditable( true ); 95 mSuffixCombo->setEditable( true );
96 label->setBuddy( mSuffixCombo ); 96 label->setBuddy( mSuffixCombo );
97 layout->addMultiCellWidget( mSuffixCombo, 4, 4, 1, 2 ); 97 layout->addMultiCellWidget( mSuffixCombo, 4, 4, 1, 2 );
98 98
99 mFormattedNameCombo = new KComboBox( page ); 99 mFormattedNameCombo = new KComboBox( page );
100 mFormattedNameCombo->setMaximumWidth(100); 100 mFormattedNameCombo->setMaximumWidth(100);
101 101
102 layout->addMultiCellWidget( mFormattedNameCombo, 5, 5, 0, 0 ); 102 layout->addMultiCellWidget( mFormattedNameCombo, 5, 5, 0, 0 );
103 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( typeChanged( int ) ) ); 103 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( typeChanged( int ) ) );
104 104
105 mFormattedNameEdit = new KLineEdit( page ); 105 mFormattedNameEdit = new KLineEdit( page );
106 mFormattedNameEdit->setEnabled( type == CustomName ); 106 mFormattedNameEdit->setEnabled( type == CustomName );
107 layout->addMultiCellWidget( mFormattedNameEdit, 5, 5, 1, 2 ); 107 layout->addMultiCellWidget( mFormattedNameEdit, 5, 5, 1, 2 );
108 108
109 mParseBox = new QCheckBox( i18n( "Parse name automatically" ), page ); 109 mParseBox = new QCheckBox( i18n( "Parse name automatically" ), page );
110 connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( parseBoxChanged(bool) ) ); 110 connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( parseBoxChanged(bool) ) );
111 connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) ); 111 connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) );
112 layout->addMultiCellWidget( mParseBox, 6, 6, 0, 1 ); 112 layout->addMultiCellWidget( mParseBox, 6, 6, 0, 2 );
113 113
114 // Fill in the values 114 // Fill in the values
115 mFamilyNameEdit->setText( addr.familyName() ); 115 mFamilyNameEdit->setText( addr.familyName() );
116 mGivenNameEdit->setText( addr.givenName() ); 116 mGivenNameEdit->setText( addr.givenName() );
117 mAdditionalNameEdit->setText( addr.additionalName() ); 117 mAdditionalNameEdit->setText( addr.additionalName() );
118 mFormattedNameEdit->setText( addr.formattedName() ); 118 mFormattedNameEdit->setText( addr.formattedName() );
119 119
120 // Prefix and suffix combos 120 // Prefix and suffix combos
121//US KConfig config( "kabcrc" ); 121//US KConfig config( "kabcrc" );
122 KConfig config( locateLocal("config", "kabcrc") ); 122 KConfig config( locateLocal("config", "kabcrc") );
123 config.setGroup( "General" ); 123 config.setGroup( "General" );
124 124
125 QStringList sTitle; 125 QStringList sTitle;
126 sTitle += i18n( "Dr." ); 126 sTitle += i18n( "Dr." );
127 sTitle += i18n( "Miss" ); 127 sTitle += i18n( "Miss" );
128 sTitle += i18n( "Mr." ); 128 sTitle += i18n( "Mr." );
129 sTitle += i18n( "Mrs." ); 129 sTitle += i18n( "Mrs." );
130 sTitle += i18n( "Ms." ); 130 sTitle += i18n( "Ms." );
131 sTitle += i18n( "Prof." ); 131 sTitle += i18n( "Prof." );
132 sTitle += config.readListEntry( "Prefixes" ); 132 sTitle += config.readListEntry( "Prefixes" );
133 sTitle.sort(); 133 sTitle.sort();
134 134
135 QStringList sSuffix; 135 QStringList sSuffix;
136 sSuffix += i18n( "I" ); 136 sSuffix += i18n( "I" );
137 sSuffix += i18n( "II" ); 137 sSuffix += i18n( "II" );
138 sSuffix += i18n( "III" ); 138 sSuffix += i18n( "III" );
139 sSuffix += i18n( "Jr." ); 139 sSuffix += i18n( "Jr." );
140 sSuffix += i18n( "Sr." ); 140 sSuffix += i18n( "Sr." );
141 sSuffix += config.readListEntry( "Suffixes" ); 141 sSuffix += config.readListEntry( "Suffixes" );
142 sSuffix.sort(); 142 sSuffix.sort();
143 143
144 mPrefixCombo->insertStringList( sTitle ); 144 mPrefixCombo->insertStringList( sTitle );
@@ -146,68 +146,65 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
146 146
147#ifndef KAB_EMBEDDED 147#ifndef KAB_EMBEDDED
148 mPrefixCombo->setCurrentText( addr.prefix() ); 148 mPrefixCombo->setCurrentText( addr.prefix() );
149 mSuffixCombo->setCurrentText( addr.suffix() ); 149 mSuffixCombo->setCurrentText( addr.suffix() );
150#else //KAB_EMBEDDED 150#else //KAB_EMBEDDED
151 mPrefixCombo->setEditText( addr.prefix() ); 151 mPrefixCombo->setEditText( addr.prefix() );
152 mSuffixCombo->setEditText( addr.suffix() ); 152 mSuffixCombo->setEditText( addr.suffix() );
153#endif //KAB_EMBEDDED 153#endif //KAB_EMBEDDED
154 154
155 AddresseeConfig::instance()->setUid( addr.uid() ); 155 AddresseeConfig::instance()->setUid( addr.uid() );
156 mParseBox->setChecked( AddresseeConfig::instance()->automaticNameParsing() ); 156 mParseBox->setChecked( AddresseeConfig::instance()->automaticNameParsing() );
157 157
158#ifndef KAB_EMBEDDED 158#ifndef KAB_EMBEDDED
159 KAcceleratorManager::manage( this ); 159 KAcceleratorManager::manage( this );
160#endif //KAB_EMBEDDED 160#endif //KAB_EMBEDDED
161 161
162 connect( mPrefixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); 162 connect( mPrefixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
163 connect( mPrefixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); 163 connect( mPrefixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
164 connect( mGivenNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); 164 connect( mGivenNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
165 connect( mGivenNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); 165 connect( mGivenNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
166 connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); 166 connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
167 connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); 167 connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
168 connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); 168 connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
169 connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); 169 connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
170 connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); 170 connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
171 connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); 171 connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
172 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( modified() ) ); 172 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( modified() ) );
173 connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); 173 connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
174 174
175 updateTypeCombo(); 175 updateTypeCombo();
176 mFormattedNameCombo->setCurrentItem( type ); 176 mFormattedNameCombo->setCurrentItem( type );
177 177
178#ifdef KAB_EMBEDDED 178
179 resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300));
180#endif //KAB_EMBEDDED
181
182 mChanged = false; 179 mChanged = false;
183} 180}
184 181
185NameEditDialog::~NameEditDialog() 182NameEditDialog::~NameEditDialog()
186{ 183{
187} 184}
188 185
189QString NameEditDialog::familyName() const 186QString NameEditDialog::familyName() const
190{ 187{
191 return mFamilyNameEdit->text(); 188 return mFamilyNameEdit->text();
192} 189}
193 190
194QString NameEditDialog::givenName() const 191QString NameEditDialog::givenName() const
195{ 192{
196 return mGivenNameEdit->text(); 193 return mGivenNameEdit->text();
197} 194}
198 195
199QString NameEditDialog::prefix() const 196QString NameEditDialog::prefix() const
200{ 197{
201 return mPrefixCombo->currentText(); 198 return mPrefixCombo->currentText();
202} 199}
203 200
204QString NameEditDialog::suffix() const 201QString NameEditDialog::suffix() const
205{ 202{
206 return mSuffixCombo->currentText(); 203 return mSuffixCombo->currentText();
207} 204}
208 205
209QString NameEditDialog::additionalName() const 206QString NameEditDialog::additionalName() const
210{ 207{
211 return mAdditionalNameEdit->text(); 208 return mAdditionalNameEdit->text();
212} 209}
213 210