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

fix a bug where a menu could only be torn off once

Thu Oct 07 18:31:37 1999  George Lebl  <jirka@5z.com>

        * menu.c: fix a bug where a menu could only be torn off once

        * gnome-panel-properties.(c|desktop),panel_config_global.[ch],
          session.[ch],main.c,menu.c,Makefile.am: put the global config
          into a crapplet
parent 202378c3
Thu Oct 07 18:31:37 1999 George Lebl <jirka@5z.com>
* menu.c: fix a bug where a menu could only be torn off once
* gnome-panel-properties.(c|desktop),panel_config_global.[ch],
session.[ch],main.c,menu.c,Makefile.am: put the global config
into a crapplet
Thu Oct 07 14:25:02 1999 George Lebl <jirka@5z.com> Thu Oct 07 14:25:02 1999 George Lebl <jirka@5z.com>
* menu-fentry.c: (get_applet_goad_id_from_dentry) check ii being null * menu-fentry.c: (get_applet_goad_id_from_dentry) check ii being null
......
Thu Oct 07 18:31:37 1999 George Lebl <jirka@5z.com>
* menu.c: fix a bug where a menu could only be torn off once
* gnome-panel-properties.(c|desktop),panel_config_global.[ch],
session.[ch],main.c,menu.c,Makefile.am: put the global config
into a crapplet
Thu Oct 07 14:25:02 1999 George Lebl <jirka@5z.com> Thu Oct 07 14:25:02 1999 George Lebl <jirka@5z.com>
* menu-fentry.c: (get_applet_goad_id_from_dentry) check ii being null * menu-fentry.c: (get_applet_goad_id_from_dentry) check ii being null
......
...@@ -13,7 +13,7 @@ INCLUDES = -I. -I$(srcdir) \ ...@@ -13,7 +13,7 @@ INCLUDES = -I. -I$(srcdir) \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) $(GNOME_INCLUDEDIR) $(ORB_CFLAGS) -I$(includedir) $(GNOME_INCLUDEDIR) $(ORB_CFLAGS)
bin_PROGRAMS = panel bin_PROGRAMS = panel gnome-panel-properties-capplet
libpanel_appletincludedir = $(includedir) libpanel_appletincludedir = $(includedir)
libpanel_statusincludedir = $(includedir) libpanel_statusincludedir = $(includedir)
...@@ -71,7 +71,6 @@ base_panel_SOURCES=\ ...@@ -71,7 +71,6 @@ base_panel_SOURCES=\
session.h \ session.h \
panel_config.c \ panel_config.c \
panel_config.h \ panel_config.h \
panel_config_global.c \
panel_config_global.h \ panel_config_global.h \
menu.c \ menu.c \
menu.h \ menu.h \
...@@ -119,14 +118,27 @@ base_panel_SOURCES=\ ...@@ -119,14 +118,27 @@ base_panel_SOURCES=\
tearoffitem.h tearoffitem.h
panel_SOURCES = \ panel_SOURCES = \
$(base_panel_SOURCES) \ $(base_panel_SOURCES)
$(CORBA_SRCLIST)
# it should work without this as we link libpanel_applet anyway for shlib
# applets and it already links to CORBA_SRCLIST, so this should give us a
# dubious gain in linking speed and memory usage
# $(CORBA_SRCLIST)
$(base_panel_SOURCES): $(CORBA_SRCLIST) #$(base_panel_SOURCES): $(CORBA_SRCLIST)
panel_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(GNORBA_LIBS) $(ORB_LIBS) $(GNOMEUI_LIBS) $(INTLLIBS) panel_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(GNORBA_LIBS) $(ORB_LIBS) $(GNOMEUI_LIBS) $(INTLLIBS)
panel_LDFLAGS=-export-dynamic panel_LDFLAGS=-export-dynamic
gnome_panel_properties_capplet_SOURCES = \
gnome-panel-properties.c \
panel-util.c \
$(CORBA_SRCLIST)
gnome_panel_properties_capplet_LDADD = -lcapplet \
$(GNOME_LIBDIR) $(ORB_LIBS) \
$(GNOMEUI_LIBS) $(INTLLIBS) -lgnorba
data_DATA = panelrc data_DATA = panelrc
## Why not just make this via configure? Because @datadir@ will be ## Why not just make this via configure? Because @datadir@ will be
...@@ -148,14 +160,15 @@ MOSTLYCLEANFILES = panelrc ...@@ -148,14 +160,15 @@ MOSTLYCLEANFILES = panelrc
MAINTAINERCLEANFILES = $(CORBA_SRCLIST) MAINTAINERCLEANFILES = $(CORBA_SRCLIST)
EXTRA_DIST = \ EXTRA_DIST = \
panelrc.in \ panelrc.in \
panel.in \ panel.in \
appletsConf.sh.in \ appletsConf.sh.in \
dockletsConf.sh.in \ dockletsConf.sh.in \
panel.gnorba \ panel.gnorba \
panel.soundlist \ panel.soundlist \
APPLET_WRITING \ APPLET_WRITING \
panel.hints panel.hints \
gnome-panel-properties.desktop
## Put `exec' in the name because this should be installed by ## Put `exec' in the name because this should be installed by
## `install-exec', not `install-data'. ## `install-exec', not `install-data'.
...@@ -193,4 +206,10 @@ soundlist_DATA = panel.soundlist ...@@ -193,4 +206,10 @@ soundlist_DATA = panel.soundlist
hintsdir = $(datadir)/gnome/hints hintsdir = $(datadir)/gnome/hints
hints_DATA = panel.hints hints_DATA = panel.hints
sysdir = $(datadir)/control-center/
sys_DATA = gnome-panel-properties.desktop
install-data-local:
$(INSTALL_DATA) $(srcdir)/gnome-panel-properties.desktop $(DESTDIR)$(datadir)/gnome/apps/Settings/gnome-panel-properties.desktop
$(srcdir)/panel-util.c: $(CORBA_SRCLIST) $(srcdir)/panel-util.c: $(CORBA_SRCLIST)
...@@ -32,7 +32,6 @@ int applet_count = 0; ...@@ -32,7 +32,6 @@ int applet_count = 0;
extern int config_sync_timeout; extern int config_sync_timeout;
extern int applets_to_sync; extern int applets_to_sync;
extern int panels_to_sync; extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save; extern int need_complete_save;
extern GlobalConfig global_config; extern GlobalConfig global_config;
......
...@@ -29,7 +29,6 @@ extern int applet_count; ...@@ -29,7 +29,6 @@ extern int applet_count;
extern int config_sync_timeout; extern int config_sync_timeout;
extern int applets_to_sync; extern int applets_to_sync;
extern int panels_to_sync; extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save; extern int need_complete_save;
extern GtkTooltips *panel_tooltips; extern GtkTooltips *panel_tooltips;
...@@ -82,6 +81,10 @@ s_panel_add_status(POA_GNOME_Panel *servant, ...@@ -82,6 +81,10 @@ s_panel_add_status(POA_GNOME_Panel *servant,
CORBA_unsigned_long* wid, CORBA_unsigned_long* wid,
CORBA_Environment *ev); CORBA_Environment *ev);
static void
s_panel_notice_config_changes(POA_GNOME_Panel *servant,
CORBA_Environment *ev);
/*** PanelSpot stuff ***/ /*** PanelSpot stuff ***/
...@@ -194,7 +197,8 @@ static POA_GNOME_Panel__epv panel_epv = { ...@@ -194,7 +197,8 @@ static POA_GNOME_Panel__epv panel_epv = {
(gpointer)&s_panel_add_applet_full, (gpointer)&s_panel_add_applet_full,
(gpointer)&s_panel_quit, (gpointer)&s_panel_quit,
(gpointer)&s_panel_get_in_drag, (gpointer)&s_panel_get_in_drag,
(gpointer)&s_panel_add_status (gpointer)&s_panel_add_status,
(gpointer)&s_panel_notice_config_changes
}; };
static POA_GNOME_Panel__vepv panel_vepv = { &panel_base_epv, &panel_epv }; static POA_GNOME_Panel__vepv panel_vepv = { &panel_base_epv, &panel_epv };
static POA_GNOME_Panel panel_servant = { NULL, &panel_vepv }; static POA_GNOME_Panel panel_servant = { NULL, &panel_vepv };
...@@ -624,6 +628,13 @@ s_panel_add_status(POA_GNOME_Panel *servant, ...@@ -624,6 +628,13 @@ s_panel_add_status(POA_GNOME_Panel *servant,
return CORBA_Object_duplicate(acc, ev); return CORBA_Object_duplicate(acc, ev);
} }
static void
s_panel_notice_config_changes(POA_GNOME_Panel *servant,
CORBA_Environment *ev)
{
load_up_globals();
}
/*** PanelSpot stuff ***/ /*** PanelSpot stuff ***/
......
This diff is collapsed.
[Desktop Entry]
Name=Panel
Comment=Global panel properties
Exec=gnome-panel-properties-capplet
Icon=
Terminal=0
Type=Application
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
extern int config_sync_timeout; extern int config_sync_timeout;
extern int applets_to_sync; extern int applets_to_sync;
extern int panels_to_sync; extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save; extern int need_complete_save;
extern GSList *panels; extern GSList *panels;
...@@ -249,6 +248,9 @@ main(int argc, char **argv) ...@@ -249,6 +248,9 @@ main(int argc, char **argv)
gnome_win_hints_init (); gnome_win_hints_init ();
/* read, convert and remove old config */
convert_old_config();
/*set the globals*/ /*set the globals*/
load_up_globals(); load_up_globals();
......
...@@ -28,7 +28,6 @@ extern GlobalConfig global_config; ...@@ -28,7 +28,6 @@ extern GlobalConfig global_config;
extern int config_sync_timeout; extern int config_sync_timeout;
extern int panels_to_sync; extern int panels_to_sync;
extern int applets_to_sync; extern int applets_to_sync;
extern int globals_to_sync;
extern int need_complete_save; extern int need_complete_save;
char * char *
......
...@@ -43,7 +43,6 @@ extern GlobalConfig global_config; ...@@ -43,7 +43,6 @@ extern GlobalConfig global_config;
extern int config_sync_timeout; extern int config_sync_timeout;
extern int panels_to_sync; extern int panels_to_sync;
extern int applets_to_sync; extern int applets_to_sync;
extern int globals_to_sync;
extern int need_complete_save; extern int need_complete_save;
/*???? this might be ugly, but I guess we can safely assume that we can only /*???? this might be ugly, but I guess we can safely assume that we can only
...@@ -1406,15 +1405,14 @@ tearoff_new_menu(GtkWidget *item, GtkWidget *menuw) ...@@ -1406,15 +1405,14 @@ tearoff_new_menu(GtkWidget *item, GtkWidget *menuw)
GSList *list; GSList *list;
GtkWidget *menu; GtkWidget *menu;
GString *title; GString *title;
if(!mfl) if(!mfl)
return; return;
menu = gtk_menu_new(); menu = gtk_menu_new();
title = g_string_new(""); title = g_string_new("");
gtk_object_set_data(GTK_OBJECT(menuw), "mf",NULL);
for(list = mfl; list != NULL; list = g_slist_next(list)) { for(list = mfl; list != NULL; list = g_slist_next(list)) {
MenuFinfo *mf = list->data; MenuFinfo *mf = list->data;
...@@ -2942,6 +2940,13 @@ add_to_panel_menu_tearoff_new_menu(GtkWidget *w, gpointer data) ...@@ -2942,6 +2940,13 @@ add_to_panel_menu_tearoff_new_menu(GtkWidget *w, gpointer data)
show_tearoff_menu(menu, _("Add to panel")); show_tearoff_menu(menu, _("Add to panel"));
} }
/* just run the gnome-panel-properties */
static void
panel_config_global(void)
{
system("(gnome-panel-properties-capplet &)");
}
void void
make_panel_submenu (GtkWidget *menu, int fake_submenus) make_panel_submenu (GtkWidget *menu, int fake_submenus)
{ {
......
...@@ -32,6 +32,4 @@ struct _GlobalConfig { ...@@ -32,6 +32,4 @@ struct _GlobalConfig {
int tile_when_over; int tile_when_over;
}; };
void panel_config_global(void); #endif /* PANEL_CONFIG_GLOBAL_H */
#endif /* PANEL_CONFIG_H */
...@@ -48,9 +48,11 @@ create_text_entry(GtkWidget *table, ...@@ -48,9 +48,11 @@ create_text_entry(GtkWidget *table,
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
GNOME_PAD_SMALL, GNOME_PAD_SMALL); GNOME_PAD_SMALL, GNOME_PAD_SMALL);
gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed", if(w) {
GTK_SIGNAL_FUNC(gnome_property_box_changed), gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed",
GTK_OBJECT(w)); GTK_SIGNAL_FUNC(gnome_property_box_changed),
GTK_OBJECT(w));
}
return entry; return entry;
} }
...@@ -87,9 +89,11 @@ create_pixmap_entry(GtkWidget *table, ...@@ -87,9 +89,11 @@ create_pixmap_entry(GtkWidget *table,
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
GNOME_PAD_SMALL, GNOME_PAD_SMALL); GNOME_PAD_SMALL, GNOME_PAD_SMALL);
gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed", if(w) {
GTK_SIGNAL_FUNC(gnome_property_box_changed), gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed",
GTK_OBJECT(w)); GTK_SIGNAL_FUNC(gnome_property_box_changed),
GTK_OBJECT(w));
}
return entry; return entry;
} }
...@@ -125,9 +129,11 @@ create_icon_entry(GtkWidget *table, ...@@ -125,9 +129,11 @@ create_icon_entry(GtkWidget *table,
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
GNOME_PAD_SMALL, GNOME_PAD_SMALL); GNOME_PAD_SMALL, GNOME_PAD_SMALL);
gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed", if(w) {
GTK_SIGNAL_FUNC(gnome_property_box_changed), gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed",
GTK_OBJECT(w)); GTK_SIGNAL_FUNC(gnome_property_box_changed),
GTK_OBJECT(w));
}
return entry; return entry;
} }
...@@ -162,9 +168,11 @@ create_file_entry(GtkWidget *table, ...@@ -162,9 +168,11 @@ create_file_entry(GtkWidget *table,
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
GNOME_PAD_SMALL, GNOME_PAD_SMALL); GNOME_PAD_SMALL, GNOME_PAD_SMALL);
gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed", if(w) {
GTK_SIGNAL_FUNC(gnome_property_box_changed), gtk_signal_connect_object_while_alive (GTK_OBJECT (t), "changed",
GTK_OBJECT(w)); GTK_SIGNAL_FUNC(gnome_property_box_changed),
GTK_OBJECT(w));
}
return entry; return entry;
} }
......
...@@ -37,7 +37,6 @@ int base_panels = 0; ...@@ -37,7 +37,6 @@ int base_panels = 0;
extern int config_sync_timeout; extern int config_sync_timeout;
extern int applets_to_sync; extern int applets_to_sync;
extern int panels_to_sync; extern int panels_to_sync;
extern int globals_to_sync;
extern int need_complete_save; extern int need_complete_save;
extern GlobalConfig global_config; extern GlobalConfig global_config;
......
...@@ -32,6 +32,4 @@ struct _GlobalConfig { ...@@ -32,6 +32,4 @@ struct _GlobalConfig {
int tile_when_over; int tile_when_over;
}; };
void panel_config_global(void); #endif /* PANEL_CONFIG_GLOBAL_H */
#endif /* PANEL_CONFIG_H */
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
int config_sync_timeout = 0; int config_sync_timeout = 0;
int applets_to_sync = FALSE; int applets_to_sync = FALSE;
int panels_to_sync = FALSE; int panels_to_sync = FALSE;
int globals_to_sync = FALSE;
int need_complete_save = FALSE; int need_complete_save = FALSE;
extern GSList *panels; extern GSList *panels;
...@@ -496,12 +495,10 @@ static void ...@@ -496,12 +495,10 @@ static void
do_session_save(GnomeClient *client, do_session_save(GnomeClient *client,
int complete_sync, int complete_sync,
int sync_applets, int sync_applets,
int sync_panels, int sync_panels)
int sync_globals)
{ {
int num; int num;
char *s; char *s;
int i;
#if 0 #if 0
gchar *new_args[] = { "rm", "-r", NULL }; gchar *new_args[] = { "rm", "-r", NULL };
...@@ -544,67 +541,6 @@ do_session_save(GnomeClient *client, ...@@ -544,67 +541,6 @@ do_session_save(GnomeClient *client,
#ifdef PANEL_DEBUG #ifdef PANEL_DEBUG
printf(" 4\n"); fflush(stdout); printf(" 4\n"); fflush(stdout);
#endif #endif
if(complete_sync || sync_globals) {
GString *buf;
/*global options*/
gnome_config_set_int("auto_hide_step_size",
global_config.auto_hide_step_size);
gnome_config_set_int("explicit_hide_step_size",
global_config.explicit_hide_step_size);
gnome_config_set_int("drawer_step_size",
global_config.drawer_step_size);
gnome_config_set_int("minimized_size",
global_config.minimized_size);
gnome_config_set_int("minimize_delay",
global_config.minimize_delay);
gnome_config_set_int("movement_type",
(int)global_config.movement_type);
gnome_config_set_bool("tooltips_enabled",
global_config.tooltips_enabled);
gnome_config_set_bool("show_small_icons",
global_config.show_small_icons);
gnome_config_set_bool("show_dot_buttons",
global_config.show_dot_buttons);
gnome_config_set_bool("hungry_menus",
global_config.hungry_menus);
gnome_config_set_bool("off_panel_popups",
global_config.off_panel_popups);
gnome_config_set_bool("disable_animations",
global_config.disable_animations);
gnome_config_set_int("applet_padding",
global_config.applet_padding);
gnome_config_set_bool("autoraise",
global_config.autoraise);
gnome_config_set_bool("keep_bottom",
global_config.keep_bottom);
gnome_config_set_bool("drawer_auto_close",
global_config.drawer_auto_close);
gnome_config_set_bool("simple_movement",
global_config.simple_movement);
gnome_config_set_bool("hide_panel_frame",
global_config.hide_panel_frame);
gnome_config_set_bool("tile_when_over",
global_config.tile_when_over);
buf = g_string_new(NULL);
for(i=0;i<LAST_TILE;i++) {
g_string_sprintf(buf,"tiles_enabled_%d",i);
gnome_config_set_bool(buf->str,
global_config.tiles_enabled[i]);
g_string_sprintf(buf,"tile_up_%d",i);
gnome_config_set_string(buf->str,
global_config.tile_up[i]);
g_string_sprintf(buf,"tile_down_%d",i);
gnome_config_set_string(buf->str,
global_config.tile_down[i]);
g_string_sprintf(buf,"tile_border_%d",i);
gnome_config_set_int(buf->str,
global_config.tile_border[i]);
g_string_sprintf(buf,"tile_depth_%d",i);
gnome_config_set_int(buf->str,
global_config.tile_depth[i]);
}
g_string_free(buf,TRUE);
}
gnome_config_pop_prefix (); gnome_config_pop_prefix ();
gnome_config_sync(); gnome_config_sync();
...@@ -625,26 +561,22 @@ panel_config_sync(void) ...@@ -625,26 +561,22 @@ panel_config_sync(void)
{ {
if(need_complete_save || if(need_complete_save ||
applets_to_sync || applets_to_sync ||
panels_to_sync || panels_to_sync) {
globals_to_sync) {
if (!(gnome_client_get_flags(client) & if (!(gnome_client_get_flags(client) &
GNOME_CLIENT_IS_CONNECTED)) { GNOME_CLIENT_IS_CONNECTED)) {
int ncs = need_complete_save; int ncs = need_complete_save;
int ats = applets_to_sync; int ats = applets_to_sync;
int pts = panels_to_sync; int pts = panels_to_sync;
int gts = globals_to_sync;
need_complete_save = FALSE; need_complete_save = FALSE;
applets_to_sync = FALSE; applets_to_sync = FALSE;
panels_to_sync = FALSE; panels_to_sync = FALSE;
globals_to_sync = FALSE; do_session_save(client,ncs,ats,pts);
do_session_save(client,ncs,ats,pts,gts);
} else { } else {
/*prevent possible races by doing this before requesting /*prevent possible races by doing this before requesting
save*/ save*/
need_complete_save = FALSE; need_complete_save = FALSE;
applets_to_sync = FALSE; applets_to_sync = FALSE;
panels_to_sync = FALSE; panels_to_sync = FALSE;
globals_to_sync = FALSE;
gnome_client_request_save (client, GNOME_SAVE_LOCAL, FALSE, gnome_client_request_save (client, GNOME_SAVE_LOCAL, FALSE,
GNOME_INTERACT_NONE, FALSE, FALSE); GNOME_INTERACT_NONE, FALSE, FALSE);
} }
...@@ -671,7 +603,7 @@ panel_session_save (GnomeClient *client, ...@@ -671,7 +603,7 @@ panel_session_save (GnomeClient *client,
ss_timeout = 1500; ss_timeout = 1500;
ss_interactive = TRUE; ss_interactive = TRUE;
} }
do_session_save(client,TRUE,FALSE,FALSE,FALSE); do_session_save(client,TRUE,FALSE,FALSE);
if(is_shutdown) { if(is_shutdown) {
GSList *li; GSList *li;
for(li=panel_list;li;li=g_slist_next(li)) { for(li=panel_list;li;li=g_slist_next(li)) {
...@@ -1135,9 +1067,7 @@ load_up_globals(void) ...@@ -1135,9 +1067,7 @@ load_up_globals(void)
buf = g_string_new(NULL); buf = g_string_new(NULL);
/*set up global options*/ /*set up global options*/
gnome_config_push_prefix("/panel/Config/");
g_string_sprintf(buf,"%spanel/Config/",PANEL_CONFIG_PATH);
gnome_config_push_prefix(buf->str);
global_config.tooltips_enabled = global_config.tooltips_enabled =
gnome_config_get_bool("tooltips_enabled=TRUE"); gnome_config_get_bool("tooltips_enabled=TRUE");
...@@ -1208,9 +1138,200 @@ load_up_globals(void) ...@@ -1208,9 +1138,200 @@ load_up_globals(void)
g_string_sprintf(buf,"tile_depth_%d=2",i); g_string_sprintf(buf,"tile_depth_%d=2",i);
global_config.tile_depth[i] = gnome_config_get_int(buf->str); global_config.tile_depth[i] = gnome_config_get_int(buf->str);
} }
g_string_free(buf,TRUE);
gnome_config_pop_prefix(); gnome_config_pop_prefix();
g_string_free(buf,TRUE);
apply_global_config(); apply_global_config();
} }
/* used for conversion to new config */
static void
convert_write_config(void)
{
int i;
int is_def;
GString *buf;
gnome_config_push_prefix("/panel/Config/");
/* is there any new config written here */
gnome_config_get_int_with_default("auto_hide_step_size", &is_def);
if(!is_def) {
/* we don't want to overwrite a good config */
gnome_config_pop_prefix();
return;
}
gnome_config_set_int("auto_hide_step_size",
global_config.auto_hide_step_size);
gnome_config_set_int("explicit_hide_step_size",
global_config.explicit_hide_step_size);
gnome_config_set_int("drawer_step_size",
global_config.drawer_step_size);
gnome_config_set_int("minimized_size",
global_config.minimized_size);
gnome_config_set_int("minimize_delay",
global_config.minimize_delay);
gnome_config_set_int("movement_type",
(int)global_config.movement_type);
gnome_config_set_bool("tooltips_enabled",
global_config.tooltips_enabled);
gnome_config_set_bool("show_small_icons",
global_config.show_small_icons);
gnome_config_set_bool("show_dot_buttons",
global_config.show_dot_buttons);
gnome_config_set_bool("hungry_menus",
global_config.hungry_menus);
gnome_config_set_bool("off_panel_popups",
global_config.off_panel_popups);
gnome_config_set_bool("disable_animations",
global_config.disable_animations);
gnome_config_set_int("applet_padding",
global_config.applet_padding);
gnome_config_set_bool("autoraise",
global_config.autoraise);
gnome_config_set_bool("keep_bottom",
global_config.keep_bottom);
gnome_config_set_bool("drawer_auto_close",
global_config.drawer_auto_close);
gnome_config_set_bool("simple_movement",
global_config.simple_movement);
gnome_config_set_bool("hide_panel_frame",
global_config.hide_panel_frame);
gnome_config_set_bool("tile_when_over",
global_config.tile_when_over);
buf = g_string_new(NULL);
for(i=0;i<LAST_TILE;i++) {
g_string_sprintf(buf,"tiles_enabled_%d",i);
gnome_config_set_bool(buf->str,
global_config.tiles_enabled[i]);
g_string_sprintf(buf,"tile_up_%d",i);
gnome_config_set_string(buf->str,
global_config.tile_up[i]);
g_string_sprintf(buf,"tile_down_%d",i);
gnome_config_set_string(buf->str,
global_config.tile_down[i]);
g_string_sprintf(buf,"tile_border_%d",i);
gnome_config_set_int(buf->str,
global_config.tile_border[i]);
g_string_sprintf(buf,"tile_depth_%d",i);
gnome_config_set_int(buf->str,
global_config.tile_depth[i]);
}
g_string_free(buf,TRUE);
gnome_config_pop_prefix();
gnome_config_sync();
}
static gboolean
convert_read_old_config(void)
{
char *tile_def[]={"normal","purple","green","blue"};
GString *buf;
int i,is_def;
int applet_count; /*store this so that we can clean*/
buf = g_string_new(NULL);
g_string_sprintf(buf,"%spanel/Config/",PANEL_CONFIG_PATH);
gnome_config_push_prefix(buf->str);
gnome_config_get_bool_with_default("tooltips_enabled=TRUE",&is_def);
if(is_def) {
gnome_config_pop_prefix();
g_string_free(buf,TRUE);
return FALSE;
}
global_config.tooltips_enabled =
gnome_config_get_bool("tooltips_enabled=TRUE");
global_config.show_small_icons =
gnome_config_get_bool("show_small_icons=TRUE");
global_config.show_dot_buttons =
gnome_config_get_bool("show_dot_buttons=FALSE");
global_config.hungry_menus =
gnome_config_get_bool("hungry_menus=TRUE");
global_config.off_panel_popups =
gnome_config_get_bool("off_panel_popups=TRUE");
global_config.disable_animations =
gnome_config_get_bool("disable_animations=FALSE");
g_string_sprintf(buf,"auto_hide_step_size=%d",
DEFAULT_AUTO_HIDE_STEP_SIZE);
global_config.auto_hide_step_size=gnome_config_get_int(buf->str);
g_string_sprintf(buf,"explicit_hide_step_size=%d",
DEFAULT_EXPLICIT_HIDE_STEP_SIZE);
global_config.explicit_hide_step_size=gnome_config_get_int(buf->str);
g_string_sprintf(buf,"drawer_step_size=%d",
DEFAULT_DRAWER_STEP_SIZE);
global_config.drawer_step_size=gnome_config_get_int(buf->str);
g_string_sprintf(buf,"minimize_delay=%d", DEFAULT_MINIMIZE_DELAY);