[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:21:24 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=972fce8

The following commit has been merged in the master branch:
commit 972fce8b79b4722fc595be2a6bf46ee70be11f3d
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date:   Tue Feb 28 20:57:53 2012 +0100

    Use Topic.html instead of Header.html for group chats if theme supports it
---
 config/appearance-config.cpp    |  1 +
 lib/adium-theme-header-info.cpp | 11 +++++++++++
 lib/adium-theme-header-info.h   |  4 ++++
 lib/adium-theme-view.cpp        |  7 ++++++-
 lib/chat-widget.cpp             |  1 +
 lib/chat-window-style.cpp       |  8 ++++++++
 lib/chat-window-style.h         |  3 +++
 7 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/config/appearance-config.cpp b/config/appearance-config.cpp
index a67c2a5..8974105 100644
--- a/config/appearance-config.cpp
+++ b/config/appearance-config.cpp
@@ -48,6 +48,7 @@ AppearanceConfig::AppearanceConfig(QWidget *parent, const QVariantList& args)
     m_demoChatHeader.setTimeOpened(QDateTime::currentDateTime());
     m_demoChatHeader.setDestinationName(i18n("BobMarley at yahoo.com"));
     m_demoChatHeader.setDestinationDisplayName(i18n("Bob Marley"));
+    m_demoChatHeader.setGroupChat(false);
 
     ui->chatView->load(AdiumThemeView::SingleUserChat);
     ui->chatView->initialise(m_demoChatHeader);
diff --git a/lib/adium-theme-header-info.cpp b/lib/adium-theme-header-info.cpp
index d6728f5..8a8aded 100644
--- a/lib/adium-theme-header-info.cpp
+++ b/lib/adium-theme-header-info.cpp
@@ -32,6 +32,7 @@ public:
     QUrl outgoingIconPath;
     QDateTime timeOpened;
     QString serviceIconImg;
+    bool isGroupChat;
 };
 
 AdiumThemeHeaderInfo::AdiumThemeHeaderInfo()
@@ -134,3 +135,13 @@ void AdiumThemeHeaderInfo::setServiceIconImage(const QString& serviceIconImg)
 {
     d->serviceIconImg = serviceIconImg;
 }
+
+bool AdiumThemeHeaderInfo::isGroupChat() const
+{
+    return d->isGroupChat;
+}
+
+void AdiumThemeHeaderInfo::setGroupChat(bool isGroupChat)
+{
+    d->isGroupChat = isGroupChat;
+}
diff --git a/lib/adium-theme-header-info.h b/lib/adium-theme-header-info.h
index 1f7afee..177d699 100644
--- a/lib/adium-theme-header-info.h
+++ b/lib/adium-theme-header-info.h
@@ -77,6 +77,10 @@ public:
     QString serviceIconImg() const;
     void setServiceIconImage(const QString &serviceIconImg);
 
+    /** The chat is a group chat */
+    bool isGroupChat() const;
+    void setGroupChat(bool isGroupChat);
+
 private:
     AdiumThemeHeaderInfoPrivate *const d;
 
diff --git a/lib/adium-theme-view.cpp b/lib/adium-theme-view.cpp
index e2b6ed8..035315c 100644
--- a/lib/adium-theme-view.cpp
+++ b/lib/adium-theme-view.cpp
@@ -145,7 +145,12 @@ void AdiumThemeView::initialise(const AdiumThemeHeaderInfo &chatInfo)
     }
 
     if (m_displayHeader) {
-        headerHtml = replaceHeaderKeywords(m_chatStyle->getHeaderHtml(), chatInfo);
+        if (chatInfo.isGroupChat()) {
+            // In group chats header should be replaced by topic
+            headerHtml = replaceHeaderKeywords(m_chatStyle->getTopicHtml(), chatInfo);
+        } else {
+            headerHtml = replaceHeaderKeywords(m_chatStyle->getHeaderHtml(), chatInfo);
+        }
     } //otherwise leave as blank.
 
     // set fontFamily and fontSize
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index c0615bd..907dc34 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -129,6 +129,7 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
 
     AdiumThemeHeaderInfo info;
 
+    info.setGroupChat(d->isGroupChat);
     //normal chat - self and one other person.
     if (d->isGroupChat) {
         info.setChatName(d->channel->targetId());
diff --git a/lib/chat-window-style.cpp b/lib/chat-window-style.cpp
index dc46954..d47d38d 100644
--- a/lib/chat-window-style.cpp
+++ b/lib/chat-window-style.cpp
@@ -165,6 +165,11 @@ QString ChatWindowStyle::getFooterHtml() const
     return content(Footer);
 }
 
+QString ChatWindowStyle::getTopicHtml() const
+{
+    return content(Topic);
+}
+
 QString ChatWindowStyle::getIncomingHtml() const
 {
     return content(Incoming);
@@ -319,6 +324,7 @@ void ChatWindowStyle::readStyleFiles()
     templateFiles.insert(Header, QLatin1String("Header.html"));
     templateFiles.insert(Content, QLatin1String("Content.html"));
     templateFiles.insert(Footer, QLatin1String("Footer.html"));
+    templateFiles.insert(Topic, QLatin1String("Topic.html"));
 
     templateFiles.insert(Incoming, QLatin1String("Incoming/Content.html"));
     templateFiles.insert(IncomingNext, QLatin1String("Incoming/NextContent.html"));
@@ -366,6 +372,8 @@ void ChatWindowStyle::readStyleFiles()
     }
 
     // basic fallbacks
+    inheritContent(Topic, Header);
+
     inheritContent(Incoming, Content);
     inheritContent(Outgoing, Content);
 
diff --git a/lib/chat-window-style.h b/lib/chat-window-style.h
index 3e9fcb9..1024ffa 100644
--- a/lib/chat-window-style.h
+++ b/lib/chat-window-style.h
@@ -99,6 +99,8 @@ public:
     QString getTemplateHtml() const;
     QString getHeaderHtml() const;
     QString getFooterHtml() const;
+    QString getTopicHtml() const;
+
     QString getIncomingHtml() const;
     QString getNextIncomingHtml() const;
     QString getOutgoingHtml() const;
@@ -170,6 +172,7 @@ private:
         Header,
         Content,
         Footer,
+        Topic,
 
         Incoming,
         IncomingNext,

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list