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

port more things to ditem

Thu Sep 27 01:03:48 2001  George Lebl <jirka@5z.com>

	* menu.c: port more things to ditem

	* main.c: fix segfault, change the warning dialog so that people
	  don't have to set evil env variables

	* *.c: fix includes, replace g_concat_dir_and_file with
	  g_build_filename, and g_basename with g_path_get_basename,
	  uncomment a couple more things that now compile.  Whack the
	  references to the hacks.  Use new help API for the help stuff.
parent 6c43e240
Thu Sep 27 01:03:48 2001 George Lebl <jirka@5z.com>
* menu.c: port more things to ditem
* main.c: fix segfault, change the warning dialog so that people
don't have to set evil env variables
* *.c: fix includes, replace g_concat_dir_and_file with
g_build_filename, and g_basename with g_path_get_basename,
uncomment a couple more things that now compile. Whack the
references to the hacks. Use new help API for the help stuff.
2001-09-26 Christian Rose <menthos@menthos.com>
* panel.hints: Fix reported "medans" typo.
......
......@@ -120,7 +120,7 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
if (strcmp (menu->name, "properties") == 0) {
launcher_properties (menu->info->data);
} else if (strcmp (menu->name, "help") == 0) {
panel_show_help ("launchers.html");
panel_show_help ("launchers", NULL);
} else if (strcmp (menu->name, "help_on_app") == 0) {
Launcher * launcher = menu->info->data;
if (launcher->ditem != NULL) {
......@@ -143,12 +143,12 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
g_assert(drawer);
panel_config(drawer->drawer);
} else if (strcmp (menu->name, "help") == 0) {
panel_show_help ("drawers.html");
panel_show_help ("drawers", NULL);
}
break;
case APPLET_SWALLOW:
if (strcmp (menu->name, "help") == 0)
panel_show_help ("specialobjects.html#SWALLOWEDAPP");
panel_show_help ("specialobjects", "SWALLOWEDAPP");
#if 0
if(strcmp(menu->name,"properties")==0) {
Swallow *swallow = info->data;
......@@ -170,8 +170,8 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
Menu *menu2 = menu->info->data;
char *page;
page = (menu2->path && strcmp (menu2->path,"."))
? "menus.html" : "mainmenu.html";
panel_show_help (page);
? "menus" : "mainmenu";
panel_show_help (page, NULL);
}
break;
case APPLET_LOCK: {
......@@ -189,7 +189,7 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
char *command = NULL;
gboolean freeit = FALSE;
if (strcmp (menu->name, "help") == 0)
panel_show_help ("specialobjects.html#LOCKBUTTON");
panel_show_help ("specialobjects", "LOCKBUTTON");
else if (!strcmp (menu->name, "restart")) {
command = "xscreensaver-command -exit ; xscreensaver &";
} else if (!strcmp (menu->name, "prefs")) {
......@@ -207,15 +207,15 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
}
case APPLET_LOGOUT:
if (strcmp (menu->name, "help") == 0)
panel_show_help ("specialobjects.html#LOGOUTBUTTON");
panel_show_help ("specialobjects", "LOGOUTBUTTON");
break;
case APPLET_STATUS:
if (strcmp (menu->name, "help") == 0)
panel_show_help ("specialobjects.html#STATUSDOC");
panel_show_help ("specialobjects", "STATUSDOC");
break;
case APPLET_RUN:
if (strcmp (menu->name, "help") == 0)
panel_show_help ("specialobjects.html#RUNBUTTON");
panel_show_help ("specialobjects", "RUNBUTTON");
break;
default: break;
}
......@@ -383,7 +383,7 @@ setup_an_item(AppletUserMenu *menu,
/* if the item is a submenu and doesn't have it's menu
created yet*/
} else if(!menu->submenu) {
menu->submenu = hack_scroll_menu_new();
menu->submenu = gtk_menu_new ();
}
if(menu->submenu) {
......@@ -445,7 +445,7 @@ add_to_submenus (AppletInfo *info,
}
if (s_menu->submenu == NULL) {
s_menu->submenu = hack_scroll_menu_new();
s_menu->submenu = gtk_menu_new ();
/*a more elegant way to do this should be done
when I don't want to go to sleep */
if (s_menu->menuitem != NULL) {
......@@ -469,7 +469,7 @@ create_applet_menu (AppletInfo *info, gboolean is_basep)
GList *user_menu = info->user_menu;
gchar *pixmap;
info->menu = hack_scroll_menu_new ();
info->menu = gtk_menu_new ();
if ( ! commie_mode) {
menuitem = gtk_menu_item_new();
......@@ -490,7 +490,7 @@ create_applet_menu (AppletInfo *info, gboolean is_basep)
gtk_menu_shell_append(GTK_MENU_SHELL(info->menu), menuitem);
}
panel_menu = hack_scroll_menu_new();
panel_menu = gtk_menu_new ();
make_panel_submenu (panel_menu, TRUE, is_basep);
menuitem = gtk_menu_item_new ();
......
......@@ -253,7 +253,7 @@ append_gnome_menu (FoobarWidget *foo, GtkWidget *menu_bar)
};
menu = hack_scroll_menu_new ();
menu = gtk_menu_new ();
for (i=0; url[i][1]; i++)
gtk_menu_shell_append (GTK_MENU_SHELL (menu),
......@@ -352,7 +352,7 @@ append_desktop_menu (GtkWidget *menu_bar)
};
GList *gmc_menu_items = NULL;
menu = hack_scroll_menu_new ();
menu = gtk_menu_new ();
for (i=0; arrange[i]; i+=2)
append_gmc_item (menu, _(arrange[i]), arrange[i+1]);
......@@ -363,7 +363,7 @@ append_desktop_menu (GtkWidget *menu_bar)
add_tearoff (GTK_MENU_SHELL (menu));
menu = hack_scroll_menu_new ();
menu = gtk_menu_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
......@@ -591,7 +591,7 @@ append_clock_menu (FoobarWidget *foo, GtkWidget *menu_bar)
NULL
};
menu = hack_scroll_menu_new ();
menu = gtk_menu_new ();
#if 0 /* put back when evolution can do this */
item = gtk_menu_item_new_with_label (_("Add appointement..."));
......@@ -614,7 +614,7 @@ append_clock_menu (FoobarWidget *foo, GtkWidget *menu_bar)
add_menu_separator (menu);
menu2 = hack_scroll_menu_new ();
menu2 = gtk_menu_new ();
for (i=0; formats[i]; i++)
append_format_item (menu2, formats[i]);
......@@ -730,7 +730,7 @@ programs_menu_to_display(GtkWidget *menu)
static void
set_the_task_submenu (FoobarWidget *foo, GtkWidget *item)
{
foo->task_menu = hack_scroll_menu_new ();
foo->task_menu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), foo->task_menu);
/*g_message ("setting...");*/
}
......
......@@ -1304,7 +1304,7 @@ misc_notebook_page(void)
static void
help (GtkWidget *capplet)
{
panel_show_help ("globalpanelprefs.html");
panel_show_help ("globalpanelprefs", NULL);
}
static void
......
......@@ -1304,7 +1304,7 @@ misc_notebook_page(void)
static void
help (GtkWidget *capplet)
{
panel_show_help ("globalpanelprefs.html");
panel_show_help ("globalpanelprefs", NULL);
}
static void
......
......@@ -193,7 +193,7 @@ string_callback (GtkWidget *w, int button_num, gpointer data)
use_advanced = gnome_config_get_bool ("/panel/State/"ADVANCED_DIALOG_KEY"=false");
if (button_num == 2/*help*/) {
panel_show_help ("specialobjects.html#RUNBUTTON");
panel_show_help ("specialobjects", "RUNBUTTON");
/* just return as we don't want to close */
return;
} else if (button_num == 1/*cancel*/) {
......
......@@ -534,7 +534,7 @@ window_clicked (GtkWidget *w, int button, gpointer data)
Launcher *launcher = data;
if (button == HELP_BUTTON) {
panel_show_help ("launchers.html");
panel_show_help ("launchers", NULL);
} else if (button == REVERT_BUTTON) { /* revert */
gnome_ditem_edit_set_ditem (GNOME_DITEM_EDIT (launcher->dedit),
launcher->revert_ditem);
......@@ -690,7 +690,7 @@ really_add_launcher(GtkWidget *dialog, int button, gpointer data)
panel_config_sync_schedule ();
} else if (button == 2/*help*/) {
panel_show_help ("launchers.html#LAUNCHERS");
panel_show_help ("launchers", "LAUNCHERS");
/* just return as we don't want to close */
return;
}
......
......@@ -347,9 +347,9 @@ find_kde_directory(void)
NULL
};
if(kdedir) {
kde_menudir = g_concat_dir_and_file(kdedir,"share/applnk");
kde_icondir = g_concat_dir_and_file(kdedir,"share/icons");
kde_mini_icondir = g_concat_dir_and_file(kdedir,"share/icons/mini");
kde_menudir = g_build_filename (kdedir, "share", "applnk", NULL);
kde_icondir = g_build_filename (kdedir, "share", "icons", NULL);
kde_mini_icondir = g_build_filename (kdedir, "share", "icons", "mini", NULL);
return;
}
......@@ -363,11 +363,11 @@ find_kde_directory(void)
for(i=0;try_prefixes[i];i++) {
char *try;
try = g_concat_dir_and_file(try_prefixes[i],"share/applnk");
try = g_build_filename (try_prefixes[i], "share", "applnk", NULL);
if(g_file_test(try,G_FILE_TEST_IS_DIR)) {
kde_menudir = try;
kde_icondir = g_concat_dir_and_file(try_prefixes[i],"share/icons");
kde_mini_icondir = g_concat_dir_and_file(try_prefixes[i],"share/icons/mini");
kde_icondir = g_build_filename (try_prefixes[i], "share", "icons", NULL);
kde_mini_icondir = g_build_filename (try_prefixes[i], "share", "icons", "mini", NULL);
return;
}
g_free(try);
......@@ -430,38 +430,24 @@ kill_free_drawers (void)
}
static void
do_the_roswell_check (void)
tell_user_Im_on_crack (void)
{
GtkWidget *dialog;
/*
* Even if this warning sounds funny - do NOT turn this
* startup protection off unless you know exactly what
* you're doing - you have been warned.
*/
if (g_getenv ("GNOME_WATCHED_ROSWELL_IN_TV"))
return;
dialog = gtk_message_dialog_new
(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
"Hi there,\n\n"
"I'm the GNOME 2 version of the panel.\n\n"
"Unfortunately, I'm still very unstable and clumsy - and most\n"
"likely I'll ruin your whole desktop if you try to run me.\n\n"
"However, as a well-behaving child I'm following my creator's\n"
"advice and won't go anywhere without his guidance.\n\n"
"So, I suggest you just lean back in your chair, have a cool\n"
"Koelsch and watch Roswell in your TV, it's really a cool\n"
"series :-)\n\n"
"Hopefully I will be grown-up soon and I promise - we'll still\n"
"have a lot of fun ....");
gtk_dialog_run (GTK_DIALOG (dialog));
(NULL /* parent */,
0 /* flags */,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_YES_NO,
_("This is the GNOME2 panel, it is likely that it will crash,\n"
"destroy configuration, cause another world war, and most\n"
"likely just plain not work. Use at your own risk.\n\n"
"Do you really want to run it?"));
if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_YES)
exit (0);
gtk_widget_destroy (dialog);
exit (0);
}
int
......@@ -478,7 +464,7 @@ main(int argc, char **argv)
LIBGNOMEUI_MODULE,
argc, argv, NULL);
do_the_roswell_check ();
tell_user_Im_on_crack ();
orb = bonobo_orb ();
#ifdef FIXME
......@@ -539,7 +525,6 @@ main(int argc, char **argv)
#ifndef PER_SESSION_CONFIGURATION
real_global_path = gnome_config_get_real_path (old_panel_cfg_path);
real_global_path = "";
if ( ! g_file_test (real_global_path, G_FILE_TEST_EXISTS)) {
g_free (old_panel_cfg_path);
old_panel_cfg_path = g_strdup ("/panel.d/default/");
......
......@@ -86,7 +86,7 @@ static GSList *
get_presorted_from(GSList *list, const char *dir, gboolean merged)
{
char buf[PATH_MAX+1];
char *fname = g_concat_dir_and_file(dir, ".order");
char *fname = g_build_filename (dir, ".order", NULL);
FILE *fp = fopen(fname, "r");
if(!fp) {
......@@ -367,7 +367,7 @@ fr_fill_dir(FileRec *fr, int sublevels)
ffr = g_chunk_new0 (FileRec, file_chunk);
ffr->type = FILE_REC_EXTRA;
ffr->name = g_concat_dir_and_file (fr->name, ".order");
ffr->name = g_build_filename (fr->name, ".order", NULL);
ffr->parent = dr;
if (stat (ffr->name, &s) != -1)
ffr->mtime = s.st_mtime;
......@@ -386,9 +386,9 @@ fr_fill_dir(FileRec *fr, int sublevels)
g_slist_free_1(tmp);
if ( ! mfile->merged) {
name = g_concat_dir_and_file (fr->name, mfile->name);
name = g_build_filename (fr->name, mfile->name, NULL);
} else if (mergedir != NULL) {
name = g_concat_dir_and_file (mergedir, mfile->name);
name = g_build_filename (mergedir, mfile->name, NULL);
} else {
free_mfile (mfile);
continue;
......@@ -530,7 +530,7 @@ fr_read_dir (DirRec *dr, const char *mdir, struct stat *dstat,
fr->name = g_strdup (mdir);
s.st_mtime = 0;
fname = g_concat_dir_and_file (mdir, ".directory");
fname = g_build_filename (mdir, ".directory", NULL);
if (dr->ditemlast_stat >= curtime-STAT_EVERY ||
stat (fname, &s) != -1) {
GnomeDesktopItem *ditem;
......@@ -671,8 +671,9 @@ fr_check_and_reread (FileRec *fr)
switch(ffr->type) {
case FILE_REC_DIR:
ddr = (DirRec *)ffr;
p = g_concat_dir_and_file(ffr->name,
".directory");
p = g_build_filename (ffr->name,
".directory",
NULL);
if (ddr->ditemlast_stat >= curtime-STAT_EVERY) {
g_free (p);
break;
......
......@@ -18,6 +18,8 @@
#include <limits.h>
#include <errno.h>
#include <libgnomeui/libgnomeui.h>
#include "panel-include.h"
/*#define PANEL_DEBUG 1*/
......@@ -69,8 +71,8 @@ get_real_menu_path(const char *arguments)
else if (*arguments == '/')
this_menu = g_strdup (arguments);
else if (*arguments == '~')
this_menu = g_concat_dir_and_file (g_get_home_dir(),
&arguments[1]);
this_menu = g_build_filename (g_get_home_dir(),
&arguments[1], NULL);
else
this_menu = gnome_unconditional_datadir_file (arguments);
......@@ -90,25 +92,27 @@ get_pixmap(const char *menudir, gboolean main_menu)
char *pixmap_name = NULL;
if (main_menu) {
pixmap_name = gnome_unconditional_pixmap_file("gnome-logo-icon-transparent.png");
#ifdef FIXME
} else {
char *dentry_name;
GnomeDesktopItem *item_info;
dentry_name = g_concat_dir_and_file (menudir,
".directory");
item_info = gnome_desktop_entry_load (dentry_name);
dentry_name = g_build_filename (menudir,
".directory",
NULL);
item_info = gnome_desktop_item_new_from_file (dentry_name,
0 /* flags */,
NULL /* error */);
g_free (dentry_name);
if(item_info && item_info->icon)
pixmap_name = g_strdup(item_info->icon);
else
if (item_info != NULL)
pixmap_name = gnome_desktop_item_get_icon (item_info);
if (pixmap_name == NULL)
pixmap_name =
gnome_unconditional_pixmap_file ("gnome-folder.png");
if (item_info)
gnome_desktop_entry_free(item_info);
#endif
if (item_info != NULL)
gnome_desktop_item_unref (item_info);
}
return pixmap_name;
}
......@@ -427,18 +431,16 @@ add_menu_type_options(Menu *menu, GtkObject *dialog, GtkTable *table, int row,
static void
dialog_clicked (GtkWidget *widget, int button, gpointer data)
{
#ifdef FIXME
Menu *menu = data;
if (button == 0 /* close */) {
gnome_dialog_close (GNOME_DIALOG (widget));
} else if (button == 1 /* help */) {
if (GTK_TOGGLE_BUTTON (menu->dialog_info->main_menu)->active)
panel_show_help ("mainmenu.html#MAINMENUCONFIG");
panel_show_help ("mainmenu", "MAINMENUCONFIG");
else
panel_show_help ("menus.html");
panel_show_help ("menus", NULL);
}
#endif
}
static GtkWidget *
......
......@@ -214,7 +214,7 @@ add_redhat_entry(GSList *list, char *file)
rh->u.item.icon = NULL;
}
} else {
rh->u.item.icon = g_concat_dir_and_file("/usr/share/icons", s);
rh->u.item.icon = g_build_filename ("/usr/share/icons", s, NULL);
if ( ! g_file_test (rh->u.item.icon,
G_FILE_TEST_EXISTS)) {
g_free(rh->u.item.icon);
......@@ -233,7 +233,7 @@ add_redhat_entry(GSList *list, char *file)
rh->u.item.mini_icon = NULL;
}
} else {
rh->u.item.mini_icon = g_concat_dir_and_file("/usr/share/icons/mini", s);
rh->u.item.mini_icon = g_build_filename ("/usr/share/icons/mini", s, NULL);
if ( ! g_file_test (rh->u.item.mini_icon,
G_FILE_TEST_EXISTS)) {
g_free(rh->u.item.mini_icon);
......@@ -286,7 +286,7 @@ make_rh_submenu(char *dir, GSList *rhlist)
GSList *li;
FILE *fp;
char *order_file;
order_file = g_concat_dir_and_file(dir,".order");
order_file = g_build_filename (dir,".order", NULL);
fp = fopen(order_file,"w");
g_free(order_file);
for(li = rhlist;li!=NULL;li = g_slist_next(li)) {
......@@ -300,11 +300,11 @@ make_rh_submenu(char *dir, GSList *rhlist)
dentry.type = "Directory";
while((p=strchr(s,' '))) *p='_';
p = g_concat_dir_and_file(dir,s);
p = g_build_filename (dir, s, NULL);
g_free(s);
if(fp) fprintf(fp,"%s\n",sure_string(g_basename(p)));
mkdir(p,0755);
dentry.location = g_concat_dir_and_file(p,".directory");
dentry.location = g_build_filename (p, ".directory", NULL);
make_rh_submenu(p,ri->u.items);
/* free up the strings */
......@@ -323,7 +323,7 @@ make_rh_submenu(char *dir, GSList *rhlist)
gnome_config_make_vector(ri->u.item.exec,
&dentry.exec_length,
&dentry.exec);
dentry.location = g_concat_dir_and_file(dir,s);
dentry.location = g_build_filename (dir, s, NULL);
if(fp) fprintf(fp,"%s\n",s);
/* free up the location */
g_free(s);
......
This diff is collapsed.
......@@ -124,11 +124,6 @@ GtkWidget * create_root_menu (GtkWidget *root_menu,
/* some gtk code cut-n-paste action */
void our_gtk_menu_position (GtkMenu *menu);
/* Why the hell do we have a "hack", when we have scroll-menu in
* our own codebase? Well cuz I don't want to require panel code in
* scroll-menu, since people copy it around */
GtkWidget * hack_scroll_menu_new (void);
void panel_add_favourite (const char *source_dentry);
#define MENU_PATH "menu_path"
......
......@@ -1787,9 +1787,9 @@ update_config_type (BasePWidget *w)
static void
window_clicked (GtkWidget *w, int button, gpointer data)
{
#ifdef FIXME
GtkWidget *notebook = data;
char *help_path = gtk_object_get_data (GTK_OBJECT (w), "help_path");
const char *help_path = gtk_object_get_data (GTK_OBJECT (w), "help_path");
const char *help_linkid = gtk_object_get_data (GTK_OBJECT (w), "help_linkid");
if (button == 1) { /* help */
int tab;
......@@ -1797,13 +1797,12 @@ window_clicked (GtkWidget *w, int button, gpointer data)
tab = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
if (tab == 1)
panel_show_help ("panelproperties.html#PANELBACKTAB");
panel_show_help ("panelproperties", "PANELBACKTAB");
else
panel_show_help (help_path);
panel_show_help (help_path, help_linkid);
} else {
gnome_dialog_close (GNOME_DIALOG (w));
}
#endif
}
void
......@@ -1816,6 +1815,7 @@ panel_config (GtkWidget *panel)
BasePWidget *basep = BASEP_WIDGET (panel);
PanelWidget *pw = PANEL_WIDGET (basep->panel);
char *help_path = "";
char *help_linkid = NULL;
ppc = get_config_struct(panel);
/* return if the window is already up. */
......@@ -1879,7 +1879,8 @@ panel_config (GtkWidget *panel)
if(IS_EDGE_WIDGET(panel)) {
/* edge notebook page */
help_path = "panelproperties.html#EDGETAB";
help_path = "panelproperties";
help_linkid = "EDGETAB";
page = edge_notebook_page(ppc);
ppc->type_tab = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(ppc->type_tab), page);
......@@ -1889,7 +1890,8 @@ panel_config (GtkWidget *panel)
ppc->type_tab_label);
} else if(IS_ALIGNED_WIDGET(panel)) {
/* aligned notebook page */
help_path = "panelproperties.html#EDGETAB";
help_path = "panelproperties";
help_linkid = "EDGETAB";
page = aligned_notebook_page(ppc);
ppc->type_tab = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(ppc->type_tab), page);
......@@ -1899,7 +1901,8 @@ panel_config (GtkWidget *panel)
ppc->type_tab_label);
} else if(IS_SLIDING_WIDGET(panel)) {
/* sliding notebook page */
help_path = "panelproperties.html#EDGETAB";
help_path = "panelproperties";
help_linkid = "EDGETAB";
page = sliding_notebook_page(ppc);
ppc->type_tab = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(ppc->type_tab), page);
......@@ -1909,7 +1912,8 @@ panel_config (GtkWidget *panel)
ppc->type_tab_label);
} else if(IS_FLOATING_WIDGET(panel)) {
/* floating notebook page */
help_path = "panelproperties.html#EDGETAB";
help_path = "panelproperties";
help_linkid = "EDGETAB";
page = floating_notebook_page(ppc);
ppc->type_tab = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(ppc->type_tab), page);
......@@ -1923,7 +1927,8 @@ panel_config (GtkWidget *panel)
AppletInfo *info =
gtk_object_get_data(GTK_OBJECT(applet), "applet_info");
add_drawer_properties_page(ppc, GTK_NOTEBOOK (prop_nbook), info->data);
help_path = "drawers.html";
help_path = "drawers";
help_linkid = NULL;
/* we can't change to/from drawers anyhow */
ppc->type_tab = NULL;
}
......@@ -1935,6 +1940,8 @@ panel_config (GtkWidget *panel)
gtk_object_set_data (GTK_OBJECT (ppc->config_window), "help_path",
help_path);
gtk_object_set_data (GTK_OBJECT (ppc->config_window), "help_linkid",
help_linkid);
gtk_signal_connect (GTK_OBJECT (ppc->config_window), "clicked",
GTK_SIGNAL_FUNC (window_clicked),
prop_nbook);
......
......@@ -16,8 +16,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-program.h>
#include <libgnomeui/libgnomeui.h>
#include "panel-include.h"
......@@ -27,13 +26,14 @@ extern GSList *applets;
extern GSList *applets_last;
void
panel_show_help (const char *path)
panel_show_help (const char *doc_name, const char *linkid)
{
#ifdef FIXME
GnomeHelpMenuEntry help_entry = { "panel" };
help_entry.path = (char *)path;
gnome_help_display (NULL, &help_entry);
#endif
gnome_help_display (NULL /* program */,
doc_name,
linkid,
NULL);
/* FIXME: handle error */
}
static char *
......@@ -147,7 +147,6 @@ create_text_entry(GtkWidget *table,
UpdateFunction func,
gpointer data)
{
#ifdef FIXME
GtkWidget *wlabel;
GtkWidget *entry;
GtkWidget *t;
......@@ -178,9 +177,6 @@ create_text_entry(GtkWidget *table,
data);
}
return entry;
#else
return NULL;
#endif
}
GtkWidget *
......@@ -193,10 +189,8 @@ create_icon_entry(GtkWidget *table,
UpdateFunction func,
gpointer data)
{
#ifdef FIXME
GtkWidget *wlabel;
GtkWidget *entry;
GtkWidget *t;
wlabel = gtk_label_new(label);
gtk_misc_set_alignment(GTK_MISC(wlabel), 0.0, 0.5);
......@@ -207,14 +201,12 @@ create_icon_entry(GtkWidget *table,
GNOME_PAD_SMALL, GNOME_PAD_SMALL);
gtk_widget_show(wlabel);
entry = gnome_icon_entry_new(history_id,_("Browse"));
hack_icon_entry (GNOME_ICON_ENTRY (entry));
entry = gnome_icon_entry_new (history_id, _("Browse"));
gnome_icon_entry_set_pixmap_subdir(GNOME_ICON_ENTRY(entry), subdir);
if (text)
hack_icon_entry_set_icon(GNOME_ICON_ENTRY(entry),text);
gnome_icon_entry_set_pixmap_subdir (GNOME_ICON_ENTRY(entry), subdir);
if (text != NULL)
gnome_icon_entry_set_filename (GNOME_ICON_ENTRY(entry), text);
t = gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (entry));
gtk_table_attach(GTK_TABLE(table), entry,
cols, cole, 1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
......@@ -222,16 +214,13 @@ create_icon_entry(GtkWidget *table,
GNOME_PAD_SMALL, GNOME_PAD_SMALL);
if(func) {
gtk_object_set_data (GTK_OBJECT (t), "update_function", func);
gtk_signal_connect (GTK_OBJECT (t), "changed",
gtk_object_set_data (GTK_OBJECT (entry), "update_function", func);
gtk_signal_connect (GTK_OBJECT (entry), "changed",
GTK_SIGNAL_FUNC (updated),
data);
}
return entry;
#else
return NULL;
#endif
}
GList *
......
......@@ -29,7 +29,8 @@ GtkWidget * create_icon_entry (GtkWidget *table,
UpdateFunction func,
gpointer data);
void panel_show_help (const char *path);
void panel_show_help (const char *path,
const char *linkid);
GList * my_g_list_swap_next (GList *list,
GList *dl);
......
......@@ -979,7 +979,7 @@ drop_directory (PanelWidget *panel, int pos, const char *dir)
{
char *tmp;
tmp = g_concat_dir_and_file (dir, ".directory");
tmp = g_build_filename (dir, ".directory", NULL);
if (g_file_test (tmp, G_FILE_TEST_EXISTS)) {
g_free (tmp);
drop_menu (panel, pos, dir);
......@@ -987,7 +987,7 @@ drop_directory (PanelWidget *panel, int pos, const char *dir)
}
g_free (tmp);
tmp = g_concat_dir_and_file (dir, ".order");
tmp = g_build_filename (dir, ".order", NULL);
if (g_file_test (tmp, G_FILE_TEST_EXISTS)) {
g_free (tmp);
drop_menu (panel, pos, dir);
......@@ -1000,9 +1000,12 @@ drop_directory (PanelWidget *panel, int pos, const char *dir)
/* nautilus */
char *exec = g_strdup_printf ("nautilus %s",
panel_quote_string (dir));
char *base;
g_free (tmp);
load_launcher_applet_from_info (g_basename (dir),
base = g_path_get_basename (dir);
load_launcher_applet_from_info (base,
dir,
exec,
"gnome-folder.png",
......@@ -1010,6 +1013,7 @@ drop_directory (PanelWidget *panel, int pos, const char *dir)
pos,
TRUE);
g_free (exec);
g_free (base);
} else {
tmp = gnome_is_program_in_path ("gmc-client");
if (tmp != NULL) {
......