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

Implement reading of defaults from a global directory. At some close point

Sun May 27 18:30:42 2001  George Lebl <jirka@5z.com>

	* Makefile.am, session.[ch], menu.c, gnome-panel-properties.c,
	  main.c, applet.c, gnome-run.c, panel-widget.c, panel.c: Implement
	  reading of defaults from a global directory.  At some close point
	  in the future the default config will be made a set of files and
	  installed and the default config that's hardcoded will disappear
	  (become something simple for failsafe reasons).  Also add a
	  LockDown (commie mode) and a NoRunBox configuration stuff for anal
	  sysadmins and kiosks.  It's untested, except that it doesn't
	  interfere with normal operation.

	* conditional.c: change "Conditional" to ":Conditional" since that
	  makes files nicer
parent 8b6b9a1c
Sun May 27 18:30:42 2001 George Lebl <jirka@5z.com>
* Makefile.am, session.[ch], menu.c, gnome-panel-properties.c,
main.c, applet.c, gnome-run.c, panel-widget.c, panel.c: Implement
reading of defaults from a global directory. At some close point
in the future the default config will be made a set of files and
installed and the default config that's hardcoded will disappear
(become something simple for failsafe reasons). Also add a
LockDown (commie mode) and a NoRunBox configuration stuff for anal
sysadmins and kiosks. It's untested, except that it doesn't
interfere with normal operation.
* conditional.c: change "Conditional" to ":Conditional" since that
makes files nicer
Fri May 25 14:36:29 2001 George Lebl <jirka@5z.com>
* foobar-widget.c: don't use the global for the clock_ebox
......
Sun May 27 18:30:42 2001 George Lebl <jirka@5z.com>
* Makefile.am, session.[ch], menu.c, gnome-panel-properties.c,
main.c, applet.c, gnome-run.c, panel-widget.c, panel.c: Implement
reading of defaults from a global directory. At some close point
in the future the default config will be made a set of files and
installed and the default config that's hardcoded will disappear
(become something simple for failsafe reasons). Also add a
LockDown (commie mode) and a NoRunBox configuration stuff for anal
sysadmins and kiosks. It's untested, except that it doesn't
interfere with normal operation.
* conditional.c: change "Conditional" to ":Conditional" since that
makes files nicer
Fri May 25 14:36:29 2001 George Lebl <jirka@5z.com>
* foobar-widget.c: don't use the global for the clock_ebox
......
......@@ -8,13 +8,18 @@ AUTOMAKE_OPTIONS = 1.3
SUBDIRS = doc help
INCLUDES = -I. -I$(srcdir) \
-I$(top_srcdir)/intl \
-I$(top_builddir)/intl \
-I$(top_builddir)/panel \
INCLUDES = \
-I. \
-I$(srcdir) \
-I$(top_srcdir)/intl \
-I$(top_builddir)/intl \
-I$(top_builddir)/panel \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DGNOME_DATADIR=\""$(datadir)"\" \
-I$(includedir) $(GNOME_INCLUDEDIR) $(ORB_CFLAGS) \
-DGLOBAL_CONFDIR=\""$(datadir)/gnome/panel-config"\" \
-I$(includedir) \
$(GNOME_INCLUDEDIR) \
$(ORB_CFLAGS) \
@PIXBUF_CFLAGS@
gwmh_dir = $(top_srcdir)/applets/desk-guide
......
......@@ -35,6 +35,7 @@ extern int applets_to_sync;
extern int panels_to_sync;
extern int need_complete_save;
extern gboolean commie_mode;
extern GlobalConfig global_config;
extern PanelWidget *current_panel;
......@@ -466,21 +467,23 @@ create_applet_menu (AppletInfo *info, gboolean is_basep)
info->menu = hack_scroll_menu_new ();
menuitem = gtk_menu_item_new();
setup_menuitem(menuitem,
gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_REMOVE),
_("Remove from panel"));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) remove_applet_callback,
info);
gtk_menu_append(GTK_MENU(info->menu), menuitem);
menuitem = gtk_menu_item_new();
setup_menuitem(menuitem,NULL,_("Move"));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) move_applet_callback,
info);
gtk_menu_append(GTK_MENU(info->menu), menuitem);
if ( ! commie_mode) {
menuitem = gtk_menu_item_new();
setup_menuitem(menuitem,
gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_REMOVE),
_("Remove from panel"));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) remove_applet_callback,
info);
gtk_menu_append(GTK_MENU(info->menu), menuitem);
menuitem = gtk_menu_item_new();
setup_menuitem(menuitem,NULL,_("Move"));
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) move_applet_callback,
info);
gtk_menu_append(GTK_MENU(info->menu), menuitem);
}
panel_menu = hack_scroll_menu_new();
make_panel_submenu (panel_menu, TRUE, is_basep);
......
......@@ -441,7 +441,7 @@ conditional_get_string (const char *key, const char *def, gboolean *isdef)
if (lisdef) {
char *cond;
g_free (ret);
fullkey = g_strdup_printf ("%sConditional", key);
fullkey = g_strdup_printf ("%s:Conditional", key);
cond = gnome_config_get_string_with_default (fullkey, &lisdef);
g_free (fullkey);
if (lisdef) {
......@@ -473,7 +473,7 @@ conditional_get_bool (const char *key, gboolean def, gboolean *isdef)
g_free (fullkey);
if (lisdef) {
char *cond, *str;
fullkey = g_strdup_printf ("%sConditional", key);
fullkey = g_strdup_printf ("%s:Conditional", key);
cond = gnome_config_get_string_with_default (fullkey, &lisdef);
g_free (fullkey);
if (lisdef) {
......@@ -512,7 +512,7 @@ conditional_get_int (const char *key, int def, gboolean *isdef)
g_free (fullkey);
if (lisdef) {
char *cond, *str;
fullkey = g_strdup_printf ("%sConditional", key);
fullkey = g_strdup_printf ("%s:Conditional", key);
cond = gnome_config_get_string_with_default (fullkey, &lisdef);
g_free (fullkey);
if (lisdef) {
......
......@@ -1226,6 +1226,25 @@ help (GtkWidget *capplet)
panel_show_help ("globalpanelprefs.html");
}
static void
_push_correct_global_prefix (void)
{
gboolean foo, def;
/*set up global options*/
gnome_config_push_prefix ("/panel/Config/");
foo = conditional_get_bool ("tooltips_enabled", TRUE, &def);
if (def) {
/* ahhh, this doesn't exist, but tooltips_enabled should be
* in every home, every kitchen and every panel configuration,
* so we will load up from the global location */
gnome_config_pop_prefix ();
gnome_config_push_prefix ("=" GLOBAL_CONFDIR "/panel=/Config/");
}
}
static void
loadup_vals (void)
{
......@@ -1247,7 +1266,7 @@ loadup_vals (void)
GString *tilebuf;
/*set up global options*/
gnome_config_push_prefix("/panel/Config/");
_push_correct_global_prefix ();
global_config.tooltips_enabled =
conditional_get_bool ("tooltips_enabled", TRUE, NULL);
......@@ -1617,6 +1636,26 @@ main (int argc, char **argv)
argv, NULL, 0, NULL) < 0)
return 1;
gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-panel.png");
/* Ahhh, yes the infamous commie mode, don't allow running of this,
* just display a label */
if (gnome_config_get_bool
("=" GLOBAL_CONFDIR "/System=/Config/LockDown=FALSE")) {
GtkWidget *label;
capplet = capplet_widget_new();
label = gtk_label_new (_("The system administrator has "
"disallowed modification of the "
"panel configuration"));
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (capplet), label);
capplet_gtk_main ();
return 0;
}
loadup_vals ();
set_config (&loaded_config, &global_config);
......
......@@ -1226,6 +1226,25 @@ help (GtkWidget *capplet)
panel_show_help ("globalpanelprefs.html");
}
static void
_push_correct_global_prefix (void)
{
gboolean foo, def;
/*set up global options*/
gnome_config_push_prefix ("/panel/Config/");
foo = conditional_get_bool ("tooltips_enabled", TRUE, &def);
if (def) {
/* ahhh, this doesn't exist, but tooltips_enabled should be
* in every home, every kitchen and every panel configuration,
* so we will load up from the global location */
gnome_config_pop_prefix ();
gnome_config_push_prefix ("=" GLOBAL_CONFDIR "/panel=/Config/");
}
}
static void
loadup_vals (void)
{
......@@ -1247,7 +1266,7 @@ loadup_vals (void)
GString *tilebuf;
/*set up global options*/
gnome_config_push_prefix("/panel/Config/");
_push_correct_global_prefix ();
global_config.tooltips_enabled =
conditional_get_bool ("tooltips_enabled", TRUE, NULL);
......@@ -1617,6 +1636,26 @@ main (int argc, char **argv)
argv, NULL, 0, NULL) < 0)
return 1;
gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-panel.png");
/* Ahhh, yes the infamous commie mode, don't allow running of this,
* just display a label */
if (gnome_config_get_bool
("=" GLOBAL_CONFDIR "/System=/Config/LockDown=FALSE")) {
GtkWidget *label;
capplet = capplet_widget_new();
label = gtk_label_new (_("The system administrator has "
"disallowed modification of the "
"panel configuration"));
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (capplet), label);
capplet_gtk_main ();
return 0;
}
loadup_vals ();
set_config (&loaded_config, &global_config);
......
......@@ -29,12 +29,14 @@
#include "panel-include.h"
#include "foobar-widget.h"
#include "multiscreen-stuff.h"
#include "gnome-run.h"
extern GSList *applets_last;
extern GtkTooltips *panel_tooltips;
extern GlobalConfig global_config;
extern gboolean no_run_box;
static GtkWidget *run_dialog = NULL;
......@@ -387,6 +389,9 @@ show_run_dialog (void)
GtkWidget *hbox;
GtkWidget *w;
if (no_run_box)
return;
if(run_dialog != NULL) {
gtk_widget_show_now(run_dialog);
gdk_window_raise(run_dialog->window);
......@@ -462,11 +467,9 @@ show_run_dialog_with_text (const char *text)
g_return_if_fail(text != NULL);
show_run_dialog();
show_run_dialog ();
if(run_dialog == NULL) {
/* this should NEVER happen, but I'm paranoid */
g_warning("Eeeeeeek!");
return;
}
......
......@@ -33,6 +33,7 @@ extern GSList *applets;
extern GSList *applets_last;
extern int applet_count;
extern gboolean commie_mode;
extern GlobalConfig global_config;
extern char *panel_cfg_path;
extern char *old_panel_cfg_path;
......@@ -487,14 +488,18 @@ main(int argc, char **argv)
gnome_win_hints_init ();
load_system_wide ();
/* read, convert and remove old config */
convert_old_config ();
if ( ! commie_mode)
convert_old_config ();
/* set the globals, it is important this is before
* init_user_applets */
load_up_globals ();
/* this is so the capplet gets the right defaults */
write_global_config ();
if ( ! commie_mode)
write_global_config ();
gwmh_init ();
......
......@@ -52,6 +52,8 @@ extern GSList *panel_list;
/*list of all PanelWidgets created*/
extern GSList *panels;
extern gboolean commie_mode;
extern gboolean no_run_box;
extern GlobalConfig global_config;
extern int config_sync_timeout;
......@@ -1765,6 +1767,10 @@ show_item_menu_b_cb(GtkWidget *w, GdkEvent *event, ShowItemMenu *sim)
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
/* no item menu in commie mode */
if (commie_mode)
return FALSE;
item = w->parent->parent;
show_item_menu (item, bevent, sim);
......@@ -1776,6 +1782,10 @@ static gboolean
show_item_menu_mi_cb (GtkWidget *w, GdkEvent *event, ShowItemMenu *sim)
{
GdkEventButton *bevent = (GdkEventButton *)event;
/* no item menu in commie mode */
if (commie_mode)
return FALSE;
if (event->type == GDK_BUTTON_PRESS &&
bevent->button == 3)
......@@ -2014,7 +2024,7 @@ setup_full_menuitem_with_size (GtkWidget *menuitem, GtkWidget *pixmap,
}
/*applets have their own drag'n'drop*/
if(!applet) {
if ( ! applet && ! commie_mode) {
gtk_drag_source_set(menuitem,
GDK_BUTTON1_MASK|GDK_BUTTON2_MASK,
menu_item_targets, 1,
......@@ -2081,7 +2091,8 @@ setup_internal_applet_drag (GtkWidget *menuitem, const char *applet_type)
{ "application/x-panel-applet-internal", 0, 0 }
};
if (applet_type == NULL)
if (applet_type == NULL ||
commie_mode)
return;
gtk_drag_source_set (menuitem,
......@@ -3056,7 +3067,8 @@ create_menu_at_fr (GtkWidget *menu,
g_free (menu_name);
setup_directory_drag (menuitem, mf->menudir);
if ( ! commie_mode)
setup_directory_drag (menuitem, mf->menudir);
}
/*add separator*/
......@@ -4813,119 +4825,121 @@ make_panel_submenu (GtkWidget *menu, gboolean fake_submenus, gboolean is_basep)
{
GtkWidget *menuitem, *submenu, *submenuitem;
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
gnome_stock_pixmap_widget (menu,
GNOME_STOCK_PIXMAP_ADD),
_("Add to panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
submenu = menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
submenu);
if (gnome_preferences_get_menus_have_tearoff ()) {
menuitem = tearoff_item_new();
gtk_widget_show(menuitem);
gtk_menu_prepend(GTK_MENU(submenu),menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(add_to_panel_menu_tearoff_new_menu),
NULL);
}
make_add_submenu (submenu, fake_submenus);
if ( ! commie_mode) {
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
gnome_stock_pixmap_widget (menu,
GNOME_STOCK_PIXMAP_ADD),
_("Add to panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
gnome_stock_pixmap_widget (menu,
GNOME_STOCK_MENU_NEW),
_("Create panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
create_add_panel_submenu(TRUE));
submenu = menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
submenu);
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
if (gnome_preferences_get_menus_have_tearoff ()) {
menuitem = tearoff_item_new();
gtk_widget_show(menuitem);
gtk_menu_prepend(GTK_MENU(submenu),menuitem);
setup_menuitem (menuitem,
gnome_stock_pixmap_widget (NULL,
GNOME_STOCK_PIXMAP_REMOVE),
_("Remove this panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (remove_panel_query),
NULL);
gtk_signal_connect (GTK_OBJECT (menu), "show",
GTK_SIGNAL_FUNC(setup_remove_this_panel),
menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(add_to_panel_menu_tearoff_new_menu),
NULL);
}
add_menu_separator(menu);
make_add_submenu (submenu, fake_submenus);
if (is_basep) {
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
gnome_stock_pixmap_widget (menu,
GNOME_STOCK_MENU_PROP),
_("Properties"));
GNOME_STOCK_MENU_NEW),
_("Create panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
submenu = menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
submenuitem = gtk_menu_item_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
create_add_panel_submenu(TRUE));
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (submenuitem,
gnome_stock_pixmap_widget(submenu,
GNOME_STOCK_MENU_PROP),
_("All properties..."));
gtk_menu_append (GTK_MENU (submenu), submenuitem);
gtk_signal_connect (GTK_OBJECT (submenuitem), "activate",
GTK_SIGNAL_FUNC(current_panel_config),
setup_menuitem (menuitem,
gnome_stock_pixmap_widget (NULL,
GNOME_STOCK_PIXMAP_REMOVE),
_("Remove this panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (remove_panel_query),
NULL);
/*add_menu_separator (submenu);*/
make_properties_submenu (submenu);
}
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
gnome_stock_pixmap_widget(menu,
GNOME_STOCK_MENU_PREF),
_("Global Preferences..."));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC(panel_config_global),
NULL);
gtk_signal_connect (GTK_OBJECT (menu), "show",
GTK_SIGNAL_FUNC(setup_remove_this_panel),
menuitem);
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem_try_pixmap (menuitem,
"gnome-gmenu.png",
_("Edit menus..."), SMALL_ICON_SIZE);
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC(panel_launch_gmenu),
NULL);
add_menu_separator(menu);
if (is_basep) {
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
gnome_stock_pixmap_widget (menu,
GNOME_STOCK_MENU_PROP),
_("Properties"));
gtk_menu_append (GTK_MENU (menu), menuitem);
submenu = menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
submenuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (submenuitem,
gnome_stock_pixmap_widget(submenu,
GNOME_STOCK_MENU_PROP),
_("All properties..."));
gtk_menu_append (GTK_MENU (submenu), submenuitem);
gtk_signal_connect (GTK_OBJECT (submenuitem), "activate",
GTK_SIGNAL_FUNC(current_panel_config),
NULL);
/*add_menu_separator (submenu);*/
make_properties_submenu (submenu);
}
if ( ! global_config.menu_check) {
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
NULL,
_("Reread all menus"));
gnome_stock_pixmap_widget(menu,
GNOME_STOCK_MENU_PREF),
_("Global Preferences..."));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (fr_force_reread),
GTK_SIGNAL_FUNC(panel_config_global),
NULL);
}
add_menu_separator (menu);
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem_try_pixmap (menuitem,
"gnome-gmenu.png",
_("Edit menus..."), SMALL_ICON_SIZE);
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC(panel_launch_gmenu),
NULL);
if ( ! global_config.menu_check) {
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
NULL,
_("Reread all menus"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (fr_force_reread),
NULL);
}
add_menu_separator (menu);
}
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
......@@ -5239,7 +5253,9 @@ create_root_menu (GtkWidget *root_menu,
create_user_menu(_("Favorites"), "apps",
root_menu, "gnome-favorites.png",
fake_submenus, FALSE, FALSE, title, FALSE);
if (flags & MAIN_MENU_APPLETS)
/* in commie mode the applets menu doesn't make sense */
if ( ! commie_mode &&
flags & MAIN_MENU_APPLETS)
create_applets_menu(root_menu, fake_submenus, title);
if (flags & MAIN_MENU_DISTRIBUTION &&
......@@ -5292,7 +5308,9 @@ create_root_menu (GtkWidget *root_menu,
GTK_SIGNAL_FUNC(submenu_to_display),
NULL);
}
if (flags & MAIN_MENU_APPLETS_SUB) {
/* in commie mode the applets menu doesn't make sense */
if ( ! commie_mode &&
flags & MAIN_MENU_APPLETS_SUB) {
menu = create_applets_menu(NULL, fake_submenus, FALSE);
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
......@@ -5313,16 +5331,18 @@ create_root_menu (GtkWidget *root_menu,
FALSE /*launcher_add */);
}
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem_try_pixmap (menuitem, "gnome-run.png",
_("Run..."), size);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (run_cb), NULL);
gtk_menu_append (GTK_MENU (root_menu), menuitem);
setup_internal_applet_drag(menuitem, "RUN:NEW");
gtk_tooltips_set_tip (panel_tooltips, menuitem,
_("Execute a command line"), NULL);
if ( ! no_run_box) {
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem_try_pixmap (menuitem, "gnome-run.png",
_("Run..."), size);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (run_cb), NULL);
gtk_menu_append (GTK_MENU (root_menu), menuitem);
setup_internal_applet_drag(menuitem, "RUN:NEW");
gtk_tooltips_set_tip (panel_tooltips, menuitem,
_("Execute a command line"), NULL);
}
if (((has_inline && !has_subs) || has_subs) && has_subs2)
add_menu_separator (root_menu);
......@@ -5690,10 +5710,10 @@ save_tornoff (void)
char *s;
int j;
s = g_strdup_printf("%spanel/TornoffMenu_%d/",
PANEL_CONFIG_PATH,i);
s = g_strdup_printf ("%spanel/TornoffMenu_%d/",
PANEL_CONFIG_PATH, i);
gnome_config_push_prefix (s);
g_free(s);
g_free (s);
tw = GTK_MENU(tm->menu)->tearoff_window;
......@@ -5937,13 +5957,18 @@ load_tornoff(void)
char *s;
int i, length;
gnome_config_push_prefix(PANEL_CONFIG_PATH "panel/Config/");
push_correct_global_prefix ();
length = conditional_get_int("tearoffs_count", 0, NULL);
gnome_config_pop_prefix();
for (i = 0; i < length; i++) {
s = g_strdup_printf ("%spanel/TornoffMenu_%d/",
PANEL_CONFIG_PATH, i);
char *prefix;
const char *sep;
prefix = get_correct_prefix (&sep);
s = g_strdup_printf ("%spanel%s/TornoffMenu_%d/",
prefix, sep, i);
g_free (prefix);
gnome_config_push_prefix (s);
g_free (s);
......
......@@ -27,6 +27,9 @@ GSList *panels = NULL; /*other panels we might want to move the applet to*/
we only have one mouse :) */
gboolean panel_applet_in_drag = FALSE;
/* Commie mode! */
extern gboolean commie_mode;
static void panel_widget_class_init (PanelWidgetClass *klass);
static void panel_widget_init (PanelWidget *panel_widget);
static int panel_try_to_set_pixmap (PanelWidget *panel,
......@@ -102,7 +105,7 @@ applet_data_compare (AppletData *ad1, AppletData *ad2)
************************/
guint
panel_widget_get_type ()
panel_widget_get_type (void)
{
static guint panel_widget_type = 0;
......@@ -2406,7 +2409,8 @@ panel_widget_applet_event(GtkWidget *widget, GdkEvent *event, gpointer data)
if (panel->currently_dragged_applet)
return TRUE;
if(bevent->button == 2) {
if ( ! commie_mode &&
bevent->button == 2) {
/* Start drag */
panel_widget_applet_drag_start
(panel, widget, PW_DRAG_OFF_CURSOR);
......
......@@ -48,6 +48,7 @@ extern int applets_to_sync;
extern int panels_to_sync;
extern int need_complete_save;
extern gboolean commie_mode;
extern GlobalConfig global_config;
extern GtkTooltips *panel_tooltips;
......@@ -802,7 +803,9 @@ panel_event(GtkWidget *widget, GdkEvent *event, PanelData *pd)
}
break;
case 2:
return panel_initiate_move (widget, bevent->time);
if ( ! commie_mode)
return panel_initiate_move (widget,
bevent->time);
break;
default: break;
}
......
......@@ -39,6 +39,9 @@ extern GtkTooltips *panel_tooltips;
extern GnomeClient *client;
gboolean commie_mode = FALSE;
gboolean no_run_box = FALSE;
GlobalConfig global_config;
char *panel_cfg_path = NULL;
......@@ -671,8 +674,13 @@ do_session_save(GnomeClient *client,
gchar *new_args[] = { "rm", "-r", NULL };
#endif /* PER_SESSION_CONFIGURATION */