[polari/wip/fmuellner/drop-target: 80/82] entryArea: Support pasting files
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/drop-target: 80/82] entryArea: Support pasting files
- Date: Fri, 29 Apr 2016 17:24:16 +0000 (UTC)
commit 208af8347f3018563c3b5c0b38c1acd5f7817836
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Feb 12 05:30:45 2016 +0100
entryArea: Support pasting files
src/entryArea.js | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index 8edb086..e571a58 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -255,6 +255,27 @@ const EntryArea = new Lang.Class({
this._setPasteContent(pixbuf);
},
+ pasteFile: function(file) {
+ file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+ Gio.FileQueryInfoFlags.NONE,
+ GLib.PRIORITY_DEFAULT, null,
+ Lang.bind(this, this._onFileInfoReady));
+ },
+
+ _onFileInfoReady: function(file, res) {
+ let fileInfo = null;
+ try {
+ fileInfo = file.query_info_finish(res);
+ } catch(e) {
+ return;
+ }
+
+ let name = fileInfo.get_display_name();
+ this._confirmLabel.label = _("Upload “%s” to public paste service?").format(name);
+ this._uploadLabel.label = _("Uploading “%s” to public paste service …").format(name);
+ this._setPasteContent(file);
+ },
+
_onPasteClicked: function() {
let title;
let nick = this._room.channel.connection.self_contact.alias;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]