[polari/gnome-3-20] entryArea: Make paste handlers public
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/gnome-3-20] entryArea: Make paste handlers public
- Date: Tue, 10 May 2016 19:56:31 +0000 (UTC)
commit 30de0f6027a3f9be44aac280f16cffda2bbe0716
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Feb 12 01:07:47 2016 +0100
entryArea: Make paste handlers public
Those are currently used to handle content pasted in the entry, but
we will soon re-use them for dropped content as well.
https://bugzilla.gnome.org/show_bug.cgi?id=766068
src/entryArea.js | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index 2a32ca1..f96a3b3 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -124,9 +124,18 @@ 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('file-pasted', Lang.bind(this, this._onFilePasted));
+ 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('file-pasted', Lang.bind(this,
+ function(entry, file) {
+ this.pasteFile(file);
+ }));
this._chatEntry.connect('changed', Lang.bind(this, this._onEntryChanged));
this._chatEntry.connect('activate', Lang.bind(this,
@@ -240,7 +249,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?",
@@ -252,13 +261,13 @@ 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);
},
- _onFilePasted: function(entry, file) {
+ pasteFile: function(file) {
file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
Gio.FileQueryInfoFlags.NONE,
GLib.PRIORITY_DEFAULT, null,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]