Commit 46fbcfb3 authored by Laurent Montel's avatar Laurent Montel 😁

Add placeholder

parent e599148f
......@@ -32,3 +32,13 @@ AddressesLocationViewer::~AddressesLocationViewer()
{
}
KContacts::Address::List AddressesLocationViewer::addresses() const
{
return mAddresses;
}
void AddressesLocationViewer::setAddresses(const KContacts::Address::List &addresses)
{
mAddresses = addresses;
}
......@@ -25,6 +25,7 @@
#define ADDRESSESLOCATIONVIEWER_H
#include <QWidget>
#include <KContacts/Address>
class AddressesLocationViewer : public QWidget
{
......@@ -32,6 +33,13 @@ class AddressesLocationViewer : public QWidget
public:
explicit AddressesLocationViewer(QWidget *parent = Q_NULLPTR);
~AddressesLocationViewer();
KContacts::Address::List addresses() const;
void setAddresses(const KContacts::Address::List &addresses);
private:
KContacts::Address::List mAddresses;
};
#endif // ADDRESSESLOCATIONVIEWER_H
......@@ -30,6 +30,7 @@
#include <QVBoxLayout>
#include <QLabel>
#include <QCheckBox>
#include <QPushButton>
AddressLocationWidget::AddressLocationWidget(QWidget *parent)
: QWidget(parent)
......@@ -37,12 +38,16 @@ AddressLocationWidget::AddressLocationWidget(QWidget *parent)
QGridLayout *topLayout = new QGridLayout;
setLayout(topLayout);
QLabel *label = new QLabel(KContacts::Address::streetLabel(), this);
label->setObjectName(QStringLiteral("streetlabel"));
QLabel *label = new QLabel(KContacts::Address::postOfficeBoxLabel(), this);
label = new QLabel(KContacts::Address::postOfficeBoxLabel(), this);
label->setObjectName(QStringLiteral("postofficeboxlabel"));
mPOBoxEdit = new KLineEdit(this);
mPOBoxEdit->setPlaceholderText(i18n("Add Post Office Box"));
mPOBoxEdit->setObjectName(QStringLiteral("postofficeboxlineedit"));
mPOBoxEdit->setTrapReturnKey(true);
......@@ -50,18 +55,21 @@ AddressLocationWidget::AddressLocationWidget(QWidget *parent)
label = new QLabel(KContacts::Address::localityLabel(), this);
label->setObjectName(QStringLiteral("localitylabel"));
mLocalityEdit = new KLineEdit(this);
mLocalityEdit->setPlaceholderText(i18n("Add Locality"));
mLocalityEdit->setObjectName(QStringLiteral("localitylineedit"));
mLocalityEdit->setTrapReturnKey(true);
label = new QLabel(KContacts::Address::regionLabel(), this);
label->setObjectName(QStringLiteral("regionlabel"));
mRegionEdit = new KLineEdit(this);
mRegionEdit->setPlaceholderText(i18n("Add Region"));
mRegionEdit->setObjectName(QStringLiteral("regionlineedit"));
mRegionEdit->setTrapReturnKey(true);
label = new QLabel(KContacts::Address::postalCodeLabel(), this);
label->setObjectName(QStringLiteral("postalcodelabel"));
mPostalCodeEdit = new KLineEdit(this);
mPostalCodeEdit->setPlaceholderText(i18n("Add Postal Code"));
mPostalCodeEdit->setObjectName(QStringLiteral("postalcodelineedit"));
mPostalCodeEdit->setTrapReturnKey(true);
......@@ -70,11 +78,15 @@ AddressLocationWidget::AddressLocationWidget(QWidget *parent)
mCountryCombo = new KComboBox(this);
mCountryCombo->setObjectName(QStringLiteral("countrycombobox"));
mCountryCombo->setEditable(true);
mCountryCombo->lineEdit()->setPlaceholderText(i18n("Add a Country"));
mCountryCombo->setDuplicatesEnabled(false);
mPreferredCheckBox = new QCheckBox(i18nc("street/postal", "This is the preferred address"), this);
mPreferredCheckBox->setObjectName(QStringLiteral("preferredcheckbox"));
mAddAddress = new QPushButton(i18n("Add Address"), this);
mAddAddress->setObjectName(QStringLiteral("addbuttonaddress"));
}
AddressLocationWidget::~AddressLocationWidget()
......
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