[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/pim/akonadi/exchange
From: Shaheed Haque <srhaque () theiet ! org>
Date: 2013-04-14 20:13:59
Message-ID: 20130414201359.A7A9BAC879 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1349259 by shaheed:
Improve behaviour of Modify Profile in light of the
fact that OpenProfile does not actually need a
password!
M +2 -2 connector/mapiconnector2.cpp
M +1 -1 connector/mapiconnector2.h
M +4 -9 ui/modifyprofiledialog.cpp
M +22 -33 ui/modifyprofiledialog.ui
M +3 -14 ui/profiledialog.cpp
--- trunk/playground/pim/akonadi/exchange/connector/mapiconnector2.cpp \
#1349258:1349259 @@ -1981,14 +1981,14 @@
return profiles;
}
-bool MapiProfiles::read(const QString &profile, QString &username, const QString \
&password, QString &domain, QString &server) +bool MapiProfiles::read(const QString \
&profile, QString &username, QString &domain, QString &server) {
if (!init()) {
return false;
}
struct mapi_profile p;
- if (MAPI_E_SUCCESS != OpenProfile(m_context, &p, profile.toUtf8(), \
password.toUtf8())) { + if (MAPI_E_SUCCESS != OpenProfile(m_context, &p, \
profile.toUtf8(), NULL)) { error() << "cannot open profile:" << profile << \
mapiError(); return false;
}
--- trunk/playground/pim/akonadi/exchange/connector/mapiconnector2.h #1349258:1349259
@@ -368,7 +368,7 @@
*/
bool add(const QString &profile, const QString &username, const QString \
&password, const QString &domain, const QString &server);
- bool read(const QString &profile, QString &username, const QString &password, \
QString &domain, QString &server); + bool read(const QString &profile, QString \
&username, QString &domain, QString &server);
bool update(const QString &profile, const QString &username, const QString \
&password, const QString &domain, const QString &server);
--- trunk/playground/pim/akonadi/exchange/ui/modifyprofiledialog.cpp #1349258:1349259
@@ -1,6 +1,6 @@
/*
* This file is part of the Akonadi Exchange Resource.
- * Copyright 2012 S.R.Haque <srhaque@theiet.org>
+ * Copyright 2012-2013 S.R.Haque <srhaque@theiet.org>
*
* Akonadi Exchange Resource is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,10 +37,9 @@
{
bool valid = false;
- if (lePassword->isEnabled()) {
- valid = true;
- } else if (!leProfile->text().isEmpty() &&
+ if (!leProfile->text().isEmpty() &&
!leUsername->text().isEmpty() &&
+ !lePassword->text().isEmpty() &&
!leDomain->text().isEmpty() &&
!leServer->text().isEmpty()) {
valid = true;
@@ -64,10 +63,6 @@
leServer->setText(server);
leDomain->setText(domain);
leUsername->setText(username);
- leServer->setEnabled(true);
- leDomain->setEnabled(true);
- leUsername->setEnabled(true);
- lePassword->setEnabled(false);
}
QString ModifyProfileDialog::username() const
@@ -90,4 +85,4 @@
return leDomain->text();
}
-#include "modifyprofiledialog.moc"
\ No newline at end of file
+#include "modifyprofiledialog.moc"
--- trunk/playground/pim/akonadi/exchange/ui/modifyprofiledialog.ui #1349258:1349259
@@ -46,9 +46,6 @@
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="leDomain">
- <property name="enabled">
- <bool>false</bool>
- </property>
<property name="whatsThis">
<string>Active Directory domain</string>
</property>
@@ -66,48 +63,24 @@
</item>
<item row="3" column="3">
<widget class="QLineEdit" name="leUsername">
- <property name="enabled">
- <bool>false</bool>
- </property>
<property name="whatsThis">
- <string>Active Directory username</string>
+ <string>Active Directory username.\n\nYou can get the username from Outlook \
-> File tab -> Account Settings, E-mail tab -> Change. If the value looks \
like "user@domain", just use the "user" part.</string> \
</property> </widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>&Password</string>
- </property>
- <property name="buddy">
- <cstring>lePassword</cstring>
- </property>
- </widget>
- </item>
<item row="0" column="1" colspan="3">
<widget class="QLabel" name="leProfile"/>
</item>
<item row="2" column="1" colspan="3">
<widget class="QLineEdit" name="leServer">
- <property name="enabled">
- <bool>false</bool>
- </property>
<property name="whatsThis">
- <string>Hostname of Exchange server, e.g. mail.biz.com</string>
+ <string>Hostname of Exchange server, e.g. mail.biz.com.
+
+You can get the hostname from Outlook -> File tab -> Account Settings, E-mail \
tab -> Change.</string> </property>
</widget>
</item>
- <item row="1" column="1" colspan="3">
- <widget class="QLineEdit" name="lePassword">
- <property name="toolTip">
- <string>Enter password to fetch profile details</string>
- </property>
- <property name="echoMode">
- <enum>QLineEdit::Password</enum>
- </property>
- </widget>
- </item>
- <item row="4" column="0" colspan="4">
+ <item row="5" column="0" colspan="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -117,10 +90,26 @@
</property>
</widget>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>&Password</string>
+ </property>
+ <property name="buddy">
+ <cstring>lePassword</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="3">
+ <widget class="QLineEdit" name="lePassword">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<tabstops>
- <tabstop>lePassword</tabstop>
<tabstop>leServer</tabstop>
<tabstop>leDomain</tabstop>
<tabstop>leUsername</tabstop>
--- trunk/playground/pim/akonadi/exchange/ui/profiledialog.cpp #1349258:1349259
@@ -112,7 +112,6 @@
void ProfileDialog::slotModifyProfile()
{
ModifyProfileDialog dlg(this);
- bool profileRead;
QString username;
QString domain;
QString server;
@@ -120,23 +119,13 @@
// Initially, the dialog will accept a password. Use it to fetch the
// attributes of the profile.
dlg.setProfileName(profileName());
-
- // Loop until the user gives up, or succeeds!
- while (profileRead = false, dlg.exec() == QDialog::Accepted) {
- bool ok = m_profiles.read(profileName(), username, dlg.password(), domain, \
server); + bool ok = m_profiles.read(profileName(), username, domain, server);
if (!ok) {
KMessageBox::error(this, i18n("Error reading profile %1: %2", \
profileName(), mapiError()));
- } else {
- profileRead = true;
- break;
- }
- }
- if (!profileRead) {
return;
}
- // Disable the password, and set the attributes of the profile, which can
- // then be edited.
+ // Set the attributes of the profile, which can then be edited.
dlg.setAttributes(server, domain, username);
// Loop until the user gives up, or succeeds!
@@ -171,4 +160,4 @@
readMapiProfiles(profile);
}
-#include "profiledialog.moc"
\ No newline at end of file
+#include "profiledialog.moc"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic