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

set the standard gnome program properties

Sun Nov 18 00:52:58 2001  George Lebl <jirka@5z.com>

	* Makefile.am, main.c:  set the standard gnome program properties

	* gnome-run.c, menu.c, panel-util.[ch]:  A little bit of
	  s/GnomeDialog/GtkDialog/

	* panel-util.[ch]: error box is now actually closable,
	  added an info box, and function to make dialog 'busy'

	* main.c, menu-fentry.[ch]: whack the mem chunks stuff

	* menu-fentry.c, menu.c, quick-desktop-item.[ch]: Lookup icons
	  before loading them, not during the creation of the menus

	* menu.c: convert one more ditem usage to qitem

	* menu-properties.c: get rid of gnome_icon_entry_gtk_entry usage
parent d6a8664f
Sun Nov 18 00:52:58 2001 George Lebl <jirka@5z.com>
* Makefile.am, main.c: set the standard gnome program properties
* gnome-run.c, menu.c, panel-util.[ch]: A little bit of
s/GnomeDialog/GtkDialog/
* panel-util.[ch]: error box is now actually closable,
added an info box, and function to make dialog 'busy'
* main.c, menu-fentry.[ch]: whack the mem chunks stuff
* menu-fentry.c, menu.c, quick-desktop-item.[ch]: Lookup icons
before loading them, not during the creation of the menus
* menu.c: convert one more ditem usage to qitem
* menu-properties.c: get rid of gnome_icon_entry_gtk_entry usage
Fri Nov 16 22:13:22 2001 George Lebl <jirka@5z.com>
* quick-desktop-reader.[ch], Makefile.am, gnome-run.c, menu-fentry.c:
......
......@@ -26,6 +26,10 @@ INCLUDES = \
-DGNOME_DATADIR=\""$(datadir)"\" \
-DGLADEDIR=\""$(datadir)/gnome/panel"\" \
-DGLOBAL_CONFDIR=\""$(sysconfdir)/gnome/panel-config"\" \
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\" \
$(PANEL_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
......
......@@ -182,8 +182,14 @@ get_environment (int *argc, char ***argv, int *envc, char ***envv)
g_list_free (envar);
}
enum {
HELP_BUTTON = 0,
CLOSE_BUTTON,
RUN_BUTTON
};
static void
string_callback (GtkWidget *w, int button_num, gpointer data)
run_dialog_response (GtkWidget *w, int response, gpointer data)
{
GtkEntry *entry;
GtkWidget *clist;
......@@ -200,17 +206,17 @@ 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*/) {
if (response == HELP_BUTTON) {
panel_show_help ("specialobjects", "RUNBUTTON");
/* just return as we don't want to close */
return;
} else if (button_num == 1/*cancel*/) {
} else if (response == CLOSE_BUTTON) {
goto return_and_close;
}
clist = gtk_object_get_data (GTK_OBJECT (run_dialog), "dentry_list");
terminal = GTK_TOGGLE_BUTTON (gtk_object_get_data(GTK_OBJECT(w),
"terminal"));
terminal = GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT(w),
"terminal"));
favorites = gtk_object_get_data (GTK_OBJECT (run_dialog), "favorites");
add_to_favourites = GTK_TOGGLE_BUTTON (favorites)->active;
......@@ -270,16 +276,18 @@ string_callback (GtkWidget *w, int button_num, gpointer data)
goto return_and_close;
}
if (strcmp (s, "you shall bring us a shrubbery") == 0) {
gnome_ok_dialog ("NI! NI! NI! NI! NI! NI!");
panel_info_dialog ("ni_ni_ni_ni",
"NI! NI! NI! NI! NI! NI!");
goto return_and_close;
}
if (strcmp (s, "supreme executive power") == 0) {
gnome_ok_dialog ("Listen -- strange women lying in\n"
"ponds distributing swords is no\n"
"basis for a system of government.\n"
"Supreme executive power derives from\n"
"a mandate from the masses, not from\n"
"some farcical aquatic ceremony!");
panel_info_dialog ("evil",
"Listen -- strange women lying in\n"
"ponds distributing swords is no\n"
"basis for a system of government.\n"
"Supreme executive power derives from\n"
"a mandate from the masses, not from\n"
"some farcical aquatic ceremony!");
goto return_and_close;
}
if (strcmp (s, "free the fish") == 0) {
......@@ -359,7 +367,7 @@ return_and_close:
g_strfreev (argv);
g_strfreev (temp_argv);
g_strfreev (envv);
gnome_dialog_close (GNOME_DIALOG (w));
gtk_widget_destroy (w);
}
static void
......@@ -583,6 +591,12 @@ advanced_contents_shown (GtkWidget *vbox,
/* does nothing at the moment */
}
static void
activate_run (GtkWidget *entry, GtkWidget *dialog)
{
gtk_dialog_response (GTK_DIALOG (dialog), RUN_BUTTON);
}
static GtkWidget*
create_advanced_contents (void)
{
......@@ -615,8 +629,9 @@ create_advanced_contents (void)
gtk_combo_set_use_arrows_always (GTK_COMBO (gentry), TRUE);
gtk_object_set_data (GTK_OBJECT (run_dialog), "entry", entry);
gnome_dialog_editable_enters (GNOME_DIALOG (run_dialog),
GTK_EDITABLE (entry));
gtk_signal_connect (GTK_OBJECT (entry), "activate",
GTK_SIGNAL_FUNC (activate_run),
run_dialog);
gtk_signal_connect (GTK_OBJECT (entry),
"changed",
GTK_SIGNAL_FUNC (entry_changed),
......@@ -954,7 +969,7 @@ select_row_handler (GtkCList *clist,
gtk_label_set_text (GTK_LABEL (desc_label),
sure_string (qitem->comment));
icon = quick_desktop_item_find_icon (qitem);
icon = quick_desktop_item_find_icon (qitem->icon);
if (icon != NULL) {
pixbuf = gdk_pixbuf_new_from_file (icon, NULL);
} else {
......@@ -1054,7 +1069,7 @@ create_simple_contents (void)
unset_selected (run_dialog);
w = create_toggle_advanced_button ("");
gtk_box_pack_end (GTK_BOX (GNOME_DIALOG (run_dialog)->vbox), w,
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (run_dialog)->vbox), w,
FALSE, FALSE, GNOME_PAD_SMALL);
gtk_object_ref (GTK_OBJECT (vbox));
......@@ -1069,7 +1084,7 @@ create_simple_contents (void)
GTK_SIGNAL_FUNC (simple_contents_shown),
run_dialog);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (run_dialog)->vbox),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (run_dialog)->vbox),
vbox,
TRUE, TRUE, 0);
......@@ -1095,7 +1110,7 @@ update_contents (GtkWidget *dialog)
advanced = gtk_object_get_data (GTK_OBJECT (dialog), "advanced");
if (advanced && advanced->parent == NULL) {
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
advanced,
FALSE, FALSE, 0);
......@@ -1143,7 +1158,18 @@ show_run_dialog (void)
use_advanced = gnome_config_get_bool ("/panel/State/"ADVANCED_DIALOG_KEY"=false");
run_dialog = gnome_dialog_new(_("Run Program"), NULL);
run_dialog = gtk_dialog_new_with_buttons (_("Run Program"),
NULL /* parent */,
0 /* flags */,
GTK_STOCK_HELP,
HELP_BUTTON,
GTK_STOCK_CLOSE,
CLOSE_BUTTON,
/* FIXME: how the hell do we get a different label but
* the execute stock icon */
GTK_STOCK_EXECUTE,
RUN_BUTTON,
NULL);
/* This is lame in advanced mode, but if you change it on mode
* toggle it creates weird effects, so always use this policy
......@@ -1156,7 +1182,7 @@ show_run_dialog (void)
gtk_window_set_default_size (GTK_WINDOW (run_dialog),
-1, 400);
#if FIXME
#ifdef FIXME
gnome_window_icon_set_from_file (GTK_WINDOW (run_dialog),
GNOME_ICONDIR"/gnome-run.png");
#endif
......@@ -1166,20 +1192,11 @@ show_run_dialog (void)
gtk_window_position(GTK_WINDOW(run_dialog), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (run_dialog), "run_dialog", "Panel");
gnome_dialog_append_button (GNOME_DIALOG (run_dialog),
GNOME_STOCK_BUTTON_HELP);
gnome_dialog_append_button (GNOME_DIALOG (run_dialog),
GNOME_STOCK_BUTTON_CANCEL);
gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (run_dialog),
_("Run"),
GTK_STOCK_EXECUTE);
gnome_dialog_set_default (GNOME_DIALOG (run_dialog), 2);
gtk_dialog_set_default_response (GTK_DIALOG (run_dialog),
RUN_BUTTON);
gtk_signal_connect (GTK_OBJECT (run_dialog), "clicked",
GTK_SIGNAL_FUNC (string_callback), NULL);
gtk_signal_connect (GTK_OBJECT (run_dialog), "response",
GTK_SIGNAL_FUNC (run_dialog_response), NULL);
create_simple_contents ();
create_advanced_contents ();
......
......@@ -492,7 +492,8 @@ main(int argc, char **argv)
gnome_program_init ("panel", VERSION,
LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_NONE);
GNOME_PROGRAM_STANDARD_PROPERTIES,
NULL);
bonobo_activate ();
......@@ -611,8 +612,6 @@ main(int argc, char **argv)
#ifdef FIXME
gwmh_init ();
#endif
init_fr_chunks ();
init_menus ();
......
......@@ -35,22 +35,12 @@
static GSList *dir_list = NULL;
static GMemChunk *file_chunk = NULL;
static GMemChunk *dir_chunk = NULL;
extern char *merge_main_dir;
extern int merge_main_dir_len;
extern char *merge_merge_dir;
extern GlobalConfig global_config;
void
init_fr_chunks (void)
{
file_chunk = g_mem_chunk_create (FileRec, 64, G_ALLOC_AND_FREE);
dir_chunk = g_mem_chunk_create (DirRec, 16, G_ALLOC_AND_FREE);
}
static GSList *
prepend_mfile (GSList *list, const char *name, gboolean merged,
gboolean verified)
......@@ -339,10 +329,7 @@ fr_free (FileRec *fr, gboolean free_fr)
}
if (free_fr) {
if (fr->type == FILE_REC_DIR)
g_chunk_free (fr, dir_chunk);
else
g_chunk_free (fr, file_chunk);
g_free (fr);
} else {
int type = fr->type;
if (fr->type == FILE_REC_DIR)
......@@ -369,7 +356,7 @@ fr_fill_dir(FileRec *fr, int sublevels)
g_return_if_fail (fr != NULL);
g_return_if_fail (fr->name != NULL);
ffr = g_chunk_new0 (FileRec, file_chunk);
ffr = g_new0 (FileRec, 1);
ffr->type = FILE_REC_EXTRA;
ffr->name = g_build_filename (fr->name, ".order", NULL);
ffr->parent = dr;
......@@ -444,7 +431,7 @@ fr_fill_dir(FileRec *fr, int sublevels)
}
}
if (qitem != NULL) {
ffr = g_chunk_new0 (FileRec, file_chunk);
ffr = g_new0 (FileRec, 1);
if (qitem->type != NULL &&
g_ascii_strcasecmp (qitem->type, "separator") == 0)
ffr->type = FILE_REC_SEP;
......@@ -455,7 +442,7 @@ fr_fill_dir(FileRec *fr, int sublevels)
ffr->mtime = s.st_mtime;
ffr->last_stat = curtime;
ffr->parent = dr;
ffr->icon = quick_desktop_item_find_icon (qitem);
ffr->icon = g_strdup (qitem->icon);
ffr->fullname = g_strdup (qitem->name);
ffr->comment = g_strdup (qitem->comment);
ffr->tryexec_path = tryexec_path;
......@@ -490,7 +477,7 @@ fr_read_dir (DirRec *dr, const char *mdir, struct stat *dstat,
/*this will zero all fields*/
if (dr == NULL) {
dr = g_chunk_new0 (DirRec, dir_chunk);
dr = g_new0 (DirRec, 1);
dr->force_reread = FALSE;
/* this must be set otherwise we may messup on
fr_free */
......@@ -541,7 +528,7 @@ fr_read_dir (DirRec *dr, const char *mdir, struct stat *dstat,
TRUE /* run_tryexec */);
if (qitem != NULL) {
g_free (fr->icon);
fr->icon = quick_desktop_item_find_icon (qitem);
fr->icon = g_strdup (qitem->icon);
g_free (fr->fullname);
fr->fullname = g_strdup (qitem->name);
g_free (fr->comment);
......@@ -700,25 +687,25 @@ fr_check_and_reread (FileRec *fr)
g_free(p);
break;
}
if(ddr->ditemmtime != s.st_mtime) {
if (ddr->ditemmtime != s.st_mtime) {
QuickDesktopItem *qitem;
qitem = quick_desktop_item_load_file (p /* file */,
NULL /* expected_type */,
TRUE /* run_tryexec */);
if(qitem) {
g_free(ffr->icon);
ffr->icon = quick_desktop_item_find_icon (qitem);
g_free(ffr->fullname);
if (qitem != NULL) {
g_free (ffr->icon);
ffr->icon = g_strdup (qitem->icon);
g_free (ffr->fullname);
ffr->fullname = g_strdup (qitem->name);
g_free(ffr->comment);
g_free (ffr->comment);
ffr->comment = g_strdup (qitem->comment);
quick_desktop_item_destroy (qitem);
} else {
g_free(ffr->icon);
g_free (ffr->icon);
ffr->icon = NULL;
g_free(ffr->fullname);
g_free (ffr->fullname);
ffr->fullname = NULL;
g_free(ffr->comment);
g_free (ffr->comment);
ffr->comment = NULL;
}
ddr->ditemmtime = s.st_mtime;
......@@ -741,7 +728,7 @@ fr_check_and_reread (FileRec *fr)
TRUE /* run_tryexec */);
if (qitem != NULL) {
g_free (ffr->icon);
ffr->icon = quick_desktop_item_find_icon (qitem);
ffr->icon = g_strdup (qitem->icon);
g_free (ffr->fullname);
ffr->fullname = g_strdup (qitem->name);
......
......@@ -75,8 +75,6 @@ char * fr_get_mergedir (const char *dir);
void fr_force_reread(void);
GSList* fr_get_all_dirs (void);
void init_fr_chunks (void);
void free_mfile (MFile *mfile);
void free_mfile_list (GSList *list);
......
......@@ -674,8 +674,7 @@ create_properties_dialog(Menu *menu)
gtk_widget_set_sensitive (w, FALSE);
}
gtk_box_pack_start(GTK_BOX(box), w, TRUE, TRUE, 0);
t = gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (w));
gtk_signal_connect (GTK_OBJECT (t), "changed",
gtk_signal_connect (GTK_OBJECT (w), "changed",
GTK_SIGNAL_FUNC (textbox_changed),
menu);
......
......@@ -58,6 +58,7 @@
#include "tearoffitem.h"
#include "title-item.h"
#include "panel-applet-frame.h"
#include "quick-desktop-reader.h"
#undef MENU_DEBUG
......@@ -122,6 +123,7 @@ typedef struct _FakeIcon FakeIcon;
struct _FakeIcon {
GtkWidget *fake;
char *file;
char *fallback;
int size;
};
......@@ -667,6 +669,9 @@ fake_destroyed(GtkWidget *w, FakeIcon *fake)
g_free (fake->file);
fake->file = NULL;
g_free (fake->fallback);
fake->fallback = NULL;
g_free (fake);
}
......@@ -679,8 +684,8 @@ load_icons_handler (gpointer data)
GdkPixbuf *pb, *pb2;
GdkPixmap *gp;
GdkBitmap *gm;
FakeIcon *fake;
char *file;
if (icons_to_load == NULL) {
load_icons_id = 0;
......@@ -696,16 +701,33 @@ load_icons_handler (gpointer data)
gtk_signal_disconnect_by_data(GTK_OBJECT(fake->fake), fake);
/* destroy and not unref, as it's already inside a parent */
gtk_widget_destroy(fake->fake);
gtk_widget_destroy (fake->fake);
fake->fake = NULL;
pb = gdk_pixbuf_new_from_file (fake->file, NULL);
file = quick_desktop_item_find_icon (fake->file);
if (file == NULL)
file = quick_desktop_item_find_icon (fake->fallback);
if (file == NULL) {
g_free (fake->file);
fake->file = NULL;
g_free (fake->fallback);
fake->fallback = NULL;
g_free (fake);
return TRUE;
}
pb = gdk_pixbuf_new_from_file (file, NULL);
if (pb == NULL) {
g_free (fake->file);
fake->file = NULL;
g_free (fake->fallback);
fake->fallback = NULL;
g_free (fake);
return TRUE;
}
g_free (file);
pb2 = gdk_pixbuf_new(GDK_COLORSPACE_RGB, gdk_pixbuf_get_has_alpha(pb),
8, fake->size, fake->size);
......@@ -795,15 +817,13 @@ fake_pixmap_from_fake(FakeIcon *fake)
}
static GtkWidget *
fake_pixmap_at_size (const char *file, int size)
fake_pixmap_at_size (const char *file, const char *fallback, int size)
{
FakeIcon *fake;
if ( ! g_file_test (file, G_FILE_TEST_EXISTS))
return NULL;
fake = g_new0 (FakeIcon, 1);
fake->file = g_strdup (file);
fake->fallback = g_strdup (fallback);
fake->size = size;
return fake_pixmap_from_fake (fake);
......@@ -826,7 +846,7 @@ validate_for_filename(char *file)
}
static void
really_add_new_menu_item (GtkWidget *d, int button, gpointer data)
really_add_new_menu_item (GtkWidget *d, int response, gpointer data)
{
GnomeDItemEdit *dedit = GNOME_DITEM_EDIT(data);
char *file, *dir = gtk_object_get_data(GTK_OBJECT(d), "dir");
......@@ -835,13 +855,15 @@ really_add_new_menu_item (GtkWidget *d, int button, gpointer data)
int i;
char *name, *loc;
if (button != 0) {
if (response != GTK_RESPONSE_OK) {
gtk_widget_destroy (d);
return;
}
g_return_if_fail (dir != NULL);
panel_push_window_busy (d);
ditem = gnome_ditem_edit_get_ditem (dedit);
#if 0
......@@ -890,6 +912,7 @@ really_add_new_menu_item (GtkWidget *d, int button, gpointer data)
* will see if we have write privilages */
fp = fopen (loc, "a");
if(fp == NULL) {
panel_pop_window_busy (d);
panel_error_dialog ("cant_open_for_writing",
_("Could not open file '%s' for writing"),
loc);
......@@ -905,6 +928,8 @@ really_add_new_menu_item (GtkWidget *d, int button, gpointer data)
/* FIXME: handle errors, better then the above hack */
gnome_desktop_item_unref (ditem);
panel_pop_window_busy (d);
gtk_widget_destroy (d);
g_free (loc);
}
......@@ -915,10 +940,15 @@ add_new_app_to_menu (GtkWidget *widget, const char *item_loc)
GtkWidget *dialog;
GtkWidget *dee;
dialog = gnome_dialog_new (_("Create menu item"),
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL,
NULL);
dialog = gtk_dialog_new_with_buttons (_("Create menu item"),
NULL /* parent */,
0 /* flags */,
GTK_STOCK_OK,
GTK_RESPONSE_OK,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
NULL);
gtk_window_set_wmclass (GTK_WINDOW (dialog),
"create_menu_item", "Panel");
gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, FALSE, TRUE);
......@@ -933,13 +963,12 @@ add_new_app_to_menu (GtkWidget *widget, const char *item_loc)
g_strdup (item_loc),
(GtkDestroyNotify)g_free);
gtk_signal_connect (GTK_OBJECT (dialog), "clicked",
gtk_signal_connect (GTK_OBJECT (dialog), "response",
GTK_SIGNAL_FUNC (really_add_new_menu_item),
dee);
gnome_dialog_close_hides (GNOME_DIALOG(dialog), FALSE);
gnome_dialog_set_default (GNOME_DIALOG(dialog), 0);
gtk_dialog_set_default_response (GTK_DIALOG(dialog),
GTK_RESPONSE_OK);
gtk_widget_show_all (dialog);
panel_set_dialog_layer (dialog);
......@@ -1113,7 +1142,7 @@ add_drawers_from_dir (const char *dirname, const char *name,
{
Drawer *drawer;
PanelWidget *newpanel;
GnomeDesktopItem *item_info;
QuickDesktopItem *item_info;
char *dentry_name;
const char *subdir_name;
char *pixmap_name;
......@@ -1128,16 +1157,16 @@ add_drawers_from_dir (const char *dirname, const char *name,
dentry_name = g_build_filename (dirname,
".directory",
NULL);
item_info = gnome_desktop_item_new_from_file (dentry_name,
GNOME_DESKTOP_ITEM_LOAD_ONLY_IF_EXISTS,
NULL);
item_info = quick_desktop_item_load_file (dentry_name,
NULL /* expected_type */,
FALSE /* run_tryexec */);
g_free (dentry_name);
if(!name)
subdir_name = item_info ? gnome_desktop_item_get_localestring (item_info, GNOME_DESKTOP_ITEM_NAME) : NULL;
if (name == NULL)
subdir_name = item_info != NULL ? item_info->name : NULL;
else
subdir_name = name;
pixmap_name = item_info?gnome_desktop_item_get_icon (item_info):NULL;
pixmap_name = item_info != NULL ? item_info->icon : NULL;
drawer = load_drawer_applet (-1, pixmap_name, subdir_name, panel, pos, FALSE);
if (!drawer) {
......@@ -1285,20 +1314,20 @@ restore_grabs(GtkWidget *w, gpointer data)
}
static void
ditem_properties_clicked (GtkWidget *w, int button, gpointer data)
ditem_properties_clicked (GtkWidget *w, int response, gpointer data)
{
GnomeDItemEdit *dee = gtk_object_get_user_data (GTK_OBJECT (w));
GnomeDesktopItem *ditem = data;
if (button == HELP_BUTTON) {
if (response == HELP_BUTTON) {
panel_show_help ("launchers", NULL);
} else if (button == REVERT_BUTTON) {
} else if (response == REVERT_BUTTON) {
if (ditem != NULL)
gnome_ditem_edit_set_ditem (dee, ditem);
else
gnome_ditem_edit_clear (dee);
} else {
gnome_dialog_close (GNOME_DIALOG (w));
gtk_widget_destroy (w);
}
}
......@@ -1398,7 +1427,7 @@ is_item_writable (const ShowItemMenu *sim)
}
static void
set_ditem_sensitive (GnomeDialog *dialog,
set_ditem_sensitive (GtkDialog *dialog,
GnomeDItemEdit *dedit,
ShowItemMenu *sim)
{
......@@ -1408,7 +1437,7 @@ set_ditem_sensitive (GnomeDialog *dialog,
gnome_ditem_edit_set_editable (dedit, sensitive);
gnome_dialog_set_sensitive (dialog, REVERT_BUTTON, sensitive);
gtk_dialog_set_response_sensitive (dialog, REVERT_BUTTON, sensitive);
}
static void
......@@ -1426,18 +1455,21 @@ edit_dentry (GtkWidget *widget, ShowItemMenu *sim)
NULL /* error */);
/* watch the enum at the top of the file */
dialog = gnome_dialog_new (_("Desktop entry properties"),
GNOME_STOCK_BUTTON_HELP,
_("Revert"),
GNOME_STOCK_BUTTON_CLOSE,
NULL);
gnome_dialog_set_close (GNOME_DIALOG (dialog),
FALSE /* click_closes */);
dialog = gtk_dialog_new_with_buttons (_("Desktop entry properties"),
NULL /* parent */,
0 /* flags */,
GTK_STOCK_HELP,
HELP_BUTTON,
GTK_STOCK_REVERT_TO_SAVED,
REVERT_BUTTON,
GTK_STOCK_CLOSE,
CLOSE_BUTTON,
NULL);
dedit = gnome_ditem_edit_new ();
gtk_widget_show (dedit);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
dedit, TRUE, TRUE, 0);
gtk_window_set_wmclass(GTK_WINDOW(dialog),
......@@ -1451,7 +1483,7 @@ edit_dentry (GtkWidget *widget, ShowItemMenu *sim)
if (ditem != NULL)
gnome_ditem_edit_set_ditem (GNOME_DITEM_EDIT (dedit), ditem);
set_ditem_sensitive (GNOME_DIALOG (dialog),
set_ditem_sensitive (GTK_DIALOG (dialog),
GNOME_DITEM_EDIT (dedit), sim);
gtk_signal_connect (GTK_OBJECT (dedit), "changed",
......@@ -1466,14 +1498,14 @@ edit_dentry (GtkWidget *widget, ShowItemMenu *sim)
if (ditem != NULL) {
/* pass the ditem as the data to clicked */
gtk_signal_connect_full (GTK_OBJECT (dialog), "clicked",
gtk_signal_connect_full (GTK_OBJECT (dialog), "response",
GTK_SIGNAL_FUNC (ditem_properties_clicked),
NULL,
ditem,
(GtkDestroyNotify) gnome_desktop_item_unref,
FALSE, FALSE);
} else {
gtk_signal_connect (GTK_OBJECT (dialog), "clicked",
gtk_signal_connect (GTK_OBJECT (dialog), "response",
GTK_SIGNAL_FUNC (ditem_properties_clicked),
NULL);
}
......@@ -1503,17 +1535,20 @@ edit_direntry (GtkWidget *widget, ShowItemMenu *sim)
}
/* watch the enum at the top of the file */
dialog = gnome_dialog_new (_("Desktop entry properties"),
GNOME_STOCK_BUTTON_HELP,
_("Revert"),
GNOME_STOCK_BUTTON_CLOSE,
NULL);
gnome_dialog_set_close (GNOME_DIALOG (dialog),
FALSE /* click_closes */);
dialog = gtk_dialog_new_with_buttons (_("Desktop entry properties"),
NULL /* parent */,
0 /* flags */,
GTK_STOCK_HELP,
HELP_BUTTON,
GTK_STOCK_REVERT_TO_SAVED,
REVERT_BUTTON,
GTK_STOCK_CLOSE,
CLOSE_BUTTON,
NULL);
notebook = gtk_notebook_new ();
gtk_widget_show (notebook);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
notebook, TRUE, TRUE, 0);
gtk_window_set_wmclass (GTK_WINDOW (dialog),
......@@ -1554,6 +1589,7 @@ edit_direntry (GtkWidget *widget, ShowItemMenu *sim)
/* This sucks, but there is no other way to do this with the current
GnomeDEntry API. */
#if 0
#define SETUP_EDITABLE(entry_name) \
gnome_dialog_editable_enters \
(GNOME_DIALOG (dialog), \
......@@ -1567,6 +1603,7 @@ edit_direntry (GtkWidget *widget, ShowItemMenu *sim)
SETUP_EDITABLE (doc);
#undef SETUP_EDITABLE
#endif
gtk_widget_set_sensitive (GNOME_DENTRY_EDIT(dedit)->exec_entry, FALSE);
gtk_widget_set_sensitive (GNOME_DENTRY_EDIT(dedit)->tryexec_entry, FALSE);
......@@ -1574,7 +1611,7 @@ edit_direntry (GtkWidget *widget, ShowItemMenu *sim)
gtk_widget_set_sensitive (GNOME_DENTRY_EDIT(dedit)->type_combo, FALSE);
gtk_widget_set_sensitive (GNOME_DENTRY_EDIT(dedit)->terminal_button, FALSE);
set_ditem_sensitive (GNOME_DIALOG (dialog),
set_ditem_sensitive (GTK_DIALOG (dialog),
GNOME_DENTRY_EDIT (dedit), sim);
gtk_signal_connect (GTK_OBJECT (dedit), "changed",
......@@ -1597,14 +1634,14 @@ edit_direntry (GtkWidget *widget, ShowItemMenu *sim)
if (dentry != NULL) {
/* pass the dentry as the data to clicked */
gtk_signal_connect_full (GTK_OBJECT (dialog), "clicked",
gtk_signal_connect_full (GTK_OBJECT (dialog), "response",
GTK_SIGNAL_FUNC (ditem_properties_clicked),
NULL,
dentry,
(GtkDestroyNotify) gnome_desktop_entry_free,
FALSE, FALSE);
} else {
gtk_signal_connect (GTK_OBJECT (dialog), "clicked",
gtk_signal_connect (GTK_OBJECT (dialog), "response",
GTK_SIGNAL_FUNC (ditem_properties_clicked),
NULL);
}
......@@ -3047,10 +3084,9 @@ create_menuitem (GtkWidget *menu,
}