Branch 'kolab/integration/4.13.0' - 9 commits - resources/imap resources/kolab

Christian Mollekopf mollekopf at kolabsys.com
Fri Oct 31 10:26:53 CET 2014


 resources/imap/imapresource.h                    |    2 
 resources/imap/imapresourcebase.h                |    3 
 resources/kolab/CMakeLists.txt                   |    7 
 resources/kolab/kolabchangeitemstagstask.cpp     |    3 
 resources/kolab/kolabhelpers.cpp                 |    2 
 resources/kolab/kolabresource.cpp                |   22 
 resources/kolab/kolabresource.h                  |    3 
 resources/kolab/kolabresourcestate.cpp           |    2 
 resources/kolab/kolabretrievecollectionstask.cpp |    9 
 resources/kolab/kolabretrievetagstask.cpp        |   52 -
 resources/kolab/kolabsettings.cpp                |   55 +
 resources/kolab/kolabsettings.h                  |   36 +
 resources/kolab/setupserver.cpp                  |  667 ++++++++++++++++++++++
 resources/kolab/setupserver.h                    |  113 +++
 resources/kolab/setupserverview_desktop.ui       |  672 +++++++++++++++++++++++
 resources/kolab/setupserverview_mobile.ui        |  514 +++++++++++++++++
 resources/kolab/tagchangehelper.cpp              |   25 
 resources/kolab/wizard/kolabwizard.es            |  197 +++++-
 resources/kolab/wizard/kolabwizard2.ui           |   72 +-
 19 files changed, 2324 insertions(+), 132 deletions(-)

New commits:
commit 4832b03bc0677786ed0f47a49bd14ca0de63cd8c
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date:   Fri Oct 31 10:26:14 2014 +0100

    KolabResource: Use the just fetched tag to write back to the resource.

diff --git a/resources/kolab/kolabchangeitemstagstask.cpp b/resources/kolab/kolabchangeitemstagstask.cpp
index f625eef..c4d66d7 100644
--- a/resources/kolab/kolabchangeitemstagstask.cpp
+++ b/resources/kolab/kolabchangeitemstagstask.cpp
@@ -115,7 +115,7 @@ void KolabChangeItemsTagsTask::onItemsFetchDone(KJob *job)
 
     const Akonadi::Tag tag = job->property("tag").value<Akonadi::Tag>();
     Q_ASSERT(tag.isValid());
-    changeHelper->start(tag, mTagConverter->createMessage(resourceState()->tag(), items), mSession);
+    changeHelper->start(tag, mTagConverter->createMessage(tag, items), mSession);
 }
 
 void KolabChangeItemsTagsTask::onApplyCollectionChanged(const Akonadi::Collection &collection)


commit 516675731f619c3c90f27c0556928f19eb80fb8b
Merge: 152c4f9 519d421
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date:   Wed Oct 29 22:42:41 2014 +0100

    Merge remote-tracking branch 'remotes/kolab/dev/resource_kolab_config' into kolab/integration/4.13.0



commit 152c4f9347e12f65c3d39ecd16bd6918990ecf86
Merge: 1982cf7 f684bc8
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date:   Wed Oct 29 22:42:14 2014 +0100

    Merge remote-tracking branch 'remotes/kolab/dev/accountwizard_edit' into kolab/integration/4.13.0



commit 1982cf78a22c770087563ce3347146aff0a70044
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date:   Wed Oct 29 16:50:16 2014 +0100

    KolabResource: If there are no objects on the server, clear the local tags.

diff --git a/resources/kolab/kolabretrievetagstask.cpp b/resources/kolab/kolabretrievetagstask.cpp
index ba46ca9..c2ab6fb 100644
--- a/resources/kolab/kolabretrievetagstask.cpp
+++ b/resources/kolab/kolabretrievetagstask.cpp
@@ -55,8 +55,8 @@ void KolabRetrieveTagTask::onFinalSelectDone(KJob *job)
     KIMAP::FetchJob *fetch = new KIMAP::FetchJob(select->session());
 
     if (select->messageCount() == 0) {
-        //Nothing to do
-        taskDone();
+        resourceState()->tagsRetrieved(mTags, mTagMembers);
+        deleteLater();
         return;
     }
 


commit 4c458983fc115bc18548a54a51725baf3e9c235e
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date:   Wed Oct 29 16:49:45 2014 +0100

    KolabResource: Properly retrieve and add items using the GID.

diff --git a/resources/kolab/kolabchangeitemstagstask.cpp b/resources/kolab/kolabchangeitemstagstask.cpp
index 3b47955..f625eef 100644
--- a/resources/kolab/kolabchangeitemstagstask.cpp
+++ b/resources/kolab/kolabchangeitemstagstask.cpp
@@ -89,6 +89,7 @@ void KolabChangeItemsTagsTask::onTagFetchDone(KJob *job)
     // fetch->fetchScope().setCacheOnly(true);
     // TODO: does the fetch already limit to resource local items?
     fetch->fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::All);
+    fetch->fetchScope().setFetchGid(true);
     fetch->setProperty("tag", QVariant::fromValue(tags.first()));
     connect(fetch, SIGNAL(result(KJob*)), this, SLOT(onItemsFetchDone(KJob*)));
 }
diff --git a/resources/kolab/kolabretrievetagstask.cpp b/resources/kolab/kolabretrievetagstask.cpp
index 9b17355..ba46ca9 100644
--- a/resources/kolab/kolabretrievetagstask.cpp
+++ b/resources/kolab/kolabretrievetagstask.cpp
@@ -109,30 +109,36 @@ void KolabRetrieveTagTask::onHeadersReceived(const QString &mailBox,
                 Akonadi::Item::List members;
                 Q_FOREACH (const QString &memberUrl, reader.getTagMembers()) {
                     Kolab::RelationMember member = Kolab::parseMemberUrl(memberUrl);
-                    //TODO implement fallback to search if uid is not available
                     //TODO should we create a dummy item if it isn't yet available?
-                    if (member.uid < 0) {
-                        kWarning() << "Failed to parse uid: " << memberUrl;
-                        continue;
-                    }
                     Akonadi::Item i;
-                    i.setRemoteId(QString::number(member.uid));
-                    kDebug() << "got member: " << member.uid << member.mailbox;
-                    Akonadi::Collection parent;
-                    {
-                        //The root collection is not part of the mailbox path
-                        Akonadi::Collection col;
-                        col.setRemoteId(rootRemoteId());
-                        col.setParentCollection(Akonadi::Collection::root());
-                        parent = col;
+                    if (!member.gid.isEmpty()) {
+                        //Reference by GID
+                        i.setGid(member.gid);
+                    } else {
+                        //Reference by imap uid
+                        if (member.uid < 0) {
+                            kWarning() << "Failed to parse uid: " << memberUrl;
+                            continue;
+                        }
+                        i.setRemoteId(QString::number(member.uid));
+                        kDebug() << "got member: " << member.uid << member.mailbox;
+                        Akonadi::Collection parent;
+                        {
+                            //The root collection is not part of the mailbox path
+                            Akonadi::Collection col;
+                            col.setRemoteId(rootRemoteId());
+                            col.setParentCollection(Akonadi::Collection::root());
+                            parent = col;
+                        }
+                        Q_FOREACH(const QByteArray part, member.mailbox) {
+                            Akonadi::Collection col;
+                            col.setRemoteId(separatorCharacter() + QString::fromLatin1(part));
+                            col.setParentCollection(parent);
+                            parent = col;
+                        }
+                        i.setParentCollection(parent);
                     }
-                    Q_FOREACH(const QByteArray part, member.mailbox) {
-                        Akonadi::Collection col;
-                        col.setRemoteId(separatorCharacter() + QString::fromLatin1(part));
-                        col.setParentCollection(parent);
-                        parent = col;
-                    }
-                    i.setParentCollection(parent);
+                    //TODO implement fallback to search if uid is not available
                     members << i;
                 }
                 mTagMembers.insert(QString::fromLatin1(tag.remoteId()), members);
diff --git a/resources/kolab/tagchangehelper.cpp b/resources/kolab/tagchangehelper.cpp
index 64c9764..8d8e9d2 100644
--- a/resources/kolab/tagchangehelper.cpp
+++ b/resources/kolab/tagchangehelper.cpp
@@ -59,11 +59,21 @@ static QList<QByteArray> ancestorChain(const Akonadi::Collection &col)
 QString TagConverter::createMemberUrl(const Akonadi::Item &item)
 {
     Kolab::RelationMember member;
-    member.uid = item.remoteId().toLong();
-    member.user = QLatin1String("user at example.org");
-    member.subject = QLatin1String("subject");
-    member.messageId = QLatin1String("messageid");
-    member.mailbox = ancestorChain(item.parentCollection());
+    if (item.mimeType() == KMime::Message::mimeType()) {
+        KMime::Message::Ptr msg = item.payload<KMime::Message::Ptr>();
+        member.uid = item.remoteId().toLong();
+        //FIXME get the user from somewhere
+        member.user = QLatin1String("user at example.org");
+        member.subject = msg->subject()->asUnicodeString();
+        member.messageId = msg->messageID()->asUnicodeString();
+        member.mailbox = ancestorChain(item.parentCollection());
+    } else {
+        if (item.gid().isEmpty()) {
+            kWarning() << "Groupware object without GID, failed to add to tag: " << item.id() << item.remoteId();
+            return QString();
+        }
+        member.gid = item.gid();
+    }
     return Kolab::generateMemberUrl(member);
 }
 
@@ -72,7 +82,10 @@ KMime::Message::Ptr TagConverter::createMessage(const Akonadi::Tag &tag, const A
     QStringList itemRemoteIds;
     itemRemoteIds.reserve(items.count());
     Q_FOREACH (const Akonadi::Item &item, items) {
-        itemRemoteIds << createMemberUrl(item);
+        const QString memberUrl = createMemberUrl(item);
+        if (!memberUrl.isEmpty()) {
+            itemRemoteIds << memberUrl;
+        }
     }
 
     // save message to the server.


commit f684bc80df8a611d94b2d99a211675e0bb9b8024
Author: Sandro Knauß <mail at sandroknauss.de>
Date:   Tue Oct 28 10:25:53 2014 +0100

    kolabwizard: Added probing of server settings

diff --git a/resources/kolab/wizard/kolabwizard.es b/resources/kolab/wizard/kolabwizard.es
index d764a6c..feb15d2 100644
--- a/resources/kolab/wizard/kolabwizard.es
+++ b/resources/kolab/wizard/kolabwizard.es
@@ -30,9 +30,6 @@ page.widget().passwordEdit.text = SetupManager.password()
 
 function guessServerName()
 {
-    if (userChangedServerAddress == true) {
-        return;
-    }
     var email = page.widget().emailEdit.text;
     var pos = email.indexOf("@");
     if (pos >= 0 && (pos + 1) < email.length) {
@@ -41,20 +38,78 @@ function guessServerName()
     }
 }
 
-function emailChanged(arg)
-{
-  validateInput();
-}
-
 function validateInput()
 {
-  if (page.widget().emailEdit.text.trim() == "") {
+  if (page.widget().emailEdit.text.trim() == "" || page.widget().passwordEdit.text.trim() == "") {
     page.setValid(false);
   } else {
     page.setValid(true);
   }
 }
 
+//Server test
+servertest_running = false;
+//0 = not running, 1 = smtp, 2 = imap
+servertest_mode = 0;
+
+function testResultFail()
+{
+  testOk( -1 );
+}
+
+var imapRes;
+function testOk( arg )
+{
+    print("testOk arg =", arg);
+    if (servertest_mode == 1) {   //smtp
+        if ( arg == "ssl" ) {
+          // The ENUM used for authentication (in the imap resource only)
+          smtp.setPort(465);
+          smtp.setEncryption("SSL");
+        } else if ( arg == "tls" ) { // tls is really STARTTLS
+          smtp.setPort(25);
+          smtp.setEncryption("TLS");
+        } else if ( arg == "none" ) {
+          smtp.setPort(25);
+          smtp.setEncryption("NONE");
+          smtp.setEditMode(true);
+        } else {
+          // safe default fallback in case server test failed
+          smtp.setPort(25);
+          smtp.setEncryption("TLS");
+          smtp.setEditMode(true);
+        }
+        servertest_mode = 2;
+        if (page2.widget().lineEditImap.text) {
+            SetupManager.setupInfo(qsTr("Probing Imap server..."));
+            ServerTest.test(page2.widget().lineEditImap.text, "imap");
+        } else {
+            SetupManager.execute();
+        }
+    } else if (servertest_mode == 2) {   //imap
+        if ( arg == "ssl" ) {
+          // The ENUM used for authentication (in the kolab resource only)
+          kolabRes.setOption( "Safety", "SSL" ); // SSL/TLS
+          kolabRes.setOption( "ImapPort", 993 );
+        } else if ( arg == "tls" ) { // tls is really STARTTLS
+          kolabRes.setOption( "Safety", "STARTTLS" );  // STARTTLS
+          kolabRes.setOption( "ImapPort", 143 );
+        } else if ( arg == "none" ) {
+          kolabRes.setOption( "Safety", "NONE" );  // No encryption
+          kolabRes.setOption( "ImapPort", 143 );
+          kolabRes.setEditMode(true);
+        } else {
+          // safe default fallback in case server test failed
+          kolabRes.setOption( "Safety", "STARTTLS" );
+          kolabRes.setOption( "ImapPort", 143 );
+          kolabRes.setEditMode(true);
+        }
+        SetupManager.execute();
+    } else {
+        print ("Unknown servertest_mode = ", servertest_mode);
+    }
+}
+
 var identity; // global so it can be accesed in setup and testOk
 
 var kolabRes;
@@ -65,8 +120,26 @@ var ac_mail;
 var ac_freebusy;
 var ac_ldap;
 
+var ac_mail_stat;
+var ac_freebusy_stat;
+var ac_ldap_stat;
+
 function checkAutoconfig()
 {
+    ac_mail_stat = false;
+    ac_freebusy_stat = false;
+    ac_ldap_stat = false;
+
+    page2.widget().lineEditImap.text = guessServerName();
+    page2.widget().lineEditSmtp.text = guessServerName();
+    page2.widget().lineEditImap.visible = false;
+    page2.widget().lineEditSmtp.visible = false;
+    page2.widget().lineEditImapLabel.visible = false;
+    page2.widget().lineEditSmtpLabel.visible = false;
+
+    page2.widget().checkBoxFreebusyEdit.text = qsTr("Create");
+    page2.widget().checkBoxLdapEdit.text = qsTr("Create");
+
     ac_mail = SetupManager.ispDB('autoconfigkolabmail');
     ac_mail.ispdbFinished.connect(mail_finished);
     ac_mail.info.connect(mail_text);
@@ -89,19 +162,18 @@ function checkAutoconfig()
     ac_ldap.start();
 }
 
-guessServerName();
-
 function mail_finished(stat) {
+    ac_mail_stat = stat;
     if (stat) {
-        page2.widget().checkBoxImap.checked = true;
-        page2.widget().checkBoxImap.enabled = true;
-        page2.widget().checkBoxSmtp.checked = true;
-        page2.widget().checkBoxSmtp.enabled = true;
+        page2.widget().lineEditImap.visible = false;
+        page2.widget().lineEditSmtp.visible = false;
+        page2.widget().lineEditImapLabel.visible = false;
+        page2.widget().lineEditSmtpLabel.visible = false;
     } else {
-        page2.widget().checkBoxImap.checked = false;
-        page2.widget().checkBoxImap.enabled = false;
-        page2.widget().checkBoxSmtp.checked = false;
-        page2.widget().checkBoxSmtp.enabled = false;
+        page2.widget().lineEditImap.visible = true;
+        page2.widget().lineEditSmtp.visible = true;
+        page2.widget().lineEditImapLabel.visible = true;
+        page2.widget().lineEditSmtpLabel.visible = true;
     }
 }
 
@@ -111,12 +183,9 @@ function mail_text(text) {
 }
 
 function freebusy_finished(stat) {
+    ac_freebusy_stat = stat;
     if (stat) {
-        page2.widget().checkBoxFreebusy.checked = true;
-        page2.widget().checkBoxFreebusy.enabled = true;
-    } else {
-        page2.widget().checkBoxFreebusy.checked = false;
-        page2.widget().checkBoxFreebusy.enabled = false;
+        page2.widget().checkBoxFreebusyEdit.text = qsTr("Manuell Edit");
     }
 }
 
@@ -124,14 +193,10 @@ function freebusy_text(text) {
     page2.widget().labelFreebusySearch.text = text;
 }
 
-
 function ldap_finished(stat) {
+    ac_ldap_stat = stat;
     if (stat) {
-        page2.widget().checkBoxLdap.checked = true;
-        page2.widget().checkBoxLdap.enabled = true;
-    } else {
-        page2.widget().checkBoxLdap.checked = false;
-        page2.widget().checkBoxLdap.enabled = false;
+        page2.widget().checkBoxLdapEdit.text = qsTr("Manuell Edit");
     }
 }
 
@@ -146,16 +211,19 @@ function setup()
     smtp.setEditMode(page2.widget().checkBoxSmtpEdit.checked);
     smtp.setPassword(page.widget().passwordEdit.text);
 
-    if (page2.widget().checkBoxSmtp.checked) {
+    if (ac_mail_stat) {
         ac_mail.fillSmtpServer(0, smtp);
-    } else if (guessServerName()) {
-        var serverAddress = guessServerName();
+    } else if (page2.widget().lineEditSmtp.text) {
+        var serverAddress = page2.widget().lineEditSmtp.text;
+        servertest_running = true;
+        servertest_mode = 1;
         smtp.setName(serverAddress);
         smtp.setHost(serverAddress);
-        smtp.setPort(465);
-        smtp.setEncryption("SSL");
-        smtp.setAuthenticationType("plain"); // using plain is ok, because we are using SSL.
         smtp.setUsername(page.widget().emailEdit.text);
+        smtp.setAuthenticationType("plain");
+
+        SetupManager.setupInfo(qsTr("Probing Smtp server..."));
+        ServerTest.test( serverAddress, "smtp" );   //probe port and encryption
     }
 
     for (i = 0; i < ac_mail.countIdentities(); i++) {
@@ -187,18 +255,22 @@ function setup()
     kolabRes.setOption("SubscriptionEnabled", true);
     kolabRes.setOption("SieveSupport", true);
 
-    if (page2.widget().checkBoxImap.checked) {
+    if (ac_mail_stat) {
         ac_mail.fillImapServer(0, kolabRes);
-    } else if (guessServerName()) {
-        var serverAddress = guessServerName();
+    } else if (page2.widget().lineEditImap.text) {
+        var serverAddress = page2.widget().lineEditImap.text;
         kolabRes.setOption("ImapServer", serverAddress);
         kolabRes.setOption("UserName", page.widget().emailEdit.text.trim());
-        kolabRes.setOption("Authentication", 7);
-        kolabRes.setOption("Safety", "STARTTLS");
-        kolabRes.setOption("ImapPort", 143);
+
+        if (!servertest_running) {
+            servertest_mode = 2;
+            servertest_running = true;
+            SetupManager.setupInfo(qsTr("Probing Imap server..."));
+            ServerTest.test(serverAddress, "imap");
+        }       kolabRes.setOption("Authentication", 7);
     }
 
-    if (page2.widget().checkBoxLdap.checked) {
+    if (ac_ldap_stat) {
         for (i = 0; i < ac_ldap.countLdapServers(); i++) {
             var ldap = SetupManager.createLdap();
             ldap.setEditMode(page2.widget().checkBoxLdapEdit.checked);
@@ -208,16 +280,16 @@ function setup()
         var ldap = SetupManager.createLdap();
         ldap.setEditMode(page2.widget().checkBoxLdapEdit.checked);
         ldap.setPassword(page.widget().passwordEdit.text);
-        ldap.setUser(page.widget().nameEdit.text);
+        ldap.setUser(page.widget().emailEdit.text);
         ldap.setServer(guessServerName());
     }
 
-    if (page2.widget().checkBoxFreebusy.checked) {
+    if (ac_freebusy_stat) {
         var korganizer = SetupManager.createConfigFile("akonadi-calendarrc");
         korganizer.setEditMode(page2.widget().checkBoxFreebusyEdit.checked);
         korganizer.setEditName("freebusy");
         korganizer.setName("korganizer");
-        ispdb.fillFreebusyServer(0,korganizer);
+        ac_freebusy.fillFreebusyServer(0,korganizer);
     } else if (page2.widget().checkBoxFreebusyEdit.checked) {
         var korganizer = SetupManager.createConfigFile("akonadi-calendarrc");
         korganizer.setEditMode(page2.widget().checkBoxFreebusyEdit.checked);
@@ -228,11 +300,18 @@ function setup()
         korganizer.setConfig( "FreeBusy Retrieve", "FreeBusyRetrieveUrl", "https://" + guessServerName()  + "/freebusy/" );
     }
 
-    SetupManager.execute();
+    if (!servertest_running) {
+        SetupManager.execute();
+    }
 }
 
 try {
-  page.widget().emailEdit.textChanged.connect(emailChanged);
+  ServerTest.testFail.connect(testResultFail);
+  ServerTest.testResult.connect(testOk);
+
+  page.widget().emailEdit.textChanged.connect(validateInput);
+  page.widget().passwordEdit.textChanged.connect(validateInput);
+
   page.pageLeftNext.connect(checkAutoconfig);
   page2.pageLeftNext.connect(setup);
 } catch (e) {
diff --git a/resources/kolab/wizard/kolabwizard2.ui b/resources/kolab/wizard/kolabwizard2.ui
index aa664a0..cad3dc6 100644
--- a/resources/kolab/wizard/kolabwizard2.ui
+++ b/resources/kolab/wizard/kolabwizard2.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>368</width>
-    <height>116</height>
+    <width>625</width>
+    <height>134</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -37,25 +37,31 @@
       </widget>
      </item>
      <item>
-      <widget class="QCheckBox" name="checkBoxImap">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
+      <widget class="QLabel" name="lineEditImapLabel">
        <property name="text">
-        <string>Use Autoconfig</string>
+        <string>Imap Servername:</string>
        </property>
       </widget>
      </item>
      <item>
+      <widget class="QLineEdit" name="lineEditImap"/>
+     </item>
+     <item>
       <widget class="QCheckBox" name="checkBoxImapEdit">
+       <property name="enabled">
+        <bool>true</bool>
+       </property>
        <property name="text">
-        <string>Edit</string>
+        <string>Manuell Edit</string>
+       </property>
+       <property name="checked">
+        <bool>false</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="4" column="1">
+   <item row="5" column="1">
     <layout class="QHBoxLayout" name="horizontalLayout_4">
      <item>
       <widget class="QLabel" name="labelFreebusySearch">
@@ -71,28 +77,18 @@
       </widget>
      </item>
      <item>
-      <widget class="QCheckBox" name="checkBoxFreebusy">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>Use Autoconfig</string>
-       </property>
-      </widget>
-     </item>
-     <item>
       <widget class="QCheckBox" name="checkBoxFreebusyEdit">
        <property name="enabled">
         <bool>true</bool>
        </property>
        <property name="text">
-        <string>Edit</string>
+        <string>Create</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="4" column="0">
+   <item row="5" column="0">
     <widget class="QLabel" name="labelFreebusy">
      <property name="text">
       <string>Freebusy:</string>
@@ -122,25 +118,31 @@
       </widget>
      </item>
      <item>
-      <widget class="QCheckBox" name="checkBoxSmtp">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
+      <widget class="QLabel" name="lineEditSmtpLabel">
        <property name="text">
-        <string>Use Autoconfig</string>
+        <string>Smtp Servername:</string>
        </property>
       </widget>
      </item>
      <item>
+      <widget class="QLineEdit" name="lineEditSmtp"/>
+     </item>
+     <item>
       <widget class="QCheckBox" name="checkBoxSmtpEdit">
+       <property name="enabled">
+        <bool>true</bool>
+       </property>
        <property name="text">
-        <string>Edit</string>
+        <string>Manuell Edit</string>
+       </property>
+       <property name="checked">
+        <bool>false</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="2" column="1">
+   <item row="3" column="1">
     <layout class="QHBoxLayout" name="horizontalLayout_2">
      <item>
       <widget class="QLabel" name="labelLdapSearch">
@@ -156,25 +158,15 @@
       </widget>
      </item>
      <item>
-      <widget class="QCheckBox" name="checkBoxLdap">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>Use Autoconfig</string>
-       </property>
-      </widget>
-     </item>
-     <item>
       <widget class="QCheckBox" name="checkBoxLdapEdit">
        <property name="text">
-        <string>Edit</string>
+        <string>Create</string>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="2" column="0">
+   <item row="3" column="0">
     <widget class="QLabel" name="labelLdap">
      <property name="text">
       <string>Ldap:</string>


commit e854d6ba397bc1661e13e867e5b0ea4db6982c76
Author: Sandro Knauß <mail at sandroknauss.de>
Date:   Wed Oct 22 13:27:22 2014 +0200

    resource/kolab: Add functunality to edit buttons in wizard
    
    The user should be able in any case to edit all configuations, that are
    set via the accountwizard. Also if there are no autoconfig are found.
    
    Additonaly use the new freebusy config file "akonadi-calendarrc".
    
    KOLAB: 3728

diff --git a/resources/kolab/wizard/kolabwizard.es b/resources/kolab/wizard/kolabwizard.es
index 2ecf14c..d764a6c 100644
--- a/resources/kolab/wizard/kolabwizard.es
+++ b/resources/kolab/wizard/kolabwizard.es
@@ -143,6 +143,7 @@ function setup()
 {
     SetupManager.openWallet();
     smtp = SetupManager.createTransport("smtp");
+    smtp.setEditMode(page2.widget().checkBoxSmtpEdit.checked);
     smtp.setPassword(page.widget().passwordEdit.text);
 
     if (page2.widget().checkBoxSmtp.checked) {
@@ -177,6 +178,7 @@ function setup()
     }
 
     kolabRes = SetupManager.createResource("akonadi_kolab_resource");
+    kolabRes.setEditMode(page2.widget().checkBoxImapEdit.checked);
     kolabRes.setOption("Password", page.widget().passwordEdit.text);
     kolabRes.setOption("UseDefaultIdentity", false);
     kolabRes.setOption("AccountIdentity", identity.uoid());
@@ -195,19 +197,35 @@ function setup()
         kolabRes.setOption("Safety", "STARTTLS");
         kolabRes.setOption("ImapPort", 143);
     }
+
     if (page2.widget().checkBoxLdap.checked) {
         for (i = 0; i < ac_ldap.countLdapServers(); i++) {
             var ldap = SetupManager.createLdap();
+            ldap.setEditMode(page2.widget().checkBoxLdapEdit.checked);
             ac_ldap.fillLdapServer(i,ldap);
         }
-    } else if (page2.widget().checkBoxLdapEdit) {
-        SetupManager.createLdap();
+    } else if (page2.widget().checkBoxLdapEdit.checked) {
+        var ldap = SetupManager.createLdap();
+        ldap.setEditMode(page2.widget().checkBoxLdapEdit.checked);
+        ldap.setPassword(page.widget().passwordEdit.text);
+        ldap.setUser(page.widget().nameEdit.text);
+        ldap.setServer(guessServerName());
     }
 
     if (page2.widget().checkBoxFreebusy.checked) {
-        var korganizer = SetupManager.createConfigFile("korganizerrc");
+        var korganizer = SetupManager.createConfigFile("akonadi-calendarrc");
+        korganizer.setEditMode(page2.widget().checkBoxFreebusyEdit.checked);
+        korganizer.setEditName("freebusy");
         korganizer.setName("korganizer");
         ispdb.fillFreebusyServer(0,korganizer);
+    } else if (page2.widget().checkBoxFreebusyEdit.checked) {
+        var korganizer = SetupManager.createConfigFile("akonadi-calendarrc");
+        korganizer.setEditMode(page2.widget().checkBoxFreebusyEdit.checked);
+        korganizer.setEditName("freebusy");
+        korganizer.setName( "korganizer" );
+        korganizer.setConfig( "FreeBusy Retrieve", "FreeBusyFullDomainRetrieval","true");
+        korganizer.setConfig( "FreeBusy Retrieve", "FreeBusyRetrieveAuto", "true" );
+        korganizer.setConfig( "FreeBusy Retrieve", "FreeBusyRetrieveUrl", "https://" + guessServerName()  + "/freebusy/" );
     }
 
     SetupManager.execute();


commit d659d2bc0223fea0a240278d536a6cb891eb55d0
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date:   Tue Oct 28 12:12:27 2014 +0100

    KolabResource: no uneccessary debug output
    
    We rely on this codepaths.

diff --git a/resources/kolab/kolabhelpers.cpp b/resources/kolab/kolabhelpers.cpp
index 7caef72..c72e790 100644
--- a/resources/kolab/kolabhelpers.cpp
+++ b/resources/kolab/kolabhelpers.cpp
@@ -402,7 +402,7 @@ QStringList KolabHelpers::getContentMimeTypes(Kolab::FolderType type)
             contentTypes << QLatin1String(KOLAB_TYPE_RELATION);
             break;
         default:
-            kDebug() << "unhandled folder type: " << type;
+            break;
     }
     return contentTypes;
 }
diff --git a/resources/kolab/kolabresourcestate.cpp b/resources/kolab/kolabresourcestate.cpp
index 86e9789..c072cf1 100644
--- a/resources/kolab/kolabresourcestate.cpp
+++ b/resources/kolab/kolabresourcestate.cpp
@@ -47,7 +47,7 @@ static Akonadi::Collection processAnnotations(const Akonadi::Collection &collect
 
         const QString icon = KolabHelpers::getIcon(folderType);
         if (!icon.isEmpty()) {
-            kDebug() << " setting icon " << icon;
+            // kDebug() << " setting icon " << icon;
             Akonadi::EntityDisplayAttribute *attr = col.attribute<Akonadi::EntityDisplayAttribute>(Akonadi::Collection::AddIfMissing);
             attr->setIconName(icon);
         }
diff --git a/resources/kolab/kolabretrievecollectionstask.cpp b/resources/kolab/kolabretrievecollectionstask.cpp
index 04ce514..cfc8b19 100644
--- a/resources/kolab/kolabretrievecollectionstask.cpp
+++ b/resources/kolab/kolabretrievecollectionstask.cpp
@@ -407,11 +407,12 @@ void KolabRetrieveCollectionsTask::applyRights(QHash<QString, KIMAP::Acl::Rights
             QStringList parts = mailbox.split(separatorCharacter());
             parts.removeLast();
             QString parentMailbox = parts.join(separatorCharacter());
-            if (!parentMailbox.isEmpty() &&!rights.contains(parentMailbox)) {
-                kWarning() << "Couldn't find parent mailbox rights";
-            }
 
-            const KIMAP::Acl::Rights parentImapRights = rights.value(parentMailbox);
+            KIMAP::Acl::Rights parentImapRights;
+            //If the parent folder is not existing we cant rename
+            if (!parentMailbox.isEmpty() && rights.contains(parentMailbox)) {
+                parentImapRights = rights.value(parentMailbox);
+            }
             // kDebug() << mailbox << parentMailbox << imapRights << parentImapRights;
 
             Akonadi::Collection &collection = mMailCollections[mailbox];


commit 519d421746678244eb0384092658ce93a4598926
Author: Sandro Knauß <mail at sandroknauss.de>
Date:   Fri Oct 24 13:14:33 2014 +0200

    Add own setting dialog for kolab resource
    
    * add own defaults for kolabresource
      -> m_settings, onConfigurationDone  must be protected to be used from
      koloab resource
    
    * modify setting dialog for kolab
      - add kolab icon for dialog
      - do not show "offline use" checkbox
    
    KOLAB: 3022

diff --git a/resources/imap/imapresource.h b/resources/imap/imapresource.h
index 2101341..e8bd6c6 100644
--- a/resources/imap/imapresource.h
+++ b/resources/imap/imapresource.h
@@ -43,7 +43,7 @@ public:
 protected:
     virtual QString defaultName() const;
 
-private Q_SLOTS:
+protected Q_SLOTS:
     void onConfigurationDone( int result );
 };
 
diff --git a/resources/imap/imapresourcebase.h b/resources/imap/imapresourcebase.h
index e4b234b..04a7cf9 100644
--- a/resources/imap/imapresourcebase.h
+++ b/resources/imap/imapresourcebase.h
@@ -151,6 +151,8 @@ protected:
   void queueTask( ResourceTask *task );
   SessionPool *m_pool;
 
+  mutable Settings *m_settings;
+
 private:
   friend class ResourceState;
 
@@ -164,7 +166,6 @@ private:
   ImapIdleManager *m_idle;
   QTimer *m_statusMessageTimer;
   QChar m_separatorCharacter;
-  mutable Settings *m_settings;
 };
 
 #endif
diff --git a/resources/kolab/CMakeLists.txt b/resources/kolab/CMakeLists.txt
index 4c410c8..b01817d 100644
--- a/resources/kolab/CMakeLists.txt
+++ b/resources/kolab/CMakeLists.txt
@@ -26,6 +26,7 @@ set(kolabresource_LIB_SRCS
     kolabremovetagtask.cpp
     tagchangehelper.cpp
     kolabretrievetagstask.cpp
+    kolabsettings.cpp
 )
 
 kde4_add_kcfg_files(kolabresource_LIB_SRCS ../imap/settingsbase.kcfgc)
@@ -56,14 +57,14 @@ set(kolabresource_SRCS
     kolabresourcestate.cpp
     ../imap/imapresource.cpp
     ../imap/settingspasswordrequester.cpp
-    ../imap/setupserver.cpp
+    setupserver.cpp
     ../imap/serverinfodialog.cpp
 )
 
 if (KDEPIM_MOBILE_UI)
-    kde4_add_ui_files(kolabresource_SRCS ../imap/setupserverview_mobile.ui)
+    kde4_add_ui_files(kolabresource_SRCS setupserverview_mobile.ui)
 else ()
-    kde4_add_ui_files(kolabresource_SRCS ../imap/setupserverview_desktop.ui)
+    kde4_add_ui_files(kolabresource_SRCS setupserverview_desktop.ui)
 endif ()
 kde4_add_ui_files(kolabresource_SRCS ../imap/serverinfo.ui)
 
diff --git a/resources/kolab/kolabresource.cpp b/resources/kolab/kolabresource.cpp
index b64b7de..ec3b5d9 100644
--- a/resources/kolab/kolabresource.cpp
+++ b/resources/kolab/kolabresource.cpp
@@ -19,6 +19,7 @@
 
 #include "kolabresource.h"
 
+#include "setupserver.h"
 #include <resourcestateinterface.h>
 #include <resourcestate.h>
 #include <timestampattribute.h>
@@ -26,13 +27,14 @@
 #include <collectionannotationsattribute.h>
 #include <changecollectiontask.h>
 
+#include <KWindowSystem>
 #include <KLocalizedString>
 #include <KLocale>
 
 #include "kolabretrievecollectionstask.h"
 #include "kolabresourcestate.h"
 #include "kolabhelpers.h"
-#include "settings.h"
+#include "kolabsettings.h"
 #include "kolabaddtagtask.h"
 #include "kolabchangeitemstagstask.h"
 #include "kolabchangetagtask.h"
@@ -53,6 +55,15 @@ KolabResource::~KolabResource()
 
 }
 
+Settings *KolabResource::settings() const
+{
+  if (m_settings == 0) {
+    m_settings = new KolabSettings;
+  }
+
+  return m_settings;
+}
+
 void KolabResource::delayedInit()
 {
     ImapResource::delayedInit();
@@ -65,6 +76,15 @@ QString KolabResource::defaultName()
     return i18n("Kolab Resource");
 }
 
+KDialog *KolabResource::createConfigureDialog(WId windowId)
+{
+  SetupServer *dlg = new SetupServer( this, windowId );
+  KWindowSystem::setMainWindow( dlg, windowId );
+  dlg->setWindowIcon( KIcon( QLatin1String("kolab") ) );
+  connect(dlg, SIGNAL(finished(int)), this, SLOT(onConfigurationDone(int)));;
+  return dlg;
+}
+
 ResourceStateInterface::Ptr KolabResource::createResourceState(const TaskArguments &args)
 {
     return ResourceStateInterface::Ptr(new KolabResourceState(this, args));
diff --git a/resources/kolab/kolabresource.h b/resources/kolab/kolabresource.h
index 53eaf2b..7971ebb 100644
--- a/resources/kolab/kolabresource.h
+++ b/resources/kolab/kolabresource.h
@@ -33,6 +33,9 @@ public:
     explicit KolabResource(const QString &id);
     ~KolabResource();
 
+    virtual KDialog *createConfigureDialog ( WId windowId );
+    virtual Settings* settings() const;
+
 protected Q_SLOTS:
     virtual void retrieveCollections();
     virtual void delayedInit();
diff --git a/resources/kolab/kolabsettings.cpp b/resources/kolab/kolabsettings.cpp
new file mode 100644
index 0000000..14bff2c
--- /dev/null
+++ b/resources/kolab/kolabsettings.cpp
@@ -0,0 +1,55 @@
+/*
+    Copyright (c) 2014 Sandro Knauß <knauss at kolabsys.com>
+
+    This library is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Library General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    This library is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
+    License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to the
+    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301, USA.
+*/
+
+#include "kolabsettings.h"
+
+#include <klocale.h>
+
+KolabSettings::KolabSettings( WId winId ) : Settings(winId)
+{
+    changeDefaults();
+    readConfig();
+}
+
+void KolabSettings::changeDefaults()
+{
+    setCurrentGroup(QLatin1String("network"));
+    KConfigSkeleton::ItemInt  *itemImapPort;
+    itemImapPort = (KConfigSkeleton::ItemInt*) findItem(QLatin1String("ImapPort"));
+    itemImapPort->setDefaultValue(143);
+    KConfigSkeleton::ItemString  *itemSafety;
+    itemSafety = (KConfigSkeleton::ItemString*) findItem(QLatin1String("Safety"));
+    itemSafety->setDefaultValue(QLatin1String("STARTTLS"));
+    KConfigSkeleton::ItemBool  *itemSubscriptionEnabled;
+    itemSubscriptionEnabled = (KConfigSkeleton::ItemBool*) findItem(QLatin1String("SubscriptionEnabled"));
+    itemSubscriptionEnabled->setDefaultValue(true);
+
+    setCurrentGroup(QLatin1String("cache"));
+    KConfigSkeleton::ItemBool  *itemDisconnectedModeEnabled;
+    itemDisconnectedModeEnabled = (KConfigSkeleton::ItemBool*) findItem(QLatin1String("DisconnectedModeEnabled"));
+    itemDisconnectedModeEnabled->setDefaultValue(true);
+
+    setCurrentGroup(QLatin1String("siever"));
+    KConfigSkeleton::ItemBool  *itemSieveSupport;
+    itemSieveSupport = (KConfigSkeleton::ItemBool*) findItem(QLatin1String("SieveSupport"));
+    itemSieveSupport->setDefaultValue(true);
+    KConfigSkeleton::ItemBool  *itemSieveReuseConfig;
+    itemSieveReuseConfig = (KConfigSkeleton::ItemBool*) findItem(QLatin1String("SieveReuseConfig"));
+    itemSieveReuseConfig->setDefaultValue(true);
+}
diff --git a/resources/kolab/kolabsettings.h b/resources/kolab/kolabsettings.h
new file mode 100644
index 0000000..22276f2
--- /dev/null
+++ b/resources/kolab/kolabsettings.h
@@ -0,0 +1,36 @@
+/*
+    Copyright (c) 2014 Sandro Knauß <knauss at kolabsys.com>
+
+    This library is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Library General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    This library is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
+    License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to the
+    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301, USA.
+*/
+
+#ifndef KOLABSETTINGS_H
+#define KOLABSETTINGS_H
+
+#include "settings.h"
+
+
+class KolabSettings : public Settings
+{
+  Q_OBJECT
+public:
+    explicit KolabSettings( WId = 0 );
+
+protected:
+    virtual void changeDefaults();
+};
+
+#endif
diff --git a/resources/kolab/setupserver.cpp b/resources/kolab/setupserver.cpp
new file mode 100644
index 0000000..8ba3060
--- /dev/null
+++ b/resources/kolab/setupserver.cpp
@@ -0,0 +1,667 @@
+/* This file is part of the KDE project
+
+   Copyright (c) 2010 Klarälvdalens Datakonsult AB,
+                      a KDAB Group company <info at kdab.com>
+   Author: Kevin Ottens <kevin at kdab.com>
+
+   Copyright (C) 2010 Casey Link <unnamedrambler at gmail.com>
+   Copyright (c) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info at kdab.net>
+   Copyright (C) 2009 Kevin Ottens <ervin at kde.org>
+   Copyright (C) 2006-2008 Omat Holding B.V. <info at omat.nl>
+   Copyright (C) 2006 Frode M. Døving <frode at lnix.net>
+
+   Original copied from showfoto:
+    Copyright 2005 by Gilles Caulier <caulier.gilles at free.fr>
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include "setupserver.h"
+#include "settings.h"
+#include "imapresource.h"
+#include "serverinfodialog.h"
+#include "resources/folderarchivesettings/folderarchivesettingpage.h"
+
+
+#include <mailtransport/transport.h>
+#include <mailtransport/servertest.h>
+
+#include <kmime/kmime_message.h>
+
+#include <akonadi/collectionfetchjob.h>
+#include <akonadi/kmime/specialmailcollections.h>
+#include <akonadi/kmime/specialmailcollectionsrequestjob.h>
+#include <akonadi/resourcesettings.h>
+#include <akonadi/entitydisplayattribute.h>
+#include <Akonadi/CollectionModifyJob>
+#include <kemailsettings.h>
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <kmessagebox.h>
+#include <kuser.h>
+#ifndef IMAPRESOURCE_NO_SOLID
+#include <solid/networking.h>
+#endif
+
+#include <kpimidentities/identitymanager.h>
+#include <kpimidentities/identitycombo.h>
+
+#include "imapaccount.h"
+#include "subscriptiondialog.h"
+
+#ifdef KDEPIM_MOBILE_UI
+#include "ui_setupserverview_mobile.h"
+#else
+#include "ui_setupserverview_desktop.h"
+#endif
+#include "ui_serverinfo.h"
+
+/** static helper functions **/
+static QString authenticationModeString( MailTransport::Transport::EnumAuthenticationType::type mode )
+{
+  switch ( mode ) {
+    case  MailTransport::Transport::EnumAuthenticationType::LOGIN:
+      return QLatin1String("LOGIN");
+    case MailTransport::Transport::EnumAuthenticationType::PLAIN:
+      return QLatin1String("PLAIN");
+    case MailTransport::Transport::EnumAuthenticationType::CRAM_MD5:
+      return QLatin1String("CRAM-MD5");
+    case MailTransport::Transport::EnumAuthenticationType::DIGEST_MD5:
+      return QLatin1String("DIGEST-MD5");
+    case MailTransport::Transport::EnumAuthenticationType::GSSAPI:
+      return QLatin1String("GSSAPI");
+    case MailTransport::Transport::EnumAuthenticationType::NTLM:
+      return QLatin1String("NTLM");
+    case MailTransport::Transport::EnumAuthenticationType::CLEAR:
+      return i18nc( "Authentication method", "Clear text" );
+    case MailTransport::Transport::EnumAuthenticationType::ANONYMOUS:
+      return i18nc( "Authentication method", "Anonymous" );
+    default:
+      break;
+  }
+  return QString();
+}
+
+static void setCurrentAuthMode( QComboBox* authCombo, MailTransport::Transport::EnumAuthenticationType::type authtype )
+{
+  kDebug() << "setting authcombo: " << authenticationModeString( authtype );
+  int index = authCombo->findData( authtype );
+  if ( index == -1 )
+    kWarning() << "desired authmode not in the combo";
+  kDebug() << "found corresponding index: " << index << "with data" << authenticationModeString( (MailTransport::Transport::EnumAuthenticationType::type) authCombo->itemData( index ).toInt() );
+  authCombo->setCurrentIndex( index );
+  MailTransport::Transport::EnumAuthenticationType::type t = (MailTransport::Transport::EnumAuthenticationType::type) authCombo->itemData( authCombo->currentIndex() ).toInt();
+  kDebug() << "selected auth mode:" << authenticationModeString( t );
+  Q_ASSERT( t == authtype );
+}
+
+static MailTransport::Transport::EnumAuthenticationType::type getCurrentAuthMode( QComboBox* authCombo )
+{
+  MailTransport::Transport::EnumAuthenticationType::type authtype = (MailTransport::Transport::EnumAuthenticationType::type) authCombo->itemData( authCombo->currentIndex() ).toInt();
+  kDebug() << "current auth mode: " << authenticationModeString( authtype );
+  return authtype;
+}
+
+static void addAuthenticationItem( QComboBox* authCombo, MailTransport::Transport::EnumAuthenticationType::type authtype )
+{
+    kDebug() << "adding auth item " << authenticationModeString( authtype );
+    authCombo->addItem( authenticationModeString( authtype ), QVariant( authtype ) );
+}
+
+SetupServer::SetupServer( ImapResourceBase *parentResource, WId parent )
+  : KDialog(), m_parentResource( parentResource ), m_ui(new Ui::SetupServerView), m_serverTest(0),
+    m_subscriptionsChanged(false), m_shouldClearCache(false), mValidator( this )
+{
+  m_parentResource->settings()->setWinId( parent );
+  m_ui->setupUi( mainWidget() );
+
+  //kolabresource always use disconnected mode
+  m_ui->disconnectedModeEnabled->setVisible(false);
+
+  m_folderArchiveSettingPage = new FolderArchiveSettingPage(m_parentResource->identifier());
+  m_ui->tabWidget->addTab(m_folderArchiveSettingPage, i18n("Folder Archive"));
+  m_ui->safeImapGroup->setId( m_ui->noRadio, KIMAP::LoginJob::Unencrypted );
+  m_ui->safeImapGroup->setId( m_ui->sslRadio, KIMAP::LoginJob::AnySslVersion );
+  m_ui->safeImapGroup->setId( m_ui->tlsRadio, KIMAP::LoginJob::TlsV1 );
+
+  connect( m_ui->noRadio, SIGNAL(toggled(bool)),
+           this, SLOT(slotSafetyChanged()) );
+  connect( m_ui->sslRadio, SIGNAL(toggled(bool)),
+           this, SLOT(slotSafetyChanged()) );
+  connect( m_ui->tlsRadio, SIGNAL(toggled(bool)),
+           this, SLOT(slotSafetyChanged()) );
+
+  m_ui->testInfo->hide();
+  m_ui->testProgress->hide();
+  m_ui->accountName->setFocus();
+  m_ui->checkInterval->setSuffix( ki18np( " minute", " minutes" ) );
+  m_ui->checkInterval->setRange( Akonadi::ResourceSettings::self()->minimumCheckInterval(), 10000, 1 );
+
+  // regex for evaluating a valid server name/ip
+  mValidator.setRegExp( QRegExp( QLatin1String("[A-Za-z0-9-_:.]*") ) );
+  m_ui->imapServer->setValidator( &mValidator );
+
+  m_ui->folderRequester->setMimeTypeFilter(
+    QStringList() << KMime::Message::mimeType() );
+  m_ui->folderRequester->setAccessRightsFilter( Akonadi::Collection::CanChangeItem | Akonadi::Collection::CanCreateItem | Akonadi::Collection::CanDeleteItem );
+  m_ui->folderRequester->changeCollectionDialogOptions( Akonadi::CollectionDialog::AllowToCreateNewChildCollection );
+  m_identityManager = new KPIMIdentities::IdentityManager( false, this, "mIdentityManager" );
+  m_identityCombobox = new KPIMIdentities::IdentityCombo( m_identityManager, this );
+  m_ui->identityLabel->setBuddy( m_identityCombobox );
+  m_ui->identityLayout->addWidget( m_identityCombobox, 1 );
+  m_ui->identityLabel->setBuddy( m_identityCombobox );
+
+
+  connect( m_ui->testButton, SIGNAL(pressed()), SLOT(slotTest()) );
+
+  connect( m_ui->imapServer, SIGNAL(textChanged(QString)),
+           SLOT(slotTestChanged()) );
+  connect( m_ui->imapServer, SIGNAL(textChanged(QString)),
+           SLOT(slotComplete()) );
+  connect( m_ui->userName, SIGNAL(textChanged(QString)),
+           SLOT(slotComplete()) );
+  connect( m_ui->subscriptionEnabled, SIGNAL(toggled(bool)), this, SLOT(slotSubcriptionCheckboxChanged()) );
+  connect( m_ui->subscriptionButton, SIGNAL(pressed()), SLOT(slotManageSubscriptions()) );
+
+  connect( m_ui->managesieveCheck, SIGNAL(toggled(bool)),
+           SLOT(slotEnableWidgets()) );
+  connect( m_ui->sameConfigCheck, SIGNAL(toggled(bool)),
+           SLOT(slotEnableWidgets()) );
+
+
+  connect( m_ui->useDefaultIdentityCheck, SIGNAL(toggled(bool)), this, SLOT(slotIdentityCheckboxChanged()) );
+  connect( m_ui->enableMailCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotMailCheckboxChanged()) );
+  connect( m_ui->safeImapGroup, SIGNAL(buttonClicked(int)), this, SLOT(slotEncryptionRadioChanged()) );
+  connect( m_ui->customSieveGroup, SIGNAL(buttonClicked(int)), this, SLOT(slotCustomSieveChanged()) );
+  connect( m_ui->showServerInfo, SIGNAL(pressed()), this, SLOT(slotShowServerInfo()) );
+
+  readSettings();
+  slotTestChanged();
+  slotComplete();
+  slotCustomSieveChanged();
+#ifndef IMAPRESOURCE_NO_SOLID
+  connect( Solid::Networking::notifier(),
+           SIGNAL(statusChanged(Solid::Networking::Status)),
+           SLOT(slotTestChanged()) );
+#endif
+  connect( this, SIGNAL(applyClicked()),
+           SLOT(applySettings()) );
+  connect( this, SIGNAL(okClicked()),
+           SLOT(applySettings()) );
+}
+
+SetupServer::~SetupServer()
+{
+  delete m_ui;
+}
+
+bool SetupServer::shouldClearCache() const
+{
+  return m_shouldClearCache;
+}
+
+void SetupServer::slotSubcriptionCheckboxChanged()
+{
+  m_ui->subscriptionButton->setEnabled( m_ui->subscriptionEnabled->isChecked() );
+}
+
+void SetupServer::slotIdentityCheckboxChanged()
+{
+  m_identityCombobox->setEnabled( !m_ui->useDefaultIdentityCheck->isChecked() );
+}
+
+void SetupServer::slotMailCheckboxChanged()
+{
+  m_ui->checkInterval->setEnabled( m_ui->enableMailCheckBox->isChecked() );
+}
+
+void SetupServer::slotEncryptionRadioChanged()
+{
+  // TODO these really should be defined somewhere else
+  switch ( m_ui->safeImapGroup->checkedId() ) {
+    case KIMAP::LoginJob::Unencrypted:
+    case KIMAP::LoginJob::TlsV1:
+      m_ui->portSpin->setValue( 143 );
+      break;
+    case KIMAP::LoginJob::AnySslVersion:
+      m_ui->portSpin->setValue( 993 );
+      break;
+  default:
+    kFatal() << "Shouldn't happen";
+  }
+}
+
+void SetupServer::slotCustomSieveChanged()
+{
+    QAbstractButton *checkedButton = m_ui->customSieveGroup->checkedButton();
+
+    if (checkedButton == m_ui->imapUserPassword ||
+            checkedButton == m_ui->noAuthentification ) {
+        m_ui->customUsername->setEnabled(false);
+        m_ui->customPassword->setEnabled(false);
+    } else if (checkedButton == m_ui->customUserPassword) {
+        m_ui->customUsername->setEnabled(true);
+        m_ui->customPassword->setEnabled(true);
+    }
+}
+
+void SetupServer::applySettings()
+{
+  m_folderArchiveSettingPage->writeSettings();
+  m_shouldClearCache = ( m_parentResource->settings()->imapServer() != m_ui->imapServer->text() )
+                    || ( m_parentResource->settings()->userName() != m_ui->userName->text() );
+
+  m_parentResource->setName( m_ui->accountName->text() );
+
+  m_parentResource->settings()->setImapServer( m_ui->imapServer->text() );
+  m_parentResource->settings()->setImapPort( m_ui->portSpin->value() );
+  m_parentResource->settings()->setUserName( m_ui->userName->text() );
+  QString encryption;
+  switch ( m_ui->safeImapGroup->checkedId() ) {
+  case KIMAP::LoginJob::Unencrypted :
+    encryption = QLatin1String("None");
+    break;
+  case KIMAP::LoginJob::AnySslVersion:
+    encryption = QLatin1String("SSL");
+    break;
+  case KIMAP::LoginJob::TlsV1:
+    encryption = QLatin1String("STARTTLS");
+    break;
+  default:
+    kFatal() << "Shouldn't happen";
+  }
+  m_parentResource->settings()->setSafety( encryption );
+  MailTransport::Transport::EnumAuthenticationType::type authtype = getCurrentAuthMode( m_ui->authenticationCombo );
+  kDebug() << "saving IMAP auth mode: " << authenticationModeString( authtype );
+  m_parentResource->settings()->setAuthentication( authtype );
+  m_parentResource->settings()->setPassword( m_ui->password->text() );
+  m_parentResource->settings()->setSubscriptionEnabled( m_ui->subscriptionEnabled->isChecked() );
+  m_parentResource->settings()->setIntervalCheckTime( m_ui->checkInterval->value() );
+  m_parentResource->settings()->setDisconnectedModeEnabled( m_ui->disconnectedModeEnabled->isChecked() );
+
+  m_parentResource->settings()->setSieveSupport( m_ui->managesieveCheck->isChecked() );
+  m_parentResource->settings()->setSieveReuseConfig( m_ui->sameConfigCheck->isChecked() );
+  m_parentResource->settings()->setSievePort( m_ui->sievePortSpin->value() );
+  m_parentResource->settings()->setSieveAlternateUrl( m_ui->alternateURL->text() );
+  m_parentResource->settings()->setSieveVacationFilename( m_vacationFileName );
+
+  m_parentResource->settings()->setTrashCollection( m_ui->folderRequester->collection().id() );
+  Akonadi::Collection trash = m_ui->folderRequester->collection();
+  Akonadi::SpecialMailCollections::self()->registerCollection(Akonadi::SpecialMailCollections::Trash, trash);
+  Akonadi::EntityDisplayAttribute *attribute =  trash.attribute<Akonadi::EntityDisplayAttribute>( Akonadi::Entity::AddIfMissing );
+  attribute->setIconName( QLatin1String( "user-trash" ) );
+  new Akonadi::CollectionModifyJob( trash );
+  if (mOldTrash != trash) {
+      Akonadi::SpecialMailCollections::self()->unregisterCollection(mOldTrash);
+  }
+
+  m_parentResource->settings()->setAutomaticExpungeEnabled( m_ui->autoExpungeCheck->isChecked() );
+  m_parentResource->settings()->setUseDefaultIdentity( m_ui->useDefaultIdentityCheck->isChecked() );
+
+  if ( !m_ui->useDefaultIdentityCheck->isChecked() )
+    m_parentResource->settings()->setAccountIdentity( m_identityCombobox->currentIdentity() );
+
+  m_parentResource->settings()->setIntervalCheckEnabled( m_ui->enableMailCheckBox->isChecked() );
+  if ( m_ui->enableMailCheckBox->isChecked() )
+    m_parentResource->settings()->setIntervalCheckTime( m_ui->checkInterval->value() );
+
+  m_parentResource->settings()->setSieveCustomUsername(m_ui->customUsername->text());
+
+  QAbstractButton *checkedButton = m_ui->customSieveGroup->checkedButton();
+
+  if (checkedButton == m_ui->imapUserPassword) {
+      m_parentResource->settings()->setSieveCustomAuthentification(QLatin1String("ImapUserPassword"));
+  } else if (checkedButton == m_ui->noAuthentification) {
+      m_parentResource->settings()->setSieveCustomAuthentification(QLatin1String("NoAuthentification"));
+  } else if (checkedButton == m_ui->customUserPassword) {
+      m_parentResource->settings()->setSieveCustomAuthentification(QLatin1String("CustomUserPassword"));
+  }
+
+  m_parentResource->settings()->setSieveCustomPassword( m_ui->customPassword->text() );
+
+  m_parentResource->settings()->writeConfig();
+  kDebug() << "wrote" << m_ui->imapServer->text() << m_ui->userName->text() << m_ui->safeImapGroup->checkedId();
+
+  if ( m_oldResourceName != m_ui->accountName->text() && !m_ui->accountName->text().isEmpty() ) {
+    m_parentResource->settings()->renameRootCollection( m_ui->accountName->text() );
+  }
+}
+
+void SetupServer::readSettings()
+{
+  m_folderArchiveSettingPage->loadSettings();
+  m_ui->accountName->setText( m_parentResource->name() );
+  m_oldResourceName = m_ui->accountName->text();
+
+  KUser* currentUser = new KUser();
+  KEMailSettings esetting;
+
+  m_ui->imapServer->setText(
+    !m_parentResource->settings()->imapServer().isEmpty() ? m_parentResource->settings()->imapServer() :
+    esetting.getSetting( KEMailSettings::InServer ) );
+
+  kDebug() << m_parentResource->settings()->imapPort();
+  kDebug() <<  m_parentResource->settings()->safety();
+  m_ui->portSpin->setValue( m_parentResource->settings()->imapPort() );
+
+  m_ui->userName->setText(
+    !m_parentResource->settings()->userName().isEmpty() ? m_parentResource->settings()->userName() :
+    currentUser->loginName() );
+
+  const QString safety = m_parentResource->settings()->safety();
+  int i = KIMAP::LoginJob::TlsV1;
+  if ( safety == QLatin1String( "SSL" ) ) {
+    i = KIMAP::LoginJob::AnySslVersion;
+  } else if ( safety == QLatin1String( "STARTTLS" ) ) {
+    i = KIMAP::LoginJob::TlsV1;
+  } else if ( safety == QLatin1String( "None" ) ) {
+    i = KIMAP::LoginJob::Unencrypted;
+  }
+
+  QAbstractButton* safetyButton = m_ui->safeImapGroup->button( i );
+  if ( safetyButton )
+      safetyButton->setChecked( true );
+
+  populateDefaultAuthenticationOptions();
+  i = m_parentResource->settings()->authentication();
+  kDebug() << "read IMAP auth mode: " << authenticationModeString( (MailTransport::Transport::EnumAuthenticationType::type) i );
+  setCurrentAuthMode( m_ui->authenticationCombo, (MailTransport::Transport::EnumAuthenticationType::type) i );
+
+  bool rejected = false;
+  const QString password = m_parentResource->settings()->password( &rejected );
+  if ( rejected ) {
+    m_ui->password->setEnabled( false );
+    KMessageBox::information( 0, i18n( "Could not access KWallet. "
+                                       "If you want to store the password permanently then you have to "
+                                       "activate it. If you do not "
+                                       "want to use KWallet, check the box below, but note that you will be "
+                                       "prompted for your password when needed." ),
+                              i18n( "Do not use KWallet" ), QLatin1String("warning_kwallet_disabled") );
+  } else {
+    m_ui->password->insert( password );
+  }
+
+  m_ui->subscriptionEnabled->setChecked( m_parentResource->settings()->subscriptionEnabled() );
+
+  m_ui->checkInterval->setValue( m_parentResource->settings()->intervalCheckTime() );
+  m_ui->disconnectedModeEnabled->setChecked( m_parentResource->settings()->disconnectedModeEnabled() );
+
+  m_ui->managesieveCheck->setChecked( m_parentResource->settings()->sieveSupport() );
+  m_ui->sameConfigCheck->setChecked( m_parentResource->settings()->sieveReuseConfig() );
+  m_ui->sievePortSpin->setValue( m_parentResource->settings()->sievePort() );
+  m_ui->alternateURL->setText( m_parentResource->settings()->sieveAlternateUrl() );
+  m_vacationFileName = m_parentResource->settings()->sieveVacationFilename();
+
+
+  Akonadi::Collection trashCollection( m_parentResource->settings()->trashCollection() );
+  if ( trashCollection.isValid() ) {
+    Akonadi::CollectionFetchJob *fetchJob = new Akonadi::CollectionFetchJob( trashCollection,Akonadi::CollectionFetchJob::Base,this );
+    connect( fetchJob, SIGNAL(collectionsReceived(Akonadi::Collection::List)),
+             this, SLOT(targetCollectionReceived(Akonadi::Collection::List)) );
+  } else {
+    Akonadi::SpecialMailCollectionsRequestJob *requestJob = new Akonadi::SpecialMailCollectionsRequestJob( this );
+    connect ( requestJob, SIGNAL(result(KJob*)),
+              this, SLOT(localFolderRequestJobFinished(KJob*)) );
+    requestJob->requestDefaultCollection( Akonadi::SpecialMailCollections::Trash );
+    requestJob->start();
+  }
+
+  m_ui->useDefaultIdentityCheck->setChecked( m_parentResource->settings()->useDefaultIdentity() );
+  if ( !m_ui->useDefaultIdentityCheck->isChecked() )
+    m_identityCombobox->setCurrentIdentity( m_parentResource->settings()->accountIdentity() );
+
+  m_ui->enableMailCheckBox->setChecked( m_parentResource->settings()->intervalCheckEnabled() );
+  if ( m_ui->enableMailCheckBox->isChecked() )
+    m_ui->checkInterval->setValue( m_parentResource->settings()->intervalCheckTime() );
+  else
+    m_ui->checkInterval->setEnabled( false );
+
+  m_ui->autoExpungeCheck->setChecked( m_parentResource->settings()->automaticExpungeEnabled() );
+
+  if ( m_vacationFileName.isEmpty() )
+    m_vacationFileName = QLatin1String("kmail-vacation.siv");
+
+  m_ui->customUsername->setText(m_parentResource->settings()->sieveCustomUsername());
+
+  m_ui->customPassword->setText(m_parentResource->settings()->sieveCustomPassword());
+
+
+  const QString sieverCustomAuth(m_parentResource->settings()->sieveCustomAuthentification());
+  if (sieverCustomAuth == QLatin1String("ImapUserPassword"))
+      m_ui->imapUserPassword->setChecked(true);
+  else if (sieverCustomAuth == QLatin1String("NoAuthentification"))
+      m_ui->noAuthentification->setChecked(true);
+  else if (sieverCustomAuth == QLatin1String("CustomUserPassword"))
+      m_ui->customUserPassword->setChecked(true);
+
+  delete currentUser;
+}
+
+void SetupServer::slotTest()
+{
+  kDebug() << m_ui->imapServer->text();
+
+  m_ui->testButton->setEnabled( false );
+  m_ui->safeImap->setEnabled( false );
+  m_ui->authenticationCombo->setEnabled( false );
+
+  m_ui->testInfo->clear();
+  m_ui->testInfo->hide();
+
+  delete m_serverTest;
+  m_serverTest = new MailTransport::ServerTest( this );
+#ifndef QT_NO_CURSOR
+  qApp->setOverrideCursor( Qt::BusyCursor );
+#endif
+
+  const QString server = m_ui->imapServer->text();
+  const int port = m_ui->portSpin->value();
+  kDebug() << "server: " << server << "port: " << port;
+
+  m_serverTest->setServer( server );
+
+  if ( port != 143 && port != 993 ) {
+    m_serverTest->setPort( MailTransport::Transport::EnumEncryption::None, port );
+    m_serverTest->setPort( MailTransport::Transport::EnumEncryption::SSL, port );
+  }
+
+  m_serverTest->setProtocol( QLatin1String("imap") );
+  m_serverTest->setProgressBar( m_ui->testProgress );
+  connect( m_serverTest, SIGNAL(finished(QList<int>)),
+           SLOT(slotFinished(QList<int>)) );
+  enableButtonOk( false );
+  m_serverTest->start();
+}
+
+void SetupServer::slotFinished( const QList<int> &testResult )
+{
+  kDebug() << testResult;
+
+#ifndef QT_NO_CURSOR
+  qApp->restoreOverrideCursor();
+#endif
+  enableButtonOk( true );
+
+  using namespace MailTransport;
+
+  if ( !m_serverTest->isNormalPossible() && !m_serverTest->isSecurePossible() )
+    KMessageBox::sorry( this, i18n( "Unable to connect to the server, please verify the server address." ) );
+
+  m_ui->testInfo->show();
+
+  m_ui->sslRadio->setEnabled( testResult.contains( Transport::EnumEncryption::SSL ) );
+  m_ui->tlsRadio->setEnabled( testResult.contains( Transport::EnumEncryption::TLS ) );
+  m_ui->noRadio->setEnabled( testResult.contains( Transport::EnumEncryption::None ) );
+
+  QString text;
+  if ( testResult.contains( Transport::EnumEncryption::TLS ) ) {
+    m_ui->tlsRadio->setChecked( true );
+    text = i18n( "<qt><b>TLS is supported and recommended.</b></qt>" );
+  } else if ( testResult.contains( Transport::EnumEncryption::SSL ) ) {
+    m_ui->sslRadio->setChecked( true );
+    text = i18n( "<qt><b>SSL is supported and recommended.</b></qt>" );
+  } else if ( testResult.contains( Transport::EnumEncryption::None ) ) {
+    m_ui->noRadio->setChecked( true );
+    text = i18n( "<qt><b>No security is supported. It is not "
+                 "recommended to connect to this server.</b></qt>" );
+  } else {
+    text = i18n( "<qt><b>It is not possible to use this server.</b></qt>" );
+  }
+  m_ui->testInfo->setText( text );
+
+  m_ui->testButton->setEnabled( true );
+  m_ui->safeImap->setEnabled( true );
+  m_ui->authenticationCombo->setEnabled( true );
+  slotEncryptionRadioChanged();
+  slotSafetyChanged();
+}
+
+void SetupServer::slotTestChanged()
+{
+  delete m_serverTest;
+  m_serverTest = 0;
+  slotSafetyChanged();
+
+  // do not use imapConnectionPossible, as the data is not yet saved.
+  m_ui->testButton->setEnabled( true /* TODO Global::connectionPossible() ||
+                                        m_ui->imapServer->text() == "localhost"*/ );
+}
+
+void SetupServer::slotEnableWidgets()
+{
+  const bool haveSieve = m_ui->managesieveCheck->isChecked();
+  const bool reuseConfig = m_ui->sameConfigCheck->isChecked();
+
+  m_ui->sameConfigCheck->setEnabled( haveSieve );
+  m_ui->sievePortSpin->setEnabled( haveSieve && reuseConfig );
+  m_ui->alternateURL->setEnabled( haveSieve && !reuseConfig );
+  m_ui->authentification->setEnabled( haveSieve && !reuseConfig );
+}
+
+void SetupServer::slotComplete()
+{
+  const bool ok =  !m_ui->imapServer->text().isEmpty() && !m_ui->userName->text().isEmpty();
+  button( KDialog::Ok )->setEnabled( ok );
+}
+
+void SetupServer::slotSafetyChanged()
+{
+  if ( m_serverTest == 0 ) {
+    kDebug() << "serverTest null";
+    m_ui->noRadio->setEnabled( true );
+    m_ui->sslRadio->setEnabled( true );
+    m_ui->tlsRadio->setEnabled( true );
+
+    m_ui->authenticationCombo->setEnabled( true );
+    return;
+  }
+
+  QList<int> protocols;
+
+  switch ( m_ui->safeImapGroup->checkedId() ) {
+  case KIMAP::LoginJob::Unencrypted :
+    kDebug() << "safeImapGroup: unencrypted";
+    protocols = m_serverTest->normalProtocols();
+    break;
+  case KIMAP::LoginJob::AnySslVersion:
+    protocols = m_serverTest->secureProtocols();
+    kDebug() << "safeImapGroup: SSL";
+    break;
+  case KIMAP::LoginJob::TlsV1:
+    protocols = m_serverTest->tlsProtocols();
+    kDebug() << "safeImapGroup: starttls";
+    break;
+  default:
+    kFatal() << "Shouldn't happen";
+  }
+
+  m_ui->authenticationCombo->clear();
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::CLEAR );
+  foreach ( int prot, protocols ) {
+    addAuthenticationItem( m_ui->authenticationCombo, (MailTransport::Transport::EnumAuthenticationType::type) prot );
+  }
+  if ( protocols.size() > 0 )
+    setCurrentAuthMode( m_ui->authenticationCombo, (MailTransport::Transport::EnumAuthenticationType::type) protocols.first() );
+  else
+    kDebug() << "no authmodes found";
+}
+
+void SetupServer::slotManageSubscriptions()
+{
+  kDebug() << "manage subscripts";
+  ImapAccount account;
+
+  account.setServer( m_ui->imapServer->text() );
+  account.setPort( m_ui->portSpin->value() );
+
+  account.setUserName( m_ui->userName->text() );
+  account.setSubscriptionEnabled( m_ui->subscriptionEnabled->isChecked() );
+
+  account.setEncryptionMode(
+    static_cast<KIMAP::LoginJob::EncryptionMode>( m_ui->safeImapGroup->checkedId() )
+  );
+
+  account.setAuthenticationMode( Settings::mapTransportAuthToKimap( getCurrentAuthMode( m_ui->authenticationCombo ) ) );
+
+  QPointer<SubscriptionDialog> subscriptions = new SubscriptionDialog( this );
+  subscriptions->setCaption(  i18n( "Serverside Subscription" ) );
+  subscriptions->setWindowIcon( KIcon( QLatin1String("network-server") ) );
+  subscriptions->connectAccount( account, m_ui->password->text() );
+  m_subscriptionsChanged = subscriptions->isSubscriptionChanged();
+
+  subscriptions->exec();
+  delete subscriptions;
+
+  m_ui->subscriptionEnabled->setChecked( account.isSubscriptionEnabled() );
+}
+
+void SetupServer::slotShowServerInfo()
+{
+  ServerInfoDialog *dialog = new ServerInfoDialog(m_parentResource, this);
+  dialog->show();
+}
+
+void SetupServer::targetCollectionReceived( const Akonadi::Collection::List &collections )
+{
+  m_ui->folderRequester->setCollection( collections.first() );
+  mOldTrash = collections.first();
+}
+
+void SetupServer::localFolderRequestJobFinished( KJob *job )
+{
+  if ( !job->error() ) {
+    Akonadi::Collection targetCollection = Akonadi::SpecialMailCollections::self()->defaultCollection( Akonadi::SpecialMailCollections::Trash );
+    Q_ASSERT( targetCollection.isValid() );
+     m_ui->folderRequester->setCollection( targetCollection );
+     mOldTrash = targetCollection;
+  }
+}
+
+void SetupServer::populateDefaultAuthenticationOptions()
+{
+  m_ui->authenticationCombo->clear();
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::CLEAR);
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::LOGIN );
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::PLAIN );
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::CRAM_MD5 );
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::DIGEST_MD5 );
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::NTLM );
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::GSSAPI );
+  addAuthenticationItem( m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::ANONYMOUS );
+}
+
+
+
+
diff --git a/resources/kolab/setupserver.h b/resources/kolab/setupserver.h
new file mode 100644
index 0000000..c5650f3
--- /dev/null
+++ b/resources/kolab/setupserver.h
@@ -0,0 +1,113 @@
+/* This file is part of the KDE project
+   Copyright (C) 2010 Casey Link <unnamedrambler at gmail.com>
+   Copyright (c) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info at kdab.net>
+   Copyright (C) 2009 Kevin Ottens <ervin at kde.org>
+   Copyright (C) 2006-2008 Omat Holding B.V. <info at omat.nl>
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef SETUPSERVER_H
+#define SETUPSERVER_H
+
+#include <klineedit.h>
+#include <kdialog.h>
+#include <akonadi/collection.h>
+#include <KJob>
+
+#include <QRegExpValidator>
+
+namespace Ui
+{
+class SetupServerView;
+}
+
+namespace MailTransport
+{
+class ServerTest;
+}
+namespace KPIMIdentities
+{
+class IdentityCombo;
+class IdentityManager;
+}
+class FolderArchiveSettingPage;
+class ImapResourceBase;
+
+/**
+ * @class SetupServer
+ * These contain the account settings
+ * @author Tom Albers <tomalbers at kde.nl>
+ */
+class SetupServer : public KDialog
+{
+  Q_OBJECT
+
+public:
+  /**
+   * Constructor
+   * @param parentResource The resource this dialog belongs to
+   * @param parent Parent WId
+   */
+  SetupServer( ImapResourceBase *parentResource, WId parent );
+
+  /**
+   * Destructor
+   */
+  ~SetupServer();
+
+  bool shouldClearCache() const;
+
+private slots:
+  /**
+   * Call this if you want the settings saved from this page.
+   */
+  void applySettings();
+  void slotIdentityCheckboxChanged();
+  void slotMailCheckboxChanged();
+  void slotEncryptionRadioChanged();
+  void slotSubcriptionCheckboxChanged();
+  void slotShowServerInfo();
+private:
+  void readSettings();
+  void populateDefaultAuthenticationOptions();
+
+  ImapResourceBase *m_parentResource;
+  Ui::SetupServerView *m_ui;
+  MailTransport::ServerTest *m_serverTest;
+  bool m_subscriptionsChanged;
+  bool m_shouldClearCache;
+  QString m_vacationFileName;
+  KPIMIdentities::IdentityManager *m_identityManager;
+  KPIMIdentities::IdentityCombo *m_identityCombobox;
+  QString m_oldResourceName;
+  QRegExpValidator mValidator;
+  Akonadi::Collection mOldTrash;
+  FolderArchiveSettingPage *m_folderArchiveSettingPage;
+
+private slots:
+  void slotTest();
+  void slotFinished(const QList<int> &testResult );
+  void slotCustomSieveChanged();
+
+  void slotTestChanged();
+  void slotComplete();
+  void slotSafetyChanged();
+  void slotManageSubscriptions();
+  void slotEnableWidgets();
+  void targetCollectionReceived(const Akonadi::Collection::List &collections );
+  void localFolderRequestJobFinished( KJob *job );
+};
+
+#endif
diff --git a/resources/kolab/setupserverview_desktop.ui b/resources/kolab/setupserverview_desktop.ui
new file mode 100644
index 0000000..3c1e3bd
--- /dev/null
+++ b/resources/kolab/setupserverview_desktop.ui
@@ -0,0 +1,672 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SetupServerView</class>
+ <widget class="QWidget" name="SetupServerView">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>481</width>
+    <height>528</height>
+   </rect>
+  </property>
+  <layout class="QHBoxLayout" name="horizontalLayout_2">
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>General</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <item>
+        <widget class="QGroupBox" name="groupBox">
+         <property name="title">
+          <string>Account Information</string>
+         </property>
+         <layout class="QFormLayout" name="formLayout_2">
+          <item row="0" column="0">
+           <widget class="QLabel" name="label_8">
+            <property name="text">
+             <string>Account Name:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="KLineEdit" name="accountName">
+            <property name="trapReturnKey" stdset="0">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0">
+           <widget class="QLabel" name="label">
+            <property name="whatsThis">
+             <string>Indicate the IMAP server. If you want to connect to a non-standard port for a specific encryption scheme, you can add ":port" to indicate that. For example: "imap.foo.com:144".</string>
+            </property>
+            <property name="text">
+             <string>IMAP Server:</string>
+            </property>
+            <property name="buddy">
+             <cstring>imapServer</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="KLineEdit" name="imapServer">
+            <property name="trapReturnKey" stdset="0">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="0">
+           <widget class="QLabel" name="label_2">
+            <property name="whatsThis">
+             <string>The username.</string>
+            </property>
+            <property name="text">
+             <string>Username:</string>
+            </property>
+            <property name="buddy">
+             <cstring>userName</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="1">
+           <widget class="KLineEdit" name="userName">
+            <property name="trapReturnKey" stdset="0">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="0">
+           <widget class="QLabel" name="label_3">
+            <property name="whatsThis">
+             <string>The password.</string>
+            </property>
+            <property name="text">
+             <string>Password:</string>
+            </property>
+            <property name="buddy">
+             <cstring>password</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="1">
+           <widget class="KLineEdit" name="password">
+            <property name="echoMode">
+             <enum>QLineEdit::Password</enum>
+            </property>
+            <property name="trapReturnKey" stdset="0">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="checkOptions">
+         <property name="title">
+          <string>Mail Checking Options</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_6">
+          <item>
+           <widget class="QCheckBox" name="disconnectedModeEnabled">
+            <property name="enabled">
+             <bool>false</bool>
+            </property>
+            <property name="text">
+             <string>&Download all messages for offline use</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="enableMailCheckBox">
+            <property name="text">
+             <string>Enable &interval mail checking</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_1">
+            <item>
+             <widget class="QLabel" name="label_7">
+              <property name="text">
+               <string>Check mail interval:</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="KIntNumInput" name="checkInterval" native="true">
+              <property name="value" stdset="0">
+               <number>1</number>
+              </property>
+              <property name="minimum" stdset="0">
+               <number>0</number>
+              </property>
+              <property name="suffix" stdset="0">
+               <string/>
+              </property>
+              <property name="prefix" stdset="0">
+               <string/>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>Filtering</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QCheckBox" name="managesieveCheck">
+         <property name="text">
+          <string>Server supports Sieve</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="sameConfigCheck">
+         <property name="text">
+          <string>Reuse host and login configuration</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_14">
+         <property name="text">
+          <string>The server port changed when ManageSieve turned into a full RFC Standard. Old server implementations still use port 2000, while newer standard conform server can only be accessed via port 4190.</string>
+         </property>
+         <property name="wordWrap">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <item>
+          <widget class="QLabel" name="label_5">
+           <property name="text">
+            <string>Managesieve port:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="KIntSpinBox" name="sievePortSpin">
+           <property name="maximum">
+            <number>65535</number>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_4">
+         <item>
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string>Alternate URL:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="KLineEdit" name="alternateURL">
+           <property name="trapReturnKey" stdset="0">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="authentification">
+         <property name="title">
+          <string>Authentication</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout">
+          <item row="5" column="1">
+           <widget class="KLineEdit" name="customPassword">
+            <property name="echoMode">
+             <enum>QLineEdit::Password</enum>
+            </property>
+            <property name="trapReturnKey" stdset="0">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0" colspan="2">
+           <widget class="QRadioButton" name="noAuthentification">
+            <property name="text">
+             <string>No authentication</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">customSieveGroup</string>
+            </attribute>
+           </widget>
+          </item>
+          <item row="5" column="0">
+           <widget class="QLabel" name="label_13">
+            <property name="text">
+             <string>Password:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="0">
+           <widget class="QLabel" name="label_12">
+            <property name="text">
+             <string>Username:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="0" colspan="2">
+           <widget class="QRadioButton" name="customUserPassword">
+            <property name="text">
+             <string>Username and Password</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">customSieveGroup</string>
+            </attribute>
+           </widget>
+          </item>
+          <item row="4" column="1">
+           <widget class="KLineEdit" name="customUsername">
+            <property name="trapReturnKey" stdset="0">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="0">
+           <widget class="QRadioButton" name="imapUserPassword">
+            <property name="text">
+             <string>IMAP Username and Password</string>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">customSieveGroup</string>
+            </attribute>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_4">
+      <attribute name="title">
+       <string>Advanced</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QGroupBox" name="groupBox_2">
+         <property name="title">
+          <string>IMAP Settings</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_5">
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_8">
+            <item>
+             <widget class="QCheckBox" name="subscriptionEnabled">
+              <property name="text">
+               <string>Enable server-side subscriptions</string>
+              </property>
+              <property name="checked">
+               <bool>true</bool>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="KPushButton" name="subscriptionButton">
+              <property name="enabled">
+               <bool>true</bool>
+              </property>
+              <property name="text">
+               <string>Serverside Subscription...</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <widget class="QCheckBox" name="autoExpungeCheck">
+            <property name="text">
+             <string>Automaticall&y compact folders (expunges deleted messages)</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_7">
+            <item>
+             <widget class="QLabel" name="label_11">
+              <property name="text">
+               <string>Trash folder:</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="Akonadi::CollectionRequester" name="folderRequester"/>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <widget class="QGroupBox" name="identityBox">
+            <property name="title">
+             <string>Identity Settings</string>
+            </property>
+            <layout class="QVBoxLayout" name="verticalLayout_7">
+             <item>
+              <widget class="QCheckBox" name="useDefaultIdentityCheck">
+               <property name="toolTip">
+                <string>Use the default identity for this account</string>
+               </property>
+               <property name="text">
+                <string>Use &default identity</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <layout class="QHBoxLayout" name="identityLayout">
+               <item>
+                <widget class="QLabel" name="identityLabel">
+                 <property name="toolTip">
+                  <string>Select the KMail identity used for this account</string>
+                 </property>
+                 <property name="text">
+                  <string>Identity:</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="safeImap">
+         <property name="whatsThis">
+          <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'HandelGotDLig'; font-size:10pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-weight:600;">SSL/TLS</span><span style=" font-family:'Sans Serif';"> is safe IMAP over port 993;</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-weight:600;">STARTTLS</span><span style=" font-family:'Sans Serif';"> will operate on port 143 and switch to a secure connection directly after connecting;</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-weight:600;">None</span><span style=" font-family:'Sans Serif';"> will connect to port 143 but not switch to a secure connection. This setting is not recommended.</span></p></body></html></string>
+         </property>
+         <property name="title">
+          <string>Connection Settings</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_2">
+          <item>
+           <widget class="KPushButton" name="testButton">
+            <property name="text">
+             <string>Auto Detect</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <layout class="QFormLayout" name="formLayout">
+            <property name="fieldGrowthPolicy">
+             <enum>QFormLayout::ExpandingFieldsGrow</enum>
+            </property>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_9">
+              <property name="text">
+               <string>Encryption:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <layout class="QHBoxLayout" name="horizontalLayout">
+              <item>
+               <widget class="QRadioButton" name="noRadio">
+                <property name="text">
+                 <string>None</string>
+                </property>
+                <property name="checked">
+                 <bool>false</bool>
+                </property>
+                <attribute name="buttonGroup">
+                 <string notr="true">safeImapGroup</string>
+                </attribute>
+               </widget>
+              </item>
+              <item>
+               <widget class="QRadioButton" name="sslRadio">
+                <property name="text">
+                 <string>SSL/TLS</string>
+                </property>
+                <attribute name="buttonGroup">
+                 <string notr="true">safeImapGroup</string>
+                </attribute>
+               </widget>
+              </item>
+              <item>
+               <widget class="QRadioButton" name="tlsRadio">
+                <property name="text">
+                 <string>STARTTLS</string>
+                </property>
+                <property name="checked">
+                 <bool>true</bool>
+                </property>
+                <attribute name="buttonGroup">
+                 <string notr="true">safeImapGroup</string>
+                </attribute>
+               </widget>
+              </item>
+             </layout>
+            </item>
+            <item row="2" column="0">
+             <widget class="QLabel" name="label_4">
+              <property name="text">
+               <string>Port:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="1">
+             <widget class="QSpinBox" name="portSpin">
+              <property name="minimum">
+               <number>1</number>
+              </property>
+              <property name="maximum">
+               <number>65534</number>
+              </property>
+              <property name="value">
+               <number>143</number>
+              </property>
+             </widget>
+            </item>
+            <item row="3" column="0">
+             <widget class="QLabel" name="label_10">
+              <property name="text">
+               <string>Authentication:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="3" column="1">
+             <widget class="QComboBox" name="authenticationCombo">
+              <item>
+               <property name="text">
+                <string>Clear text</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>LOGIN</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>PLAIN</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>CRAM-MD5</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>DIGEST-MD5</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>NTLM</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>GSSAPI</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>Anonymous</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="testInfo">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Empty</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+         <property name="wordWrap">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QProgressBar" name="testProgress">
+         <property name="value">
+          <number>24</number>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="showServerInfo">
+         <property name="text">
+          <string>Server Info</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>KPushButton</class>
+   <extends>QPushButton</extends>
+   <header>kpushbutton.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KIntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>knuminput.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KIntNumInput</class>
+   <extends>QWidget</extends>
+   <header>knuminput.h</header>
+  </customwidget>
+  <customwidget>
+   <class>Akonadi::CollectionRequester</class>
+   <extends>QFrame</extends>
+   <header>Akonadi/CollectionRequester</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+ <buttongroups>
+  <buttongroup name="safeImapGroup"/>
+  <buttongroup name="customSieveGroup"/>
+ </buttongroups>
+</ui>
diff --git a/resources/kolab/setupserverview_mobile.ui b/resources/kolab/setupserverview_mobile.ui
new file mode 100644
index 0000000..4760fec
--- /dev/null
+++ b/resources/kolab/setupserverview_mobile.ui
@@ -0,0 +1,514 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SetupServerView</class>
+ <widget class="QWidget" name="SetupServerView">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>307</width>
+    <height>774</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QScrollArea" name="scrollArea">
+     <property name="frameShape">
+      <enum>QFrame::NoFrame</enum>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Plain</enum>
+     </property>
+     <property name="verticalScrollBarPolicy">
+      <enum>Qt::ScrollBarAsNeeded</enum>
+     </property>
+     <property name="horizontalScrollBarPolicy">
+      <enum>Qt::ScrollBarAlwaysOff</enum>
+     </property>
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="scrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>307</width>
+        <height>774</height>
+       </rect>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <layout class="QFormLayout" name="formLayout_4">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_9">
+           <property name="text">
+            <string>Account Name:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="KLineEdit" name="accountName"/>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label">
+           <property name="whatsThis">
+            <string>Indicate the IMAP server. If you want to connect to a non-standard port for a specific encryption scheme, you can add ":port" to indicate that. For example: "imap.foo.com:144".</string>
+           </property>
+           <property name="text">
+            <string>IMAP server:</string>
+           </property>
+           <property name="buddy">
+            <cstring>imapServer</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="KLineEdit" name="imapServer"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QLabel" name="testInfo">
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>Empty</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QProgressBar" name="testProgress">
+         <property name="value">
+          <number>24</number>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="KPushButton" name="testButton">
+         <property name="text">
+          <string>Auto Detect</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="safeImap">
+         <property name="whatsThis">
+          <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">SSL</span> is safe IMAP over port 993;</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">TLS</span> will operate on port 143 and switch to a secure connection directly after connecting;</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">None</span> will connect to port 143 but not switch to a secure connection. This setting is not recommended.</p></body></html></string>
+         </property>
+         <property name="title">
+          <string>Encryption</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+         <layout class="QHBoxLayout" name="horizontalLayout">
+          <item>
+           <widget class="QRadioButton" name="noRadio">
+            <property name="text">
+             <string>None</string>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
+            </property>
+            <attribute name="buttonGroup">
+             <string>safeImapGroup</string>
+            </attribute>
+           </widget>
+          </item>
+          <item>
+           <widget class="QRadioButton" name="sslRadio">
+            <property name="text">
+             <string>SSL</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string>safeImapGroup</string>
+            </attribute>
+           </widget>
+          </item>
+          <item>
+           <widget class="QRadioButton" name="tlsRadio">
+            <property name="text">
+             <string>TLS</string>
+            </property>
+            <attribute name="buttonGroup">
+             <string>safeImapGroup</string>
+            </attribute>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_2">
+           <property name="whatsThis">
+            <string>The username.</string>
+           </property>
+           <property name="text">
+            <string>Username:</string>
+           </property>
+           <property name="buddy">
+            <cstring>userName</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="KLineEdit" name="userName"/>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_3">
+           <property name="whatsThis">
+            <string>The password.</string>
+           </property>
+           <property name="text">
+            <string>Password:</string>
+           </property>
+           <property name="buddy">
+            <cstring>password</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="KLineEdit" name="password">
+           <property name="echoMode">
+            <enum>QLineEdit::Password</enum>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_8">
+           <property name="text">
+            <string>Port:</string>
+           </property>
+           <property name="buddy">
+            <cstring>portSpin</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QSpinBox" name="portSpin">
+           <property name="maximum">
+            <number>65536</number>
+           </property>
+           <property name="value">
+            <number>143</number>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="authImap">
+         <property name="title">
+          <string>Authentication Method</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout">
+          <item>
+           <widget class="QComboBox" name="authenticationCombo">
+            <item>
+             <property name="text">
+              <string>Clear text</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>LOGIN</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>PLAIN</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>CRAM-MD5</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>DIGEST-MD5</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>NTLM</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>GSSAPI</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Anonymous</string>
+             </property>
+            </item>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="enableMailCheckBox">
+         <property name="text">
+          <string>Enable interval mail checking</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>Check interval:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="KIntNumInput" name="checkInterval">
+           <property name="value">
+            <number>1</number>
+           </property>
+           <property name="minimum">
+            <number>0</number>
+           </property>
+           <property name="suffix">
+            <string> minutes</string>
+           </property>
+           <property name="prefix">
+            <string/>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="disconnectedModeEnabled">
+         <property name="text">
+          <string>&Download all messages for offline use</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="subscriptionEnabled">
+         <property name="text">
+          <string>Enable Server-Side Subscriptions</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="KPushButton" name="subscriptionButton">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string>Serverside Subscription...</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="autoExpungeCheck">
+         <property name="text">
+          <string>Automaticall&y expunge deleted messages</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_5">
+         <item>
+          <widget class="QLabel" name="label_7">
+           <property name="text">
+            <string>Trash folder:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="Akonadi::CollectionRequester" name="folderRequester"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="useDefaultIdentityCheck">
+         <property name="toolTip">
+          <string>Use the default identity for this account</string>
+         </property>
+         <property name="text">
+          <string>Use &default identity</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="identityBox">
+         <property name="title">
+          <string/>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_6">
+          <item>
+           <layout class="QHBoxLayout" name="identityLayout">
+            <item>
+             <widget class="QLabel" name="identityLabel">
+              <property name="toolTip">
+               <string>Select the KMail identity used for this account</string>
+              </property>
+              <property name="text">
+               <string>Identity:</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="managesieveCheck">
+         <property name="text">
+          <string>Server supports Sieve</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="sameConfigCheck">
+         <property name="text">
+          <string>Reuse host and login configuration</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout_3">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string>Alternate URL:</string>
+           </property>
+           <property name="buddy">
+            <cstring>alternateURL</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="KLineEdit" name="alternateURL"/>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_5">
+           <property name="text">
+            <string>Managesieve port:</string>
+           </property>
+           <property name="buddy">
+            <cstring>sievePortSpin</cstring>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="KIntSpinBox" name="sievePortSpin">
+           <property name="maximum">
+            <number>65535</number>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QPushButton" name="showServerInfo">
+         <property name="text">
+          <string>Server Info</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KIntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>knuminput.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KPushButton</class>
+   <extends>QPushButton</extends>
+   <header>kpushbutton.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>KIntNumInput</class>
+   <extends>QWidget</extends>
+   <header>knuminput.h</header>
+  </customwidget>
+  <customwidget>
+   <class>Akonadi::CollectionRequester</class>
+   <extends>QFrame</extends>
+   <header>Akonadi/CollectionRequester</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>subscriptionEnabled</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>subscriptionButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>131</x>
+     <y>431</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>331</x>
+     <y>432</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <buttongroups>
+  <buttongroup name="safeImapGroup"/>
+ </buttongroups>
+</ui>




More information about the commits mailing list