patches/nautilus-07-lockdown.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 17505 ed8b5d260e6a
child 21293 3800dae91cd2
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
     1
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/Makefile.am nautilus-2.26.3/libnautilus-private/Makefile.am
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
     2
--- nautilus-2.26.3.old/libnautilus-private/Makefile.am	2009-04-20 11:57:19.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
     3
+++ nautilus-2.26.3/libnautilus-private/Makefile.am	2009-07-13 11:41:43.040463000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
     4
@@ -124,6 +124,8 @@ libnautilus_private_la_SOURCES = \
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
     5
 	nautilus-lib-self-check-functions.h \
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     6
 	nautilus-link.c \
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     7
 	nautilus-link.h \
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     8
+	nautilus-lockdown.c \
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
     9
+	nautilus-lockdown.h \
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    10
 	nautilus-marshal.c \
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    11
 	nautilus-marshal.h \
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    12
 	nautilus-merged-directory.c \
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    13
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-directory-async.c nautilus-2.26.3/libnautilus-private/nautilus-directory-async.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    14
--- nautilus-2.26.3.old/libnautilus-private/nautilus-directory-async.c	2009-05-13 12:30:32.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    15
+++ nautilus-2.26.3/libnautilus-private/nautilus-directory-async.c	2009-07-13 11:41:43.043014000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    16
@@ -856,6 +857,10 @@ should_skip_file (NautilusDirectory *dir
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    17
 		return TRUE;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    18
 	}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    19
 
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    20
+	if (nautilus_lockdown_is_forbidden_file(directory, info)) {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    21
+		return TRUE;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    22
+	}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    23
+
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    24
 	return FALSE;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    25
 }
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    26
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    27
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-directory.c nautilus-2.26.3/libnautilus-private/nautilus-directory.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    28
--- nautilus-2.26.3.old/libnautilus-private/nautilus-directory.c	2009-04-20 11:57:19.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    29
+++ nautilus-2.26.3/libnautilus-private/nautilus-directory.c	2009-07-13 11:41:43.045220000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    30
@@ -342,6 +342,7 @@ add_preferences_callbacks (void)
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    31
 	eel_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    32
 				      filtering_changed_callback,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    33
 				      NULL);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    34
+    nautilus_lockdown_notify_add(filtering_changed_callback, NULL) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    35
 	eel_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_TEXT_IN_ICONS,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    36
 				      async_data_preference_changed_callback,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    37
 				      NULL);
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    38
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-file.c nautilus-2.26.3/libnautilus-private/nautilus-file.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    39
--- nautilus-2.26.3.old/libnautilus-private/nautilus-file.c	2009-07-13 11:38:13.506664000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    40
+++ nautilus-2.26.3/libnautilus-private/nautilus-file.c	2009-07-13 11:41:43.048782000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    41
@@ -47,6 +47,7 @@
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    42
 #include "nautilus-users-groups-cache.h"
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    43
 #include "nautilus-vfs-file.h"
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    44
 #include "nautilus-saved-search-file.h"
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    45
+#include "nautilus-lockdown.h"
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    46
 #include <eel/eel-debug.h>
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    47
 #include <eel/eel-glib-extensions.h>
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    48
 #include <eel/eel-gtk-extensions.h>
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    49
@@ -2814,7 +2815,8 @@ nautilus_file_should_show (NautilusFile 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    50
 		return TRUE;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    51
 	} else {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    52
 		return (show_hidden || (!nautilus_file_is_hidden_file (file) && !is_file_hidden (file))) &&
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    53
-			(show_backup || !nautilus_file_is_backup_file (file)) &&
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    54
+			(show_backup || !nautilus_file_is_backup_file (file) &&
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    55
+			!nautilus_lockdown_is_forbidden_nautilus_file(file)) &&
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    56
 			(show_foreign || !(nautilus_file_is_in_desktop (file) && nautilus_file_is_foreign_link (file)));
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    57
 	}
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    58
 }
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    59
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-lockdown.c nautilus-2.26.3/libnautilus-private/nautilus-lockdown.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    60
--- nautilus-2.26.3.old/libnautilus-private/nautilus-lockdown.c	1970-01-01 01:00:00.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    61
+++ nautilus-2.26.3/libnautilus-private/nautilus-lockdown.c	2009-07-13 11:41:43.050482000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    62
@@ -0,0 +1,332 @@
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    63
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    64
+/*
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    65
+ * Copyright (C) 2004 Sun Microsystems, Inc.
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    66
+ *
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    67
+ * This program is free software; you can redistribute it and/or
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    68
+ * modify it under the terms of the GNU General Public License as
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    69
+ * published by the Free Software Foundation; either version 2 of the
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    70
+ * License, or (at your option) any later version.
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    71
+ *
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    72
+ * This program is distributed in the hope that it will be useful, but
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    73
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    74
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    75
+ * General Public License for more details.
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    76
+ *
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    77
+ * You should have received a copy of the GNU General Public License
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    78
+ * along with this program; if not, write to the Free Software
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    79
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    80
+ * 02111-1307, USA.
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    81
+ *
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    82
+ * Authors:
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    83
+ *      Matt Keenan  <[email protected]>
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    84
+ *      Mark McLoughlin  <[email protected]>
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    85
+ */
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    86
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    87
+#include <config.h>
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    88
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    89
+#include "nautilus-lockdown.h"
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    90
+#include "nautilus-global-preferences.h"
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    91
+#include "nautilus-program-choosing.h"
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    92
+#include <eel/eel-preferences.h>
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
    93
+#include <eel/eel-string.h>
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    94
+#include <libgnome/gnome-desktop-item.h>
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    95
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    96
+#include <string.h>
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    97
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    98
+#define N_LISTENERS 3
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
    99
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   100
+typedef struct {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   101
+        guint   initialized : 1;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   102
+        guint   disable_command_line : 1;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   103
+        guint   restrict_application_launching : 1;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   104
+	
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   105
+        char**  allowed_applications;
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   106
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   107
+        guint   listeners [N_LISTENERS];
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   108
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   109
+        GSList *closures;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   110
+} NautilusLockdown ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   111
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   112
+const gchar *command_line_execs[] = {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   113
+	"/usr/bin/gnome-terminal",
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   114
+	"/usr/bin/xterm",
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   115
+};
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   116
+#define NUMBER_COMMAND_LINE_EXECS	2
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   117
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   118
+static NautilusLockdown nautilus_lockdown = { 0, };
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   119
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   120
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   121
+static inline void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   122
+nautilus_lockdown_invoke_closures (NautilusLockdown *lockdown)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   123
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   124
+        GSList *l;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   125
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   126
+        for (l = lockdown->closures; l; l = l->next)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   127
+                g_closure_invoke (l->data, NULL, 0, NULL, NULL);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   128
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   129
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   130
+static void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   131
+disable_command_line_notify (NautilusLockdown *lockdown)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   132
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   133
+        lockdown->disable_command_line = 
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   134
+            eel_preferences_get_boolean(
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   135
+                                    NAUTILUS_PREFERENCES_DISABLE_COMMANDLINE) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   136
+        nautilus_lockdown_invoke_closures (lockdown);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   137
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   138
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   139
+static void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   140
+restrict_application_launching_notify (NautilusLockdown *lockdown)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   141
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   142
+        lockdown->restrict_application_launching =
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   143
+                eel_preferences_get_boolean (
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   144
+                                NAUTILUS_PREFERENCES_RESTRICT_APP_LAUNCHING);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   145
+        nautilus_lockdown_invoke_closures (lockdown);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   146
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   147
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   148
+static void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   149
+allowed_applications_notify (NautilusLockdown *lockdown)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   150
+{
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   151
+        g_strfreev(lockdown->allowed_applications) ;
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   152
+        lockdown->allowed_applications = 
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   153
+                eel_preferences_get_string_array(
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   154
+                                    NAUTILUS_PREFERENCES_ALLOWED_APPLICATIONS) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   155
+        nautilus_lockdown_invoke_closures (lockdown);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   156
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   157
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   158
+static gboolean
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   159
+nautilus_lockdown_load_bool (NautilusLockdown         *lockdown,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   160
+                          const char            *key,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   161
+                          EelPreferencesCallback  notify_func)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   162
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   163
+        gboolean  retval = eel_preferences_get_boolean (key);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   164
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   165
+        eel_preferences_add_callback(key, notify_func, lockdown) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   166
+        return retval;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   167
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   168
+
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   169
+static char**
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   170
+nautilus_lockdown_load_allowed_applications (NautilusLockdown *lockdown)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   171
+{
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   172
+        char **retval;
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   173
+
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   174
+        retval = eel_preferences_get_string_array(
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   175
+                                    NAUTILUS_PREFERENCES_ALLOWED_APPLICATIONS) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   176
+        eel_preferences_add_callback(NAUTILUS_PREFERENCES_ALLOWED_APPLICATIONS,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   177
+                                     allowed_applications_notify, lockdown) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   178
+        return retval;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   179
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   180
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   181
+void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   182
+nautilus_lockdown_init (void)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   183
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   184
+        nautilus_lockdown.disable_command_line =
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   185
+                nautilus_lockdown_load_bool (
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   186
+                                    &nautilus_lockdown,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   187
+                                    NAUTILUS_PREFERENCES_DISABLE_COMMANDLINE,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   188
+                                    disable_command_line_notify);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   189
+        nautilus_lockdown.restrict_application_launching =
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   190
+                nautilus_lockdown_load_bool (
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   191
+                                    &nautilus_lockdown,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   192
+                                    NAUTILUS_PREFERENCES_RESTRICT_APP_LAUNCHING,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   193
+                                    restrict_application_launching_notify) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   194
+        nautilus_lockdown.allowed_applications =
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   195
+                nautilus_lockdown_load_allowed_applications (
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   196
+                                                        &nautilus_lockdown) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   197
+        nautilus_lockdown.initialized = TRUE;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   198
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   199
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   200
+void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   201
+nautilus_lockdown_finalize (void)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   202
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   203
+    GSList *l = NULL ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   204
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   205
+        g_assert (nautilus_lockdown.initialized == TRUE);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   206
+        eel_preferences_remove_callback(
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   207
+                                    NAUTILUS_PREFERENCES_DISABLE_COMMANDLINE,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   208
+                                    disable_command_line_notify, 
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   209
+                                    &nautilus_lockdown) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   210
+        eel_preferences_remove_callback(
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   211
+                                    NAUTILUS_PREFERENCES_RESTRICT_APP_LAUNCHING,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   212
+                                    restrict_application_launching_notify, 
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   213
+                                    &nautilus_lockdown) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   214
+        eel_preferences_remove_callback(
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   215
+                                    NAUTILUS_PREFERENCES_ALLOWED_APPLICATIONS,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   216
+                                    allowed_applications_notify, 
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   217
+                                    &nautilus_lockdown) ;
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   218
+        g_strfreev(nautilus_lockdown.allowed_applications) ;
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   219
+        for (l = nautilus_lockdown.closures; l; l = l->next) {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   220
+                g_closure_unref (l->data);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   221
+        }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   222
+        g_slist_free (nautilus_lockdown.closures);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   223
+        nautilus_lockdown.closures = NULL;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   224
+        nautilus_lockdown.initialized = FALSE;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   225
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   226
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   227
+gboolean
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   228
+nautilus_lockdown_is_command_line_disabled (void)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   229
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   230
+        g_assert (nautilus_lockdown.initialized == TRUE);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   231
+        return nautilus_lockdown.disable_command_line;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   232
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   233
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   234
+gboolean
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   235
+nautilus_lockdown_is_app_launching_restricted (void)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   236
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   237
+        g_assert (nautilus_lockdown.initialized == TRUE);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   238
+        return nautilus_lockdown.restrict_application_launching;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   239
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   240
+
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   241
+char**
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   242
+nautilus_lockdown_get_allowed_apps (void)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   243
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   244
+	g_assert (nautilus_lockdown.initialized == TRUE);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   245
+	return nautilus_lockdown.allowed_applications;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   246
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   247
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   248
+static GClosure *
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   249
+nautilus_lockdown_notify_find (GSList    *closures,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   250
+                            GCallback  callback_func,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   251
+                            gpointer   user_data)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   252
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   253
+        GSList *l;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   254
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   255
+        for (l = closures; l; l = l->next) {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   256
+                GCClosure *cclosure = l->data;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   257
+                GClosure  *closure  = l->data;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   258
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   259
+                if (closure->data == user_data &&
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   260
+                    cclosure->callback == callback_func)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   261
+                        return closure;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   262
+        }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   263
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   264
+        return NULL;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   265
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   266
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   267
+static void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   268
+marshal_user_data (GClosure     *closure,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   269
+                   GValue       *return_value,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   270
+                   guint         n_param_values,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   271
+                   const GValue *param_values,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   272
+                   gpointer      invocation_hint,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   273
+                   gpointer      marshal_data)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   274
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   275
+        GCClosure *cclosure = (GCClosure*) closure;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   276
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   277
+        g_return_if_fail (cclosure->callback != NULL);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   278
+        g_return_if_fail (n_param_values == 0);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   279
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   280
+        ((void (*) (gpointer *))cclosure->callback) (closure->data);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   281
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   282
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   283
+void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   284
+nautilus_lockdown_notify_add (GCallback callback_func,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   285
+                           gpointer  user_data)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   286
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   287
+        GClosure *closure;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   288
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   289
+        g_assert (nautilus_lockdown_notify_find (nautilus_lockdown.closures,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   290
+                                              callback_func,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   291
+                                              user_data) == NULL);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   292
+        closure = g_cclosure_new (callback_func, user_data, NULL);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   293
+        g_closure_set_marshal (closure, marshal_user_data);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   294
+        nautilus_lockdown.closures = g_slist_append (nautilus_lockdown.closures,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   295
+                                                  closure);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   296
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   297
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   298
+void
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   299
+nautilus_lockdown_notify_remove (GCallback callback_func,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   300
+                              gpointer  user_data)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   301
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   302
+        GClosure *closure;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   303
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   304
+        closure = nautilus_lockdown_notify_find (nautilus_lockdown.closures,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   305
+                                              callback_func,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   306
+                                              user_data);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   307
+        g_assert (closure != NULL);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   308
+        nautilus_lockdown.closures = g_slist_remove (nautilus_lockdown.closures,
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   309
+                                                  closure);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   310
+        g_closure_unref (closure);
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   311
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   312
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   313
+static gboolean nautilus_lockdown_is_forbidden_uri(const char *uri)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   314
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   315
+    GnomeDesktopItem *item = NULL ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   316
+    GError *error = NULL ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   317
+    const char *command = NULL ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   318
+    gboolean ret_code = FALSE ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   319
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   320
+    item = gnome_desktop_item_new_from_uri(uri, 0, &error) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   321
+    if (error != NULL) { 
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   322
+        g_error_free(error) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   323
+        return ret_code ; 
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   324
+    }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   325
+    command = gnome_desktop_item_get_string(item, GNOME_DESKTOP_ITEM_EXEC) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   326
+    if (command == NULL) { return ret_code ; }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   327
+    return nautilus_lockdown_is_forbidden_command(command) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   328
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   329
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   330
+static const char *GNOME_APP_MIME = "application/x-gnome-app-info" ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   331
+static const char *DESKTOP_MIME = "application/x-desktop" ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   332
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   333
+gboolean nautilus_lockdown_is_forbidden_file(NautilusDirectory *directory,
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   334
+                                             GFileInfo *file)
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   335
+{
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   336
+    const char *mime_type = g_file_info_get_content_type(file) ;
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   337
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   338
+    if (nautilus_lockdown.restrict_application_launching &&
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   339
+            mime_type != NULL &&
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   340
+            (strcmp(mime_type, GNOME_APP_MIME) == 0 ||
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   341
+             strcmp(mime_type, DESKTOP_MIME) == 0)) {
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   342
+        return nautilus_lockdown_is_forbidden_command(
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   343
+                    nautilus_directory_get_file_uri(directory, g_file_info_get_name(file)));
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   344
+    }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   345
+    return FALSE ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   346
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   347
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   348
+gboolean nautilus_lockdown_is_forbidden_nautilus_file(NautilusFile *file)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   349
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   350
+    if (nautilus_lockdown.restrict_application_launching &&
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   351
+                        (nautilus_file_is_mime_type(file, GNOME_APP_MIME) ||
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   352
+                         nautilus_file_is_mime_type(file, DESKTOP_MIME))) {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   353
+        return nautilus_lockdown_is_forbidden_uri(nautilus_file_get_uri(file)) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   354
+    }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   355
+    return FALSE ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   356
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   357
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   358
+gboolean nautilus_lockdown_is_forbidden_command(const char *command)
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   359
+{
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   360
+    char *commandCopy = NULL ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   361
+    char *program = NULL ;
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   362
+    char *allowed_app;
11595
8254027d4999 2008-02-05 Padraig O'Briain <[email protected]>
padraig
parents: 11546
diff changeset
   363
+    gboolean retCode = FALSE ;
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   364
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   365
+    if (!nautilus_lockdown.restrict_application_launching) { return retCode ; }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   366
+    commandCopy = g_shell_unquote(command, NULL) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   367
+    if (commandCopy == NULL) { commandCopy = g_strdup(command) ; }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   368
+    strtok(commandCopy, " ") ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   369
+    if (g_path_is_absolute(commandCopy)) {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   370
+        program = commandCopy ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   371
+    }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   372
+    else {
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   373
+        char *stripped = g_path_get_basename(commandCopy) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   374
+
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   375
+        program = g_find_program_in_path(stripped) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   376
+        g_free(stripped) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   377
+        g_free(commandCopy) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   378
+    }
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   379
+    retCode = TRUE;
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   380
+    if (program != NULL) {
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   381
+        int i = 0;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   382
+        allowed_app = nautilus_lockdown.allowed_applications[i];
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   383
+        while (allowed_app != NULL) {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   384
+            if (!strcmp(allowed_app, program)) {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   385
+                retCode = FALSE;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   386
+                break;   
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   387
+            }
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   388
+            allowed_app = nautilus_lockdown.allowed_applications[++i];
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   389
+        }
9060
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   390
+        g_free(program) ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   391
+    }
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   392
+    return retCode ;
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   393
+}
c457ded950ba 2007-01-23 Stephen Browne <[email protected]>
stephen
parents:
diff changeset
   394
+
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   395
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-lockdown.h nautilus-2.26.3/libnautilus-private/nautilus-lockdown.h
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   396
--- nautilus-2.26.3.old/libnautilus-private/nautilus-lockdown.h	1970-01-01 01:00:00.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   397
+++ nautilus-2.26.3/libnautilus-private/nautilus-lockdown.h	2009-07-13 11:41:43.050917000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   398
@@ -0,0 +1,54 @@
12144
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   399
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   400
+/*
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   401
+ * Copyright (C) 2004 Sun Microsystems, Inc.
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   402
+ *
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   403
+ * This program is free software; you can redistribute it and/or
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   404
+ * modify it under the terms of the GNU General Public License as
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   405
+ * published by the Free Software Foundation; either version 2 of the
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   406
+ * License, or (at your option) any later version.
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   407
+ *
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   408
+ * This program is distributed in the hope that it will be useful, but
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   409
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   410
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   411
+ * General Public License for more details.
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   412
+ *
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   413
+ * You should have received a copy of the GNU General Public License
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   414
+ * along with this program; if not, write to the Free Software
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   415
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   416
+ * 02111-1307, USA.
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   417
+ *
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   418
+ * Authors:
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   419
+ *      Matt Keenan  <[email protected]>
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   420
+ *      Mark McLoughlin  <[email protected]>
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   421
+ */
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   422
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   423
+#ifndef __NAUTILUS_LOCKDOWN_H__
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   424
+#define __NAUTILUS_LOCKDOWN_H__
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   425
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   426
+#include <libgnomevfs/gnome-vfs.h>
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   427
+#include <glib.h>
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   428
+#include <glib-object.h>
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   429
+#include "nautilus-directory.h"
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   430
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   431
+G_BEGIN_DECLS
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   432
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   433
+void nautilus_lockdown_init     (void);
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   434
+void nautilus_lockdown_finalize (void);
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   435
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   436
+void nautilus_lockdown_notify_add    (GCallback callback_func,
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   437
+                                   gpointer  user_data);
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   438
+void nautilus_lockdown_notify_remove (GCallback callback_func,
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   439
+                                   gpointer  user_data);
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   440
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   441
+gboolean nautilus_lockdown_is_command_line_disabled(void) ;
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   442
+gboolean nautilus_lockdown_is_app_launching_restricted(void) ;
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   443
+char** nautilus_lockdown_get_allowed_apps(void) ;
12144
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   444
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   445
+gboolean nautilus_lockdown_is_forbidden_file(NautilusDirectory *directory,
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   446
+                                             GFileInfo *file) ;
12144
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   447
+gboolean nautilus_lockdown_is_forbidden_nautilus_file(NautilusFile *file) ;
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   448
+gboolean nautilus_lockdown_is_forbidden_command(const char *command) ;
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   449
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   450
+G_END_DECLS
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   451
+
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   452
+#endif /* __NAUTILUS_LOCKDOWN_H__ */
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   453
/jds/bin/diff -uprN nautilus-2.26.3.old/src/file-manager/fm-directory-view.c nautilus-2.26.3/src/file-manager/fm-directory-view.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   454
--- nautilus-2.26.3.old/src/file-manager/fm-directory-view.c	2009-05-18 20:44:27.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   455
+++ nautilus-2.26.3/src/file-manager/fm-directory-view.c	2009-07-13 11:41:43.055406000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   456
@@ -314,6 +314,7 @@ static void     reset_update_interval   
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   457
 static void     schedule_idle_display_of_pending_files         (FMDirectoryView      *view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   458
 static void     unschedule_display_of_pending_files            (FMDirectoryView      *view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   459
 static void     disconnect_model_handlers                      (FMDirectoryView      *view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   460
+static void     lockdown_changed_callback (gpointer context);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   461
 static void     metadata_for_directory_as_file_ready_callback  (NautilusFile         *file,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   462
 								gpointer              callback_data);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   463
 static void     metadata_for_files_in_directory_ready_callback (NautilusDirectory    *directory,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   464
@@ -9575,6 +9579,15 @@ fm_directory_view_handle_uri_list_drop (
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   465
 	g_free (container_uri);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   466
 }
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   467
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   468
+static void lockdown_changed_callback(gpointer context)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   469
+{
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   470
+    FMDirectoryView *directory_view = FM_DIRECTORY_VIEW(context) ;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   471
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   472
+    if (directory_view != NULL && directory_view->details->model != NULL) {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   473
+        load_directory(directory_view, directory_view->details->model) ;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   474
+    }
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   475
+}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   476
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   477
 void
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   478
 fm_directory_view_handle_text_drop (FMDirectoryView  *view,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   479
 				    const char       *text,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   480
/jds/bin/diff -uprN nautilus-2.26.3.old/src/file-manager/fm-tree-model.c nautilus-2.26.3/src/file-manager/fm-tree-model.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   481
--- nautilus-2.26.3.old/src/file-manager/fm-tree-model.c	2009-04-20 11:57:20.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   482
+++ nautilus-2.26.3/src/file-manager/fm-tree-model.c	2009-07-13 11:41:43.056901000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   483
@@ -38,6 +38,8 @@
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   484
 #include <gtk/gtk.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   485
 #include <string.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   486
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   487
+#include <libnautilus-private/nautilus-lockdown.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   488
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   489
 enum {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   490
   ROW_LOADED,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   491
   LAST_SIGNAL
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   492
@@ -1707,6 +1709,14 @@ fm_tree_model_set_show_hidden_files (FMT
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   493
 	schedule_monitoring_update (model);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   494
 }
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   495
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   496
+void fm_tree_model_refresh_permissions(FMTreeModel *model)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   497
+{
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   498
+    g_return_if_fail(FM_IS_TREE_MODEL(model)) ;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   499
+    stop_monitoring(model) ;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   500
+    destroy_by_function(model, nautilus_lockdown_is_forbidden_nautilus_file) ;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   501
+    schedule_monitoring_update(model) ;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   502
+}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   503
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   504
 static gboolean
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   505
 file_is_not_directory (NautilusFile *file)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   506
 {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   507
/jds/bin/diff -uprN nautilus-2.26.3.old/src/file-manager/fm-tree-view.c nautilus-2.26.3/src/file-manager/fm-tree-view.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   508
--- nautilus-2.26.3.old/src/file-manager/fm-tree-view.c	2009-05-18 20:44:27.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   509
+++ nautilus-2.26.3/src/file-manager/fm-tree-view.c	2009-07-13 11:41:43.059783000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   510
@@ -1485,6 +1485,7 @@ update_filtering_from_preferences (FMTre
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   511
 	fm_tree_model_set_show_only_directories
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   512
 		(view->details->child_model,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   513
 		 eel_preferences_get_boolean (NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES));
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   514
+    fm_tree_model_refresh_permissions(view->details->child_model) ;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   515
 }
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   516
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   517
 static void
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   518
@@ -1543,6 +1544,7 @@ fm_tree_view_init (FMTreeView *view)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   519
 						  filtering_changed_callback, view, G_OBJECT (view));
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   520
 	eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   521
 						  filtering_changed_callback, view, G_OBJECT (view));
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   522
+	nautilus_lockdown_notify_add (filtering_changed_callback, view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   523
 	eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   524
 						  filtering_changed_callback, view, G_OBJECT (view));
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   525
 	
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   526
@@ -1610,6 +1612,8 @@ fm_tree_view_finalize (GObject *object)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   527
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   528
 	view = FM_TREE_VIEW (object);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   529
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   530
+	nautilus_lockdown_notify_remove (filtering_changed_callback, view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   531
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   532
 	g_free (view->details);
12144
8f8301d97203 2008-04-16 Stephen Browne <[email protected]>
stephen
parents: 12079
diff changeset
   533
 
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   534
 	G_OBJECT_CLASS (parent_class)->finalize (object);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   535
/jds/bin/diff -uprN nautilus-2.26.3.old/src/nautilus-window-menus.c nautilus-2.26.3/src/nautilus-window-menus.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   536
--- nautilus-2.26.3.old/src/nautilus-window-menus.c	2009-05-18 20:44:27.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   537
+++ nautilus-2.26.3/src/nautilus-window-menus.c	2009-07-13 11:41:43.061038000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   538
@@ -49,6 +49,7 @@
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   539
 #include <libnautilus-private/nautilus-global-preferences.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   540
 #include <libnautilus-private/nautilus-icon-names.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   541
 #include <libnautilus-private/nautilus-ui-utilities.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   542
+#include <libnautilus-private/nautilus-lockdown.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   543
 #include <libnautilus-private/nautilus-module.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   544
 #include <libnautilus-private/nautilus-undo-manager.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   545
 #include <libnautilus-private/nautilus-search-directory.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   546
@@ -1021,6 +1022,34 @@ add_extension_menu_items (NautilusWindow
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   547
 	}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   548
 }
11234
747c26bb2d66 2007-11-22 Padraig O'Briain <[email protected]>
padraig
parents: 11127
diff changeset
   549
 
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   550
+static gboolean
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   551
+load_extension_menus_idle(gpointer context)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   552
+{
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   553
+	NautilusWindow *window = NAUTILUS_WINDOW(context);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   554
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   555
+	nautilus_window_load_extension_menus(window);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   556
+	return FALSE;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   557
+}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   558
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   559
+static void
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   560
+lockdown_changed_callback(gpointer context)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   561
+{
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   562
+	NautilusWindow *window = NAUTILUS_WINDOW(context);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   563
+	g_idle_add(load_extension_menus_idle, window);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   564
+}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   565
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   566
+void
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   567
+nautilus_window_menus_lockdown_notify_remove (NautilusWindow *window)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   568
+{
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   569
+	nautilus_lockdown_notify_remove(lockdown_changed_callback, window);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   570
+}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   571
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   572
+void
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   573
+nautilus_window_menus_lockdown_notify_add (NautilusWindow *window)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   574
+{
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   575
+	nautilus_lockdown_notify_add(lockdown_changed_callback, window);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   576
+}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   577
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   578
 void
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   579
 nautilus_window_load_extension_menus (NautilusWindow *window)
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   580
 {
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   581
/jds/bin/diff -uprN nautilus-2.26.3.old/src/nautilus-window.c nautilus-2.26.3/src/nautilus-window.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   582
--- nautilus-2.26.3.old/src/nautilus-window.c	2009-04-20 11:57:20.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   583
+++ nautilus-2.26.3/src/nautilus-window.c	2009-07-13 11:41:43.064214000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   584
@@ -629,6 +629,8 @@ nautilus_window_finalize (GObject *objec
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   585
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   586
 	g_object_unref (window->details->ui_manager);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   587
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   588
+	nautilus_window_menus_lockdown_notify_remove(window);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   589
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   590
 	G_OBJECT_CLASS (nautilus_window_parent_class)->finalize (object);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   591
 }
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   592
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   593
/jds/bin/diff -uprN nautilus-2.26.3.old/src/nautilus-main.c nautilus-2.26.3/src/nautilus-main.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   594
--- nautilus-2.26.3.old/src/nautilus-main.c	2009-05-18 20:44:27.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   595
+++ nautilus-2.26.3/src/nautilus-main.c	2009-07-13 11:41:43.077497000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   596
@@ -464,6 +465,7 @@ main (int argc, char *argv[])
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   597
 			(NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR, TRUE);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   598
 	}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   599
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   600
+	nautilus_lockdown_init ();
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   601
 	application = NULL;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   602
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   603
 	/* Do either the self-check or the real work. */
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   604
@@ -525,6 +527,7 @@ main (int argc, char *argv[])
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   605
 		g_object_unref (application);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   606
 	}
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   607
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   608
+	nautilus_lockdown_finalize ();
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   609
  	eel_debug_shut_down ();
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   610
  	
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   611
  	nautilus_application_save_accel_map (NULL);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   612
/jds/bin/diff -uprN nautilus-2.26.3.old/libnautilus-private/nautilus-program-choosing.c nautilus-2.26.3/libnautilus-private/nautilus-program-choosing.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   613
--- nautilus-2.26.3.old/libnautilus-private/nautilus-program-choosing.c	2009-04-20 11:57:19.000000000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   614
+++ nautilus-2.26.3/libnautilus-private/nautilus-program-choosing.c	2009-07-13 11:41:43.078947000 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   615
@@ -158,6 +158,22 @@ nautilus_launch_application (GAppInfo *a
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   616
 	eel_g_list_free_deep (uris);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   617
 }
15621
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   618
 
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   619
+static gboolean
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   620
+command_is_allowed (const char *full_command)
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   621
+{
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   622
+       gboolean allowed = !nautilus_lockdown_is_forbidden_command(full_command);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   623
+       if (!allowed) {
15621
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   624
+               eel_show_error_dialog
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   625
+                       /* SUN_BRANDING */
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   626
+                       (_("Sorry, This is a restricted application which "
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   627
+                          "you may not run."),
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   628
+                       /* SUN_BRANDING */
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   629
+                       _("Restricted Application"),
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   630
+                       NULL);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   631
+       }
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   632
+       return  allowed;
15621
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   633
+}
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   634
+
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   635
 void
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   636
 nautilus_launch_application_by_uri (GAppInfo *application, 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   637
 				    GList *uris,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   638
@@ -335,8 +351,22 @@ nautilus_launch_application_from_command
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   639
 		}
15621
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   640
 	}
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   641
 
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   642
+	if (!command_is_allowed  (command_string)) {
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   643
+		g_free (full_command);
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   644
+		return;
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   645
+	}
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   646
+
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   647
 	if (use_terminal) {
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   648
-		eel_gnome_open_terminal_on_screen (full_command, screen);
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   649
+		if (!nautilus_lockdown_is_command_line_disabled ()) {
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   650
+			eel_gnome_open_terminal_on_screen (full_command, screen);
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   651
+		} else {
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   652
+			eel_show_error_dialog
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   653
+				/* SUN_BRANDING */
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   654
+				(_("Sorry, this command requires a terminal "),
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   655
+				/* SUN_BRANDING */
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   656
+				_("Terminal access is restricted."),
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   657
+				NULL);
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   658
+		}
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   659
 	} else {
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   660
 	    	gdk_spawn_command_line_on_screen (screen, full_command, NULL);
15621
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   661
 	}
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   662
@@ -387,6 +417,10 @@ nautilus_launch_desktop_file (GdkScreen 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   663
 			 parent_window);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   664
 		return;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   665
 	}
15621
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   666
+
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   667
+	if (!command_is_allowed (g_app_info_get_executable (app_info))) {
15621
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   668
+		return;
b447de05cc21 Bump to 2.26.1
davelam
parents: 15399
diff changeset
   669
+	}
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   670
 	
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   671
 	/* count the number of uris with local paths */
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   672
 	count = 0;
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   673
diff -ruN nautilus-2.27.4.orig/libnautilus-private/nautilus-directory-async.c nautilus-2.27.4/libnautilus-private/nautilus-directory-async.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   674
--- nautilus-2.27.4.orig/libnautilus-private/nautilus-directory-async.c	2009-07-23 15:47:20.972324079 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   675
+++ nautilus-2.27.4/libnautilus-private/nautilus-directory-async.c	2009-07-23 15:48:27.250174766 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   676
@@ -32,6 +32,7 @@
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   677
 #include "nautilus-signaller.h"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   678
 #include "nautilus-global-preferences.h"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   679
 #include "nautilus-link.h"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   680
+#include "nautilus-lockdown.h"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   681
 #include "nautilus-marshal.h"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   682
 #include <eel/eel-glib-extensions.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   683
 #include <eel/eel-string.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   684
diff -ruN nautilus-2.27.4.orig/src/nautilus-main.c nautilus-2.27.4/src/nautilus-main.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   685
--- nautilus-2.27.4.orig/src/nautilus-main.c	2009-07-23 15:47:20.959902926 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   686
+++ nautilus-2.27.4/src/nautilus-main.c	2009-07-23 15:49:22.737922718 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   687
@@ -47,6 +47,7 @@
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   688
 #include <gio/gdesktopappinfo.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   689
 #include <libnautilus-private/nautilus-debug-log.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   690
 #include <libnautilus-private/nautilus-global-preferences.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   691
+#include <libnautilus-private/nautilus-lockdown.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   692
 #include <libnautilus-private/nautilus-lib-self-check-functions.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   693
 #include <libnautilus-private/nautilus-icon-names.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   694
 #include <libxml/parser.h>
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   695
diff -ruN nautilus-2.27.91.orig/libnautilus-private/nautilus-global-preferences.h nautilus-2.27.91/libnautilus-private/nautilus-global-preferences.h
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   696
--- nautilus-2.27.91.orig/libnautilus-private/nautilus-global-preferences.h	2009-08-25 14:16:47.618321840 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   697
+++ nautilus-2.27.91/libnautilus-private/nautilus-global-preferences.h	2009-08-25 14:17:34.366770658 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   698
@@ -228,6 +228,9 @@
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   699
 #define NAUTILUS_PREFERENCES_DESKTOP_NETWORK_VISIBLE       "desktop/network_icon_visible"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   700
 #define NAUTILUS_PREFERENCES_DESKTOP_NETWORK_NAME          "desktop/network_icon_name"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   701
 #define NAUTILUS_PREFERENCES_DESKTOP_PRIMARY_SCREEN        "desktop/primary_screen"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   702
+#define NAUTILUS_PREFERENCES_DISABLE_COMMANDLINE           "/desktop/gnome/lockdown/disable_command_line"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   703
+#define NAUTILUS_PREFERENCES_RESTRICT_APP_LAUNCHING        "/desktop/gnome/lockdown/restrict_application_launching"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   704
+#define NAUTILUS_PREFERENCES_ALLOWED_APPLICATIONS          "/desktop/gnome/lockdown/allowed_applications"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   705
 
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   706
 /* Lockdown */
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   707
 #define NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE         "/desktop/gnome/lockdown/disable_command_line"
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   708
diff -ruN nautilus-2.27.91.orig/src/file-manager/fm-directory-view.c nautilus-2.27.91/src/file-manager/fm-directory-view.c
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   709
--- nautilus-2.27.91.orig/src/file-manager/fm-directory-view.c	2009-08-25 14:16:47.523491404 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   710
+++ nautilus-2.27.91/src/file-manager/fm-directory-view.c	2009-08-25 14:20:03.740747515 +0100
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   711
@@ -1943,6 +1943,7 @@
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   712
 				      sort_directories_first_changed_callback, view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   713
 	eel_preferences_add_callback (NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   714
 				      lockdown_disable_command_line_changed_callback, view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   715
+        nautilus_lockdown_notify_add (lockdown_changed_callback, view);
17055
2733640fe957 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 16359
diff changeset
   716
 }
2733640fe957 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 16359
diff changeset
   717
 
2733640fe957 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 16359
diff changeset
   718
 static void
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   719
@@ -2059,6 +2060,7 @@
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   720
 					 sort_directories_first_changed_callback, view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   721
 	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   722
 					 lockdown_disable_command_line_changed_callback, view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   723
+        nautilus_lockdown_notify_remove (lockdown_changed_callback, view);
17055
2733640fe957 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 16359
diff changeset
   724
 
17056
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   725
 	unschedule_pop_up_location_context_menu (view);
07a2ecbb1d1a 2009-11-30 Brian Cameron <[email protected]>
yippi
parents: 17055
diff changeset
   726
 	if (view->details->location_popup_event != NULL) {
17505
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   727
diff -ruN nautilus-2.29.2.orig/src/nautilus-window.c nautilus-2.29.2/src/nautilus-window.c
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   728
--- nautilus-2.29.2.orig/src/nautilus-window.c	2010-02-01 22:58:18.483524915 +0000
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   729
+++ nautilus-2.29.2/src/nautilus-window.c	2010-02-01 23:00:45.641679123 +0000
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   730
@@ -629,7 +629,7 @@
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   731
 
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   732
 	slot = nautilus_window_open_slot (window->details->active_pane, 0);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   733
 	nautilus_window_set_active_slot (window, slot);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   734
-
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   735
+        nautilus_window_menus_lockdown_notify_add (window);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   736
 	return object;
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   737
 }
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   738
 
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   739
diff -ruN nautilus-2.29.2.orig/src/nautilus-window-private.h nautilus-2.29.2/src/nautilus-window-private.h
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   740
--- nautilus-2.29.2.orig/src/nautilus-window-private.h	2010-02-01 23:01:51.066830219 +0000
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   741
+++ nautilus-2.29.2/src/nautilus-window-private.h	2010-02-01 23:02:35.249306426 +0000
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   742
@@ -160,6 +160,8 @@
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   743
                                                                           const char        *status);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   744
 void               nautilus_window_load_view_as_menus                    (NautilusWindow    *window);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   745
 void               nautilus_window_load_extension_menus                  (NautilusWindow    *window);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   746
+void               nautilus_window_menus_lockdown_notify_add             (NautilusWindow    *window);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   747
+void               nautilus_window_menus_lockdown_notify_remove          (NautilusWindow    *window);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   748
 void               nautilus_window_initialize_menus                      (NautilusWindow    *window);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   749
 void               nautilus_window_remove_trash_monitor_callback         (NautilusWindow    *window);
ed8b5d260e6a 2010-02-07 Christian Kelly <[email protected]>
chrisk
parents: 17056
diff changeset
   750
 NautilusWindowPane *nautilus_window_get_next_pane                        (NautilusWindow *window);