[polari/wip/fmuellner/paste-confirmation: 13/16] entryArea: Make pasteText()/pasteImage() public
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/paste-confirmation: 13/16] entryArea: Make pasteText()/pasteImage() public
- Date: Fri, 12 Feb 2016 13:00:39 +0000 (UTC)
commit ce17b5b88cf13f022afa9641d0ed299f6824afcb
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Feb 12 01:07:47 2016 +0100
entryArea: Make pasteText()/pasteImage() public
Those are currently used to handle content pasted in the entry, but
we will soon re-use them for dropped content as well.
src/entryArea.js | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index 5167bac..6cc47ca 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -115,8 +115,14 @@ const EntryArea = new Lang.Class({
}));
this._nickPopover.set_default_widget(this._changeButton);
- this._chatEntry.connect('text-pasted', Lang.bind(this, this._onTextPasted));
- this._chatEntry.connect('image-pasted', Lang.bind(this, this._onImagePasted));
+ this._chatEntry.connect('text-pasted', Lang.bind(this,
+ function(entry, text, nLines) {
+ this.pasteText(text, nLines);
+ }));
+ this._chatEntry.connect('image-pasted', Lang.bind(this,
+ function(entry, image) {
+ this.pasteImage(image);
+ }));
this._chatEntry.connect('changed', Lang.bind(this, this._onEntryChanged));
this._chatEntry.connect('activate', Lang.bind(this,
@@ -230,7 +236,7 @@ const EntryArea = new Lang.Class({
}
},
- _onTextPasted: function(entry, text, nLines) {
+ pasteText: function(text, nLines) {
this._confirmLabel.label =
ngettext("Paste %s line of text to public paste service?",
"Paste %s lines of text to public paste service?",
@@ -242,7 +248,7 @@ const EntryArea = new Lang.Class({
this._setPasteContent(text);
},
- _onImagePasted: function(entry, pixbuf) {
+ pasteImage: function(pixbuf) {
this._confirmLabel.label = _("Upload image to public paste service?");
this._uploadLabel.label = _("Uploading image to public paste service …");
this._setPasteContent(pixbuf);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]