aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_summary
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-01-28 20:56:27 +0100
committerfiaxh <git@mx.ax.lt>2018-01-28 22:00:22 +0100
commitf6db249c92e8fd25c1cb52872d3a647be034b626 (patch)
tree65ebb9d61fd27dcfd37a26137f507413193902d3 /main/src/ui/conversation_summary
parentbec810e234a7b9783eb8f35e2ffd7c60d75e09c7 (diff)
downloaddino-f6db249c92e8fd25c1cb52872d3a647be034b626.tar.gz
dino-f6db249c92e8fd25c1cb52872d3a647be034b626.zip
Only display transferred images, display file names, open in system viewer, include and use pgp embedded file names
Diffstat (limited to 'main/src/ui/conversation_summary')
-rw-r--r--main/src/ui/conversation_summary/default_file_display.vala4
-rw-r--r--main/src/ui/conversation_summary/image_display.vala17
2 files changed, 6 insertions, 15 deletions
diff --git a/main/src/ui/conversation_summary/default_file_display.vala b/main/src/ui/conversation_summary/default_file_display.vala
index 15eab6fe..1547440b 100644
--- a/main/src/ui/conversation_summary/default_file_display.vala
+++ b/main/src/ui/conversation_summary/default_file_display.vala
@@ -66,9 +66,9 @@ public class DefaultFileDisplay : Plugins.MetaConversationItem {
event_box.button_release_event.connect((event_button) => {
if (event_button.button == 1) {
try{
- AppInfo.launch_default_for_uri("file://" + file_transfer.get_uri(), null);
+ AppInfo.launch_default_for_uri(file_transfer.get_file().get_uri(), null);
} catch (Error err) {
- print("Tried to open " + file_transfer.get_uri());
+ print("Tried to open " + file_transfer.get_file().get_path());
}
}
return false;
diff --git a/main/src/ui/conversation_summary/image_display.vala b/main/src/ui/conversation_summary/image_display.vala
index c1cd32a1..15880836 100644
--- a/main/src/ui/conversation_summary/image_display.vala
+++ b/main/src/ui/conversation_summary/image_display.vala
@@ -41,7 +41,7 @@ public class ImageDisplay : Plugins.MetaConversationItem {
Image image = new Image() { halign=Align.START, visible = true };
Gdk.Pixbuf pixbuf;
try {
- pixbuf = new Gdk.Pixbuf.from_file(file_transfer.get_uri());
+ pixbuf = new Gdk.Pixbuf.from_file(file_transfer.get_file().get_path());
} catch (Error error) {
return null;
}
@@ -65,16 +65,7 @@ public class ImageDisplay : Plugins.MetaConversationItem {
Label url_label = builder.get_object("url_label") as Label;
Util.force_color(url_label, "#eee");
- file_transfer.notify["info"].connect_after(() => { update_info(url_label, file_transfer.info); });
- update_info(url_label, file_transfer.info);
-
- Image copy_image = builder.get_object("copy_image") as Image;
- Util.force_css(copy_image, "*:not(:hover) { color: #eee; }");
- Button copy_button = builder.get_object("copy_button") as Button;
- Util.force_css(copy_button, "*:hover { background-color: rgba(255,255,255,0.3); border-color: transparent; }");
- copy_button.clicked.connect(() => {
- if (file_transfer.info != null) Clipboard.get_default(Gdk.Display.get_default()).set_text(file_transfer.info, file_transfer.info.length);
- });
+ update_info(url_label, file_transfer.file_name);
Image open_image = builder.get_object("open_image") as Image;
Util.force_css(open_image, "*:not(:hover) { color: #eee; }");
@@ -82,9 +73,9 @@ public class ImageDisplay : Plugins.MetaConversationItem {
Util.force_css(open_button, "*:hover { background-color: rgba(255,255,255,0.3); border-color: transparent; }");
open_button.clicked.connect(() => {
try{
- AppInfo.launch_default_for_uri(file_transfer.info, null);
+ AppInfo.launch_default_for_uri(file_transfer.get_file().get_uri(), null);
} catch (Error err) {
- print("Tried to open " + file_transfer.info);
+ print("Tried to open file://" + file_transfer.get_file().get_path() + " " + err.message + "\n");
}
});