[seahorse] Replace GtkFileChooserDialog with GtkFileChooserNative
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse] Replace GtkFileChooserDialog with GtkFileChooserNative
- Date: Sun, 5 Jan 2020 23:31:20 +0000 (UTC)
commit d98ca615f995691ff914838be694943ee8fcb036
Author: Niels De Graef <nielsdegraef gmail com>
Date: Mon Jan 6 00:25:45 2020 +0100
Replace GtkFileChooserDialog with GtkFileChooserNative
It's better for our Flatpak and makes non-GNOME users have a more
integrated interface.
common/exportable.vala | 7 ++-----
pkcs11/pkcs11-request.vala | 6 ++----
src/key-manager.vala | 9 +++------
3 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/common/exportable.vala b/common/exportable.vala
index e425a18c..8ed2db46 100644
--- a/common/exportable.vala
+++ b/common/exportable.vala
@@ -187,12 +187,9 @@ public interface Exportable : GLib.Object {
ref string? directory,
out GLib.File chosen_file,
out Exporter chosen_exporter) {
- var chooser = new Gtk.FileChooserDialog(null, parent, Gtk.FileChooserAction.SAVE,
- _("_Cancel"), Gtk.ResponseType.CANCEL,
- _("Export"), Gtk.ResponseType.ACCEPT,
- null);
+ var chooser = new Gtk.FileChooserNative(null, parent, Gtk.FileChooserAction.SAVE,
+ _("Export"), _("_Cancel"));
- chooser.set_default_response(Gtk.ResponseType.ACCEPT);
chooser.set_local_only(false);
chooser.set_do_overwrite_confirmation(true);
diff --git a/pkcs11/pkcs11-request.vala b/pkcs11/pkcs11-request.vala
index 304a2219..688acd4d 100644
--- a/pkcs11/pkcs11-request.vala
+++ b/pkcs11/pkcs11-request.vala
@@ -101,12 +101,10 @@ public class Request : Gtk.Dialog {
private void save_certificate_request(Gcr.CertificateRequest req,
Gtk.Window? parent) {
- var chooser = new Gtk.FileChooserDialog(_("Save certificate request"),
+ var chooser = new Gtk.FileChooserNative(_("Save certificate request"),
parent, Gtk.FileChooserAction.SAVE,
- _("_Cancel"), Gtk.ResponseType.CANCEL,
- _("_Save"), Gtk.ResponseType.ACCEPT);
+ _("_Save"), _("_Cancel"));
- chooser.set_default_response(Gtk.ResponseType.ACCEPT);
chooser.set_local_only(false);
var der_filter = new Gtk.FileFilter();
diff --git a/src/key-manager.vala b/src/key-manager.vala
index cc19efca..a900a67d 100644
--- a/src/key-manager.vala
+++ b/src/key-manager.vala
@@ -247,14 +247,11 @@ public class Seahorse.KeyManager : Catalog {
}
private void on_import_file(SimpleAction action, GLib.Variant? parameter) {
- Gtk.FileChooserDialog dialog =
- new Gtk.FileChooserDialog(_("Import Key"), this,
+ Gtk.FileChooserNative dialog =
+ new Gtk.FileChooserNative(_("Import Key"), this,
Gtk.FileChooserAction.OPEN,
- _("_Cancel"), Gtk.ResponseType.CANCEL,
- _("_Open"), Gtk.ResponseType.ACCEPT,
- null);
+ _("_Open"), _("_Cancel"));
- dialog.set_default_response(Gtk.ResponseType.ACCEPT);
dialog.set_local_only(false);
// TODO: This should come from libgcr somehow
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]