[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:19:17 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=dc1d383
The following commit has been merged in the master branch:
commit dc1d38314b8d3703e2b05020caa78b7380af0fd2
Author: Lasse Liehu <lasse.liehu at gmail.com>
Date: Wed Apr 13 11:09:46 2011 +0300
Disable the chat tab when channel is invalidated
---
lib/chat-widget.cpp | 15 +++++++++++++++
lib/chat-widget.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 3611590..3d460ae 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -217,6 +217,8 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, QWidget *parent)
SLOT(handleMessageSent(Tp::Message,Tp::MessageSendingFlags,QString)));
connect(d->channel.data(), SIGNAL(chatStateChanged(Tp::ContactPtr,Tp::ChannelChatState)),
SLOT(onChatStatusChanged(Tp::ContactPtr,Tp::ChannelChatState)));
+ connect(d->channel->connection().data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
+ this, SLOT(onChannelInvalidated()));
if (d->channel->hasChatStateInterface()) {
connect(d->ui.sendMessageBox, SIGNAL(textChanged()), SLOT(onInputBoxChanged()));
@@ -678,6 +680,19 @@ void ChatWidget::onContactAliasChanged(const Tp::ContactPtr & contact, const QSt
}
}
+void ChatWidget::onChannelInvalidated()
+{
+ d->ui.sendMessageBox->setDisabled(true);
+ d->ui.sendButton->setDisabled(true);
+
+ // show a message informing the user
+ AdiumThemeStatusInfo statusMessage;
+ statusMessage.setMessage(i18n("Connection closed"));
+ statusMessage.setService(d->channel->connection()->protocolName());
+ statusMessage.setTime(QDateTime::currentDateTime());
+ d->ui.chatArea->addStatusMessage(statusMessage);
+}
+
void ChatWidget::onInputBoxChanged()
{
//if the box is empty
diff --git a/lib/chat-widget.h b/lib/chat-widget.h
index 92cda98..f357aea 100644
--- a/lib/chat-widget.h
+++ b/lib/chat-widget.h
@@ -92,6 +92,8 @@ protected slots:
void onContactAliasChanged(const Tp::ContactPtr &contact, const QString &alias);
+ void onChannelInvalidated();
+
void onInputBoxChanged();
void chatViewReady();
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list