Commit dedbc451 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

Never set commie mode or no runbox mode on root. Don't add the

Tue May 29 00:55:34 2001  George Lebl <jirka@5z.com>

	* menu.c, drawer.c, extern.c, launcher.c, logout.c, session.c:  Never
	  set commie mode or no runbox mode on root.  Don't add the
	  preferences/properties menuitems, even for external applets.
parent 9a5f9645
Tue May 29 00:55:34 2001 George Lebl <jirka@5z.com>
* menu.c, drawer.c, extern.c, launcher.c, logout.c, session.c: Never
set commie mode or no runbox mode on root. Don't add the
preferences/properties menuitems, even for external applets.
Mon May 28 23:38:29 2001 George Lebl <jirka@5z.com>
* Applying patch:
......
Tue May 29 00:55:34 2001 George Lebl <jirka@5z.com>
* menu.c, drawer.c, extern.c, launcher.c, logout.c, session.c: Never
set commie mode or no runbox mode on root. Don't add the
preferences/properties menuitems, even for external applets.
Mon May 28 23:38:29 2001 George Lebl <jirka@5z.com>
* Applying patch:
......
......@@ -25,6 +25,7 @@ extern GSList *applets;
extern GSList *applets_last;
extern int applet_count;
extern GlobalConfig global_config;
extern gboolean commie_mode;
extern int applets_to_sync;
extern int panels_to_sync;
......@@ -478,13 +479,14 @@ load_drawer_applet (int mypanel_id, const char *pixmap, const char *tooltip,
gtk_tooltips_set_tip (panel_tooltips,drawer->button,
drawer->tooltip,NULL);
drawer_setup(drawer);
drawer_setup (drawer);
g_assert(applets_last!=NULL);
g_assert (applets_last != NULL);
applet_add_callback(applets_last->data,"properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
if ( ! commie_mode)
applet_add_callback(applets_last->data,"properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
applet_add_callback(applets_last->data, "help",
GNOME_STOCK_PIXMAP_HELP,
_("Help"));
......
......@@ -40,6 +40,7 @@ extern int need_complete_save;
extern GtkTooltips *panel_tooltips;
extern GlobalConfig global_config;
extern gboolean commie_mode;
extern char *panel_cfg_path;
extern char *old_panel_cfg_path;
......@@ -1713,6 +1714,13 @@ s_panelspot_add_callback(PortableServer_Servant servant,
g_assert(ext != NULL);
g_assert(ext->info != NULL);
if (commie_mode &&
callback_name != NULL &&
(strcmp (callback_name, "preferences") == 0 ||
strcmp (callback_name, "properties") == 0))
return;
applet_add_callback(ext->info, callback_name, stock_item,
menuitem_text);
}
......
......@@ -33,6 +33,7 @@ extern int applet_count;
static char *default_app_pixmap = NULL;
extern GlobalConfig global_config;
extern gboolean commie_mode;
extern GSList *panels;
......@@ -651,9 +652,10 @@ load_launcher_applet_full (const char *params, GnomeDesktopEntry *dentry,
launcher->dentry->comment,
NULL);
applet_add_callback (applets_last->data,"properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
if ( ! commie_mode)
applet_add_callback (applets_last->data,"properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
applet_add_callback (applets_last->data, "help",
GNOME_STOCK_PIXMAP_HELP,
_("Help"));
......
......@@ -13,6 +13,7 @@ extern GSList *applets_last;
extern GtkTooltips *panel_tooltips;
extern GlobalConfig global_config;
extern gboolean commie_mode;
static void
logout (GtkWidget *widget)
......@@ -189,8 +190,9 @@ load_lock_applet(PanelWidget *panel, int pos, gboolean exactpos)
NULL, _("Kill Daemon"));
applet_add_callback(applets_last->data, "restart",
NULL, _("Restart Daemon"));
applet_add_callback(applets_last->data, "prefs",
NULL, _("Preferences"));
if ( ! commie_mode)
applet_add_callback(applets_last->data, "prefs",
NULL, _("Preferences"));
applet_add_callback(applets_last->data, "help",
GNOME_STOCK_PIXMAP_HELP,
_("Help"));
......
......@@ -226,6 +226,16 @@ about_cb (GtkWidget *widget, gpointer data)
hbox, TRUE, FALSE, 0);
gtk_widget_show_all (hbox);
if (commie_mode) {
l = gtk_label_new (_("Running in \"Lockdown\" mode. This "
"means your system administrator has "
"prohibited any changes to the panel's "
"configuration to take place."));
gtk_widget_show (l);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (about)->vbox),
l, FALSE, FALSE, 0);
}
gtk_widget_show (about);
}
......@@ -5670,14 +5680,16 @@ load_menu_applet(const char *params, int main_menu_flags, gboolean global_main,
menu->info = applets_last->data;
applet_add_callback(menu->info, "properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
if(params && strcmp(params, ".")==0 &&
(tmp = panel_is_program_in_path("gmenu"))) {
g_free(tmp);
applet_add_callback(menu->info, "edit_menus",
NULL, _("Edit menus..."));
if ( ! commie_mode) {
applet_add_callback(menu->info, "properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
if(params && strcmp(params, ".")==0 &&
(tmp = panel_is_program_in_path("gmenu"))) {
g_free(tmp);
applet_add_callback(menu->info, "edit_menus",
NULL, _("Edit menus..."));
}
}
applet_add_callback(applets_last->data, "help",
GNOME_STOCK_PIXMAP_HELP,
......
......@@ -1735,6 +1735,12 @@ load_system_wide (void)
commie_mode = gnome_config_get_bool ("LockDown=FALSE");
no_run_box = gnome_config_get_bool ("NoRunBox=FALSE");
gnome_config_pop_prefix ();
/* Root shall always be allowed to do whatever */
if (getuid () == 0) {
commie_mode = FALSE;
no_run_box = FALSE;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment