summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2018-05-27 14:03:21 (GMT)
committerNiels De Graef <nielsdegraef@gmail.com>2018-05-27 14:14:09 (GMT)
commitc586ce03a00cc7639c4cbad574b5377c8654170e (patch)
tree73f636f1bb12c597742d1aecd6f103e836ceb66d
parent73cbfcb0fe97b0c4401c74c041876d50eb0ab807 (diff)
downloadgnome-contacts-c586ce03a00cc7639c4cbad574b5377c8654170e.tar.gz
AvatarSelector: use a FileChooserNative.
This means we no longer need to specify access permissions to $HOME. Fixes #96.
-rw-r--r--data/flatpak/org.gnome.Contacts.json2
-rw-r--r--src/contacts-avatar-selector.vala10
2 files changed, 5 insertions, 7 deletions
diff --git a/data/flatpak/org.gnome.Contacts.json b/data/flatpak/org.gnome.Contacts.json
index e07e24f..56f255e 100644
--- a/data/flatpak/org.gnome.Contacts.json
+++ b/data/flatpak/org.gnome.Contacts.json
@@ -24,8 +24,6 @@
"--talk-name=org.gnome.evolution.dataserver.Subprocess.Backend.*",
/* Telepathy */
"--talk-name=org.freedesktop.Telepathy.AccountManager",
- /* Allow avatars from $HOME */
- "--filesystem=home:ro",
/* Access for the default avatars */
"--filesystem=xdg-data/pixmaps/faces:ro:create",
/* Needed for dconf to work */
diff --git a/src/contacts-avatar-selector.vala b/src/contacts-avatar-selector.vala
index e2e66cd..aeaa6e6 100644
--- a/src/contacts-avatar-selector.vala
+++ b/src/contacts-avatar-selector.vala
@@ -187,11 +187,10 @@ public class Contacts.AvatarSelector : Popover {
[GtkCallback]
private void on_file_clicked (Button button) {
- var chooser = new FileChooserDialog (_("Browse for more pictures"),
+ var chooser = new FileChooserNative (_("Browse for more pictures"),
(Gtk.Window)this.get_toplevel (),
FileChooserAction.OPEN,
- _("_Cancel"), ResponseType.CANCEL,
- _("_Open"), ResponseType.ACCEPT);
+ _("_Open"), _("_Cancel"));
chooser.set_modal (true);
chooser.set_local_only (false);
var preview = new Image ();
@@ -235,7 +234,7 @@ public class Contacts.AvatarSelector : Popover {
chooser.destroy ();
});
- chooser.present ();
+ chooser.run ();
this.popdown();
}
@@ -259,7 +258,8 @@ public class Contacts.AvatarSelector : Popover {
} catch {
}
- (chooser as Dialog).set_response_sensitive (ResponseType.ACCEPT, (pixbuf != null));
+ if (chooser is Dialog)
+ ((Dialog) chooser).set_response_sensitive (ResponseType.ACCEPT, (pixbuf != null));
if (pixbuf != null)
preview.set_from_pixbuf (pixbuf);