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

cleaned up the load_applet function mess a bit, having one function that

Sun Jul 19 18:57:19 1998  George Lebl  <jirka@5z.com>

        * main.c: cleaned up the load_applet function mess a bit,
          having one function that does it all is not the right choice,
          also took  out the applet load queue, I can't remember why it
          was there but it was just making things more complicated

        * menu.c: cleaned things up and added a menu parameter for different
          usermenu/system menu configurations for the main menu, but no
          config fialog yet
parent 07647235
Sun Jul 19 18:57:19 1998 George Lebl <jirka@5z.com>
* main.c: cleaned up the load_applet function mess a bit,
having one function that does it all is not the right choice,
also took out the applet load queue, I can't remember why it
was there but it was just making things more complicated
* menu.c: cleaned things up and added a menu parameter for different
usermenu/system menu configurations for the main menu, but no
config fialog yet
Sun Jul 19 15:20:22 1998 George Lebl <jirka@5z.com>
* menu.c: cleanups, better multiple dir menu support, more
......
Sun Jul 19 18:57:19 1998 George Lebl <jirka@5z.com>
* main.c: cleaned up the load_applet function mess a bit,
having one function that does it all is not the right choice,
also took out the applet load queue, I can't remember why it
was there but it was just making things more complicated
* menu.c: cleaned things up and added a menu parameter for different
usermenu/system menu configurations for the main menu, but no
config fialog yet
Sun Jul 19 15:20:22 1998 George Lebl <jirka@5z.com>
* menu.c: cleanups, better multiple dir menu support, more
......
......@@ -72,24 +72,8 @@ GlobalConfig global_config = {
TRUE /*show small icons*/
};
typedef struct _LoadApplet LoadApplet;
struct _LoadApplet {
char *id_str;
char *path;
char *params;
int width;
int height;
char *pixmap;
char *tooltip;
int pos;
PanelWidget *panel;
char *cfgpath;
};
GList * children = NULL;
GList *load_queue=NULL;
/* True if parsing determined that all the work is already done. */
int just_exit = 0;
......@@ -266,30 +250,6 @@ get_def_panel_widget(GtkWidget *panel)
return NULL;
}
static void
queue_load_applet(char *id_str, char *path, char *params, int width, int height,
char *pixmap, char *tooltip,
int pos, PanelWidget *panel, char *cfgpath)
{
LoadApplet *l;
l = g_new(LoadApplet,1);
l->id_str=g_strdup(id_str);
if(path) l->path=g_strdup(path);
else l->path = NULL;
l->params=g_strdup(params);
l->width=width;
l->height=height;
l->pixmap=g_strdup(pixmap);
l->tooltip=g_strdup(tooltip);
l->pos=pos;
l->panel=panel;
l->cfgpath=g_strdup(cfgpath);
load_queue = g_list_append(load_queue,l);
}
static void
monitor_drawers(GtkWidget *w, PanelWidget *panel)
{
......@@ -443,11 +403,127 @@ drawer_realize_cb(GtkWidget *button, Drawer *drawer)
}
}
void
load_swallow_applet(char *path, char *params, int width, int height,
int pos, PanelWidget *panel)
{
Swallow *swallow;
swallow = create_swallow_applet(params, width, height,
SWALLOW_HORIZONTAL);
if(!swallow)
return;
register_toy(swallow->table,NULL,swallow,SWALLOW_ID,
path, params,pos, panel,NULL,
APPLET_SWALLOW);
if(path && *path) {
char *s = g_copy_strings("(true; ",path," &)",NULL);
system(s);
g_free(s);
}
}
void
load_menu_applet(char *params, int main_menu_type,
int pos, PanelWidget *panel)
{
Menu *menu;
menu = create_menu_applet(params, ORIENT_UP,main_menu_type);
if(menu)
register_toy(menu->button,menu->menu,menu,MENU_ID,
NULL,params, pos,panel,NULL,APPLET_MENU);
}
void
load_applet(char *id_str, char *path, char *params, int width, int height,
char *pixmap, char *tooltip,
load_drawer_applet(char *params, char *pixmap, char *tooltip,
int pos, PanelWidget *panel)
{
Drawer *drawer;
PanelWidget *dr_panel;
if(!params) {
drawer = create_empty_drawer_applet(
tooltip,pixmap,
get_applet_orient(panel));
if(drawer) panel_setup(drawer->drawer);
} else {
int i;
PanelData *dr_pd;
sscanf(params,"%d",&i);
dr_pd = g_list_nth(panel_list,i)->data;
drawer=create_drawer_applet(dr_pd->panel,
tooltip,pixmap,
get_applet_orient(panel));
}
if(!drawer)
return;
g_return_if_fail(drawer != NULL);
register_toy(drawer->button,drawer->drawer,drawer,DRAWER_ID,
NULL, params, pos, panel, NULL, APPLET_DRAWER);
/*the panel of the drawer*/
dr_panel = PANEL_WIDGET(DRAWER_WIDGET(drawer->drawer)->panel);
gtk_signal_connect(GTK_OBJECT(drawer->button), "clicked",
GTK_SIGNAL_FUNC(monitor_drawers),
dr_panel);
if(DRAWER_WIDGET(drawer->drawer)->state == DRAWER_SHOWN) {
GtkWidget *wpanel;
/*pop up, if popped down*/
wpanel = gtk_object_get_data(GTK_OBJECT(panel),
PANEL_PARENT);
if(IS_SNAPPED_WIDGET(wpanel)) {
/*drawer is open so we track it*/
SNAPPED_WIDGET(wpanel)->drawers_open++;
snapped_widget_pop_up(SNAPPED_WIDGET(wpanel));
}
}
panel_widget_add_forbidden(
PANEL_WIDGET(DRAWER_WIDGET(drawer->drawer)->panel));
gtk_tooltips_set_tip (panel_tooltips,drawer->button->parent,
drawer->tooltip,NULL);
if(GTK_WIDGET_REALIZED(drawer->button)) {
reposition_drawer(drawer);
if(DRAWER_WIDGET(drawer->drawer)->state == DRAWER_SHOWN)
gtk_widget_show(drawer->drawer);
else {
/*hmm ... weird but it works*/
gtk_widget_set_uposition(drawer->drawer,
-100,-100);
gtk_widget_show(drawer->drawer);
/*gtk_widget_realize(drawer->drawer);*/
gtk_widget_hide(drawer->drawer);
}
} else
gtk_signal_connect_after(GTK_OBJECT(drawer->button),
"realize",
GTK_SIGNAL_FUNC(
drawer_realize_cb),
drawer);
gtk_signal_connect_after(GTK_OBJECT(drawer->drawer),
"realize",
GTK_SIGNAL_FUNC(drawer_realize_cb),
drawer);
applet_add_callback(applet_count-1,"properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
}
void
load_applet(char *id_str, char *path, char *params,
int pos, PanelWidget *panel, char *cfgpath)
{
if(strcmp(id_str,EXTERN_ID) == 0) {
......@@ -496,14 +572,6 @@ load_applet(char *id_str, char *path, char *params, int width, int height,
g_free(cfgpath);
g_free(fullpath);
} else if(strcmp(id_str,MENU_ID) == 0) {
Menu *menu;
menu = create_menu_applet(params, ORIENT_UP);
if(menu)
register_toy(menu->button,menu->menu,menu,MENU_ID,
NULL,params, pos,panel,NULL,APPLET_MENU);
} else if(strcmp(id_str,LAUNCHER_ID) == 0) {
Launcher *launcher;
......@@ -522,102 +590,6 @@ load_applet(char *id_str, char *path, char *params, int width, int height,
GNOME_STOCK_MENU_PROP,
_("Properties..."));
}
} else if(strcmp(id_str,DRAWER_ID) == 0) {
Drawer *drawer;
PanelWidget *dr_panel;
if(!params) {
drawer = create_empty_drawer_applet(
tooltip,pixmap,
get_applet_orient(panel));
if(drawer) panel_setup(drawer->drawer);
} else {
int i;
PanelData *dr_pd;
sscanf(params,"%d",&i);
dr_pd = g_list_nth(panel_list,i)->data;
drawer=create_drawer_applet(dr_pd->panel,
tooltip,pixmap,
get_applet_orient(panel));
}
if(!drawer)
return;
g_return_if_fail(drawer != NULL);
register_toy(drawer->button,drawer->drawer,drawer,DRAWER_ID,
NULL, params, pos, panel, NULL, APPLET_DRAWER);
/*the panel of the drawer*/
dr_panel = PANEL_WIDGET(DRAWER_WIDGET(drawer->drawer)->panel);
gtk_signal_connect(GTK_OBJECT(drawer->button), "clicked",
GTK_SIGNAL_FUNC(monitor_drawers),
dr_panel);
if(DRAWER_WIDGET(drawer->drawer)->state == DRAWER_SHOWN) {
GtkWidget *wpanel;
/*pop up, if popped down*/
wpanel = gtk_object_get_data(GTK_OBJECT(panel),
PANEL_PARENT);
if(IS_SNAPPED_WIDGET(wpanel)) {
/*drawer is open so we track it*/
SNAPPED_WIDGET(wpanel)->drawers_open++;
snapped_widget_pop_up(SNAPPED_WIDGET(wpanel));
}
}
panel_widget_add_forbidden(
PANEL_WIDGET(DRAWER_WIDGET(drawer->drawer)->panel));
gtk_tooltips_set_tip (panel_tooltips,drawer->button->parent,
drawer->tooltip,NULL);
if(GTK_WIDGET_REALIZED(drawer->button)) {
reposition_drawer(drawer);
if(DRAWER_WIDGET(drawer->drawer)->state == DRAWER_SHOWN)
gtk_widget_show(drawer->drawer);
else {
/*hmm ... weird but it works*/
gtk_widget_set_uposition(drawer->drawer,
-100,-100);
gtk_widget_show(drawer->drawer);
/*gtk_widget_realize(drawer->drawer);*/
gtk_widget_hide(drawer->drawer);
}
} else
gtk_signal_connect_after(GTK_OBJECT(drawer->button),
"realize",
GTK_SIGNAL_FUNC(
drawer_realize_cb),
drawer);
gtk_signal_connect_after(GTK_OBJECT(drawer->drawer),
"realize",
GTK_SIGNAL_FUNC(drawer_realize_cb),
drawer);
applet_add_callback(applet_count-1,"properties",
GNOME_STOCK_MENU_PROP,
_("Properties..."));
} else if(strcmp(id_str,SWALLOW_ID) == 0) {
Swallow *swallow;
swallow = create_swallow_applet(params, width, height,
SWALLOW_HORIZONTAL);
if(!swallow)
return;
register_toy(swallow->table,NULL,swallow,SWALLOW_ID,
path, params,pos, panel,NULL,
APPLET_SWALLOW);
if(path && *path) {
char *s = g_copy_strings("(true; ",path," &)",NULL);
system(s);
g_free(s);
}
} else if(strcmp(id_str,LOGOUT_ID) == 0) {
GtkWidget *logout;
......@@ -626,37 +598,16 @@ load_applet(char *id_str, char *path, char *params, int width, int height,
if(logout)
register_toy(logout,NULL,NULL,LOGOUT_ID,NULL,params,
pos, panel,NULL,APPLET_LOGOUT);
}
}
static void
load_queued_applets(void)
{
GList *list;
for(list = load_queue;list!=NULL;list=g_list_next(list)) {
LoadApplet *l=list->data;
load_applet(l->id_str,l->path,l->params,l->width,l->height,
l->pixmap,l->tooltip,
l->pos,l->panel,l->cfgpath);
g_free(l->id_str);
if(l->path) g_free(l->path);
g_free(l->params);
g_free(l->pixmap);
g_free(l->tooltip);
g_free(l->cfgpath);
g_free(l);
}
g_list_free(load_queue);
} else
g_assert_not_reached();
}
static void
load_default_applets(void)
{
queue_load_applet(MENU_ID,NULL,".",0,0,NULL,NULL,
PANEL_UNKNOWN_APPLET_POSITION,panels->data,NULL);
queue_load_applet(EXTERN_ID,"gen_util_applet","--clock",0,0,NULL,NULL,
PANEL_UNKNOWN_APPLET_POSITION,panels->data,NULL);
load_menu_applet(NULL,0, PANEL_UNKNOWN_APPLET_POSITION,panels->data);
load_applet(EXTERN_ID,"gen_util_applet","--clock",
PANEL_UNKNOWN_APPLET_POSITION,panels->data,NULL);
/*we laoded default applets, so we didn't find the config or
something else was wrong, so do complete save when next syncing*/
need_complete_save = TRUE;
......@@ -672,30 +623,25 @@ init_user_applets(void)
count=gnome_config_get_int(buf);
for(num=1;num<=count;num++) {
char *applet_name;
char *applet_params;
char *applet_pixmap;
char *applet_tooltip;
char *applet_path;
int applet_width,applet_height;
int pos=0,panel_num;
PanelWidget *panel;
g_snprintf(buf,256,"%sApplet_%d/config/", old_panel_cfg_path, num);
g_snprintf(buf,256,"%sApplet_%d/config/",
old_panel_cfg_path, num);
gnome_config_push_prefix(buf);
applet_name = gnome_config_get_string("id=Unknown");
if(strcmp(applet_name,EMPTY_ID)==0) {
g_free(applet_name);
gnome_config_pop_prefix();
continue;
} else if(strcmp(applet_name,"Unknown")==0) {
g_warning("Unknown applet type!");
g_free(applet_name);
gnome_config_pop_prefix();
continue;
}
applet_path = gnome_config_get_string("execpath=");
applet_params = gnome_config_get_string("parameters=");
applet_pixmap = gnome_config_get_string("pixmap=");
applet_tooltip = gnome_config_get_string("tooltip=");
applet_width = gnome_config_get_int("width=0");
applet_height = gnome_config_get_int("height=0");
g_snprintf(buf,256,"position=%d",
PANEL_UNKNOWN_APPLET_POSITION);
pos = gnome_config_get_int(buf);
......@@ -709,27 +655,52 @@ init_user_applets(void)
} else
panel = list->data;
}
/*if we are to right stick this, make the number large,
INT_MAX/2 should allways be large enough */
pos += gnome_config_get_bool("right_stick=false")?INT_MAX/2:0;
if(strcmp(applet_name,EXTERN_ID) == 0) {
char *path = gnome_config_get_string("execpath=");
char *params = gnome_config_get_string("parameters=");
/*this is the config path to be passed to the applet
when it loads*/
g_snprintf(buf,256,"%sApplet_%d/",
old_panel_cfg_path,num);
load_applet(EXTERN_ID,path,params,pos,panel,buf);
g_free(path);
g_free(params);
} else if(strcmp(applet_name,LAUNCHER_ID) == 0) {
char *params = gnome_config_get_string("parameters=");
load_applet(LAUNCHER_ID,NULL,params,pos,panel,NULL);
g_free(params);
} else if(strcmp(applet_name,LOGOUT_ID) == 0) {
load_applet(LAUNCHER_ID,NULL,NULL,pos,panel,NULL);
} else if(strcmp(applet_name,SWALLOW_ID) == 0) {
char *path = gnome_config_get_string("execpath=");
char *params = gnome_config_get_string("parameters=");
int width = gnome_config_get_int("width=0");
int height = gnome_config_get_int("height=0");
load_swallow_applet(path,params,width,height,pos,panel);
g_free(path);
g_free(params);
} else if(strcmp(applet_name,MENU_ID) == 0) {
char *params = gnome_config_get_string("parameters=");
int main_menu_type =
gnome_config_get_int("main_menu_type=0");
load_menu_applet(params,main_menu_type,pos,panel);
g_free(params);
} else if(strcmp(applet_name,DRAWER_ID) == 0) {
char *params = gnome_config_get_string("parameters=");
char *pixmap = gnome_config_get_string("pixmap=");
char *tooltip = gnome_config_get_string("tooltip=");
load_drawer_applet(params,pixmap,tooltip,pos,panel);
g_free(params);
g_free(pixmap);
g_free(tooltip);
} else
g_warning("Unknown applet type!");
gnome_config_pop_prefix();
/*this is the config path to be passed to the applet when it
loads*/
g_snprintf(buf,256,"%sApplet_%d/",old_panel_cfg_path,num);
queue_load_applet(applet_name, applet_path, applet_params,
applet_width,applet_height,
applet_pixmap, applet_tooltip,
pos, panel, buf);
g_free(applet_name);
if(applet_path) g_free(applet_path);
g_free(applet_params);
g_free(applet_pixmap);
g_free(applet_tooltip);
}
}
......@@ -1987,16 +1958,14 @@ main(int argc, char **argv)
gnome_config_pop_prefix();
init_user_panels();
init_user_applets();
panel_tooltips = gtk_tooltips_new();
init_user_applets();
/*set the globals*/
apply_global_config();
/*everything is ready ... load up the applets*/
load_queued_applets();
/*add forbidden lists to ALL panels*/
g_list_foreach(panels,(GFunc)panel_widget_add_forbidden,NULL);
......
......@@ -25,9 +25,14 @@ struct _PanelData {
just get the that one*/
PanelWidget * get_def_panel_widget(GtkWidget *panel);
void load_applet(char *id, char *path, char *params, int width, int height,
char *pixmap, char *tooltip,
void load_applet(char *id, char *path, char *params,
int pos, PanelWidget *panel, char *cfgpath);
void load_swallow_applet(char *path, char *params, int width, int height,
int pos, PanelWidget *panel);
void load_menu_applet(char *params, int main_menu_type,
int pos, PanelWidget *panel);
void load_drawer_applet(char *params, char *pixmap, char *tooltip,
int pos, PanelWidget *panel);
void orientation_change(int applet_id, PanelWidget *panel);
void back_change(int applet_id, PanelWidget *panel);
......
......@@ -47,7 +47,7 @@ extern int need_complete_save;
typedef struct _FileInfo FileInfo;
struct _FileInfo {
char *name;
time_t ctime;
time_t mtime;
};
typedef struct _MenuFinfo MenuFinfo;
......@@ -82,7 +82,7 @@ about_cb (GtkWidget *widget, gpointer data)
about = gnome_about_new ( "The GNOME Panel", VERSION,
"(C) 1998 the Free Software Foundation",
authors,
(char **)authors,
"This program is responsible for launching "
"other applications, embedding small applets "
"within itself, world peace, and random X crashes.",
......@@ -173,7 +173,7 @@ free_string (GtkWidget *widget, void *data)
static int
add_to_panel (char *applet, char *path, char *arg)
{
load_applet(applet,path,arg,0,0,NULL,NULL,
load_applet(applet,path,arg,
PANEL_UNKNOWN_APPLET_POSITION,
current_panel,NULL);
return TRUE;
......@@ -188,11 +188,30 @@ add_app_to_panel (GtkWidget *widget, void *data)
}
static int
add_dir_to_panel (GtkWidget *widget, void *data)
add_menu_to_panel (GtkWidget *widget, void *data)
{
return add_to_panel (MENU_ID, NULL, data);
load_menu_applet(data,0,
PANEL_UNKNOWN_APPLET_POSITION,
current_panel);
return TRUE;
}
static int
add_drawer_to_panel (GtkWidget *widget, void *data)
{
load_drawer_applet(NULL,NULL,NULL,
PANEL_UNKNOWN_APPLET_POSITION,
current_panel);
return TRUE;
}
static int
add_logout_to_panel (GtkWidget *widget, void *data)
{
return add_to_panel(LOGOUT_ID,NULL,NULL);
}
static int
add_applet (GtkWidget *w, gpointer data)
......@@ -227,7 +246,7 @@ check_finfo_list(GList *finfo)
fi = finfo->data;
if (stat (fi->name, &s) == -1)
continue;
if(fi->ctime != s.st_ctime)
if(fi->mtime != s.st_mtime)
return FALSE;
}
return TRUE;
......@@ -244,7 +263,7 @@ make_finfo(char *name)
fi = g_new(FileInfo,1);
fi->name = g_strdup(name);
fi->ctime = s.st_ctime;
fi->mtime = s.st_mtime;
return fi;
}
......@@ -255,7 +274,7 @@ make_finfo_s(char *name, struct stat *s)
fi = g_new(FileInfo,1);
fi->name = g_strdup(name);
fi->ctime = s->st_ctime;
fi->mtime = s->st_mtime;
return fi;
}
......@@ -340,7 +359,7 @@ make_app_menu(GtkWidget *sub, char *pixmap_name,
dirname = g_strdup (filename);
gtk_menu_prepend (GTK_MENU (sub), menuitem);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC(add_dir_to_panel),
GTK_SIGNAL_FUNC(add_menu_to_panel),
dirname);
gtk_signal_connect (GTK_OBJECT (menuitem), "destroy",
GTK_SIGNAL_FUNC(free_string),
......@@ -816,12 +835,6 @@ panel_configure (GtkWidget *widget, void *data)
panel_config_global();
}
static void
add_applet_to_panel_data(GtkWidget *widget, gpointer data)
{
add_to_panel((char *)data, NULL, NULL);
}
static GtkWidget *
create_applets_menu(int fake_submenus)
{
......@@ -890,8 +903,8 @@ create_add_panel_submenu (void)
setup_menuitem (menuitem, 0, _("Drawer"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_applet_to_panel_data,
DRAWER_ID);
(GtkSignalFunc) add_drawer_to_panel,
NULL);
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Edge Panel"));
......@@ -945,15 +958,15 @@ create_panel_submenu (GtkWidget *app_menu, GtkWidget *applet_menu)
setup_menuitem (menuitem, 0, _("Add main menu"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_applet_to_panel_data,
MENU_ID);
(GtkSignalFunc) add_menu_to_panel,
NULL);
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add log out button"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_applet_to_panel_data,
LOGOUT_ID);
(GtkSignalFunc) add_logout_to_panel,
NULL);
menuitem = gtk_menu_item_new ();
......@@ -1032,9 +1045,10 @@ add_special_entries (GtkWidget *menu, GtkWidget *app_menu, GtkWidget *applet_men
}
static GtkWidget *
create_root_menu(int fake_submenus)
create_root_menu(int fake_submenus, MainMenuType type)
{
GtkWidget *root_menu;
GtkWidget *uroot_menu;
GtkWidget *app_menu;
GtkWidget *applet_menu;
char *menu_base = gnome_unconditional_datadir_file ("apps");
......@@ -1055,14 +1069,43 @@ create_root_menu(int fake_submenus)
menu_base = gnome_util_home_file ("apps");
menudir = g_concat_dir_and_file (menu_base, ".");
g_free (menu_base);
mkdir (menudir, 0755);
if (!g_file_exists (menudir))
mkdir (menudir, 0755);
if (g_file_exists (menudir)) {
root_menu = create_menu_at(root_menu,menudir,FALSE,FALSE,
NULL,fake_submenus);
if(type == MAIN_MENU_BOTH)
root_menu = create_menu_at(root_menu,menudir,FALSE,
FALSE, NULL,fake_submenus);
else
uroot_menu = create_menu_at(NULL,menudir,FALSE,FALSE,
NULL,fake_submenus);
app_menu = create_menu_at (app_menu,menudir, TRUE,FALSE,
NULL,fake_submenus);
}
} else if(type != MAIN_MENU_BOTH)
uroot_menu = gtk_menu_new();
g_free (menudir);
if(type == MAIN_MENU_USER) {
GtkWidget *menuitem;
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("System Menus"));
gtk_menu_append (GTK_MENU (uroot_menu), menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
root_menu);
gtk_signal_connect(GTK_OBJECT(menuitem),"select",
GTK_SIGNAL_FUNC(submenu_to_display),
NULL);
root_menu = uroot_menu;
} else if(type == MAIN_MENU_SYSTEM) {
GtkWidget *menuitem;
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("User Menus"));
gtk_menu_append (GTK_MENU (root_menu), menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
uroot_menu);
gtk_signal_connect(GTK_OBJECT(menuitem),"select",
GTK_SIGNAL_FUNC(submenu_to_display),
NULL);
}
applet_menu = create_applets_menu(FALSE);
add_special_entries (root_menu, app_menu, applet_menu);
......@@ -1076,7 +1119,7 @@ add_menu_widget (Menu *menu, GList *menudirl, int main_menu, int fake_subs)
GList *li;
if (main_menu)
menu->menu = create_root_menu(fake_subs);
menu->menu = create_root_menu(fake_subs, menu->main_menu_type);
else {
menu->menu = NULL;
for(li=menudirl;li!=NULL;li=g_list_next(li))
......@@ -1171,7 +1214,7 @@ get_pixmap(char *menudir, PanelOrientType orient, int main_menu)
static Menu *
create_panel_menu (char *menudir, int main_menu,
PanelOrientType orient)
PanelOrientType orient, MainMenuType main_menu_type)
{
GtkWidget *pixmap;
Menu *menu;
......@@ -1183,6 +1226,8 @@ create_panel_menu (char *menudir, int main_menu,
pixmap_name = get_pixmap(menudir,orient,main_menu);
menu->orient = orient;
menu->main_menu_type = main_menu_type;
/* main button */
menu->button = gtk_button_new ();
......@@ -1219,7 +1264,7 @@ create_panel_menu (char *menudir, int main_menu,
}
Menu *