aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-07-19 16:27:06 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-07-19 16:27:06 +0800
commita43be88202d423307d4612e444e984cea45f6d99 (patch)
tree42f7050cc5cb0e090f4e2672c94089d19dfeef3e /src
parentc12a362e88752a1c26c79a830c12ff5a254a66c2 (diff)
downloadgsoc2013-epiphany-a43be88202d423307d4612e444e984cea45f6d99.tar
gsoc2013-epiphany-a43be88202d423307d4612e444e984cea45f6d99.tar.gz
gsoc2013-epiphany-a43be88202d423307d4612e444e984cea45f6d99.tar.bz2
gsoc2013-epiphany-a43be88202d423307d4612e444e984cea45f6d99.tar.lz
gsoc2013-epiphany-a43be88202d423307d4612e444e984cea45f6d99.tar.xz
gsoc2013-epiphany-a43be88202d423307d4612e444e984cea45f6d99.tar.zst
gsoc2013-epiphany-a43be88202d423307d4612e444e984cea45f6d99.zip
Add disable_quit, disable_new_window, first_window_fullscreen lockdown
2004-07-19 Marco Pesenti Gritti <marco@gnome.org> * lib/ephy-prefs.h: * src/ephy-shell.c: (ephy_shell_new_tab): * src/ephy-window.c: (ephy_window_fullscreen), (ephy_window_unfullscreen), (update_actions_sensitivity), (tab_detached_cb), (tab_delete_cb), (ephy_window_init): * src/window-commands.c: (window_cmd_file_new_window), (window_cmd_file_close_window): Add disable_quit, disable_new_window, first_window_fullscreen lockdown options.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-shell.c2
-rw-r--r--src/ephy-window.c50
-rw-r--r--src/window-commands.c8
3 files changed, 50 insertions, 10 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index ff2a36917..1d709d9eb 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -555,6 +555,8 @@ ephy_shell_new_tab (EphyShell *shell,
if (flags & EPHY_NEW_TAB_IN_NEW_WINDOW) in_new_window = TRUE;
if (flags & EPHY_NEW_TAB_IN_EXISTING_WINDOW) in_new_window = FALSE;
+ in_new_window = in_new_window && !eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN);
+
jump_to = (flags & EPHY_NEW_TAB_JUMP);
if (!in_new_window && parent_window != NULL)
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 01eafb2a8..b74bb4d8f 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -536,6 +536,14 @@ ephy_window_fullscreen (EphyWindow *window)
window->priv->mode = EPHY_WINDOW_MODE_FULLSCREEN;
+ sync_chromes_visibility (window);
+
+ if (eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN))
+ {
+ /* no need to show "exit fullscreen" button */
+ return;
+ }
+
popup = gtk_window_new (GTK_WINDOW_POPUP);
window->priv->exit_fullscreen_popup = popup;
@@ -570,8 +578,6 @@ ephy_window_fullscreen (EphyWindow *window)
(EGG_EDITABLE_TOOLBAR (window->priv->toolbar),
EGG_TOOLBARS_MODEL (
ephy_shell_get_toolbars_model (ephy_shell, TRUE)));
-
- sync_chromes_visibility (window);
}
static void
@@ -579,12 +585,15 @@ ephy_window_unfullscreen (EphyWindow *window)
{
window->priv->mode = EPHY_WINDOW_MODE_NORMAL;
- g_signal_handlers_disconnect_by_func (G_OBJECT (gdk_screen_get_default ()),
- G_CALLBACK (size_changed_cb),
- window);
+ if (window->priv->exit_fullscreen_popup != NULL)
+ {
+ g_signal_handlers_disconnect_by_func (G_OBJECT (gdk_screen_get_default ()),
+ G_CALLBACK (size_changed_cb),
+ window);
- gtk_widget_destroy (window->priv->exit_fullscreen_popup);
- window->priv->exit_fullscreen_popup = NULL;
+ gtk_widget_destroy (window->priv->exit_fullscreen_popup);
+ window->priv->exit_fullscreen_popup = NULL;
+ }
egg_editable_toolbar_set_model
(EGG_EDITABLE_TOOLBAR (window->priv->toolbar),
@@ -992,7 +1001,7 @@ update_actions_sensitivity (EphyWindow *window)
GtkActionGroup *popups_action_group = GTK_ACTION_GROUP (window->priv->popups_action_group);
GtkAction *action;
gboolean bookmarks_editable, save_to_disk;
- gboolean printing, print_setup;
+ gboolean printing, print_setup, fullscreen;
action = gtk_action_group_get_action (action_group, "ViewToolbar");
g_object_set (action, "sensitive", eel_gconf_key_is_writable (CONF_WINDOWS_SHOW_TOOLBARS), NULL);
@@ -1044,6 +1053,14 @@ update_actions_sensitivity (EphyWindow *window)
action = gtk_action_group_get_action (action_group, "EditToolbar");
g_object_set (action, "sensitive", ! eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_TOOLBAR_EDITING), NULL);
+
+ fullscreen = eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN);
+ action = gtk_action_group_get_action (action_group, "FileNewWindow");
+ g_object_set (action, "sensitive", !fullscreen, NULL);
+ action = gtk_action_group_get_action (action_group, "ViewFullscreen");
+ g_object_set (action, "sensitive", !fullscreen, NULL);
+ action = gtk_action_group_get_action (action_group, "TabsDetach");
+ g_object_set (action, "sensitive", !fullscreen, NULL);
}
static void
@@ -1829,6 +1846,11 @@ tab_detached_cb (EphyNotebook *notebook,
g_return_if_fail (EPHY_IS_TAB (tab));
+ if (eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN))
+ {
+ return;
+ }
+
window = ephy_window_new ();
ephy_notebook_move_tab (notebook,
EPHY_NOTEBOOK (ephy_window_get_notebook (window)),
@@ -1849,7 +1871,12 @@ tab_delete_cb (EphyNotebook *notebook,
{
g_return_val_if_fail (EPHY_IS_TAB (tab), FALSE);
- if (ephy_embed_has_modified_forms (ephy_tab_get_embed (tab)))
+ if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_QUIT) &&
+ gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->priv->notebook)) == 1)
+ {
+ return TRUE;
+ }
+ else if (ephy_embed_has_modified_forms (ephy_tab_get_embed (tab)))
{
return !confirm_close_with_modified_forms (window);
}
@@ -2191,6 +2218,11 @@ ephy_window_init (EphyWindow *window)
G_CALLBACK (ephy_window_delete_event_cb),
window);
+ if (eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN))
+ {
+ gtk_window_fullscreen (GTK_WINDOW (window));
+ }
+
/* lockdown pref notifiers */
window->priv->disable_arbitrary_url_notifier_id = eel_gconf_notification_add
(CONF_LOCKDOWN_DISABLE_ARBITRARY_URL,
diff --git a/src/window-commands.c b/src/window-commands.c
index 38724702f..1562d1b7f 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -286,7 +286,7 @@ window_cmd_file_new_window (GtkAction *action,
tab = ephy_window_get_active_tab (window);
g_return_if_fail (tab != NULL);
- ephy_shell_new_tab (ephy_shell, NULL, tab, NULL,
+ ephy_shell_new_tab (ephy_shell, window, tab, NULL,
EPHY_NEW_TAB_NEW_PAGE |
EPHY_NEW_TAB_IN_NEW_WINDOW);
}
@@ -451,6 +451,12 @@ window_cmd_file_close_window (GtkAction *action,
{
EphyTab *tab;
+ if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_QUIT) &&
+ gtk_notebook_get_n_pages (GTK_NOTEBOOK (ephy_window_get_notebook (window))) == 1)
+ {
+ return;
+ }
+
tab = ephy_window_get_active_tab (window);
g_return_if_fail (tab != NULL);