author | zautrix <zautrix> | 2005-02-17 10:52:04 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-17 10:52:04 (UTC) |
commit | 002e4f8cea2352e4b9a046b98f66be946fbeb5fc (patch) (unidiff) | |
tree | 7dde06f92ed54ec8ee40e68eaa312d2a2d379fb1 /kmicromail | |
parent | ec18172021a9adc0f6fa1fe80aec71e9a905a351 (diff) | |
download | kdepimpi-002e4f8cea2352e4b9a046b98f66be946fbeb5fc.zip kdepimpi-002e4f8cea2352e4b9a046b98f66be946fbeb5fc.tar.gz kdepimpi-002e4f8cea2352e4b9a046b98f66be946fbeb5fc.tar.bz2 |
desktop fix
-rw-r--r-- | kmicromail/composemail.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 3231b45..7b609fc 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -28,257 +28,264 @@ | |||
28 | #include <libmailwrapper/mailtypes.h> | 28 | #include <libmailwrapper/mailtypes.h> |
29 | 29 | ||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | //#include <opie2/ofiledialog.h> | 31 | //#include <opie2/ofiledialog.h> |
32 | //#include <opie2/odebug.h> | 32 | //#include <opie2/odebug.h> |
33 | #include <kfiledialog.h> | 33 | #include <kfiledialog.h> |
34 | //#include <qpe/resource.h> | 34 | //#include <qpe/resource.h> |
35 | #include <qpe/global.h> | 35 | #include <qpe/global.h> |
36 | //#include <qpe/contact.h> | 36 | //#include <qpe/contact.h> |
37 | 37 | ||
38 | 38 | ||
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | #include <qiconset.h> | 41 | #include <qiconset.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qmultilineedit.h> | 45 | #include <qmultilineedit.h> |
46 | #include <qlabel.h> | 46 | #include <qlabel.h> |
47 | #include <qtabwidget.h> | 47 | #include <qtabwidget.h> |
48 | #include <qlistview.h> | 48 | #include <qlistview.h> |
49 | 49 | ||
50 | //using namespace Opie::Core; | 50 | //using namespace Opie::Core; |
51 | //using namespace Opie::Ui; | 51 | //using namespace Opie::Ui; |
52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) | 52 | ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) |
53 | : ComposeMailUI( parent, name, modal ) | 53 | : ComposeMailUI( parent, name, modal ) |
54 | { | 54 | { |
55 | 55 | ||
56 | mPickLineEdit = 0; | 56 | mPickLineEdit = 0; |
57 | mEncoding = KOPrefs::instance()->mCurrentCodeName; | 57 | mEncoding = KOPrefs::instance()->mCurrentCodeName; |
58 | //managed from opiemail now | 58 | //managed from opiemail now |
59 | //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 59 | //connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
60 | // this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 60 | // this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
61 | settings = sett; | 61 | settings = sett; |
62 | m_replyid = ""; | 62 | m_replyid = ""; |
63 | if ( KOPrefs::instance()->mUseKapi) { | 63 | if ( KOPrefs::instance()->mUseKapi) { |
64 | KConfig config( locateLocal("config", "kabcrc") ); | 64 | KConfig config( locateLocal("config", "kabcrc") ); |
65 | config.setGroup( "General" ); | 65 | config.setGroup( "General" ); |
66 | QString whoami_uid = config.readEntry( "WhoAmI" ); | 66 | QString whoami_uid = config.readEntry( "WhoAmI" ); |
67 | 67 | ||
68 | if ( whoami_uid.isEmpty() ) { | 68 | if ( whoami_uid.isEmpty() ) { |
69 | QMessageBox::information( 0, i18n( "Hint" ), | 69 | QMessageBox::information( 0, i18n( "Hint" ), |
70 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 70 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
71 | i18n( "Ok" ) ); | 71 | i18n( "Ok" ) ); |
72 | 72 | ||
73 | 73 | ||
74 | fillSettings(); | 74 | fillSettings(); |
75 | } else | 75 | } else |
76 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); | 76 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); |
77 | 77 | ||
78 | 78 | ||
79 | #ifdef DESKTOP_VERSION | 79 | #ifdef DESKTOP_VERSION |
80 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); | 80 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); |
81 | QStringList mails = con.emails(); | 81 | QStringList mails = con.emails(); |
82 | QString defmail = con.preferredEmail(); | 82 | QString defmail = con.preferredEmail(); |
83 | if ( mails.count() == 0) | 83 | if ( mails.count() == 0) |
84 | QMessageBox::information( 0, i18n( "Hint" ), | 84 | QMessageBox::information( 0, i18n( "Hint" ), |
85 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 85 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
86 | i18n( "Ok" ) ); | 86 | i18n( "Ok" ) ); |
87 | if (defmail.length()!=0) { | 87 | if (defmail.length()!=0) { |
88 | fromBox->insertItem(defmail); | 88 | fromBox->insertItem(defmail); |
89 | } | 89 | } |
90 | QStringList::ConstIterator sit = mails.begin(); | 90 | QStringList::ConstIterator sit = mails.begin(); |
91 | for (;sit!=mails.end();++sit) { | 91 | for (;sit!=mails.end();++sit) { |
92 | if ( (*sit)==defmail) | 92 | if ( (*sit)==defmail) |
93 | continue; | 93 | continue; |
94 | fromBox->insertItem((*sit)); | 94 | fromBox->insertItem((*sit)); |
95 | } | 95 | } |
96 | senderNameEdit->setText(con.formattedName()); | 96 | senderNameEdit->setText(con.formattedName()); |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | } else { | 99 | } else { |
100 | fillSettings(); | 100 | fillSettings(); |
101 | } | 101 | } |
102 | checkBoxLater->setChecked( KOPrefs::instance()->mSendLater ); | 102 | checkBoxLater->setChecked( KOPrefs::instance()->mSendLater ); |
103 | 103 | ||
104 | attList->addColumn( i18n( "Name" ) ); | 104 | attList->addColumn( i18n( "Name" ) ); |
105 | attList->addColumn( i18n( "Size" ) ); | 105 | attList->addColumn( i18n( "Size" ) ); |
106 | QList<Account> accounts = settings->getAccounts(); | 106 | QList<Account> accounts = settings->getAccounts(); |
107 | 107 | ||
108 | if ( QApplication::desktop()->width() < 320 ) | 108 | if ( QApplication::desktop()->width() < 320 ) |
109 | smtpAccountBox->setMaximumWidth( 80 ); | 109 | smtpAccountBox->setMaximumWidth( 80 ); |
110 | Account *it; | 110 | Account *it; |
111 | for ( it = accounts.first(); it; it = accounts.next() ) { | 111 | for ( it = accounts.first(); it; it = accounts.next() ) { |
112 | if ( it->getType()==MAILLIB::A_SMTP ) { | 112 | if ( it->getType()==MAILLIB::A_SMTP ) { |
113 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 113 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
114 | smtpAccountBox->insertItem( smtp->getAccountName() ); | 114 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
115 | smtpAccounts.append( smtp ); | 115 | smtpAccounts.append( smtp ); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 118 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
119 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); | 119 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); |
120 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); | 120 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); |
121 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); | 121 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); |
122 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); | 122 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); |
123 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); | 123 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); |
124 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); | 124 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); |
125 | mMail = 0; | 125 | mMail = 0; |
126 | warnAttach = true; | 126 | warnAttach = true; |
127 | QIconSet icon; | 127 | QIconSet icon; |
128 | //icon = SmallIcon("fileexport"); | 128 | //icon = SmallIcon("fileexport"); |
129 | icon = SmallIcon("filesave"); | 129 | icon = SmallIcon("filesave"); |
130 | SaveButton->setIconSet (icon ) ; | 130 | SaveButton->setIconSet (icon ) ; |
131 | if ( QApplication::desktop()->width() < 320 ) { | 131 | if ( QApplication::desktop()->width() < 320 ) { |
132 | SaveButton->setText ("") ; | 132 | SaveButton->setText ("") ; |
133 | SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; | 133 | SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; |
134 | } | 134 | } |
135 | else | 135 | else |
136 | SaveButton->setText (i18n("Save")); | 136 | SaveButton->setText (i18n("Save")); |
137 | #ifndef DESKTOP_VERSION | 137 | #ifndef DESKTOP_VERSION |
138 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); | 138 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); |
139 | QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); | 139 | QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); |
140 | QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); | 140 | QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); |
141 | #endif | 141 | #endif |
142 | message->setFont ( KOPrefs::instance()->mComposeFont ); | 142 | message->setFont ( KOPrefs::instance()->mComposeFont ); |
143 | message->setWordWrap (QMultiLineEdit::WidgetWidth); | 143 | message->setWordWrap (QMultiLineEdit::WidgetWidth); |
144 | if ( smtpAccounts.count() > 0 ) { | 144 | if ( smtpAccounts.count() > 0 ) { |
145 | fillValues( smtpAccountBox->currentItem() ); | 145 | fillValues( smtpAccountBox->currentItem() ); |
146 | } else { | 146 | } else { |
147 | QMessageBox::information( 0, i18n( "Problem" ), | 147 | QMessageBox::information( 0, i18n( "Problem" ), |
148 | i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), | 148 | i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), |
149 | i18n( "Ok" ) ); | 149 | i18n( "Ok" ) ); |
150 | return; | 150 | return; |
151 | } | 151 | } |
152 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | 152 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); |
153 | connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) ); | 153 | connect( SaveSigButton, SIGNAL( clicked() ), SLOT( saveSig()) ); |
154 | if ( smtpAccountBox->count()) | 154 | if ( smtpAccountBox->count()) |
155 | fillValues(0); | 155 | fillValues(0); |
156 | 156 | #ifdef DESKTOP_VERSION | |
157 | if ( QApplication::desktop()->width() <= 800 ) { | ||
158 | resize( QApplication::desktop()->size() ); | ||
159 | } else | ||
160 | resize( 800, 600 ); | ||
161 | if ( QApplication::desktop()->width() >= 640 ) | ||
162 | senderNameEdit->setFixedWidth( 200 ); | ||
163 | #endif | ||
157 | } | 164 | } |
158 | 165 | ||
159 | void ComposeMail::fillSettings() | 166 | void ComposeMail::fillSettings() |
160 | { | 167 | { |
161 | if ( QApplication::desktop()->width() < 320 ) | 168 | if ( QApplication::desktop()->width() < 320 ) |
162 | fromBox->setMaximumWidth( 100 ); | 169 | fromBox->setMaximumWidth( 100 ); |
163 | QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail); | 170 | QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail); |
164 | QStringList::ConstIterator sit = mailList.begin(); | 171 | QStringList::ConstIterator sit = mailList.begin(); |
165 | int pref = 0; | 172 | int pref = 0; |
166 | for (;sit!=mailList.end();++sit) { | 173 | for (;sit!=mailList.end();++sit) { |
167 | fromBox->insertItem((*sit)); | 174 | fromBox->insertItem((*sit)); |
168 | } | 175 | } |
169 | senderNameEdit->setText(KOPrefs::instance()->mName); | 176 | senderNameEdit->setText(KOPrefs::instance()->mName); |
170 | } | 177 | } |
171 | void ComposeMail::saveSig() | 178 | void ComposeMail::saveSig() |
172 | { | 179 | { |
173 | if ( smtpAccountBox->count()) { | 180 | if ( smtpAccountBox->count()) { |
174 | int cur = smtpAccountBox->currentItem (); | 181 | int cur = smtpAccountBox->currentItem (); |
175 | SMTPaccount *smtp = smtpAccounts.at( cur ); | 182 | SMTPaccount *smtp = smtpAccounts.at( cur ); |
176 | if ( smtp ) | 183 | if ( smtp ) |
177 | smtp->setSignature( sigMultiLine->text()); | 184 | smtp->setSignature( sigMultiLine->text()); |
178 | } | 185 | } |
179 | } | 186 | } |
180 | void ComposeMail::saveAsDraft() | 187 | void ComposeMail::saveAsDraft() |
181 | { | 188 | { |
182 | 189 | ||
183 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); | 190 | Opie::Core::OSmartPointer<Mail> mail= new Mail(); |
184 | mail->setMail(fromBox->currentText()); | 191 | mail->setMail(fromBox->currentText()); |
185 | mail->setTo( toLine->text() ); | 192 | mail->setTo( toLine->text() ); |
186 | mail->setName(senderNameEdit->text()); | 193 | mail->setName(senderNameEdit->text()); |
187 | mail->setCC( ccLine->text() ); | 194 | mail->setCC( ccLine->text() ); |
188 | mail->setBCC( bccLine->text() ); | 195 | mail->setBCC( bccLine->text() ); |
189 | mail->setReply( replyLine->text() ); | 196 | mail->setReply( replyLine->text() ); |
190 | mail->setSubject( subjectLine->text() ); | 197 | mail->setSubject( subjectLine->text() ); |
191 | if (!m_replyid.isEmpty()) { | 198 | if (!m_replyid.isEmpty()) { |
192 | QStringList ids; | 199 | QStringList ids; |
193 | ids.append(m_replyid); | 200 | ids.append(m_replyid); |
194 | mail->setInreply(ids); | 201 | mail->setInreply(ids); |
195 | } | 202 | } |
196 | QString txt = message->text(); | 203 | QString txt = message->text(); |
197 | if ( !sigMultiLine->text().isEmpty() ) { | 204 | if ( !sigMultiLine->text().isEmpty() ) { |
198 | txt.append( "\n--\n" ); | 205 | txt.append( "\n--\n" ); |
199 | txt.append( sigMultiLine->text() ); | 206 | txt.append( sigMultiLine->text() ); |
200 | } | 207 | } |
201 | mail->setMessage( txt ); | 208 | mail->setMessage( txt ); |
202 | mail->setCharset (mEncoding); | 209 | mail->setCharset (mEncoding); |
203 | /* only use the default drafts folder name! */ | 210 | /* only use the default drafts folder name! */ |
204 | Storemail wrapper(AbstractMail::draftFolder()); | 211 | Storemail wrapper(AbstractMail::draftFolder()); |
205 | wrapper.storeMail(mail); | 212 | wrapper.storeMail(mail); |
206 | 213 | ||
207 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); | 214 | AttachViewItem *it = (AttachViewItem *) attList->firstChild(); |
208 | /* attachments we will ignore! */ | 215 | /* attachments we will ignore! */ |
209 | if ( it != 0 ) { | 216 | if ( it != 0 ) { |
210 | if ( warnAttach ) | 217 | if ( warnAttach ) |
211 | QMessageBox::warning(0,i18n("Store message"), | 218 | QMessageBox::warning(0,i18n("Store message"), |
212 | i18n("<center>Attachments will not be stored in \"Draft\" folder</center>")); | 219 | i18n("<center>Attachments will not be stored in \"Draft\" folder</center>")); |
213 | warnAttach = false; | 220 | warnAttach = false; |
214 | } | 221 | } |
215 | setStatus( i18n("Mail saved as draft!") ); | 222 | setStatus( i18n("Mail saved as draft!") ); |
216 | } | 223 | } |
217 | void ComposeMail::clearStatus() | 224 | void ComposeMail::clearStatus() |
218 | { | 225 | { |
219 | topLevelWidget()->setCaption( i18n("Compose mail") ); | 226 | topLevelWidget()->setCaption( i18n("Compose mail") ); |
220 | } | 227 | } |
221 | void ComposeMail::setStatus( QString status ) | 228 | void ComposeMail::setStatus( QString status ) |
222 | { | 229 | { |
223 | topLevelWidget()->setCaption( status ); | 230 | topLevelWidget()->setCaption( status ); |
224 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; | 231 | QTimer::singleShot ( 10000, this, SLOT( clearStatus() ) ) ; |
225 | } | 232 | } |
226 | void ComposeMail::pickAddress( ) | 233 | void ComposeMail::pickAddress( ) |
227 | { | 234 | { |
228 | 235 | ||
229 | QLineEdit *line = mPickLineEdit; | 236 | QLineEdit *line = mPickLineEdit; |
230 | if ( line == 0 ) | 237 | if ( line == 0 ) |
231 | return; | 238 | return; |
232 | #ifdef DESKTOP_VERSION | 239 | #ifdef DESKTOP_VERSION |
233 | //qDebug(" ComposeMail::pickAddress "); | 240 | //qDebug(" ComposeMail::pickAddress "); |
234 | QString names ;//= AddressPicker::getNames(); | 241 | QString names ;//= AddressPicker::getNames(); |
235 | 242 | ||
236 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 243 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
237 | uint i=0; | 244 | uint i=0; |
238 | for (i=0; i < list.count(); i++) { | 245 | for (i=0; i < list.count(); i++) { |
239 | if ( !list[i].preferredEmail().isEmpty()) { | 246 | if ( !list[i].preferredEmail().isEmpty()) { |
240 | if ( ! names.isEmpty() ) | 247 | if ( ! names.isEmpty() ) |
241 | names+= ","; | 248 | names+= ","; |
242 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; | 249 | names+= "\""+list[i].realName() +"\"<" +list[i].preferredEmail() +">"; |
243 | 250 | ||
244 | } | 251 | } |
245 | } | 252 | } |
246 | 253 | ||
247 | 254 | ||
248 | if ( line->text().isEmpty() ) { | 255 | if ( line->text().isEmpty() ) { |
249 | line->setText( names ); | 256 | line->setText( names ); |
250 | } else if ( !names.isEmpty() ) { | 257 | } else if ( !names.isEmpty() ) { |
251 | line->setText( line->text() + ", " + names ); | 258 | line->setText( line->text() + ", " + names ); |
252 | } | 259 | } |
253 | #else | 260 | #else |
254 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/); | 261 | bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/); |
255 | // the result should now arrive through method insertAttendees | 262 | // the result should now arrive through method insertAttendees |
256 | #endif | 263 | #endif |
257 | } | 264 | } |
258 | //the map includes name/email pairs, that comes from Ka/Pi | 265 | //the map includes name/email pairs, that comes from Ka/Pi |
259 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 266 | void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) |
260 | { | 267 | { |
261 | //qDebug("ComposeMail::insertAttendees "); | 268 | //qDebug("ComposeMail::insertAttendees "); |
262 | raise(); | 269 | raise(); |
263 | 270 | ||
264 | QString UID = uid; | 271 | QString UID = uid; |
265 | if ( uid.left( 18 ) == (this->name() +QString("pick2")) ) { | 272 | if ( uid.left( 18 ) == (this->name() +QString("pick2")) ) { |
266 | mPickLineEdit = toLine; | 273 | mPickLineEdit = toLine; |
267 | UID = this->name(); | 274 | UID = this->name(); |
268 | subjectLine->setText( uid.mid( 18 ) ); | 275 | subjectLine->setText( uid.mid( 18 ) ); |
269 | } | 276 | } |
270 | //qDebug("ccc %s %s ", uid.latin1(), this->name()); | 277 | //qDebug("ccc %s %s ", uid.latin1(), this->name()); |
271 | if ( mPickLineEdit == 0 ) { //whoami received | 278 | if ( mPickLineEdit == 0 ) { //whoami received |
272 | QString defmail = uidList[0]; | 279 | QString defmail = uidList[0]; |
273 | if ( emailList.count() == 0 ) | 280 | if ( emailList.count() == 0 ) |
274 | QMessageBox::information( 0, i18n( "Hint" ), | 281 | QMessageBox::information( 0, i18n( "Hint" ), |
275 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 282 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
276 | i18n( "Ok" ) ); | 283 | i18n( "Ok" ) ); |
277 | if (defmail.length()!=0) { | 284 | if (defmail.length()!=0) { |
278 | fromBox->insertItem(defmail); | 285 | fromBox->insertItem(defmail); |
279 | } | 286 | } |
280 | QStringList::ConstIterator sit = emailList.begin(); | 287 | QStringList::ConstIterator sit = emailList.begin(); |
281 | int pref = 0; | 288 | int pref = 0; |
282 | for (;sit!=emailList.end();++sit) { | 289 | for (;sit!=emailList.end();++sit) { |
283 | if ( (*sit)==defmail) | 290 | if ( (*sit)==defmail) |
284 | continue; | 291 | continue; |