Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
a59b9b1f
Commit
a59b9b1f
authored
Jul 2, 2019
by
Ming Rui Zhang
Browse files
Options
Downloads
Patches
Plain Diff
messagewebview: detect paste(ctrl + v) key press event in textarea
Change-Id: I4d4dbdebe0eb316b1eea1f576e5dae4867008659
parent
34c34096
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
callwidget.cpp
+3
-0
3 additions, 0 deletions
callwidget.cpp
messagewebview.cpp
+11
-0
11 additions, 0 deletions
messagewebview.cpp
messagewebview.h
+2
-0
2 additions, 0 deletions
messagewebview.h
web/chatview.js
+5
-0
5 additions, 0 deletions
web/chatview.js
with
21 additions
and
0 deletions
callwidget.cpp
+
3
−
0
View file @
a59b9b1f
...
...
@@ -205,6 +205,9 @@ CallWidget::CallWidget(QWidget* parent) :
connect
(
ui
->
messageView
,
SIGNAL
(
customContextMenuRequested
(
const
QPoint
&
)),
this
,
SLOT
(
ShowContextMenu
(
const
QPoint
&
)));
connect
(
ui
->
messageView
,
&
MessageWebView
::
pasteKeyDetected
,
this
,
&
CallWidget
::
Paste
);
// set first view to welcome view
ui
->
stackedWidget
->
setCurrentWidget
(
ui
->
welcomePage
);
ui
->
btnConversations
->
setChecked
(
true
);
...
...
This diff is collapsed.
Click to expand it.
messagewebview.cpp
+
11
−
0
View file @
a59b9b1f
...
...
@@ -621,3 +621,14 @@ PrivateBridging::blockConversation()
}
return
0
;
}
Q_INVOKABLE
int
PrivateBridging
::
emitPasteKeyDetected
()
{
if
(
auto
messageView
=
qobject_cast
<
MessageWebView
*>
(
this
->
parent
()))
{
emit
messageView
->
pasteKeyDetected
();
}
else
{
qDebug
()
<<
"JS bridging - exception during emitPasteKeyDetected"
;
}
return
0
;
}
This diff is collapsed.
Click to expand it.
messagewebview.h
+
2
−
0
View file @
a59b9b1f
...
...
@@ -48,6 +48,7 @@ public:
Q_INVOKABLE
int
blockConversation
();
Q_INVOKABLE
int
emitMessagesCleared
();
Q_INVOKABLE
int
emitMessagesLoaded
();
Q_INVOKABLE
int
emitPasteKeyDetected
();
};
class
MessageWebView
:
public
QWebEngineView
...
...
@@ -101,6 +102,7 @@ signals:
void
messagesCleared
();
void
messagesLoaded
();
void
textSelectedReady
();
void
pasteKeyDetected
();
private
slots
:
void
slotLoadFinished
();
...
...
This diff is collapsed.
Click to expand it.
web/chatview.js
+
5
−
0
View file @
a59b9b1f
...
...
@@ -34,6 +34,7 @@ var messages = document.getElementById("messages")
var
backToBottomBtn
=
document
.
getElementById
(
"
back_to_bottom_button
"
)
var
sendContainer
=
document
.
getElementById
(
"
file_image_send_container
"
)
messageBarInput
.
onpaste
=
pasteKeyDetected
;
/* States: allows us to avoid re-doing something if it isn't meaningful */
var
displayLinksEnabled
=
true
...
...
@@ -1755,3 +1756,7 @@ function remove(e) {
sendContainer
.
style
.
visibility
=
"
hidden
"
;
}
}
function
pasteKeyDetected
()
{
window
.
jsbridge
.
emitPasteKeyDetected
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment