Commit 834bcde3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to remove/modify address

parent 46be6043
...@@ -31,6 +31,7 @@ AddressesLocationViewer::AddressesLocationViewer(QWidget *parent) ...@@ -31,6 +31,7 @@ AddressesLocationViewer::AddressesLocationViewer(QWidget *parent)
mAddressesLocationGrantleeFormatter(new AddressesLocationGrantleeFormater(this)) mAddressesLocationGrantleeFormatter(new AddressesLocationGrantleeFormater(this))
{ {
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
settings()->setAttribute(QWebSettings::JavascriptEnabled, false); settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
settings()->setAttribute(QWebSettings::JavaEnabled, false); settings()->setAttribute(QWebSettings::JavaEnabled, false);
settings()->setAttribute(QWebSettings::PluginsEnabled, false); settings()->setAttribute(QWebSettings::PluginsEnabled, false);
...@@ -46,6 +47,7 @@ AddressesLocationViewer::~AddressesLocationViewer() ...@@ -46,6 +47,7 @@ AddressesLocationViewer::~AddressesLocationViewer()
void AddressesLocationViewer::slotLinkClicked(const QUrl &url) void AddressesLocationViewer::slotLinkClicked(const QUrl &url)
{ {
qDebug()<<" url "<<url;
if (url.scheme() == QLatin1String("addresslocationaction")) { if (url.scheme() == QLatin1String("addresslocationaction")) {
const QString urlPath(url.path()); const QString urlPath(url.path());
if (url.hasQuery()) { if (url.hasQuery()) {
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <QLabel> #include <QLabel>
#include <QCheckBox> #include <QCheckBox>
#include <QPushButton> #include <QPushButton>
#include <QDebug>
AddressLocationWidget::AddressLocationWidget(QWidget *parent) AddressLocationWidget::AddressLocationWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
...@@ -171,6 +172,7 @@ KContacts::Address AddressLocationWidget::address() const ...@@ -171,6 +172,7 @@ KContacts::Address AddressLocationWidget::address() const
void AddressLocationWidget::slotModifyAddress(const KContacts::Address &address, int currentIndex) void AddressLocationWidget::slotModifyAddress(const KContacts::Address &address, int currentIndex)
{ {
qDebug()<<" void AddressLocationWidget::slotModifyAddress(const KContacts::Address &address, int currentIndex)"<<currentIndex;
setAddress(address); setAddress(address);
//TODO store currentIndex. //TODO store currentIndex.
//TODO //TODO
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<body> <body>
{% if addresses %} {% if addresses %}
{% for address in addresses %} {% for address in addresses %}
<div> {{ address.formattedAddress }} </div> <div> {{ address.formattedAddress }} {{ address.modifyAddressAction|safe}} {{ address.removeAddressAction|safe}} </div>
</br>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
......
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