Merge lp:~davidmhewitt/pantheon-agent-geoclue2/fix-1667757 into lp:~elementary-pantheon/pantheon-agent-geoclue2/trunk

Proposed by David Hewitt
Status: Merged
Approved by: Danielle Foré
Approved revision: 17
Merged at revision: 15
Proposed branch: lp:~davidmhewitt/pantheon-agent-geoclue2/fix-1667757
Merge into: lp:~elementary-pantheon/pantheon-agent-geoclue2/trunk
Diff against target: 84 lines (+7/-22)
2 files modified
src/Agent.vala (+7/-12)
src/Geoclue2Dialog.vala (+0/-10)
To merge this branch: bzr merge lp:~davidmhewitt/pantheon-agent-geoclue2/fix-1667757
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+318293@code.launchpad.net

Commit message

Remove "never ask again" checkbox.

Description of the change

Remove "never ask again" checkbox. If you deny, you will prompted each time the app requests access again. If you allow, you will not be asked again.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Does what it says it does! Just a minor code style issue ;)

17. By David Hewitt

Fix code style

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Agent.vala'
--- src/Agent.vala 2017-02-24 17:37:39 +0000
+++ src/Agent.vala 2017-02-25 00:36:22 +0000
@@ -97,11 +97,9 @@
97 var stored_accuracy = remembered_accuracy.get_uint32();97 var stored_accuracy = remembered_accuracy.get_uint32();
98 if (req_accuracy <= stored_accuracy) {98 if (req_accuracy <= stored_accuracy) {
99 authorized = true;99 authorized = true;
100 } else {100 allowed_accuracy = req_accuracy;
101 authorized = false;101 return;
102 }102 }
103 allowed_accuracy = req_accuracy;
104 return;
105 }103 }
106104
107 string app_name = app_info.get_display_name ();105 string app_name = app_info.get_display_name ();
@@ -121,7 +119,6 @@
121 dialog.show_all ();119 dialog.show_all ();
122120
123 var result = dialog.run ();121 var result = dialog.run ();
124 var remember = dialog.remember_checked ();
125122
126 switch (result) {123 switch (result) {
127 case Gtk.ResponseType.YES:124 case Gtk.ResponseType.YES:
@@ -132,12 +129,10 @@
132 break;129 break;
133 }130 }
134131
135 if (remember) {132 if (authorized) {
136 if(authorized) {133 remember_app (id, new Variant.uint32 (req_accuracy));
137 remember_app (id, new Variant.uint32 (req_accuracy));134 } else {
138 } else {135 remember_app (id, new Variant.uint32 (0));
139 remember_app (id, new Variant.uint32 (0));
140 }
141 }136 }
142137
143 dialog.destroy ();138 dialog.destroy ();
144139
=== modified file 'src/Geoclue2Dialog.vala'
--- src/Geoclue2Dialog.vala 2017-02-24 17:37:39 +0000
+++ src/Geoclue2Dialog.vala 2017-02-25 00:36:22 +0000
@@ -21,8 +21,6 @@
2121
22namespace Ag.Widgets {22namespace Ag.Widgets {
23 public class Geoclue2Dialog : Gtk.Dialog {23 public class Geoclue2Dialog : Gtk.Dialog {
24 public signal void done (bool allow);
25 private Gtk.CheckButton remember_checkbox;
2624
27 public Geoclue2Dialog (string message, string app_name, string icon_name) {25 public Geoclue2Dialog (string message, string app_name, string icon_name) {
28 Object (title: _("Location Dialog"), window_position: Gtk.WindowPosition.CENTER, resizable: false, deletable: false, skip_taskbar_hint: true);26 Object (title: _("Location Dialog"), window_position: Gtk.WindowPosition.CENTER, resizable: false, deletable: false, skip_taskbar_hint: true);
@@ -41,9 +39,6 @@
41 message_label.wrap = true;39 message_label.wrap = true;
42 message_label.xalign = 0;40 message_label.xalign = 0;
4341
44 remember_checkbox = new Gtk.CheckButton.with_label (_("Never ask again"));
45 remember_checkbox.margin_top = 12;
46
47 var image = new Gtk.Image.from_icon_name ("find-location", Gtk.IconSize.DIALOG);42 var image = new Gtk.Image.from_icon_name ("find-location", Gtk.IconSize.DIALOG);
4843
49 var overlay = new Gtk.Overlay ();44 var overlay = new Gtk.Overlay ();
@@ -63,7 +58,6 @@
63 grid.attach (overlay, 0, 0, 1, 3);58 grid.attach (overlay, 0, 0, 1, 3);
64 grid.attach (heading, 1, 0, 1, 1);59 grid.attach (heading, 1, 0, 1, 1);
65 grid.attach (message_label, 1, 1, 1, 1);60 grid.attach (message_label, 1, 1, 1, 1);
66 grid.attach (remember_checkbox, 1, 2, 1, 1);
6761
68 var deny_button = (Gtk.Button)add_button (_("Deny"), Gtk.ResponseType.NO);62 var deny_button = (Gtk.Button)add_button (_("Deny"), Gtk.ResponseType.NO);
69 var allow_button = (Gtk.Button)add_button (_("Allow"), Gtk.ResponseType.YES);63 var allow_button = (Gtk.Button)add_button (_("Allow"), Gtk.ResponseType.YES);
@@ -89,9 +83,5 @@
8983
90 window.focus (Gdk.CURRENT_TIME);84 window.focus (Gdk.CURRENT_TIME);
91 }85 }
92
93 public bool remember_checked () {
94 return remember_checkbox.get_active ();
95 }
96 }86 }
97}87}

Subscribers

People subscribed via source and target branches

to all changes: