author | harlekin <harlekin> | 2004-01-10 00:32:04 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-01-10 00:32:04 (UTC) |
commit | 76cf4990cb4171a747ac31e9832f4ee694ced2cc (patch) (side-by-side diff) | |
tree | ce97c1b6b6e9f832cc09a71fe3e8e87551bb01bd /noncore/net/mail | |
parent | 241fb3509f6b62efda3c89f5bf9cec0dfba86b43 (diff) | |
download | opie-76cf4990cb4171a747ac31e9832f4ee694ced2cc.zip opie-76cf4990cb4171a747ac31e9832f4ee694ced2cc.tar.gz opie-76cf4990cb4171a747ac31e9832f4ee694ced2cc.tar.bz2 |
new connection setting stuff for imap too
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 19 | ||||
-rw-r--r-- | noncore/net/mail/editaccounts.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/imapconfigui.ui | 159 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 2 |
5 files changed, 116 insertions, 78 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 @@ -266,13 +266,22 @@ IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, fillValues(); - connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); + connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) ); + ComboBox1->insertItem( "Only if available", 0 ); + ComboBox1->insertItem( "Always, Negotiated", 1 ); + ComboBox1->insertItem( "Connect on secure port", 2 ); + ComboBox1->insertItem( "Run command instead", 3 ); + CommandEdit->hide(); + ComboBox1->setCurrentItem( data->ConnectionType() ); } -void IMAPconfig::slotSSL( bool enabled ) +void IMAPconfig::slotConnectionToggle( int index ) { - if ( enabled ) { + if ( index == 2 ) { portLine->setText( IMAP_SSL_PORT ); + } else if ( index == 3 ) { + portLine->setText( IMAP_PORT ); + CommandEdit->show(); } else { portLine->setText( IMAP_PORT ); } @@ -283,7 +292,7 @@ void IMAPconfig::fillValues() accountLine->setText( data->getAccountName() ); serverLine->setText( data->getServer() ); portLine->setText( data->getPort() ); - sslBox->setChecked( data->getSSL() ); + ComboBox1->setCurrentItem( data->ConnectionType() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); prefixLine->setText(data->getPrefix()); @@ -294,7 +303,7 @@ void IMAPconfig::accept() data->setAccountName( accountLine->text() ); data->setServer( serverLine->text() ); data->setPort( portLine->text() ); - data->setSSL( sslBox->isChecked() ); + data->setConnectionType( ComboBox1->currentItem() ); data->setUser( userLine->text() ); data->setPassword( passLine->text() ); data->setPrefix(prefixLine->text()); diff --git a/noncore/net/mail/editaccounts.h b/noncore/net/mail/editaccounts.h index d51e299..d8e1219 100644 --- a/noncore/net/mail/editaccounts.h +++ b/noncore/net/mail/editaccounts.h @@ -79,7 +79,7 @@ public slots: void fillValues(); protected slots: - void slotSSL( bool enabled ); + void slotConnectionToggle( int index ); void accept(); private: diff --git a/noncore/net/mail/imapconfigui.ui b/noncore/net/mail/imapconfigui.ui index ac0297f..a96c1a2 100644 --- a/noncore/net/mail/imapconfigui.ui +++ b/noncore/net/mail/imapconfigui.ui @@ -11,8 +11,8 @@ <rect> <x>0</x> <y>0</y> - <width>228</width> - <height>320</height> + <width>425</width> + <height>428</height> </rect> </property> <property stdset="1"> @@ -32,30 +32,8 @@ </property> <property stdset="1"> <name>spacing</name> - <number>2</number> - </property> - <widget row="6" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>userLabel</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>User</string> - </property> - </widget> - <widget row="4" column="1" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>sslBox</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Use SSL</string> + <number>3</number> </property> - </widget> <widget row="2" column="1" > <class>QLineEdit</class> <property stdset="1"> @@ -63,24 +41,6 @@ <cstring>serverLine</cstring> </property> </widget> - <widget row="6" column="1" > - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>userLine</cstring> - </property> - </widget> - <widget row="7" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>passLabel</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Password</string> - </property> - </widget> <widget row="3" column="0" > <class>QLabel</class> <property stdset="1"> @@ -110,18 +70,40 @@ <cstring>portLine</cstring> </property> </widget> - <widget row="7" column="1" > + <widget row="0" column="1" > <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>passLine</cstring> + <cstring>accountLine</cstring> + </property> + <property> + <name>toolTip</name> + <string>Name of the Account</string> </property> + </widget> + <widget row="0" column="0" > + <class>QLabel</class> <property stdset="1"> - <name>echoMode</name> - <enum>Password</enum> + <name>name</name> + <cstring>accountLabel</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Account</string> + </property> + </widget> + <widget row="1" column="0" rowspan="1" colspan="2" > + <class>Line</class> + <property stdset="1"> + <name>name</name> + <cstring>line1</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> </property> </widget> - <spacer row="10" column="1" > + <spacer row="12" column="1" > <property> <name>name</name> <cstring>spacer</cstring> @@ -142,58 +124,54 @@ </size> </property> </spacer> - <widget row="0" column="1" > + <widget row="8" column="1" > <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>accountLine</cstring> - </property> - <property> - <name>toolTip</name> - <string>Name of the Account</string> + <cstring>userLine</cstring> </property> </widget> - <widget row="0" column="0" > - <class>QLabel</class> + <widget row="9" column="1" > + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>accountLabel</cstring> + <cstring>passLine</cstring> </property> <property stdset="1"> - <name>text</name> - <string>Account</string> + <name>echoMode</name> + <enum>Password</enum> </property> </widget> - <widget row="1" column="0" rowspan="1" colspan="2" > - <class>Line</class> + <widget row="11" column="0" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>line1</cstring> + <cstring>prefixLabel</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> + <name>text</name> + <string>Prefix</string> </property> </widget> - <widget row="9" column="1" > + <widget row="11" column="1" > <class>QLineEdit</class> <property stdset="1"> <name>name</name> <cstring>prefixLine</cstring> </property> </widget> - <widget row="9" column="0" > + <widget row="8" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>prefixLabel</cstring> + <cstring>userLabel</cstring> </property> <property stdset="1"> <name>text</name> - <string>Prefix</string> + <string>User</string> </property> </widget> - <widget row="5" column="0" rowspan="1" colspan="2" > + <widget row="7" column="0" rowspan="1" colspan="2" > <class>Line</class> <property stdset="1"> <name>name</name> @@ -218,7 +196,7 @@ <name>layoutSpacing</name> </property> </widget> - <widget row="8" column="0" rowspan="1" colspan="2" > + <widget row="10" column="0" rowspan="1" colspan="2" > <class>Line</class> <property stdset="1"> <name>name</name> @@ -229,13 +207,52 @@ <enum>Horizontal</enum> </property> </widget> + <widget row="9" column="0" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>passLabel</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Password</string> + </property> + </widget> + <widget row="6" column="0" rowspan="1" colspan="2" > + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>CommandEdit</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>ssh $SERVER exec</string> + </property> + </widget> + <widget row="5" column="0" rowspan="1" colspan="2" > + <class>QComboBox</class> + <property stdset="1"> + <name>name</name> + <cstring>ComboBox1</cstring> + </property> + </widget> + <widget row="4" column="0" rowspan="1" colspan="2" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Use secure sockets:</string> + </property> + </widget> </grid> </widget> <tabstops> <tabstop>accountLine</tabstop> <tabstop>serverLine</tabstop> <tabstop>portLine</tabstop> - <tabstop>sslBox</tabstop> <tabstop>userLine</tabstop> <tabstop>passLine</tabstop> </tabstops> diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 4b633ea..1c22c26 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -80,8 +80,18 @@ void IMAPwrapper::login() m_imap = mailimap_new( 20, &imap_progress ); + + /* connect */ - if (account->getSSL()) { + + bool ssl = false; + + if ( account->ConnectionType() == 2 ) { + ssl = true; + } + + if ( ssl ) { + qDebug( "using ssl" ); err = mailimap_ssl_connect( m_imap, (char*)server, port ); } else { err = mailimap_socket_connect( m_imap, (char*)server, port ); diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index 7b6a58d..3279f39 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp @@ -164,6 +164,7 @@ void IMAPaccount::read() if (server.isNull()) server=""; port = conf->readEntry( "Port","" ); if (port.isNull()) port="143"; + connectionType = conf->readNumEntry( "ConnectionType" ); ssl = conf->readBoolEntry( "SSL",false ); user = conf->readEntry( "User","" ); if (user.isNull()) user = ""; @@ -186,6 +187,7 @@ void IMAPaccount::save() conf->writeEntry( "Server", server ); conf->writeEntry( "Port", port ); conf->writeEntry( "SSL", ssl ); + conf->writeEntry( "ConnectionType", connectionType ); conf->writeEntry( "User", user ); conf->writeEntryCrypt( "Password", password ); conf->writeEntry( "MailPrefix",prefix); |