[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:51 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=57fc225
The following commit has been merged in the master branch:
commit 57fc2250e69154ead5aa1161b5d2c69bcbd90694
Author: Róbert Szókovács <szo at szo.hu>
Date: Tue Apr 16 15:21:56 2013 +0200
Paste clipboard contents when pressing middle mouse button on chat area
REVIEW: 110041
---
lib/adium-theme-view.cpp | 10 ++++++++++
lib/adium-theme-view.h | 2 ++
lib/chat-text-edit.cpp | 10 ++++++++++
lib/chat-text-edit.h | 1 +
lib/chat-widget.cpp | 1 +
5 files changed, 24 insertions(+)
diff --git a/lib/adium-theme-view.cpp b/lib/adium-theme-view.cpp
index db688a5..abbe831 100644
--- a/lib/adium-theme-view.cpp
+++ b/lib/adium-theme-view.cpp
@@ -158,6 +158,16 @@ void AdiumThemeView::wheelEvent(QWheelEvent* event)
QWebView::wheelEvent(event);
}
+void AdiumThemeView::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (event->modifiers() == Qt::NoModifier && event->button() == Qt::MidButton) {
+ Q_EMIT textPasted();
+ event->accept();
+ return;
+ }
+ QWebView::mouseReleaseEvent(event);
+}
+
void AdiumThemeView::initialise(const AdiumThemeHeaderInfo &chatInfo)
{
QString headerHtml;
diff --git a/lib/adium-theme-view.h b/lib/adium-theme-view.h
index a3e5db2..676b794 100644
--- a/lib/adium-theme-view.h
+++ b/lib/adium-theme-view.h
@@ -100,9 +100,11 @@ public Q_SLOTS:
protected:
virtual void contextMenuEvent(QContextMenuEvent *event);
virtual void wheelEvent(QWheelEvent *event);
+ virtual void mouseReleaseEvent(QMouseEvent *event);
Q_SIGNALS:
void zoomFactorChanged(qreal zoomFactor);
+ void textPasted();
private:
ChatWindowStyle *m_chatStyle;
diff --git a/lib/chat-text-edit.cpp b/lib/chat-text-edit.cpp
index 305455c..20055c9 100644
--- a/lib/chat-text-edit.cpp
+++ b/lib/chat-text-edit.cpp
@@ -26,6 +26,8 @@
#include <QtCore/QTimer>
#include <QtCore/QDebug>
#include <QtCore/QString>
+#include <QApplication>
+#include <QClipboard>
#include <KStandardShortcut>
#include <KActionCollection>
@@ -176,6 +178,14 @@ void ChatTextEdit::updateScrollBar()
ensureCursorVisible();
}
+void ChatTextEdit::pasteSelection()
+{
+ const QMimeData *md = QApplication::clipboard()->mimeData(QClipboard::Selection);
+ if (md) {
+ insertFromMimeData(md);
+ }
+}
+
void ChatTextEdit::sendMessage()
{
if (!toPlainText().isEmpty()) {
diff --git a/lib/chat-text-edit.h b/lib/chat-text-edit.h
index 11d428e..a14d716 100644
--- a/lib/chat-text-edit.h
+++ b/lib/chat-text-edit.h
@@ -55,6 +55,7 @@ protected:
private Q_SLOTS:
void recalculateSize();
void updateScrollBar();
+ void pasteSelection();
Q_SIGNALS:
void returnKeyPressed();
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 301ebf1..02fa106 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -145,6 +145,7 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
/* Prepare the chat area */
connect(d->ui.chatArea, SIGNAL(loadFinished(bool)), SLOT(chatViewReady()), Qt::QueuedConnection);
connect(d->ui.chatArea, SIGNAL(zoomFactorChanged(qreal)), SIGNAL(zoomFactorChanged(qreal)));
+ connect(d->ui.chatArea, SIGNAL(textPasted()), d->ui.sendMessageBox, SLOT(pasteSelection()));
initChatArea();
d->pausedStateTimer = new QTimer(this);
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list