[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:08:06 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=ada8ab0
The following commit has been merged in the master branch:
commit ada8ab0b03d1fdb649f961df5fe6646080aa2c14
Author: Daniel Cohen <analoguecolour at gmail.com>
Date: Sun Mar 30 17:51:30 2014 +0200
Added presence request message in the add contact dialog
Added an optional text input line for the capability of sending a message with presence requests.
I'm not entirely sure of the HIG for making it clear that it's an optional field, so put the label below for now - putting 'message (optional)' on the left-hand label looks unreasonably awkward to me.
REVIEW: 117138
BUG: 318529
---
KTp/Widgets/add-contact-dialog.cpp | 17 ++++++++++++++++-
KTp/Widgets/add-contact-dialog.h | 1 +
KTp/Widgets/add-contact-dialog.ui | 31 ++++++++++++++++++++++++-------
3 files changed, 41 insertions(+), 8 deletions(-)
diff --git a/KTp/Widgets/add-contact-dialog.cpp b/KTp/Widgets/add-contact-dialog.cpp
index 045c0e3..233a6b6 100644
--- a/KTp/Widgets/add-contact-dialog.cpp
+++ b/KTp/Widgets/add-contact-dialog.cpp
@@ -98,6 +98,9 @@ AddContactDialog::AddContactDialog(const Tp::AccountManagerPtr &accountManager,
Tp::AccountSetPtr accountSet = accountManager->filterAccounts(filter);
d->ui->accountCombo->setAccountSet(accountSet);
+ updateSubscriptionMessageVisibility();
+
+ connect(d->ui->accountCombo, SIGNAL(currentIndexChanged(int)), SLOT(updateSubscriptionMessageVisibility()));
//bodge.
//Wtih KPeople support we don't enable FeatureRoster
@@ -175,7 +178,7 @@ void AddContactDialog::_k_onContactsForIdentifiersFinished(Tp::PendingOperation
kDebug() << "Requesting presence subscription";
Tp::PendingContacts *pc = qobject_cast<Tp::PendingContacts*>(op);
- connect(pc->manager()->requestPresenceSubscription(pc->contacts()),
+ connect(pc->manager()->requestPresenceSubscription(pc->contacts(), d->ui->messageLineEdit->text()),
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(_k_onRequestPresenceSubscriptionFinished(Tp::PendingOperation*)));
}
@@ -194,6 +197,18 @@ void AddContactDialog::_k_onRequestPresenceSubscriptionFinished(Tp::PendingOpera
}
}
+void AddContactDialog::updateSubscriptionMessageVisibility()
+{
+ Tp::AccountPtr account = d->ui->accountCombo->currentAccount();
+ if (account && account->connection()->contactManager()->subscriptionRequestHasMessage()) {
+ d->ui->messageLineEdit->show();
+ d->ui->messageLineLabel->show();
+ } else {
+ d->ui->messageLineEdit->hide();
+ d->ui->messageLineLabel->hide();
+ }
+}
+
void AddContactDialog::setInProgress(bool inProgress)
{
d->acceptInProgress = inProgress;
diff --git a/KTp/Widgets/add-contact-dialog.h b/KTp/Widgets/add-contact-dialog.h
index 2004a27..3ca14c0 100644
--- a/KTp/Widgets/add-contact-dialog.h
+++ b/KTp/Widgets/add-contact-dialog.h
@@ -51,6 +51,7 @@ private Q_SLOTS:
KTP_NO_EXPORT void _k_onContactsForIdentifiersFinished(Tp::PendingOperation *op);
KTP_NO_EXPORT void _k_onRequestPresenceSubscriptionFinished(Tp::PendingOperation *op);
KTP_NO_EXPORT void _k_onAccountUpgraded(Tp::PendingOperation *op);
+ void updateSubscriptionMessageVisibility();
private:
KTP_NO_EXPORT void setInProgress(bool inProgress);
diff --git a/KTp/Widgets/add-contact-dialog.ui b/KTp/Widgets/add-contact-dialog.ui
index fc355ff..63e4b78 100644
--- a/KTp/Widgets/add-contact-dialog.ui
+++ b/KTp/Widgets/add-contact-dialog.ui
@@ -11,6 +11,9 @@
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@@ -18,6 +21,16 @@
</property>
</widget>
</item>
+ <item row="0" column="1">
+ <widget class="KTp::AccountsComboBox" name="accountCombo">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@@ -28,13 +41,17 @@
<item row="1" column="1">
<widget class="KLineEdit" name="screenNameLineEdit"/>
</item>
- <item row="0" column="1">
- <widget class="KTp::AccountsComboBox" name="accountCombo">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="2" column="0">
+ <widget class="QLabel" name="messageLineLabel">
+ <property name="text">
+ <string>Message:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="KLineEdit" name="messageLineEdit">
+ <property name="clickMessage">
+ <string>Optional message to send</string>
</property>
</widget>
</item>
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list