[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:23:05 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=c585941
The following commit has been merged in the master branch:
commit c5859419bc92dba3b47d061fcf92699509540c98
Author: Alin M Elena <alinm.elena at gmail.com>
Date: Sun Dec 30 23:23:34 2012 +0000
Added easy to type emoticons toolbar...
FEATURE: 302005
CCBUG: 302005
REVIEW: 108040
simple style fix
---
CMakeLists.txt | 2 ++
app/CMakeLists.txt | 1 +
app/chat-window.cpp | 11 +++++++++++
app/chat-window.h | 1 +
app/chatwindow.rc | 8 +++++++-
lib/chat-widget.cpp | 6 +++++-
lib/chat-widget.h | 2 ++
7 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3057b3c..e639404 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,8 @@ find_package (KDE4 ${KDE_MIN_VERSION} REQUIRED)
find_package (TelepathyQt4 0.9.1 REQUIRED)
find_package (KTp REQUIRED)
find_package (TelepathyLoggerQt4 0.5.60 REQUIRED)
+find_package(KdepimLibs ${KDE_MIN_VERSION} REQUIRED)
+
include (CheckIncludeFiles)
include (KDE4Defaults)
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 3050e95..a9d87bb 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -21,6 +21,7 @@ target_link_libraries(ktp-text-ui
${QT_QTWEBKIT_LIBRARY}
${KDE4_KNOTIFYCONFIG_LIBS}
${KDE4_KCMUTILS_LIBS}
+ ${KDEPIMLIBS_KPIMTEXTEDIT_LIBS}
ktpchat)
configure_file(org.freedesktop.Telepathy.Client.KTp.TextUi.service.in
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 6567e91..1de8484 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -56,6 +56,7 @@
#include <TelepathyQt/TextChannel>
#include <Sonnet/DictionaryComboBox>
+#include <kpimtextedit/emoticontexteditaction.h>
#include "invite-contact-dialog.h"
@@ -646,6 +647,9 @@ void ChatWindow::setupCustomActions()
clearViewAction->setToolTip(i18nc("Toolbar icon tooltip", "Clear all messages from current chat tab"));
connect(clearViewAction, SIGNAL(triggered()), this, SLOT(onClearViewTriggered()));
+ KPIMTextEdit::EmoticonTextEditAction *addEmoticonAction = new KPIMTextEdit::EmoticonTextEditAction(this);
+ connect(addEmoticonAction, SIGNAL(emoticonActivated(QString)), this, SLOT(onAddEmoticon(QString)) );
+
// add custom actions to the collection
actionCollection()->addAction(QLatin1String("next-tab"), nextTabAction);
actionCollection()->addAction(QLatin1String("previous-tab"), previousTabAction);
@@ -659,6 +663,7 @@ void ChatWindow::setupCustomActions()
actionCollection()->addAction(QLatin1String("block-contact"), blockContactAction);
actionCollection()->addAction(QLatin1String("open-log"), openLogAction);
actionCollection()->addAction(QLatin1String("clear-chat-view"), clearViewAction);
+ actionCollection()->addAction(QLatin1String("emoticons"), addEmoticonAction);
}
void ChatWindow::setAudioCallEnabled(bool enable)
@@ -833,5 +838,11 @@ void ChatWindow::toggleBlockButton(bool contactIsBlocked)
setBlockEnabled(true);
}
+void ChatWindow::onAddEmoticon(const QString& emoticon)
+{
+ int index = m_tabWidget->currentIndex();
+ ChatTab *currentChatTab = qobject_cast<ChatTab*>(m_tabWidget->widget(index));
+ currentChatTab->addEmoticonToChat(emoticon);
+}
#include "chat-window.moc"
diff --git a/app/chat-window.h b/app/chat-window.h
index 759942f..5a90c91 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -102,6 +102,7 @@ private Q_SLOTS:
void setTabSpellDictionary(const QString &dict); /** set the spelling language for the current chat tab*/
void toggleBlockButton(bool contactIsBlocked); /** Toggle block/unblock action according to the flag */
void updateAccountIcon(); /** Update account icon fake action */
+ void onAddEmoticon(const QString& emoticon); /** Add the corresponding emoticon*/
protected Q_SLOTS:
void showSettingsDialog();
diff --git a/app/chatwindow.rc b/app/chatwindow.rc
index 29f7c17..01c27c5 100644
--- a/app/chatwindow.rc
+++ b/app/chatwindow.rc
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gui name="ktp-text-ui"
- version="4"
+ version="5"
xmlns="http://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
@@ -45,4 +45,10 @@
<Action name="language"/>
</ToolBar>
+ <ToolBar hidden="true" newline="true" fullWidth="true" noEdit="true" noMerge="1" position="bottom" name="emoticonsToolBar">
+ <text>Smiley Toolbar</text>
+ <Action name="emoticons"/>
+ </ToolBar>
+
</gui>
+
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 568b7e2..daaaec1 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -1065,5 +1065,9 @@ void ChatWidget::currentPresenceChanged(const Tp::Presence &presence)
}
}
-
+void ChatWidget::addEmoticonToChat(const QString &emoticon)
+{
+ d->ui.sendMessageBox->insertPlainText(QLatin1String(" ") + emoticon);
+ d->ui.sendMessageBox->setFocus();
+}
#include "chat-widget.moc"
diff --git a/lib/chat-widget.h b/lib/chat-widget.h
index a103a9b..80b92d4 100644
--- a/lib/chat-widget.h
+++ b/lib/chat-widget.h
@@ -86,6 +86,8 @@ public:
void setSpellDictionary(const QString &dict);
+ void addEmoticonToChat(const QString &emoticon);
+
/** Returns the chat state of remote contact */
Tp::ChannelChatState remoteChatState();
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list