[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:50 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=806d736
The following commit has been merged in the master branch:
commit 806d736bc93885aae51a27eaad543c1015205d27
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Sun Sep 18 16:34:19 2011 +0100
Force group chat theme to be something sensible when in a group chat
Review: 102660
Reviewed-by: Martin Klapetek
BUG: 282203
---
lib/adium-theme-view.cpp | 34 ++++++++++++++++++++++------------
lib/adium-theme-view.h | 11 +++++++++++
lib/chat-widget.cpp | 6 ++++--
3 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/lib/adium-theme-view.cpp b/lib/adium-theme-view.cpp
index 15751c0..89879c8 100644
--- a/lib/adium-theme-view.cpp
+++ b/lib/adium-theme-view.cpp
@@ -57,11 +57,30 @@ AdiumThemeView::AdiumThemeView(QWidget *parent)
//blocks QWebView functionality which allows you to change page by dragging a URL onto it.
setAcceptDrops(false);
- //determine the chat window style to use (from the Kopete config file).
+ // don't let QWebView handle the links, we do
+ page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
+
+ QAction *defaultOpenLinkAction = pageAction(QWebPage::OpenLink);
+ m_openLinkAction = new KAction(defaultOpenLinkAction->text(), this);
+ connect(m_openLinkAction, SIGNAL(triggered()),
+ this, SLOT(onOpenLinkActionTriggered()));
+
+ connect(this, SIGNAL(linkClicked(QUrl)), this, SLOT(onLinkClicked(QUrl)));
+}
+
+void AdiumThemeView::load(ChatType chatType) {
+
+ //determine the chat window style to use
KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
KConfigGroup appearanceConfig = config->group("Appearance");
- QString chatStyleName = appearanceConfig.readEntry("styleName", "renkoo.AdiumMessageStyle");
+ QString chatStyleName;
+ if (chatType == AdiumThemeView::SingleUserChat) {
+ chatStyleName = appearanceConfig.readEntry("styleName", "renkoo.AdiumMessageStyle");
+ } else {
+ chatStyleName = QLatin1String("simkete");
+ }
+
m_chatStyle = ChatWindowStyleManager::self()->getValidStyleFromPool(chatStyleName);
if (m_chatStyle == 0 || !m_chatStyle->isValid()) {
KMessageBox::error(this, i18n("Failed to load a valid theme. Please make sure you "
@@ -93,18 +112,9 @@ AdiumThemeView::AdiumThemeView(QWidget *parent)
m_useCustomFont = appearanceConfig.readEntry("useCustomFont", false);
m_fontFamily = appearanceConfig.readEntry("fontFamily", QWebSettings::globalSettings()->fontFamily(QWebSettings::StandardFont));
m_fontSize = appearanceConfig.readEntry("fontSize", QWebSettings::globalSettings()->fontSize(QWebSettings::DefaultFontSize));
-
- // don't let QWebView handle the links, we do
- page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
-
- QAction *defaultOpenLinkAction = pageAction(QWebPage::OpenLink);
- m_openLinkAction = new KAction(defaultOpenLinkAction->text(), this);
- connect(m_openLinkAction, SIGNAL(triggered()),
- this, SLOT(onOpenLinkActionTriggered()));
-
- connect(this, SIGNAL(linkClicked(QUrl)), this, SLOT(onLinkClicked(QUrl)));
}
+
void AdiumThemeView::contextMenuEvent(QContextMenuEvent *event)
{
QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos());
diff --git a/lib/adium-theme-view.h b/lib/adium-theme-view.h
index 10afd2e..06210fb 100644
--- a/lib/adium-theme-view.h
+++ b/lib/adium-theme-view.h
@@ -42,7 +42,18 @@ class KDE_TELEPATHY_CHAT_EXPORT AdiumThemeView : public QWebView
{
Q_OBJECT
public:
+
+ enum ChatType {
+ GroupChat,
+ SingleUserChat
+ };
+
explicit AdiumThemeView(QWidget *parent = 0);
+
+ /** Loads the Theme data*/
+ void load(ChatType chatType);
+
+ /** Starts populating the HTML into the view*/
void initialise(const AdiumThemeHeaderInfo&);
const QString variantPath() const;
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 526567c..28b9ae2 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -159,6 +159,8 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
d->ui.contactsView->setModel(d->contactModel);
+ d->ui.chatArea->load((d->isGroupChat?AdiumThemeView::GroupChat:AdiumThemeView::SingleUserChat));
+
AdiumThemeHeaderInfo info;
//normal chat - self and one other person.
@@ -227,8 +229,8 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
connect(this, SIGNAL(searchTextComplete(bool)), d->ui.searchBar, SLOT(onSearchTextComplete(bool)));
- // to make PgUp and PgDown keys work properly
- connect(d->ui.sendMessageBox, SIGNAL(scrollEventRecieved(QKeyEvent*)), d->ui.chatArea, SLOT(onScrollEvent(QKeyEvent*)));
+ // to make PgUp and PgDown keys work properly
+ connect(d->ui.sendMessageBox, SIGNAL(scrollEventRecieved(QKeyEvent*)), d->ui.chatArea, SLOT(onScrollEvent(QKeyEvent*)));
}
ChatWidget::~ChatWidget()
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list