[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:17:59 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=402b748
The following commit has been merged in the master branch:
commit 402b748ab059f2ee723f312e7e7251ba497964a0
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Thu Sep 23 17:48:22 2010 +0000
Added format toolbar to the chat window.
svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1178720
---
lib/CMakeLists.txt | 1 +
lib/chattextedit.cpp | 18 ++++++++++++
lib/chattextedit.h | 19 ++++++++++++
lib/chatwindow.cpp | 17 +++++++++++
lib/chatwindow.ui | 66 ++++++++++++++++++++++++++++++++++++++----
lib/telepathychatmessageinfo.h | 2 ++
6 files changed, 117 insertions(+), 6 deletions(-)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index a4b3327..c3bd48d 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -11,6 +11,7 @@ set(telepathy_chat_handler_lib_SRCS
adiumthemestatusinfo.cpp
channelcontactlist.cpp
chatstyleplistfilereader.cpp
+ chattextedit.cpp
)
set(telepathy_chat_handler_lib_UI
diff --git a/lib/chattextedit.cpp b/lib/chattextedit.cpp
new file mode 100644
index 0000000..f65a153
--- /dev/null
+++ b/lib/chattextedit.cpp
@@ -0,0 +1,18 @@
+#include "chattextedit.h"
+
+ChatTextEdit::ChatTextEdit(QWidget *parent) :
+ QTextEdit(parent)
+{
+}
+
+void ChatTextEdit::setFontBold(bool isBold)
+{
+ if (isBold)
+ {
+ setFontWeight(QFont::Bold);
+ }
+ else
+ {
+ setFontWeight(QFont::Normal);
+ }
+}
diff --git a/lib/chattextedit.h b/lib/chattextedit.h
new file mode 100644
index 0000000..2f1a1c5
--- /dev/null
+++ b/lib/chattextedit.h
@@ -0,0 +1,19 @@
+#ifndef CHATTEXTEDIT_H
+#define CHATTEXTEDIT_H
+
+#include <QTextEdit>
+
+class ChatTextEdit : public QTextEdit
+{
+ Q_OBJECT
+public:
+ explicit ChatTextEdit(QWidget *parent = 0);
+
+signals:
+
+public slots:
+ /** wraps setFontWeight to a simple on/off bold) */
+ void setFontBold(bool);
+};
+
+#endif // CHATTEXTEDIT_H
diff --git a/lib/chatwindow.cpp b/lib/chatwindow.cpp
index 0363eb9..eaf60fa 100644
--- a/lib/chatwindow.cpp
+++ b/lib/chatwindow.cpp
@@ -36,6 +36,23 @@ ChatWindow::ChatWindow(ChatConnection* chat, QWidget *parent) :
ui->setupUi(this);
ui->statusLabel->setText("");
+ ui->formatBold->setText("");
+ ui->formatBold->setIcon(KIcon("format-text-bold"));
+
+ ui->formatItalic->setText("");
+ ui->formatItalic->setIcon(KIcon("format-text-italic"));
+
+ ui->formatUnderline->setText("");
+ ui->formatUnderline->setIcon(KIcon("format-text-underline"));
+
+ ui->insertEmoticon->setText("");
+ ui->insertEmoticon->setIcon(KIcon("face-smile"));
+
+ connect(ui->formatBold, SIGNAL(toggled(bool)), ui->sendMessageBox, SLOT(setFontBold(bool)));
+ connect(ui->formatItalic, SIGNAL(toggled(bool)), ui->sendMessageBox, SLOT(setFontItalic(bool)));
+ connect(ui->formatUnderline, SIGNAL(toggled(bool)), ui->sendMessageBox, SLOT(setFontUnderline(bool)));
+
+
updateEnabledState(false);
//chat connection lifespan should be same as the chatwindow
diff --git a/lib/chatwindow.ui b/lib/chatwindow.ui
index 9339455..1e7065d 100644
--- a/lib/chatwindow.ui
+++ b/lib/chatwindow.ui
@@ -18,12 +18,61 @@
<widget class="AdiumThemeView" name="chatArea" native="true"/>
</item>
<item>
- <widget class="QSplitter" name="splitter">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <widget class="QPlainTextEdit" name="sendMessageBox"/>
- </widget>
+ <layout class="QHBoxLayout" name="formatToolbar">
+ <item>
+ <widget class="QPushButton" name="formatBold">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="formatItalic">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="formatUnderline">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="insertEmoticon">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="ChatTextEdit" name="sendMessageBox"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
@@ -65,6 +114,11 @@
<header>adiumthemeview.h</header>
<container>1</container>
</customwidget>
+ <customwidget>
+ <class>ChatTextEdit</class>
+ <extends>QTextEdit</extends>
+ <header>chattextedit.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
diff --git a/lib/telepathychatmessageinfo.h b/lib/telepathychatmessageinfo.h
index 6e26f52..d90962e 100644
--- a/lib/telepathychatmessageinfo.h
+++ b/lib/telepathychatmessageinfo.h
@@ -108,6 +108,8 @@ public:
QStringList classes;
+ classes.append("action");
+
if (m_type == RemoteToLocal) {
classes.append("incoming");
classes.append("message");
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list