Commit 48c05f36 authored by Laurent Montel's avatar Laurent Montel 😁

Add readonly support

parent 7d970c27
......@@ -84,7 +84,10 @@ void GeneralInfoWidget::loadContact(const KContacts::Addressee &contact)
mWebListWidget->loadContact(contact);
mMessagingListWidget->loadContact(contact);
mMailListWidget->loadContact(contact);
//TODO
mNameWidget->loadContact(contact);
mNickNameWidget->loadContact(contact);
//TODO load image
}
void GeneralInfoWidget::storeContact(KContacts::Addressee &contact) const
......@@ -93,5 +96,18 @@ void GeneralInfoWidget::storeContact(KContacts::Addressee &contact) const
mWebListWidget->storeContact(contact);
mMessagingListWidget->storeContact(contact);
mMailListWidget->storeContact(contact);
//TODO
mNameWidget->storeContact(contact);
mNickNameWidget->storeContact(contact);
//TODO save image
}
void GeneralInfoWidget::setReadOnly(bool readOnly)
{
mPhoneListWidget->setReadOnly(readOnly);
mWebListWidget->setReadOnly(readOnly);
mMessagingListWidget->setReadOnly(readOnly);
mMailListWidget->setReadOnly(readOnly);
mNameWidget->setReadOnly(readOnly);
mNickNameWidget->setReadOnly(readOnly);
mPhotoWidget->setReadOnly(readOnly);
}
......@@ -51,6 +51,7 @@ public:
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
PhoneListWidget *mPhoneListWidget;
WebListWidget *mWebListWidget;
......
......@@ -59,3 +59,8 @@ void MailListWidget::storeContact(KContacts::Addressee &contact) const
{
mMailWidgetLister->storeContact(contact);
}
void MailListWidget::setReadOnly(bool readOnly)
{
mMailWidgetLister->setEnabled(!readOnly);
}
......@@ -39,6 +39,7 @@ public:
~MailListWidget();
void loadContact(const KContacts::Addressee &contact);
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
Akonadi::MailWidgetLister *mMailWidgetLister;
};
......
......@@ -59,3 +59,8 @@ void MessagingListWidget::storeContact(KContacts::Addressee &contact) const
{
mMessagingWidgetLister->storeContact(contact);
}
void MessagingListWidget::setReadOnly(bool readOnly)
{
mMessagingWidgetLister->setEnabled(!readOnly);
}
......@@ -40,6 +40,7 @@ public:
void loadContact(const KContacts::Addressee &contact);
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
Akonadi::MessagingWidgetLister *mMessagingWidgetLister;
......
......@@ -61,3 +61,8 @@ void NameWidget::storeContact(KContacts::Addressee &contact) const
{
//TODO
}
void NameWidget::setReadOnly(bool readOnly)
{
mNameEdit->setReadOnly(readOnly);
}
......@@ -40,6 +40,7 @@ public:
void loadContact(const KContacts::Addressee &contact);
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
QLineEdit *mNameEdit;
};
......
......@@ -56,3 +56,8 @@ void NicknameWidget::storeContact(KContacts::Addressee &contact) const
{
//TODO
}
void NicknameWidget::setReadOnly(bool readOnly)
{
mNickName->setReadOnly(readOnly);
}
......@@ -39,6 +39,7 @@ public:
~NicknameWidget();
void loadContact(const KContacts::Addressee &contact);
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
QLineEdit *mNickName;
};
......
......@@ -59,3 +59,8 @@ void PhoneListWidget::storeContact(KContacts::Addressee &contact) const
{
mPhoneWidgetLister->storeContact(contact);
}
void PhoneListWidget::setReadOnly(bool readOnly)
{
mPhoneWidgetLister->setEnabled(!readOnly);
}
......@@ -40,6 +40,7 @@ public:
~PhoneListWidget();
void loadContact(const KContacts::Addressee &contact);
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
Akonadi::PhoneWidgetLister *mPhoneWidgetLister;
};
......
......@@ -60,3 +60,8 @@ void WebListWidget::storeContact(KContacts::Addressee &contact) const
{
mWebWidgetLister->storeContact(contact);
}
void WebListWidget::setReadOnly(bool readOnly)
{
mWebWidgetLister->setEnabled(!readOnly);
}
......@@ -40,6 +40,7 @@ public:
~WebListWidget();
void loadContact(const KContacts::Addressee &contact);
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
private:
WebWidgetLister *mWebWidgetLister;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment