diff -ruN old/mc-4.5.25/Specfile new/mc-4.5.26/Specfile --- old/mc-4.5.25/Specfile Fri Mar 12 21:02:29 1999 +++ new/mc-4.5.26/Specfile Sun Mar 14 19:19:25 1999 @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 4.5.25 +%define ver 4.5.26 %define rel 1 %define prefix /usr diff -ruN old/mc-4.5.25/VERSION new/mc-4.5.26/VERSION --- old/mc-4.5.25/VERSION Fri Mar 12 21:02:29 1999 +++ new/mc-4.5.26/VERSION Sun Mar 14 19:19:25 1999 @@ -1 +1 @@ -#define VERSION "4.5.25" +#define VERSION "4.5.26" diff -ruN old/mc-4.5.25/configure new/mc-4.5.26/configure --- old/mc-4.5.25/configure Fri Mar 12 21:02:29 1999 +++ new/mc-4.5.26/configure Sun Mar 14 19:19:25 1999 @@ -586,7 +586,7 @@ PACKAGE=mc -VERSION=4.5.25 +VERSION=4.5.26 cat >> confdefs.h < + + * gdesktop.c (text_changed): If the file has the "icon-caption" + metadata set, then change that instead of renaming the file. This + can be used by URLs and is also needed by the mountable device + icons. + (text_changed_url): Removed this function now that text_changed() + can handle all cases. + + * gdnd.c (drop_url_on_directory): Set the "icon-caption" metadata + for URLs. + + * gdesktop.c (icon_event): Handle button-2 clicks and drags + properly. + +1999-03-14 Miguel de Icaza + + * gmount.c (get_mountable_devices): Show error message if the + /etc/fstab is not readable by the user. + 1999-03-12 Miguel de Icaza * gview.c (scrollbar_moved): Better, but still shaggy when you diff -ruN old/mc-4.5.25/gnome/gdesktop.c new/mc-4.5.26/gnome/gdesktop.c --- old/mc-4.5.25/gnome/gdesktop.c Fri Mar 12 21:02:39 1999 +++ new/mc-4.5.26/gnome/gdesktop.c Sun Mar 14 19:19:37 1999 @@ -790,47 +790,47 @@ char *new_name; char *source; char *dest; + char *buf; + int size; int retval; dii = data; source = g_concat_dir_and_file (desktop_directory, dii->filename); new_name = gnome_icon_text_item_get_text (iti); - dest = g_concat_dir_and_file (desktop_directory, new_name); - if (mc_rename (source, dest) == 0) { - gnome_metadata_delete (dest); - gnome_metadata_rename (source, dest); - g_free (dii->filename); - dii->filename = g_strdup (new_name); - desktop_reload_icons (FALSE, 0, 0); - retval = TRUE; - } else - retval = FALSE; /* FIXME: maybe pop up a warning/query dialog? */ + if (gnome_metadata_get (source, "icon-caption", &size, &buf) != 0) { + /* No icon caption metadata, so rename the file */ - g_free (source); - g_free (dest); + dest = g_concat_dir_and_file (desktop_directory, new_name); - return retval; -} + if (mc_rename (source, dest) == 0) { + gnome_metadata_delete (dest); + gnome_metadata_rename (source, dest); + g_free (dii->filename); + dii->filename = g_strdup (new_name); + desktop_reload_icons (FALSE, 0, 0); + retval = TRUE; + } else + retval = FALSE; /* FIXME: maybe pop up a warning/query dialog? */ -/* - * Callback when an icon's text changes and the icon reprensents an - * URL - */ -static int -text_changed_url (GnomeIconTextItem *iti, gpointer data) -{ - DesktopIconInfo *dii = data; - char *fullname; - char *new_text; - - fullname = g_concat_dir_and_file (desktop_directory, dii->filename); - new_text = gnome_icon_text_item_get_text (iti); - gnome_metadata_set (fullname, "icon-caption", strlen (new_text) + 1, new_text); - desktop_reload_icons (FALSE, 0, 0); + g_free (dest); + } else { + /* The icon has the icon-caption metadata, so change that instead */ - return TRUE; + g_free (buf); + + buf = gnome_icon_text_item_get_text (iti); + if (*buf) { + gnome_metadata_set (source, "icon-caption", strlen (buf) + 1, buf); + desktop_reload_icons (FALSE, 0, 0); + retval = TRUE; + } else + retval = FALSE; + } + + g_free (source); + return retval; } /* Sets up the mouse grab for when a desktop icon is being edited */ @@ -1464,7 +1464,7 @@ switch (event->type) { case GDK_BUTTON_PRESS: - if (event->button.button == 1) { + if (event->button.button == 1 || event->button.button == 2) { /* If se are editing, do not handle the event ourselves * -- either let the text item handle it, or wait until * we fall back to the icon_event_after() callback. @@ -1484,7 +1484,8 @@ */ if (!on_text || !dii->selected - || (event->button.state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK))) { + || (event->button.state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) + || event->button.button == 2) { /* If click on text, and the icon was not * selected in the first place or shift is down, * save this flag. @@ -1530,7 +1531,7 @@ break; case GDK_BUTTON_RELEASE: - if (event->button.button != 1) + if (event->button.button != 1 || event->button.button != 2) break; if (on_text && icon_select_on_text) { @@ -1948,8 +1949,7 @@ file_entry *fe; char *full_name; GdkImlibImage *icon_im; - GtkSignalFunc text_changed_func; - + /* Create the icon structure */ full_name = g_concat_dir_and_file (desktop_directory, filename); @@ -2006,13 +2006,8 @@ /* Connect to the text item's signals */ - if (dii->url) - text_changed_func = (GtkSignalFunc) text_changed_url; - else - text_changed_func = (GtkSignalFunc) text_changed; - gtk_signal_connect (GTK_OBJECT (DESKTOP_ICON (dii->dicon)->text), "text_changed", - text_changed_func, dii); + (GtkSignalFunc) text_changed, dii); gtk_signal_connect (GTK_OBJECT (DESKTOP_ICON (dii->dicon)->text), "editing_started", (GtkSignalFunc) editing_started, diff -ruN old/mc-4.5.25/gnome/gdnd.c new/mc-4.5.26/gnome/gdnd.c --- old/mc-4.5.25/gnome/gdnd.c Fri Mar 12 21:02:39 1999 +++ new/mc-4.5.26/gnome/gdnd.c Sun Mar 14 19:19:37 1999 @@ -274,12 +274,12 @@ fclose (f); gnome_metadata_set (template, "desktop-url", - strlen (selection_data->data) + 1, - selection_data->data); + strlen (selection_data->data) + 1, selection_data->data); + gnome_metadata_set (template, "icon-caption", + strlen (selection_data->data) + 1, selection_data->data); icon = g_concat_dir_and_file (ICONDIR, "gnome-http-url.png"); - gnome_metadata_set (template, "icon-filename", - strlen (icon) + 1, icon); + gnome_metadata_set (template, "icon-filename", strlen (icon) + 1, icon); g_free (icon); } } diff -ruN old/mc-4.5.25/gnome/gmount.c new/mc-4.5.26/gnome/gmount.c --- old/mc-4.5.25/gnome/gmount.c Fri Mar 12 21:02:39 1999 +++ new/mc-4.5.26/gnome/gmount.c Sun Mar 14 19:19:38 1999 @@ -188,8 +188,10 @@ GList *list = NULL; f = setmntent ("/etc/fstab", "r"); - if (f == NULL) + if (f == NULL){ + message (1, MSG_ERROR, _("Could not open the /etc/fstab file")); return NULL; + } while ((mnt = getmntent (f))){ if (option_has_user (mnt->mnt_opts)){ diff -ruN old/mc-4.5.25/mc.spec new/mc-4.5.26/mc.spec --- old/mc-4.5.25/mc.spec Fri Mar 12 21:02:29 1999 +++ new/mc-4.5.26/mc.spec Sun Mar 14 19:19:25 1999 @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 4.5.25 +%define ver 4.5.26 %define rel 1 %define prefix /usr diff -ruN old/mc-4.5.25/po/mc.pot new/mc-4.5.26/po/mc.pot --- old/mc-4.5.25/po/mc.pot Fri Mar 12 21:02:46 1999 +++ new/mc-4.5.26/po/mc.pot Sun Mar 14 19:19:46 1999 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-03-12 20:02-0600\n" +"POT-Creation-Date: 1999-03-14 18:17-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -181,7 +181,7 @@ msgid "Enter extra arguments:" msgstr "" -#: gnome/gdesktop.c:420 gnome/gdesktop.c:2072 +#: gnome/gdesktop.c:420 gnome/gdesktop.c:2067 msgid "Warning" msgstr "" @@ -203,45 +203,45 @@ msgstr "" #. Create the link to the user's home directory so that he will have an icon -#: gnome/gdesktop.c:2068 +#: gnome/gdesktop.c:2063 msgid "Home directory" msgstr "" -#: gnome/gdesktop.c:2073 +#: gnome/gdesktop.c:2068 #, c-format msgid "Could not symlink %s to %s; will not have initial desktop icons." msgstr "" -#: gnome/gdesktop.c:2402 gnome/glayout.c:355 +#: gnome/gdesktop.c:2397 gnome/glayout.c:355 msgid "_Terminal" msgstr "" -#: gnome/gdesktop.c:2402 gnome/glayout.c:355 +#: gnome/gdesktop.c:2397 gnome/glayout.c:355 msgid "Launch a new terminal in the current directory" msgstr "" #. If this ever changes, make sure you update create_new_menu accordingly. -#: gnome/gdesktop.c:2404 gnome/glayout.c:357 +#: gnome/gdesktop.c:2399 gnome/glayout.c:357 msgid "_Directory..." msgstr "" -#: gnome/gdesktop.c:2404 gnome/glayout.c:357 +#: gnome/gdesktop.c:2399 gnome/glayout.c:357 msgid "Creates a new directory" msgstr "" -#: gnome/gdesktop.c:2412 gnome/glayout.c:440 +#: gnome/gdesktop.c:2407 gnome/glayout.c:440 msgid "Arrange Icons" msgstr "" -#: gnome/gdesktop.c:2413 +#: gnome/gdesktop.c:2408 msgid "Create New Window" msgstr "" -#: gnome/gdesktop.c:2415 +#: gnome/gdesktop.c:2410 msgid "Rescan Mountable Devices" msgstr "" -#: gnome/gdesktop.c:2416 gnome/glayout.c:443 +#: gnome/gdesktop.c:2411 gnome/glayout.c:443 msgid "Rescan Desktop" msgstr "" diff -ruN old/mc-4.5.25/src/ChangeLog new/mc-4.5.26/src/ChangeLog --- old/mc-4.5.25/src/ChangeLog Fri Mar 12 21:02:36 1999 +++ new/mc-4.5.26/src/ChangeLog Sun Mar 14 19:19:36 1999 @@ -1,3 +1,8 @@ +1999-03-14 Miguel de Icaza + + * dlg.c (dlg_select_nth_widget): Handle the case where h->current + points to NULL. + 1999-03-12 Federico Mena Quintero * file.c (erase_file): Here we need to mc_lstat(), not mc_stat(). diff -ruN old/mc-4.5.25/src/dlg.c new/mc-4.5.26/src/dlg.c --- old/mc-4.5.25/src/dlg.c Fri Mar 12 21:02:34 1999 +++ new/mc-4.5.26/src/dlg.c Sun Mar 14 19:19:31 1999 @@ -17,7 +17,7 @@ */ #include -/* "$Id: dlg.c,v 1.24 1999/01/27 01:08:49 timur Exp $" */ +/* "$Id: dlg.c,v 1.25 1999/03/14 23:18:42 unammx Exp $" */ #include #include #include @@ -339,9 +339,12 @@ int remove_widget (Dlg_head *h, void *what) { Widget_Item *first, *p; + + if (!h->current) + return; first = p = h->current; - + do { if (p->widget == what){ /* Remove links to this Widget_Item */ @@ -422,6 +425,9 @@ int dlg_focus (Dlg_head *h) { + if (!h->current) + return 0; + if (send_message (h, h->current->widget, WIDGET_FOCUS, 0)){ (*h->callback) (h, h->current->dlg_id, DLG_FOCUS); return 1; @@ -431,6 +437,9 @@ int dlg_unfocus (Dlg_head *h) { + if (!h->current) + return 0; + if (send_message (h, h->current->widget, WIDGET_UNFOCUS, 0)){ (*h->callback) (h, h->current->dlg_id, DLG_UNFOCUS); return 1; @@ -442,6 +451,9 @@ { int direction = h->direction; + if (!h->current) + return; + if (!down) direction = !direction; @@ -476,6 +488,8 @@ if (!h) return 0; + if (!h->current) + return 0; w = 0; for (i = 0, item = h->current; i < h->count; i++, item = item->next){ @@ -492,6 +506,10 @@ Widget_Item *old; old = h->current; + + if (!old) + return; + /* If it accepts unFOCUSion */ if (!dlg_unfocus(h)) return; @@ -508,6 +526,9 @@ Widget_Item *old; old = h->current; + if (!old) + return; + if (!dlg_unfocus (h)) return; @@ -520,6 +541,9 @@ int dlg_select_widget (Dlg_head *h, void *w) { + if (!h->current) + return 0; + if (dlg_unfocus (h)){ while (h->current->widget != w) h->current = h->current->next; @@ -536,6 +560,9 @@ Widget_Item *p = h->current; int v, i; + if (!h->current) + return 0; + v = 0; for (i = 0; i < h->count; i++){ if (w == (void *) p->widget){ @@ -654,6 +681,9 @@ Widget_Item *hot_cur; Widget_Item *previous; int handled, c; + + if (!h->current) + return 0; /* * Explanation: we don't send letter hotkeys to other widgets if @@ -714,6 +744,9 @@ int dlg_key_event (Dlg_head *h, int d_key) { int handled; + + if (!h->current) + return 0; /* TAB used to cycle */ if (!h->raw && (d_key == '\t' || d_key == KEY_BTAB)) @@ -835,8 +868,15 @@ { (*h->callback) (h, h->current->dlg_id, DLG_END); current_dlg = (Dlg_head *) h->previous_dialog; - if (current_dlg) - x_focus_widget (current_dlg->current); + if (current_dlg){ + + /* + * Special case for the GNOME desktop: + * The desktop will not have any widgets + */ + if (current_dlg->current) + x_focus_widget (current_dlg->current); + } } void dlg_process_event (Dlg_head *h, int key, Gpm_Event *event) @@ -917,8 +957,10 @@ if (c->widget->destroy) c->widget->destroy (c->widget); c = c->next; - g_free (h->current->widget); - g_free (h->current); + if (h->current){ + g_free (h->current->widget); + g_free (h->current); + } h->current = c; } if (h->title) @@ -950,6 +992,9 @@ { Widget_Item *p = h->current; int should_focus = 0; + + if (!h->current) + return; do { if (p->widget == old){ @@ -982,6 +1027,9 @@ { Widget_Item *save = h->current; + if (!h->current) + return; + h->current = w; (*w->widget->callback)(h, h->current->widget, WIDGET_DRAW, 0); h->current = save;