[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:07:04 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=7580cad
The following commit has been merged in the master branch:
commit 7580cad924f652b668b9c0c59baa2d00067ae21c
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Mon Jul 18 02:11:31 2011 +0100
Incorporated review comments
---
dialogs/contact-info.cpp | 78 +++++++++++++++++++++++++++---------------------
dialogs/contact-info.h | 24 ++++++++++++++-
dialogs/contact-info.ui | 12 +++++---
main-widget.cpp | 18 +++++------
4 files changed, 84 insertions(+), 48 deletions(-)
diff --git a/dialogs/contact-info.cpp b/dialogs/contact-info.cpp
index 6fce736..b3efa99 100644
--- a/dialogs/contact-info.cpp
+++ b/dialogs/contact-info.cpp
@@ -1,3 +1,23 @@
+/*
+ * Dialog for showing contact info
+ *
+ * Copyright (C) 2011 David Edmundson <kde at davidedmundson.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include "contact-info.h"
#include "ui_contact-info.h"
@@ -8,11 +28,11 @@
#include <KProtocolInfo>
-ContactInfo::ContactInfo(Tp::ContactPtr contact, QWidget *parent) :
+ContactInfo::ContactInfo(const Tp::ContactPtr &contact, QWidget *parent) :
KDialog(parent),
ui(new Ui::ContactInfo)
{
- QWidget* widget = new QWidget(this);
+ QWidget *widget = new QWidget(this);
setMainWidget(widget);
ui->setupUi(widget);
@@ -39,8 +59,7 @@ ContactInfo::ContactInfo(Tp::ContactPtr contact, QWidget *parent) :
QString link = "<a href='" + realUrl + "'>" + realUrl + "</a>";
presenceMessage.replace(index, realUrl.length(), link);
index += link.length();
- }
- else {
+ } else {
index += realUrl.length();
}
}
@@ -48,42 +67,33 @@ ContactInfo::ContactInfo(Tp::ContactPtr contact, QWidget *parent) :
ui->presenceLabel->setTextFormat(Qt::RichText);
ui->presenceLabel->setText(presenceMessage);
- QString blockedText;
+ KIcon blockedIcon;
if (contact->isBlocked()) {
- blockedText = i18n("Yes");
- }
- else {
- blockedText = i18n("No");
- }
- ui->blockedLabel->setText(blockedText);
-
- QString presenceSubscriptionText;
- if (contact->subscriptionState() == Tp::Contact::PresenceStateYes) {
- presenceSubscriptionText = i18n("Yes");
- }
- else if (contact->subscriptionState() == Tp::Contact::PresenceStateNo){
- presenceSubscriptionText = i18n("No");
+ blockedIcon = KIcon("task-complete");
+ } else {
+ blockedIcon = KIcon("task-reject");
}
- else {
- presenceSubscriptionText = i18n("Unknown");
- }
- ui->subscriptionStateLabel->setText(presenceSubscriptionText);
-
+ ui->blockedLabel->setPixmap(blockedIcon.pixmap(16));
- QString presencePublicationText;
- if (contact->publishState() == Tp::Contact::PresenceStateYes) {
- presencePublicationText = i18n("Yes");
- }
- else if (contact->publishState() == Tp::Contact::PresenceStateNo){
- presencePublicationText = i18n("No");
- }
- else {
- presencePublicationText = i18n("Unknown");
- }
- ui->publishStateLabel->setText(presencePublicationText);
+ ui->subscriptionStateLabel->setPixmap(iconForPresenceState(contact->subscriptionState()).pixmap(16));
+ ui->publishStateLabel->setPixmap(iconForPresenceState(contact->publishState()).pixmap(16));
}
ContactInfo::~ContactInfo()
{
delete ui;
}
+
+KIcon ContactInfo::iconForPresenceState(Tp::Contact::PresenceState state) const
+{
+ switch (state) {
+ case Tp::Contact::PresenceStateYes:
+ return KIcon("task-complete");
+ case Tp::Contact::PresenceStateNo:
+ return KIcon("task-reject");
+ case Tp::Contact::PresenceStateAsk:
+ /* Drop Through*/
+ default:
+ return KIcon("task-attempt");
+ }
+}
diff --git a/dialogs/contact-info.h b/dialogs/contact-info.h
index dbe0b05..95add7d 100644
--- a/dialogs/contact-info.h
+++ b/dialogs/contact-info.h
@@ -1,3 +1,24 @@
+/*
+ * Dialog for showing contact info
+ *
+ * Copyright (C) 2011 David Edmundson <kde at davidedmundson.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
#ifndef CONTACTINFO_H
#define CONTACTINFO_H
@@ -14,11 +35,12 @@ class ContactInfo : public KDialog
Q_OBJECT
public:
- explicit ContactInfo(Tp::ContactPtr contact, QWidget *parent = 0);
+ explicit ContactInfo(const Tp::ContactPtr &contact, QWidget *parent = 0);
~ContactInfo();
private:
Ui::ContactInfo *ui;
+ KIcon iconForPresenceState(Tp::Contact::PresenceState state) const;
};
#endif // CONTACTINFO_H
diff --git a/dialogs/contact-info.ui b/dialogs/contact-info.ui
index ba96e7b..a10bc9c 100644
--- a/dialogs/contact-info.ui
+++ b/dialogs/contact-info.ui
@@ -101,9 +101,11 @@
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
+ <property name="toolTip">
+ <string>Can see when you are online</string>
+ </property>
<property name="text">
- <string>Publish State
-(can see when you are online):</string>
+ <string>Publish State:</string>
</property>
</widget>
</item>
@@ -116,9 +118,11 @@
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
+ <property name="toolTip">
+ <string>You can see when they are online</string>
+ </property>
<property name="text">
- <string>Subscription State
-(you can see when they are online):</string>
+ <string>Subscription State:</string>
</property>
</widget>
</item>
diff --git a/main-widget.cpp b/main-widget.cpp
index b08eb6d..be3b691 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -839,15 +839,15 @@ void MainWidget::onCustomContextMenuRequested(const QPoint &pos)
//menu->addSeparator();
// TODO: Remove when Telepathy actually supports blocking.
-// if (contact->isBlocked()) {
-// action = menu->addAction(i18n("Unblock User"));
-// connect(action, SIGNAL(triggered(bool)),
-// SLOT(slotUnblockContactTriggered()));
-// } else {
-// action = menu->addAction(i18n("Block"));
-// connect(action, SIGNAL(triggered(bool)),
-// SLOT(slotBlockContactTriggered()));
-// }
+ /*if (contact->isBlocked()) {
+ action = menu->addAction(i18n("Unblock User"));
+ connect(action, SIGNAL(triggered(bool)),
+ SLOT(slotUnblockContactTriggered()));
+ } else {
+ action = menu->addAction(i18n("Blocked"));
+ connect(action, SIGNAL(triggered(bool)),
+ SLOT(slotBlockContactTriggered()));
+ }*/
menu->addSeparator();
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list