summaryrefslogtreecommitdiff
path: root/noncore/net/mail/editaccounts.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 9fc97e8..1cb202e 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -245,77 +245,86 @@ void EditAccounts::accept()
245SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) 245SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags )
246 : SelectMailTypeUI( parent, name, modal, flags ) 246 : SelectMailTypeUI( parent, name, modal, flags )
247{ 247{
248 selected = selection; 248 selected = selection;
249 selected->replace( 0, selected->length(), typeBox->currentText() ); 249 selected->replace( 0, selected->length(), typeBox->currentText() );
250 connect( typeBox, SIGNAL( activated( const QString & ) ), SLOT( slotSelection( const QString & ) ) ); 250 connect( typeBox, SIGNAL( activated( const QString & ) ), SLOT( slotSelection( const QString & ) ) );
251} 251}
252 252
253void SelectMailType::slotSelection( const QString &sel ) 253void SelectMailType::slotSelection( const QString &sel )
254{ 254{
255 selected->replace( 0, selected->length(), sel ); 255 selected->replace( 0, selected->length(), sel );
256} 256}
257 257
258/** 258/**
259 * IMAPconfig 259 * IMAPconfig
260 */ 260 */
261 261
262IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 262IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
263 : IMAPconfigUI( parent, name, modal, flags ) 263 : IMAPconfigUI( parent, name, modal, flags )
264{ 264{
265 data = account; 265 data = account;
266 266
267 fillValues(); 267 fillValues();
268 268
269 connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); 269 connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) );
270 ComboBox1->insertItem( "Only if available", 0 );
271 ComboBox1->insertItem( "Always, Negotiated", 1 );
272 ComboBox1->insertItem( "Connect on secure port", 2 );
273 ComboBox1->insertItem( "Run command instead", 3 );
274 CommandEdit->hide();
275 ComboBox1->setCurrentItem( data->ConnectionType() );
270} 276}
271 277
272void IMAPconfig::slotSSL( bool enabled ) 278void IMAPconfig::slotConnectionToggle( int index )
273{ 279{
274 if ( enabled ) { 280 if ( index == 2 ) {
275 portLine->setText( IMAP_SSL_PORT ); 281 portLine->setText( IMAP_SSL_PORT );
282 } else if ( index == 3 ) {
283 portLine->setText( IMAP_PORT );
284 CommandEdit->show();
276 } else { 285 } else {
277 portLine->setText( IMAP_PORT ); 286 portLine->setText( IMAP_PORT );
278 } 287 }
279} 288}
280 289
281void IMAPconfig::fillValues() 290void IMAPconfig::fillValues()
282{ 291{
283 accountLine->setText( data->getAccountName() ); 292 accountLine->setText( data->getAccountName() );
284 serverLine->setText( data->getServer() ); 293 serverLine->setText( data->getServer() );
285 portLine->setText( data->getPort() ); 294 portLine->setText( data->getPort() );
286 sslBox->setChecked( data->getSSL() ); 295 ComboBox1->setCurrentItem( data->ConnectionType() );
287 userLine->setText( data->getUser() ); 296 userLine->setText( data->getUser() );
288 passLine->setText( data->getPassword() ); 297 passLine->setText( data->getPassword() );
289 prefixLine->setText(data->getPrefix()); 298 prefixLine->setText(data->getPrefix());
290} 299}
291 300
292void IMAPconfig::accept() 301void IMAPconfig::accept()
293{ 302{
294 data->setAccountName( accountLine->text() ); 303 data->setAccountName( accountLine->text() );
295 data->setServer( serverLine->text() ); 304 data->setServer( serverLine->text() );
296 data->setPort( portLine->text() ); 305 data->setPort( portLine->text() );
297 data->setSSL( sslBox->isChecked() ); 306 data->setConnectionType( ComboBox1->currentItem() );
298 data->setUser( userLine->text() ); 307 data->setUser( userLine->text() );
299 data->setPassword( passLine->text() ); 308 data->setPassword( passLine->text() );
300 data->setPrefix(prefixLine->text()); 309 data->setPrefix(prefixLine->text());
301 310
302 QDialog::accept(); 311 QDialog::accept();
303} 312}
304 313
305/** 314/**
306 * POP3config 315 * POP3config
307 */ 316 */
308 317
309POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 318POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags )
310 : POP3configUI( parent, name, modal, flags ) 319 : POP3configUI( parent, name, modal, flags )
311{ 320{
312 data = account; 321 data = account;
313 fillValues(); 322 fillValues();
314 323
315 connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) ); 324 connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) );
316 ComboBox1->insertItem( "Only if available", 0 ); 325 ComboBox1->insertItem( "Only if available", 0 );
317 ComboBox1->insertItem( "Always, Negotiated", 1 ); 326 ComboBox1->insertItem( "Always, Negotiated", 1 );
318 ComboBox1->insertItem( "Connect on secure port", 2 ); 327 ComboBox1->insertItem( "Connect on secure port", 2 );
319 ComboBox1->insertItem( "Run command instead", 3 ); 328 ComboBox1->insertItem( "Run command instead", 3 );
320 CommandEdit->hide(); 329 CommandEdit->hide();
321 ComboBox1->setCurrentItem( data->ConnectionType() ); 330 ComboBox1->setCurrentItem( data->ConnectionType() );