Merge lp:~midori/midori/availactions into lp:midori

Proposed by Cris Dywan
Status: Work in progress
Proposed branch: lp:~midori/midori/availactions
Merge into: lp:midori
Diff against target: 54 lines (+19/-0)
2 files modified
midori/midori-browser.c (+16/-0)
midori/midori-settings.vala (+3/-0)
To merge this branch: bzr merge lp:~midori/midori/availactions
Reviewer Review Type Date Requested Status
Midori Devs Pending
Review via email: mp+165271@code.launchpad.net

Description of the change

Implement available-actions whitelist

midori -c /tmp/kiosktest -e available-actions=SaveAs,Fullscreen,TabNew,Cut,Navigationbar

To post a comment you must log in.
lp:~midori/midori/availactions updated
6174. By Cris Dywan

Fix different action entry lists inside loops

Revision history for this message
Cory J. Geesaman (cory-g) wrote :

Christian,
Thanks for the update, but there are still some items that are visible with the flag -e available-actions=none:

Back
Forward
Stop
Refresh
Inspect Element
Undo Close Tab
Open in New Window
Add Bookmark

The Back/Forward/Stop/Refresh buttons should go since they can control the flow of an application (it would be nice if the shortcuts extension could disable F5/Refresh but that one isn't so bad), Inspect Element/Undo Close Tab/Open in New Window/Add Bookmark can definitely be used to circumvent a kiosk setup.

With ctrl+right-click the items visible are:

Undo Close Tab
Open in New Window
Add Bookmark
Inspect Element

Like you said, the ctrl+right-click one looks a bit better, but the command doesn't remove all the menu items.

Unmerged revisions

6174. By Cris Dywan

Fix different action entry lists inside loops

6173. By Cris Dywan

Implement available-actions whitelist

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2013-05-21 19:59:59 +0000
3+++ midori/midori-browser.c 2013-05-23 00:01:27 +0000
4@@ -6748,6 +6748,7 @@
5 gchar* toolbar_items;
6 gboolean close_buttons_on_tabs;
7 KatzeItem* item;
8+ gchar* available_actions;
9
10 g_object_get (browser->settings,
11 "remember-last-window-size", &remember_last_window_size,
12@@ -6769,6 +6770,7 @@
13 "toolbar-items", &toolbar_items,
14 "close-buttons-on-tabs", &close_buttons_on_tabs,
15 "maximum-history-age", &browser->maximum_history_age,
16+ "available-actions", &available_actions,
17 NULL);
18
19 #ifdef HAVE_GRANITE
20@@ -6846,6 +6848,20 @@
21 _action_set_active (browser, "Statusbar", browser->show_statusbar);
22
23 g_free (toolbar_items);
24+
25+ if (available_actions && *available_actions)
26+ {
27+ guint i;
28+ for (i = 0; i < G_N_ELEMENTS (entries); i++)
29+ if (!strstr (available_actions, entries[i].name))
30+ gtk_action_set_visible (_action_by_name (browser, entries[i].name), FALSE);
31+ for (i = 0; i < G_N_ELEMENTS (toggle_entries); i++)
32+ if (!strstr (available_actions, toggle_entries[i].name))
33+ gtk_action_set_visible (_action_by_name (browser, toggle_entries[i].name), FALSE);
34+ for (i = 0; i < G_N_ELEMENTS (encoding_entries); i++)
35+ if (!strstr (available_actions, encoding_entries[i].name))
36+ gtk_action_set_visible (_action_by_name (browser, encoding_entries[i].name), FALSE);
37+ }
38 }
39
40 static void
41
42=== modified file 'midori/midori-settings.vala'
43--- midori/midori-settings.vala 2013-04-11 20:33:43 +0000
44+++ midori/midori-settings.vala 2013-05-23 00:01:27 +0000
45@@ -64,6 +64,9 @@
46
47 /* Since: 0.4.8 */
48 public uint inactivity_reset { get; set; default = 0; }
49+ /* The comma-separated list of visible actions if set
50+ Since: 0.5.3 */
51+ public string? available_actions { get; set; default = null; }
52
53 GLib.Regex? block_uris_regex = null;
54 /* Since: 0.4.8 */

Subscribers

People subscribed via source and target branches

to all changes: