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

get rid of the "." main menu parameter hack. I feel sort of sentimental

Mon Nov 26 00:57:16 2001  George Lebl <jirka@5z.com>

	* applet.c, menu-properties.[ch], menu.[ch], panel.c, session.c:
	  get rid of the "." main menu parameter hack.  I feel sort of
	  sentimental removing this since this dates back from the days
	  when federico maintained the panel.  I don't know why it lived
	  on so long anyway :)

	* menu.c: remove the properties menu stuff, just about everyone
	  agreed it was quite a horrible UI

	* foobar-widget.c, menu.c, panel-util.[ch]: add
	  panel_is_program_in_path which is like g_find_program_in_path
	  but returns just a boolean

	* menu.h, session.c: remove some compatibility hacks dating to
	  some ancient 1.0 versions or whatnot.  We'll break config compat
	  anyway.
parent 78a869fa
Mon Nov 26 00:57:16 2001 George Lebl <jirka@5z.com>
* applet.c, menu-properties.[ch], menu.[ch], panel.c, session.c:
get rid of the "." main menu parameter hack. I feel sort of
sentimental removing this since this dates back from the days
when federico maintained the panel. I don't know why it lived
on so long anyway :)
* menu.c: remove the properties menu stuff, just about everyone
agreed it was quite a horrible UI
* foobar-widget.c, menu.c, panel-util.[ch]: add
panel_is_program_in_path which is like g_find_program_in_path
but returns just a boolean
* menu.h, session.c: remove some compatibility hacks dating to
some ancient 1.0 versions or whatnot. We'll break config compat
anyway.
Sun Nov 25 20:07:06 2001 George Lebl <jirka@5z.com>
* launcher.c, menu.c, menu-fentry.[ch], main.c: remove the
......
......@@ -164,8 +164,7 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
} else if (strcmp (menu->name, "help") == 0) {
Menu *menu2 = menu->info->data;
char *page;
page = (menu2->path && strcmp (menu2->path,"."))
? "menus" : "mainmenu";
page = menu2->main_menu ? "mainmenu" : "menus";
panel_show_help (page, NULL);
}
break;
......
......@@ -385,7 +385,6 @@ static void
append_desktop_menu (GtkWidget *menu_bar)
{
GtkWidget *menu, *item;
char *char_tmp;
int i;
static char *arrange[] = {
N_("By Name"), "--arrange-desktop-icons=name",
......@@ -426,16 +425,13 @@ append_desktop_menu (GtkWidget *menu_bar)
item = add_menu_separator (menu);
gmc_menu_items = g_list_prepend (gmc_menu_items, item);
char_tmp = g_find_program_in_path ("xscreensaver");
if (char_tmp) {
if (panel_is_program_in_path ("xscreensaver")) {
item = pixmap_menu_item_new (_("Lock Screen"),
"gnome-lockscreen.png");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_signal_connect (GTK_OBJECT (item), "activate",
GTK_SIGNAL_FUNC (panel_lock), 0);
setup_internal_applet_drag(item, "LOCK:NEW");
g_free (char_tmp);
}
item = pixmap_menu_item_new (_("Log Out"), "gnome-term-night.png");
......
......@@ -62,24 +62,17 @@ struct _MenuDialogInfo {
};
char *
get_real_menu_path (const char *arguments)
get_real_menu_path (const char *arguments, gboolean main_menu)
{
char *this_menu;
if (main_menu)
return g_strdup ("programs:");
/*if null, let's put the main menu up*/
if (string_empty (arguments))
arguments = ".";
if (strcmp (arguments, ".") == 0)
this_menu = g_strdup ("programs:");
else if (*arguments == '~')
/* FIXME: this needs to be a URI */
this_menu = g_build_filename (g_get_home_dir(),
return g_build_filename (g_get_home_dir(),
&arguments[1], NULL);
else
this_menu = g_strdup (arguments);
return this_menu;
return g_strdup (arguments);
}
char *
......@@ -180,29 +173,31 @@ properties_apply_callback (Menu *menu)
}
need_edit_menus = FALSE;
/* default to non-main-menu */
menu->main_menu = FALSE;
if (GTK_TOGGLE_BUTTON (menu->dialog_info->main_menu)->active ||
GTK_TOGGLE_BUTTON (menu->dialog_info->global_main)->active) {
g_free (menu->path);
menu->path = g_strdup (".");
menu->main_menu = TRUE;
if (got_gmenu ()) {
need_edit_menus = TRUE;
}
} else {
g_free (menu->path);
s = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (menu->dialog_info->pathentry),
TRUE);
if(s == NULL) {
g_warning (_("Can't open directory, using main menu!"));
menu->path = g_strdup (".");
menu->main_menu = TRUE;
} else if (*s == '\0') {
menu->path = g_strdup (".");
menu->main_menu = TRUE;
} else {
g_free (menu->path);
menu->path = g_strdup (s);
}
}
/* Setup the edit_menus callback */
if (panel_applet_get_callback (menu->info->user_menu, "edit_menus"))
got_edit_menus = TRUE;
......@@ -277,12 +272,11 @@ properties_apply_callback (Menu *menu)
/* Apply menu changes */
if (need_reload) {
char *this_menu = get_real_menu_path (menu->path);
char *this_menu = get_real_menu_path (menu->path, menu->main_menu);
GSList *list = g_slist_append (NULL, this_menu);
gboolean main_menu = strcmp (menu->path, ".") == 0;
add_menu_widget (menu, PANEL_WIDGET (menu->button->parent),
list, main_menu, TRUE);
list, TRUE);
g_free (this_menu);
......@@ -291,7 +285,8 @@ properties_apply_callback (Menu *menu)
/* Apply icon changes */
if (change_icon) {
char *this_menu = get_real_menu_path(menu->path);
char *this_menu = get_real_menu_path (menu->path,
menu->main_menu);
char *pixmap_name;
if (menu->custom_icon &&
......@@ -299,7 +294,7 @@ properties_apply_callback (Menu *menu)
g_file_test (menu->custom_icon_file, G_FILE_TEST_EXISTS))
pixmap_name = g_strdup (menu->custom_icon_file);
else
pixmap_name = get_pixmap(this_menu, (strcmp (menu->path, ".") == 0));
pixmap_name = get_pixmap (this_menu, menu->main_menu);
button_widget_set_pixmap(BUTTON_WIDGET(menu->button),
pixmap_name, -1);
}
......@@ -491,9 +486,8 @@ create_properties_dialog (Menu *menu)
w = gtk_radio_button_new_with_label (NULL, _("Global main menu"));
global_main = w;
menu->dialog_info->global_main = w;
if((menu->path == NULL ||
strcmp(menu->path, ".") == 0) &&
menu->global_main)
if (menu->main_menu &&
menu->global_main)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
gtk_signal_connect (GTK_OBJECT (w), "toggled",
GTK_SIGNAL_FUNC (toggle_global_main),
......@@ -505,9 +499,8 @@ create_properties_dialog (Menu *menu)
_("Main menu"));
main_menu = w;
menu->dialog_info->main_menu = w;
if((menu->path == NULL ||
strcmp(menu->path, ".") == 0) &&
! menu->global_main)
if (menu->main_menu &&
! menu->global_main)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE);
gtk_signal_connect (GTK_OBJECT (w), "toggled",
GTK_SIGNAL_FUNC (toggle_main_menu),
......@@ -517,7 +510,7 @@ create_properties_dialog (Menu *menu)
w2 = gtk_radio_button_new_with_label (
gtk_radio_button_group (GTK_RADIO_BUTTON (global_main)),
_("Normal menu"));
if(menu->path && strcmp(menu->path, ".") != 0)
if ( ! menu->main_menu)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w2), TRUE);
gtk_signal_connect (GTK_OBJECT (w2), "toggled",
GTK_SIGNAL_FUNC (toggle_normal_menu),
......@@ -525,9 +518,8 @@ create_properties_dialog (Menu *menu)
gtk_box_pack_start(GTK_BOX(box), w2, TRUE, TRUE, 0);
f = gtk_frame_new(_("Main menu"));
if((menu->path &&
strcmp(menu->path, ".") != 0) ||
menu->global_main)
if ( ! menu->main_menu ||
menu->global_main)
gtk_widget_set_sensitive(f, FALSE);
menu->dialog_info->main_frame = f;
gtk_box_pack_start(GTK_BOX(vbox), f, FALSE, FALSE, 0);
......@@ -587,11 +579,10 @@ create_properties_dialog (Menu *menu)
menu->main_menu_flags & MAIN_MENU_DESKTOP_SUB);
f = gtk_frame_new(_("Normal menu"));
if(menu->path == NULL ||
strcmp(menu->path, ".") == 0)
gtk_widget_set_sensitive(f, FALSE);
if ( ! menu->main_menu)
gtk_widget_set_sensitive (f, FALSE);
menu->dialog_info->normal_frame = f;
gtk_box_pack_start(GTK_BOX(vbox), f, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), f, FALSE, FALSE, 0);
box = gtk_hbox_new(FALSE, GNOME_PAD_SMALL);
gtk_container_set_border_width(GTK_CONTAINER(box), GNOME_PAD_SMALL);
......@@ -606,7 +597,7 @@ create_properties_dialog (Menu *menu)
t = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (w));
menu->dialog_info->pathentry = w;
if (menu->path) {
char *s = get_real_menu_path(menu->path);
char *s = get_real_menu_path (menu->path, menu->main_menu);
gtk_entry_set_text(GTK_ENTRY(t), s);
g_free(s);
}
......
......@@ -7,7 +7,8 @@ G_BEGIN_DECLS
void menu_properties (Menu *menu);
char * get_real_menu_path (const char *arguments);
char * get_real_menu_path (const char *arguments,
gboolean main_menu);
char * get_pixmap (const char *menudir,
gboolean main_menu);
......
......@@ -1254,7 +1254,8 @@ add_menudrawer_to_panel(GtkWidget *w, gpointer data)
static void
add_menu_to_panel (GtkWidget *widget, gpointer data)
{
char *menudir = data;
const char *menudir = data;
gboolean main_menu;
PanelWidget *panel;
DistributionType distribution = get_distribution_type ();
int flags = MAIN_MENU_SYSTEM_SUB | MAIN_MENU_USER_SUB |
......@@ -1271,7 +1272,20 @@ add_menu_to_panel (GtkWidget *widget, gpointer data)
panel = get_panel_from_menu_data (widget, TRUE);
load_menu_applet (menudir, flags, TRUE, FALSE, NULL, panel, 0, FALSE);
if (menudir == NULL) {
main_menu = TRUE;
menudir = "programs:/";
} else {
main_menu = FALSE;
}
load_menu_applet (menudir, main_menu, flags,
TRUE /* global_main */,
FALSE /* custom_icon */,
NULL /* custom_icon_file */,
panel,
0 /* pos */,
FALSE /* exactpos */);
}
/*most of this function stolen from the real gtk_menu_popup*/
......@@ -2355,7 +2369,7 @@ menu_destroy(GtkWidget *menu, gpointer data)
/*reread the applet menu, not a submenu*/
static void
check_and_reread_applet(Menu *menu, gboolean main_menu)
check_and_reread_applet (Menu *menu)
{
GSList *mfl, *list;
......@@ -2363,8 +2377,8 @@ check_and_reread_applet(Menu *menu, gboolean main_menu)
mfl = gtk_object_get_data (GTK_OBJECT (menu->menu), "mf");
/*that will be destroyed in add_menu_widget*/
if(main_menu) {
add_menu_widget (menu, NULL, NULL, main_menu, TRUE);
if (menu->main_menu) {
add_menu_widget (menu, NULL, NULL, TRUE);
} else {
GSList *dirlist = NULL;
for(list = mfl; list != NULL;
......@@ -2373,7 +2387,7 @@ check_and_reread_applet(Menu *menu, gboolean main_menu)
dirlist = g_slist_append (dirlist,
g_strdup (mf->menudir));
}
add_menu_widget (menu, NULL, dirlist, main_menu, TRUE);
add_menu_widget (menu, NULL, dirlist, TRUE);
g_slist_foreach (dirlist, (GFunc)g_free, NULL);
g_slist_free (dirlist);
......@@ -3920,12 +3934,16 @@ create_kde_menu (GtkWidget *menu, gboolean fake_submenus,
gboolean favourites_add)
{
char *pixmap_name;
char *uri;
pixmap_name = g_build_filename (kde_icondir, "exec.xpm", NULL);
if(!fake || menu) {
uri = gnome_vfs_get_uri_from_local_path (kde_menudir);
if ( ! fake ||
menu != NULL) {
menu = create_menu_at (menu,
kde_menudir,
uri,
FALSE /* applets */,
launcher_add,
favourites_add,
......@@ -3934,7 +3952,7 @@ create_kde_menu (GtkWidget *menu, gboolean fake_submenus,
fake_submenus,
force, title);
} else {
menu = create_fake_menu_at (kde_menudir,
menu = create_fake_menu_at (uri,
FALSE /* applets */,
launcher_add,
favourites_add,
......@@ -3942,6 +3960,8 @@ create_kde_menu (GtkWidget *menu, gboolean fake_submenus,
pixmap_name, title);
}
g_free (pixmap_name);
g_free (uri);
return menu;
}
......@@ -4138,6 +4158,8 @@ ask_about_swallowing_cb(GtkWidget *w, gpointer data)
ask_about_swallowing(get_panel_from_menu_data(w, TRUE), 0, FALSE);
}
#ifdef FIXME
/* FIXME: This needs to be in the properties */
static void
convert_setup (BasePWidget *basep, GType type)
{
......@@ -4147,7 +4169,10 @@ convert_setup (BasePWidget *basep, GType type)
basep_pos_connect_signals (basep);
update_config_type (basep);
}
#endif
#ifdef FIXME
/* FIXME: This needs to be in the properties */
static void
convert_to_panel(GtkWidget *widget, gpointer data)
{
......@@ -4295,640 +4320,7 @@ convert_to_panel(GtkWidget *widget, gpointer data)
gtk_object_unref (GTK_OBJECT (old_pos));
gtk_widget_queue_resize (GTK_WIDGET (basep));
}
static void
change_hiding_mode (GtkWidget *widget, gpointer data)
{
BasePWidget *basep;
PanelWidget *cur_panel = get_panel_from_menu_data(widget, TRUE);
g_return_if_fail(cur_panel != NULL);
g_return_if_fail(PANEL_IS_WIDGET(cur_panel));
if (!GTK_CHECK_MENU_ITEM (widget)->active)
return;
g_assert (cur_panel->panel_parent);
g_return_if_fail (BASEP_IS_WIDGET (cur_panel->panel_parent));
basep = BASEP_WIDGET(cur_panel->panel_parent);
basep_widget_change_params (basep,
basep->screen,
cur_panel->orient,
cur_panel->sz,
GPOINTER_TO_INT (data),
basep->state,
basep->level,
basep->avoid_on_maximize,
basep->hidebuttons_enabled,
basep->hidebutton_pixmaps_enabled,
cur_panel->back_type,
cur_panel->back_pixmap,
cur_panel->fit_pixmap_bg,
cur_panel->strech_pixmap_bg,
cur_panel->rotate_pixmap_bg,
&cur_panel->back_color);
update_config_mode (basep);
}
static void
change_level (GtkWidget *widget, gpointer data)
{
BasePWidget *basep;
PanelWidget *cur_panel = get_panel_from_menu_data(widget, TRUE);
g_return_if_fail(cur_panel != NULL);
g_return_if_fail(PANEL_IS_WIDGET(cur_panel));
if (!GTK_CHECK_MENU_ITEM (widget)->active)
return;
g_assert (cur_panel->panel_parent);
g_return_if_fail (BASEP_IS_WIDGET (cur_panel->panel_parent));
basep = BASEP_WIDGET(cur_panel->panel_parent);
basep_widget_change_params (basep,
basep->screen,
cur_panel->orient,
cur_panel->sz,
basep->mode,
basep->state,
GPOINTER_TO_INT (data),
basep->avoid_on_maximize,
basep->hidebuttons_enabled,
basep->hidebutton_pixmaps_enabled,
cur_panel->back_type,
cur_panel->back_pixmap,
cur_panel->fit_pixmap_bg,
cur_panel->strech_pixmap_bg,
cur_panel->rotate_pixmap_bg,
&cur_panel->back_color);
update_config_level (basep);
}
static void
change_avoid_on_maximize (GtkWidget *widget, gpointer data)
{
BasePWidget *basep;
PanelWidget *cur_panel = get_panel_from_menu_data(widget, TRUE);
g_return_if_fail(cur_panel != NULL);
g_return_if_fail(PANEL_IS_WIDGET(cur_panel));
if (!GTK_CHECK_MENU_ITEM (widget)->active)
return;
g_assert (cur_panel->panel_parent);
g_return_if_fail (BASEP_IS_WIDGET (cur_panel->panel_parent));
basep = BASEP_WIDGET(cur_panel->panel_parent);
basep_widget_change_params (basep,
basep->screen,
cur_panel->orient,
cur_panel->sz,
basep->mode,
basep->state,
basep->level,
GPOINTER_TO_INT (data),
basep->hidebuttons_enabled,
basep->hidebutton_pixmaps_enabled,
cur_panel->back_type,
cur_panel->back_pixmap,
cur_panel->fit_pixmap_bg,
cur_panel->strech_pixmap_bg,
cur_panel->rotate_pixmap_bg,
&cur_panel->back_color);
update_config_avoid_on_maximize (basep);
}
static void
change_size (GtkWidget *widget, gpointer data)
{
PanelWidget *cur_panel = get_panel_from_menu_data(widget, TRUE);
g_return_if_fail(cur_panel != NULL);
if (!GTK_CHECK_MENU_ITEM (widget)->active)
return;
panel_widget_change_params (cur_panel,
cur_panel->orient,
GPOINTER_TO_INT (data),
cur_panel->back_type,
cur_panel->back_pixmap,
cur_panel->fit_pixmap_bg,
cur_panel->strech_pixmap_bg,
cur_panel->rotate_pixmap_bg,
&cur_panel->back_color);
}
static void
change_orient (GtkWidget *widget, gpointer data)
{
BasePWidget *basep;
PanelWidget *cur_panel = get_panel_from_menu_data(widget, TRUE);
g_return_if_fail(cur_panel != NULL);
g_return_if_fail(PANEL_IS_WIDGET(cur_panel));
if (!GTK_CHECK_MENU_ITEM (widget)->active)
return;
g_assert (cur_panel->panel_parent);
g_return_if_fail (BASEP_IS_WIDGET (cur_panel->panel_parent));
basep = BASEP_WIDGET(cur_panel->panel_parent);
basep_widget_change_params (basep,
basep->screen,
GPOINTER_TO_INT (data),
cur_panel->sz,
basep->mode,
basep->state,
basep->level,
basep->avoid_on_maximize,
basep->hidebuttons_enabled,
basep->hidebutton_pixmaps_enabled,
cur_panel->back_type,
cur_panel->back_pixmap,
cur_panel->fit_pixmap_bg,
cur_panel->strech_pixmap_bg,
cur_panel->rotate_pixmap_bg,
&cur_panel->back_color);
}
static void
change_background (GtkWidget *widget, gpointer data)
{
PanelWidget *cur_panel = get_panel_from_menu_data(widget, TRUE);
g_return_if_fail(cur_panel != NULL);
if (!GTK_CHECK_MENU_ITEM (widget)->active)
return;
panel_widget_change_params (cur_panel,
cur_panel->orient,
cur_panel->sz,
GPOINTER_TO_INT (data),
cur_panel->back_pixmap,
cur_panel->fit_pixmap_bg,
cur_panel->strech_pixmap_bg,
cur_panel->rotate_pixmap_bg,
&cur_panel->back_color);
}
static void
change_hidebuttons (GtkWidget *widget, gpointer data)
{
BasePWidget *basep;
gboolean hidebutton_pixmaps_enabled, hidebuttons_enabled;
PanelWidget *cur_panel = get_panel_from_menu_data(widget, TRUE);
g_return_if_fail(cur_panel != NULL);
g_return_if_fail(PANEL_IS_WIDGET(cur_panel));
if (!GTK_CHECK_MENU_ITEM (widget)->active)
return;
g_assert (cur_panel->panel_parent);
g_return_if_fail (BASEP_IS_WIDGET (cur_panel->panel_parent));
basep = BASEP_WIDGET(cur_panel->panel_parent);
hidebuttons_enabled = basep->hidebuttons_enabled;
hidebutton_pixmaps_enabled = basep->hidebutton_pixmaps_enabled;
switch (GPOINTER_TO_INT (data)) {
case HIDEBUTTONS_NONE:
hidebuttons_enabled = FALSE;
break;
case HIDEBUTTONS_PLAIN:
hidebutton_pixmaps_enabled = FALSE;
hidebuttons_enabled = TRUE;
break;
case HIDEBUTTONS_PIXMAP:
hidebutton_pixmaps_enabled = TRUE;
hidebuttons_enabled = TRUE;
break;
}
basep_widget_change_params (basep,
basep->screen,
cur_panel->orient,
cur_panel->sz,
basep->mode,
basep->state,
basep->level,
basep->avoid_on_maximize,
hidebuttons_enabled,
hidebutton_pixmaps_enabled,
cur_panel->back_type,
cur_panel->back_pixmap,
cur_panel->fit_pixmap_bg,
cur_panel->strech_pixmap_bg,
cur_panel->rotate_pixmap_bg,
&cur_panel->back_color);
update_config_hidebuttons (basep);
}
static void
show_x_on_panels(GtkWidget *menu, gpointer data)
{
GtkWidget *pw;
GtkWidget *types = gtk_object_get_data(GTK_OBJECT(menu), MENU_TYPES);
GtkWidget *modes = gtk_object_get_data(GTK_OBJECT(menu), MENU_MODES);
GtkWidget *orient = gtk_object_get_data (GTK_OBJECT (menu), MENU_ORIENTS);
PanelWidget *cur_panel = get_panel_from_menu_data(menu, TRUE);
g_return_if_fail(cur_panel != NULL);
g_return_if_fail(PANEL_IS_WIDGET(cur_panel));
g_return_if_fail(types != NULL);
g_return_if_fail(modes != NULL);
pw = cur_panel->panel_parent;
g_return_if_fail(pw != NULL);
if(DRAWER_IS_WIDGET(pw)) {
gtk_widget_hide(modes);
gtk_widget_hide(types);
} else {
gtk_widget_show(modes);
gtk_widget_show(types);
}
if (FLOATING_IS_WIDGET (pw))
gtk_widget_show (orient);
else
gtk_widget_hide (orient);
}
static void
update_type_menu (GtkWidget *menu, gpointer data)
{
char *s = NULL;
GtkWidget *menuitem = NULL;
PanelWidget *cur_panel = get_panel_from_menu_data(menu, TRUE);
GtkWidget *basep = cur_panel->panel_parent;
if (EDGE_IS_WIDGET (basep))
s = MENU_TYPE_EDGE;
else if (ALIGNED_IS_WIDGET (basep))
s = MENU_TYPE_ALIGNED;
else if (SLIDING_IS_WIDGET (basep))
s = MENU_TYPE_SLIDING;
else if (FLOATING_IS_WIDGET (basep))
s = MENU_TYPE_FLOATING;
else
return;
menuitem = gtk_object_get_data (GTK_OBJECT (menu), s);
if (menuitem)
gtk_check_menu_item_set_active (
GTK_CHECK_MENU_ITEM (menuitem), TRUE);
}
static void
update_level_menu (GtkWidget *menu, gpointer data)
{
char *s = NULL;
GtkWidget *menuitem = NULL;
PanelWidget *cur_panel = get_panel_from_menu_data(menu, TRUE);
GtkWidget *basep = cur_panel->panel_parent;
/* sanity */
if ( ! BASEP_WIDGET (basep))
return;
switch (BASEP_WIDGET (basep)->level) {
case BASEP_LEVEL_DEFAULT:
s = MENU_LEVEL_DEFAULT;
break;
case BASEP_LEVEL_ABOVE:
s = MENU_LEVEL_ABOVE;
break;
case BASEP_LEVEL_NORMAL:
s = MENU_LEVEL_NORMAL;
break;
case BASEP_LEVEL_BELOW:
s = MENU_LEVEL_BELOW;
break;
default:
return;
}
menuitem = gtk_object_get_data (GTK_OBJECT (menu), s);
if (menuitem != NULL)
gtk_check_menu_item_set_active (
GTK_CHECK_MENU_ITEM (menuitem), TRUE);
}
static void
update_avoid_on_maximize_menu (GtkWidget *menu, gpointer data)
{
char *s = NULL;
GtkWidget *menuitem = NULL;
PanelWidget *cur_panel = get_panel_from_menu_data(menu, TRUE);
GtkWidget *basep = cur_panel->panel_parent;
/* sanity */
if ( ! BASEP_WIDGET (basep))
return;
if (BASEP_WIDGET (basep)->avoid_on_maximize) {
s = MENU_AVOID_ON_MAX;
} else {
s = MENU_NO_AVOID_ON_MAX;
}
menuitem = gtk_object_get_data (GTK_OBJECT (menu), s);
if (menuitem != NULL)
gtk_check_menu_item_set_active (
GTK_CHECK_MENU_ITEM (menuitem), TRUE);
}
static void
update_size_menu (GtkWidget *menu,
gpointer data)
{
GtkWidget *menuitem;
PanelWidget *cur_panel;
char *s;
cur_panel = get_panel_from_menu_data (menu, TRUE);
switch (cur_panel->sz) {
case PANEL_SIZE_XX_SMALL:
s = MENU_SIZE_XX_SMALL;
break;
case PANEL_SIZE_X_SMALL:
s = MENU_SIZE_X_SMALL;
break;
case PANEL_SIZE_SMALL:
s = MENU_SIZE_SMALL;
break;
case PANEL_SIZE_MEDIUM:
s = MENU_SIZE_MEDIUM;
break;