diff --git a/BUGS b/BUGS index 3f88d65ff..a56c9a501 100644 --- a/BUGS +++ b/BUGS @@ -1,7 +1,7 @@ Bugzilla: 3436 bugs.gnome.org: - Important: 382, 1006, 1035/1412/1416, 1414, 1549, 1796 + Important: 1006, 1035/1412/1416, 1414, 1549, 1796 Major cosmetic: 272/875, 487, 825, 845, 1845, 899, 923, 1072/1336, 1299, 1415, 1457, 1545, 1559, 1582, 1656, 1758, 1789 Minor cosmetic: 55/208, 115, 308, 383, 398, 449, 479, 597, 781, @@ -10,13 +10,6 @@ bugs.gnome.org: Non-essential or feature: 779?, 448, 1133, 1121, 1122, 1251 Look at bug yourself: 1613, 1458, 1773 - 382: Steps to reproduce: Start editing a file label. - Drag as if to select part of the label - text. - gmc will fall over very soon afterwards. - (e.g. if you try to select the same icon - once or twice) - 1006: Try going to 'ftp://ftp.cs.cuc.edu/' and then clicking on the root window. I think the pointer grab stays around or something. diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 0af87558a..79d422ea3 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,42 @@ +1999-08-09 Federico Mena Quintero + + * gscreen.c (editing_icon_list): New function to figure out + whether an icon in the icon list is being edited. This is a + FANTASTICALLY UGLY HACK, but we cannot add new functions to the + icon list at this point as it would break forwards compatibility. + Sigh. BUGFIX: GNOME bug tracker #382, #1065. + + * glayout.c (gnome_panel_desktop_menu): Added some underline + accelerators. + + * gdesktop.c (desktop_arrange_icons_items): Renamed to the desktop + namespace. Added underline accelerators. + (handle_arrange_icons_name): Made static. + (handle_arrange_icons_type): Likewise. + (handle_arrange_icons_size): Likewise. + (handle_arrange_icons_access): Likewise. + (handle_arrange_icons_mod): Likewise. + (handle_arrange_icons_change): Likewise. + (desktop_arrange_icons): Made static. + (strip_tearoff_menu_item): Made it return the number of items in + the menu, not the list of children. + (desktop_icon_info_destroy): Remove the icon from the icon hash + table. + (text_changed): Update the icon hash table information. + + * gdesktop.h: Cleaned up some unused prototypes. + + * gview.c (view_status): Use the correct g_snprintf() format + argument. + + * gcmd.c (sort_get_func_from_type): Indented according to the MC + conventions. People, *PLEASE* follow the Gnome Programming + Guidelines, especially when modifying existing code. + + * gdesktop.c (swap): Likewise. + (auto_pos): Likewise. + (get_icon_auto_pos): Likewise. + 1999-08-08 Richard Hestilow * gcmd.[ch] @@ -9,13 +48,13 @@ there are now 3 options (Right to Left, Bottom to Top, Rows instead of Columns) controlling layout positioning. (Located in the "Desktop" Preferences tab) - + 1999-08-08 David Martin * gaction.c (mainly gmc_unable_to_execute_dlg): Moved g_strconcat to g_strdup_printf, to get compact strings and make coherent translations. Translate atomic actions (open, edit, view) when - calling this function. + calling this function. 1999-08-06 Federico Mena Quintero @@ -27,10 +66,10 @@ 1999-08-06 Norbert Warmuth - * gconf.h (PORT_STATIC_IN_STRING_FILE_XTIME): new port specific - feature. The Gnome edition first calls all string_file functions - and then uses the return values of these functions. This needs - some static buffers in string_file_[acm]time. Therefore additional + * gconf.h (PORT_STATIC_IN_STRING_FILE_XTIME): new port specific + feature. The Gnome edition first calls all string_file functions + and then uses the return values of these functions. This needs + some static buffers in string_file_[acm]time. Therefore additional static buffers in string_file_[acm]time are needed. 1999-08-05 Federico Mena Quintero @@ -50,7 +89,7 @@ 1999-08-01 David Martin * gcmd.c (gnome_about_cmd): Change strings in gmc "about" to - static as they only translated once. + static as they only translated once. 1999-08-01 @@ -66,7 +105,7 @@ * gnome-file-property-dialog.c (perm_group_new): the return values from the group functions in libc return pointers to static buffers in the library. Duplicate all return values and free them at the - end. + end. 1999-07-12 Miguel de Icaza @@ -95,8 +134,8 @@ 1999-06-24 Norbert Warmuth - * gmc-chargrid.c (update_strip): Paint every character with the - assigned fore and background color instead of using the colors of + * gmc-chargrid.c (update_strip): Paint every character with the + assigned fore and background color instead of using the colors of the first character for the whole line. 1999-06-22 Miguel de Icaza @@ -110,7 +149,7 @@ * gmain.c (non_corba_create_panels): Use parameter for startup directory (use the this_dir external directory for this). (create_panels): Pass this_dsir to non_corba_create_panels and - corba_create_window. + corba_create_window. 1999-06-22 David Martin @@ -186,7 +225,7 @@ 1999-06-01 Miguel de Icaza * gdesktop-icon.c (desktop_icon_select): Show the - dicon->background. + dicon->background. (desktop_icon_init): Initialize backgorund as a rectangle that fills all of the space used by the icon. @@ -194,7 +233,7 @@ * glayout.c (gnome_panel_about_menu): Hooked up the new help file in the menu. - + 1999-05-29 Miguel de Icaza * gprefs.c (create_prop_int): Translate this label too. @@ -206,11 +245,11 @@ 1999-05-27 Miguel de Icaza * gscreen.c (panel_tree_button_press): Beginning of context menu - on tree. + on tree. * gtkdtree.c (gtk_dtree_load_path): Comment out the phantom code. Need to review this code. Lets fix the problem Federico needs - solved now. + solved now. 1999-05-26 Miguel de Icaza @@ -289,7 +328,7 @@ 1999-04-16 Miguel de Icaza - * mc.keys.in.in: Merge the application/tex values. + * mc.keys.in.in: Merge the application/tex values. 1999-04-18 Miguel de Icaza @@ -361,7 +400,7 @@ 1999-04-12 Tuomas Kuosmanen - * glayout.c: Changed the stock icon for File->Delete to + * glayout.c: Changed the stock icon for File->Delete to GNOME_STOCK_PIXMAP_TRASH (the trashcan) 1999-04-09 Federico Mena Quintero @@ -378,7 +417,7 @@ 1999-04-09 Miguel de Icaza * gmount.c (is_block_device_mountable): Allow root to mount - devices. + devices. 1999-04-09 Federico Mena Quintero @@ -420,7 +459,7 @@ 1999-04-08 Jonathan Blandford - * gaction.c (gmc_unable_to_execute_dlg): + * gaction.c (gmc_unable_to_execute_dlg): now actions do the right thing (TM). 1999-04-07 Owen Taylor @@ -430,7 +469,7 @@ 1999-04-06 Jonathan Blandford - * gscreen.c: make sure that we bring up an open_with if + * gscreen.c: make sure that we bring up an open_with if open it. * gcmd.c (gnome_select): new selection dialog. @@ -451,7 +490,7 @@ 1999-04-06 David Martin * gcmd.c: marked message for translation. - + 1999-04-05 Federico Mena Quintero * gmetadata.c (gmeta_del_icon_pos): New function to delete the @@ -609,7 +648,7 @@ * gdesktop-init.c (desktop_load_init_from): New file that loads new configuration files from the installation directory. - * gdesktop.c: Drop all the reload code from there, put it above. + * gdesktop.c: Drop all the reload code from there, put it above. * gpopup2.c (create_mime_actions): Attach to the menu, not the uiinfo. @@ -630,12 +669,12 @@ Weninger * gcmd.c (dentry_apply_callback): new function. - (gnome_new_launcher): We can now create new + (gnome_new_launcher): We can now create new 1999-03-19 Miguel de Icaza * gpopup2.c (create_mime_actions): Free full_name, just once, not - once per action. + once per action. 1999-03-19 Paul Raines @@ -646,7 +685,7 @@ 1999-03-18 Miguel de Icaza * gdesktop.c (desktop_icon_info_open): Fix condition. Should not - open a new panel if it fails to mount the device. + open a new panel if it fails to mount the device. Thu Mar 18 14:59:12 1999 Timur Bakeyev @@ -748,7 +787,7 @@ Mon Mar 15 17:09:37 1999 Gregory McLean 1999-03-11 Miguel de Icaza * gpopup2.c: Sigh. It happened again. More features killed by - the merge. + the merge. If a file does not have any metadata/mime way of viewing it, the viewer will always work. @@ -872,7 +911,7 @@ Mon Mar 15 17:09:37 1999 Gregory McLean panel, always allow edition of the icon image. 1999-03-10 Miguel de Icaza - + * gdialogs.c: Support ui->ctx to be NULL, as file.c will set this to NULL for background operations. @@ -893,7 +932,7 @@ Mon Mar 15 17:09:37 1999 Gregory McLean * gmain.c (session_save_state): Add call to gnome_config_sync(). * gutil.c (my_system_get_child_pid): reset SIGPIPE to a sensible - value. + value. (my_system_get_child_pid): Close also stdin/stdout/stderr * gdesktop.c (is_mountable): Allow user-nfs devices to be mounted @@ -940,10 +979,10 @@ Mon Mar 15 17:09:37 1999 Gregory McLean So, no need to kill the tearoff menus in gmc now. * gmount.c (is_block_device_mountable): compare the device name - here. - - (get_mountable_devices): Do not stop scanning devices. - + here. + + (get_mountable_devices): Do not stop scanning devices. + * gview.c (scrollbar_moved): Call view update here, with update_gui = FALSE. @@ -978,11 +1017,11 @@ Mon Mar 15 17:09:37 1999 Gregory McLean 1999-02-24 Miguel de Icaza * gmount.c (desktop_cleanup_devices): Export this routine now and - call it from gdeskop instead of overloading gmount_setup_devices. + call it from gdeskop instead of overloading gmount_setup_devices. * gprint.c: Sample file, it uses an externally provided program (not in 1.0 so far) to setup printer devices. - + * gmount.c (gmount_setup_devices): No longer cleans up here. * gicon.c (gicon_get_filename_for_icon): Return const char *, this @@ -992,14 +1031,14 @@ Mon Mar 15 17:09:37 1999 Gregory McLean * gnome-file-property-dialog.c (apply_metadata_change): Always set the name of the icon to the new value, as the entry will always match the imlib image anyways (due to the fixes I did to const - correctness). + correctness). (generate_icon_sel): Do not free the value. We do not own this - return value. + return value. * gdesktop.c (is_mountable): NULL terminate string returned from - readlink. Yes guys, readlink does not NULL terminate things. + readlink. Yes guys, readlink does not NULL terminate things. (do_mount_umount): ditto. - + * gnome-file-property-dialog.c (init_metadata): ditto Tue Feb 23 17:41:45 1999 George Lebl @@ -1028,7 +1067,7 @@ Tue Feb 23 17:41:45 1999 George Lebl * gwidget.c (x_create_input): Hook to the changed signal and sync the input with our view of the entry. This fixes the paste bug - reported. + reported. Tue Feb 23 01:57:22 1999 George Lebl @@ -1140,25 +1179,25 @@ Tue Feb 23 01:57:22 1999 George Lebl * gdesktop.c (reload_desktop_icons): Load the information provided on the .desktop file for the desktop icon information: icon filename and text to be displayed.pwd - - * gpopup.c (create_actions): Add ejectable + + * gpopup.c (create_actions): Add ejectable * gdesktop.c (do_eject): Add eject command. - + 1999-02-16 Miguel de Icaza * gpopup.c (create_actions): Add support for mountable icons. * gdesktop.c (try_to_mount): Add an option to automatically mount - links on the desktop that point to devices. + links on the desktop that point to devices. (is_mountable): Returns true if a pathname is mountable. * glayout.c: Add the dirsizes command here. * gmount.c: New file. Implements support routines for mount/umount. - + 1999-02-16 Federico Mena Quintero * i-symlink.png: Flipped the image around, since we are putting @@ -1212,7 +1251,7 @@ Tue Feb 23 01:57:22 1999 George Lebl command to execute (used internally). * gaction.c (gmc_edit_filename): Support for the GNOME editor - environment properties. + environment properties. * gdesktop.c (create_desktop_dir): Support GNOME_DESKTOP_DIR variable to configure the desktop directory. @@ -1260,13 +1299,13 @@ Tue Feb 23 01:57:22 1999 George Lebl due to having the "file-must-exist" bit turned on. * gnome-file-property-dialog.c (apply_metadata_change): Metadata - rename the file. + rename the file. Change fpd->file_name to point to the new name so that any metadat changes take effect on the new name, not the old name. Test return value from move_file_file. - + (init_metadata): Fixed typo. 1999-02-12 Federico Mena Quintero @@ -1320,7 +1359,7 @@ Tue Feb 23 01:57:22 1999 George Lebl 1999-02-10 Miguel de Icaza * gaction.c (gmc_open_filename): Add support for running .desktop - files. + files. Made const correct. (gmc_view): Made const correct. @@ -1426,11 +1465,11 @@ Sun Feb 7 05:29:17 1999 Timur Bakeyev we don't need this in GNOME. Changed the order of linking - libgtkedit require libgnomeui.a, so swap $(LDFLAGS) and $(EXTRALIBS). The same for corba edition. - + gdnd.c, gmetadata.c, gpopup2.c, gtools.c: Adde #include "global.h" or move it before #include to avoid warnings about redefining MIN, MAX nad RE_DUP_MAX. More clean compiling. - + * gpopup2.h: New file - to avoid errors during "make distcheck". What it is for, really? @@ -1503,8 +1542,8 @@ Sun Feb 7 05:29:17 1999 Timur Bakeyev (gicon_init): Load the url image. * gdesktop.c (desktop_icon_info_new): Use an URL image for - desktop-urls. Use the url as the caption for those icons. - + desktop-urls. Use the url as the caption for those icons. + 1999-02-04 Jonathan Blandford * gprefs.c (caching_and_optimization_props): wording changes @@ -1513,7 +1552,7 @@ Sun Feb 7 05:29:17 1999 Timur Bakeyev * gdesktop.c (desktop_icon_info_open): Run "execute" if the file is an executable. I forgot that gmc_open does not test for - executable-ness. + executable-ness. 1999-02-04 Jonathan Blandford @@ -1540,7 +1579,7 @@ Sun Feb 7 05:29:17 1999 Timur Bakeyev the type column be displayed. (panel_file_list_select_row): Removed dead code. (panel_file_list_press_row): Select the row before calling - gpopup_do_popup. + gpopup_do_popup. 1999-02-03 Federico Mena Quintero @@ -1593,7 +1632,7 @@ Sun Feb 7 05:29:17 1999 Timur Bakeyev * gnome-file-property-dialog.c (icon_sel_callback): Fix the conditional here. - + 1999-02-01 Federico Mena Quintero * gdesktop.c (desktop_drag_motion): If the user is dragging a @@ -1655,7 +1694,7 @@ Sun Jan 31 19:42:47 1999 Norbert Warmuth * gnome-file-property-dialog.h (struct _GnomeFilePropertyDialog): Now make open field mandatory and icon selection optional. * gnome-file-property-dialog.c: as above - + * gpopup.c (panel_action_properties): only allow setting images if we_can_afford_the_speed. @@ -1672,9 +1711,9 @@ Sun Jan 31 19:42:47 1999 Norbert Warmuth Thu Jan 28 02:15:48 1999 Timur Bakeyev * gdialogs.c: fixed "regexp.h" -> "eregexp.h" conversion. - + * oldnd.c: Replaced copy_strings() with g_strconcat(). - + 1999-01-26 Federico Mena Quintero * gscreen.c (panel_clist_motion): Stop the emission of the @@ -1688,7 +1727,7 @@ Thu Jan 28 02:15:48 1999 Timur Bakeyev Wed Jan 27 03:14:46 1999 Timur Bakeyev - * Converted memory managment to Glib - where it wasn't done. Now we + * Converted memory managment to Glib - where it wasn't done. Now we use g_new()/g_malloc()/g_strdup()/g_free() routings. copy_strings() re- placed by g_strconcat(), and sprintf() by g_snprintf(). Some other, minor changes. @@ -1719,7 +1758,7 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev 1999-01-25 Miguel de Icaza - * gtkdtree.c (gtk_dtree_select_row): This should be also protected + * gtkdtree.c (gtk_dtree_select_row): This should be also protected against async notifications. 1999-01-25 Federico Mena Quintero @@ -1751,7 +1790,7 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev * gtkdtree.c (gtk_dtree_load_path): Keep track of when we are loading the tree (and thus we do not care about async notifications to the tree state changes) and when we are done (and - thus, we care about the async treestore structure notifications). + thus, we care about the async treestore structure notifications). 1999-01-23 Miguel de Icaza @@ -1761,17 +1800,17 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev (gnome_filter_cmd): ditto. * gdialogs.c (file_progress_query_replace_policy): Set Window's - position to GTK_WIN_POS_MOUSE. + position to GTK_WIN_POS_MOUSE. (file_progress_real_query_replace): ditto. (file_mask_dialog): ditto. * gdialogs.c: Tag the strings for localization. Remove debugging - messages. + messages. * gmain.c (gmc_window_setup_from_panel): Helper routine used to set the GTK_WIN_POS_MOUSE on a window and set the parent with gnome_dialog_set_parent (iff you have the WPanel * pointer to the - parent). + parent). * gtools.c (query_dialog): Set the window position to GTK_WIN_POS_MOUSE. @@ -1874,7 +1913,7 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev * gicon.h (gicon_image_to_name): Added prototype for gicon_image_to_name(). - * gicon.c (gicon_get_icon_for_file): + * gicon.c (gicon_get_icon_for_file): (gicon_get_icon_for_file_speed): Added a "directory" argument. It is needed because the file_entry structure only contains the pruned filename, and we need the complete name for the metadata @@ -1999,10 +2038,10 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev register themselves with it. 1999-01-13 bertrand - + * gdialogs.c - * gwidget.c: - * gprop.c: + * gwidget.c: + * gprop.c: s/gtk_toggle_button_state/gtk_toggle_button_active 1999-01-12 Federico Mena Quintero @@ -2038,7 +2077,7 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev command. Add Mkdir command. Use standard key definitions. * gview.c: Use new standard keybindings - + * gtkdtree.c: Now it uses the treestore code. * treestore.c: New file format which includes the scan status of @@ -2079,12 +2118,12 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev * gscreen.c (panel_icon_list_select_icon): Remove debugging message. * glayout.c: Add a create directory option. - + 1999-01-07 Jonathan Blandford * gcmd.c (gnome_filter_cmd): now it works! It's even sorta useful. I'm so psyched... (: - + 1999-01-07 Miguel de Icaza @@ -2138,7 +2177,7 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev 1999-01-05 Miguel de Icaza * gdesktop.c (desktop_icon_drop_uri_list): Implement - drops-on-executable. + drops-on-executable. * gmetadata.c, gaction.c, gdesktop.c, gicon.c: Use g_free instead of free to follow the convention in gnome-metadata.c @@ -2146,11 +2185,11 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev * gtools.c (query_dialog): Fix the new version of this. It was overwriting memory all over. - * gdialogs.c (): Use GNOME stock; Fill in some FIXME strings. + * gdialogs.c (): Use GNOME stock; Fill in some FIXME strings. (file_progress_real_query_replace): Use the formatted - message. + message. - Change the inlined N_( for _( in various places. + Change the inlined N_( for _( in various places. (cancel_cb): Cancel button now cancels a copy or move operation. * gtools.c (query_dialog): Remove the hotkey indicator in the @@ -2191,13 +2230,13 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev calling a routine that somehow got dropped during some recent changes). - * gtools.c (query_dialog): Simplified. + * gtools.c (query_dialog): Simplified. 1999-01-02 Jonathan Blandford * gcmd.c (gnome_sort_cmd): pretified (gnome_select_all_cmd): New command -- selects all files (in - theory). + theory). * glayout.c: rearrange the edit menu some. @@ -2222,10 +2261,10 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev * gwidget.c (x_create_listbox): Temporary hack - * gmetadata.c (gmeta_get_icon_pos): Fixed the memory leak here. + * gmetadata.c (gmeta_get_icon_pos): Fixed the memory leak here. * gicon.c (gicon_get_icon_for_file): Actually return a value - here. + here. 1999-01-01 Miguel de Icaza @@ -2266,7 +2305,7 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev * gmain.c (create_panels): Register corba server here. * gcorba.c: Fix a servant declaration to point to the correct - vepv. + vepv. 1998-12-30 Federico Mena Quintero @@ -2291,7 +2330,7 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev 1998-12-29 Miguel de Icaza * gdesktop.c (desktop_icon_delete): New function, used for - dicon_delete. + dicon_delete. (load_desktop_icons): Implemented the incremental reloading of desktop icons. This should make the code much nicer. (reload_desktop_icons): Call x_flush_events to force a display at @@ -2299,17 +2338,17 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev * gpopup.c (dicon_delete): Implement this operation. (desktop_icon_execute): Use the existing implementation for - launching desktop icons instead of a new hacked up version + launching desktop icons instead of a new hacked up version (desktop_icon_actions): Until copy/move is implemented, do not even list them to the user. * gdesktop.c (create_desktop_dir): No trashcan setup until it - works. + works. * gscren.c (panel_widget_motion): Use button 2 for dragging and - asking. - + asking. + * gscreen.c (panel_create_file_list): Use a notebook instead of the hack I was using before for switching the panel contents. @@ -2322,8 +2361,8 @@ Wed Jan 27 03:14:46 1999 Timur Bakeyev Tue Dec 29 16:55:24 1998 Norbert Warmuth - * gmain.c: According to the man page the color keyword for executable - files is `executable' and not `execute' -- changed. + * gmain.c: According to the man page the color keyword for executable + files is `executable' and not `execute' -- changed. 1998-12-28 Jonathan Blandford @@ -2346,12 +2385,12 @@ Thu Dec 24 18:38:45 1998 Norbert Warmuth Mon Dec 21 22:33:07 1998 Norbert Warmuth * layout: Deleted obsolete widgets from the Virtual FS configuration - dialog. + dialog. 1998-12-17 Miguel de Icaza * gscreen.c (panel_icon_list_select_icon): Show the popup menu on - button release here. This is what makes most sense. + button release here. This is what makes most sense. (panel_widget_motion): Drags with button 3 now produce a popup dialog box that asks @@ -2359,7 +2398,7 @@ Mon Dec 21 22:33:07 1998 Norbert Warmuth * gdialogs.c (create_op_win): Remove second spurious packing. (create_op_win): OP_MOVE uses the same stuff OP_COPY does. Fix - this. + this. (file_progress_show_target): More compliant to the original functions. (file_progress_show_source): More compliant to the original @@ -2371,7 +2410,7 @@ Tue Dec 15 10:51:12 1998 Gregory McLean * gdesktop-icon.c : Attach a desktop_icon wmclass to the desktop icons to allow even more wizardry with the desktop icons, mainly - to exclude them from window lists, don't decorate them, skip + to exclude them from window lists, don't decorate them, skip desktops and other boring stuff. 1998-12-14 Sven Neumann @@ -2407,7 +2446,7 @@ Tue Dec 15 10:51:12 1998 Gregory McLean * gscreen.c (panel_tree_drag_motion): Doubled timeout for autoexpand - reducing opening unwanted directories. - * gscreen.c (tree_drag_open_directory): Use + * gscreen.c (tree_drag_open_directory): Use gtk_ctree_expand() not gtk_ctree_expand_recursive, which increases confusion and could be _vvveeerrrryyyy_ expensive. (/afs ?) diff --git a/gnome/gcmd.c b/gnome/gcmd.c index 403ee8809..f5651a688 100644 --- a/gnome/gcmd.c +++ b/gnome/gcmd.c @@ -32,9 +32,9 @@ gnome_listing_cmd (GtkWidget *widget, WPanel *panel) { int view_type, use_msformat; char *user, *status; - + view_type = display_box (panel, &user, &status, &use_msformat, get_current_index ()); - + if (view_type == -1) return; @@ -56,7 +56,7 @@ gnome_open_terminal_with_cmd (const char *command) { char *p; int quote_all = 0; - + if (!(p = gnome_is_program_in_path ("gnome-terminal"))){ if (!(p = gnome_is_program_in_path ("dtterm"))) if (!(p = gnome_is_program_in_path ("nxterm"))) @@ -104,12 +104,12 @@ gnome_about_cmd (void) if (!translated){ int i; - + for (i = 0; authors [i]; i++) authors [i] = _(authors [i]); translated = TRUE; } - + about = gnome_about_new (_("GNU Midnight Commander"), VERSION, "Copyright 1994-1999 the Free Software Foundation", authors, @@ -237,34 +237,44 @@ sort_callback (GtkWidget *menu_item, GtkWidget *cbox1) gtk_widget_set_sensitive (cbox1, FALSE); } - +/* Returns a sort function based on its type */ sortfn * -sort_get_func_from_type (SortType type) { +sort_get_func_from_type (SortType type) +{ sortfn *sfn = NULL; - + switch (type) { - case SORT_NAME: - sfn = (sortfn *) sort_name; - break; - case SORT_EXTENSION: - sfn = (sortfn *) sort_ext; - break; - case SORT_ACCESS: - sfn = (sortfn *) sort_atime; - break; - case SORT_MODIFY: - sfn = (sortfn *) sort_time; - break; - case SORT_CHANGE: - sfn = (sortfn *) sort_ctime; - break; - case SORT_SIZE: - sfn = (sortfn *) sort_size; - break; + case SORT_NAME: + sfn = (sortfn *) sort_name; + break; + + case SORT_EXTENSION: + sfn = (sortfn *) sort_ext; + break; + + case SORT_ACCESS: + sfn = (sortfn *) sort_atime; + break; + + case SORT_MODIFY: + sfn = (sortfn *) sort_time; + break; + + case SORT_CHANGE: + sfn = (sortfn *) sort_ctime; + break; + + case SORT_SIZE: + sfn = (sortfn *) sort_size; + break; + + default: + g_assert_not_reached (); } + return sfn; } - + void gnome_sort_cmd (GtkWidget *widget, WPanel *panel) { @@ -276,10 +286,10 @@ gnome_sort_cmd (GtkWidget *widget, WPanel *panel) GtkWidget *cbox1, *cbox2; sortfn *sfn = NULL; - sort_box = gnome_dialog_new (_("Sort By"), GNOME_STOCK_BUTTON_OK, + sort_box = gnome_dialog_new (_("Sort By"), GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); gmc_window_setup_from_panel (GNOME_DIALOG (sort_box), panel); - + /* we define this up here so we can pass it in to our callback */ cbox1 = gtk_check_button_new_with_label (_("Ignore case sensitivity.")); hbox = gtk_hbox_new (FALSE, 0); @@ -295,7 +305,7 @@ gnome_sort_cmd (GtkWidget *widget, WPanel *panel) gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_NAME); gtk_signal_connect (GTK_OBJECT (menu_item), "activate", GTK_SIGNAL_FUNC (sort_callback), cbox1); - + menu_item = gtk_menu_item_new_with_label ( _("File Type")); gtk_menu_append (GTK_MENU (menu), menu_item); gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_EXTENSION); @@ -329,7 +339,7 @@ gnome_sort_cmd (GtkWidget *widget, WPanel *panel) gtk_widget_show_all (menu); gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu); - + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox1), panel->case_sensitive); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (sort_box)->vbox), cbox1, FALSE, FALSE, 0); @@ -380,8 +390,8 @@ get_nickname (gchar *text) GtkWidget *label; gchar *retval = NULL; int destroy; - - dlg = gnome_dialog_new (_("Enter name."), GNOME_STOCK_BUTTON_OK, + + dlg = gnome_dialog_new (_("Enter name."), GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE); entry = gtk_entry_new (); @@ -408,7 +418,7 @@ get_nickname (gchar *text) if (destroy) gtk_widget_destroy (dlg); - return retval; + return retval; } static void @@ -490,7 +500,7 @@ load_settings (GtkCList *clist) gint i = 0; profile_keys = profile_init_iterator (panelize_section, profile_name); - + if (!profile_keys){ insert_tab[0] = _("Find all core files"); i = gtk_clist_insert (clist, i, insert_tab); @@ -536,14 +546,14 @@ gnome_external_panelize (GtkWidget *widget, WPanel *panel) gint i; gchar *row_data; int destroy; - + data = g_new0 (ep_dlg_data, 1); data->setting_text = FALSE; data->selected = -1; - data->ep_dlg = gnome_dialog_new (_("Run Command"), GNOME_STOCK_BUTTON_OK, + data->ep_dlg = gnome_dialog_new (_("Run Command"), GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); gtk_window_set_position (GTK_WINDOW (data->ep_dlg), GTK_WIN_POS_MOUSE); - + /* Frame 1 */ frame = gtk_frame_new (_("Preset Commands")); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (data->ep_dlg)->vbox), @@ -587,7 +597,7 @@ gnome_external_panelize (GtkWidget *widget, WPanel *panel) gtk_widget_show_all (GNOME_DIALOG (data->ep_dlg)->vbox); destroy = TRUE; - + switch (gnome_dialog_run (GNOME_DIALOG (data->ep_dlg))) { case 0: gtk_widget_hide (data->ep_dlg); @@ -659,7 +669,7 @@ gnome_filter_cmd (GtkWidget *widget, WPanel *panel) GtkWidget *label; gchar *text1, *text2, *text3; - filter_dlg = gnome_dialog_new (_("Set Filter"), GNOME_STOCK_BUTTON_OK, + filter_dlg = gnome_dialog_new (_("Set Filter"), GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); gtk_window_set_position (GTK_WINDOW (filter_dlg), GTK_WIN_POS_MOUSE); if (easy_patterns) { @@ -679,7 +689,7 @@ gnome_filter_cmd (GtkWidget *widget, WPanel *panel) } entry = gnome_entry_new (text1); gnome_entry_load_history (GNOME_ENTRY (entry)); - + if (text2) { gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))), text2); gnome_entry_prepend_history (GNOME_ENTRY (entry), FALSE, text3); @@ -692,7 +702,7 @@ gnome_filter_cmd (GtkWidget *widget, WPanel *panel) label = gtk_label_new (_("Enter a Regular Expression to filter files in the panel view.")); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (filter_dlg)->vbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (filter_dlg)->vbox), entry, FALSE, FALSE, 0); @@ -717,7 +727,7 @@ gnome_filter_cmd (GtkWidget *widget, WPanel *panel) gtk_label_set_text (GTK_LABEL (panel->status), _("Show all files")); } else gtk_label_set_text (GTK_LABEL (panel->status), panel->filter); - + gnome_entry_save_history (GNOME_ENTRY (entry)); x_filter_changed (panel); reread_cmd (); @@ -759,7 +769,7 @@ gnome_open_files (GtkWidget *widget, WPanel *panel) } #endif g_list_free (later); - + } void @@ -782,7 +792,7 @@ dentry_apply_callback(GtkWidget *widget, int page, gpointer data) if (page != -1) return; - + g_return_if_fail(data!=NULL); g_return_if_fail(GNOME_IS_DENTRY_EDIT(data)); dentry = gnome_dentry_get_dentry(GNOME_DENTRY_EDIT(data)); @@ -838,8 +848,8 @@ gnome_select (GtkWidget *widget, WPanel *panel) GtkWidget *entry; GtkWidget *label; int run; - - select_dialog = gnome_dialog_new (_("Select File"), GNOME_STOCK_BUTTON_OK, + + select_dialog = gnome_dialog_new (_("Select File"), GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); gtk_window_set_position (GTK_WINDOW (select_dialog), GTK_WIN_POS_MOUSE); entry = gnome_entry_new ("mc_select"); @@ -850,10 +860,10 @@ gnome_select (GtkWidget *widget, WPanel *panel) label = gtk_label_new (_("Enter a filter here to select files in the panel view with.\n\nFor example:\n*.png will select all png images")); else label = gtk_label_new (_("Enter a regular expression here to select files in the panel view with.")); - + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (select_dialog)->vbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (select_dialog)->vbox), entry, FALSE, FALSE, 0); @@ -866,7 +876,7 @@ gnome_select (GtkWidget *widget, WPanel *panel) } if (run != -1) gtk_widget_destroy (select_dialog); - + if ((reg_exp == NULL) || (*reg_exp == '\000')) { g_free (reg_exp); return; @@ -927,7 +937,7 @@ set_cursor_normal (WPanel *panel) if (is_a_desktop_panel (panel)) return; - + cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW); gdk_window_set_cursor (GTK_WIDGET (panel->xwindow)->window, cursor); gdk_cursor_destroy (cursor); @@ -944,7 +954,7 @@ gnome_new_link (GtkWidget *widget, WPanel *panel) _("Enter the URL:"), ""); if (!url) return; - + template = g_concat_dir_and_file (desktop_directory, "urlXXXXXX"); if (mktemp (template)) { diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index b73538b5c..080d9708e 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -51,8 +51,9 @@ int desktop_arr_rows = FALSE; /* The computed name of the user's desktop directory */ char *desktop_directory; -/* Layout information: number of rows/columns for the layout slots, and the array of slots. Each - * slot is an integer that specifies the number of icons that belong to that slot. +/* Layout information: number of rows/columns for the layout slots, and the + * array of slots. Each slot is an integer that specifies the number of icons + * that belong to that slot. */ static int layout_screen_width; static int layout_screen_height; @@ -129,9 +130,10 @@ static int click_current_y; static int click_dragging; -static DesktopIconInfo *desktop_icon_info_new (char *filename, char *url, char *caption, int xpos, int ypos); +static DesktopIconInfo *desktop_icon_info_new (char *filename, char *url, char *caption, + int xpos, int ypos); -static GHashTable *infos_hash; +static GHashTable *icon_hash; /* Convenience function to figure out the slot corresponding to an (x, y) position */ @@ -147,16 +149,17 @@ get_slot_from_pos (int x, int y, int *u, int *v) *v = CLAMP (vv, 0, layout_rows - 1); } -static void swap(int *a, int *b) { +/* Swaps two integer variables */ +static void +swap (int *a, int *b) +{ int tmp; - - g_return_if_fail(a != NULL); - g_return_if_fail(b != NULL); tmp = *a; *a = *b; *b = tmp; } + /* Looks for a free slot in the layout_slots array and returns the coordinates * that coorespond to it. "Free" means it either has zero icons in it, or it * has the minimum number of icons of all the slots. Returns the number of @@ -168,35 +171,46 @@ auto_pos (int sx, int ex, int sy, int ey, int *slot) int min, min_slot; int x, y; int val; - int xinc = 1, yinc = 1; + int xinc, yinc; int r, b; - min = l_slots(sx, sy).num_icons; + min = l_slots (sx, sy).num_icons; min_slot = sx * layout_rows + sy; - + xinc = yinc = 1; + if (desktop_arr_rows) { swap (&ex, &ey); swap (&sx, &sy); } - -/* if (desktop_arr_r2l) swap (&sx, &ex); - if (desktop_arr_b2t) swap (&sy, &ey);*/ - if (desktop_arr_r2l) xinc = -1; - if (desktop_arr_b2t) yinc = -1; - - if (desktop_arr_rows) swap (&xinc, &yinc); - + +#if 0 + if (desktop_arr_r2l) + swap (&sx, &ex); + + if (desktop_arr_b2t) + swap (&sy, &ey); +#endif + if (desktop_arr_r2l) + xinc = -1; + + if (desktop_arr_b2t) + yinc = -1; + + if (desktop_arr_rows) + swap (&xinc, &yinc); + r = desktop_arr_r2l; b = desktop_arr_b2t; - if (desktop_arr_rows) swap (&r, &b); + if (desktop_arr_rows) + swap (&r, &b); - for (x = sx; (r ? (x >= ex) : (x <= ex));x += xinc) { - for (y = sy;(b ? (y >= ey) : (y <= ey)); y += yinc) { + for (x = sx; (r ? (x >= ex) : (x <= ex)); x += xinc) { + for (y = sy; (b ? (y >= ey) : (y <= ey)); y += yinc) { if (desktop_arr_rows) - val = l_slots(y, x).num_icons; + val = l_slots (y, x).num_icons; else - val = l_slots(x, y).num_icons; + val = l_slots (x, y).num_icons; if (val < min || val == 0) { min = val; @@ -208,9 +222,11 @@ auto_pos (int sx, int ex, int sy, int ey, int *slot) break; } } - if (val == 0) break; + + if (val == 0) + break; } - + *slot = min_slot; return min; } @@ -219,18 +235,34 @@ auto_pos (int sx, int ex, int sy, int ey, int *slot) static void get_icon_auto_pos (int *x, int *y) { - int val1, val2; - int slot1, slot2; + int val1; + int slot1; int slot; int sx, sy, ex, ey; -/* get_slot_from_pos (*x, *y, &sx, &sy);*/ -/* FIXME funky stuff going on with the efficient positioning thingy */ - if (desktop_arr_r2l) sx = layout_cols - 1; else sx = 0; - if (desktop_arr_b2t) sy = layout_rows - 1; else sy = 0; +#if 0 + get_slot_from_pos (*x, *y, &sx, &sy); +#endif + /* FIXME funky stuff going on with the efficient positioning thingy */ + if (desktop_arr_r2l) + sx = layout_cols - 1; + else + sx = 0; - if (desktop_arr_r2l) ex = 0; else ex = layout_cols - 1; - if (desktop_arr_b2t) ey = 0; else ey = layout_rows - 1; + if (desktop_arr_b2t) + sy = layout_rows - 1; + else + sy = 0; + + if (desktop_arr_r2l) + ex = 0; + else + ex = layout_cols - 1; + + if (desktop_arr_b2t) + ey = 0; + else + ey = layout_rows - 1; /* Look forwards until the end of the grid. If we could not find an * empty spot, find the second best. @@ -239,17 +271,27 @@ get_icon_auto_pos (int *x, int *y) val1 = auto_pos (sx, ex, sy, ey, &slot1); slot = slot1; -/* to be used at a later date: - * if (val1 == 0) + +#if 0 + /* to be used at a later date */ + if (val1 == 0) slot = slot1; else { - if (desktop_arr_r2l) sx = layout_cols - 1; else sx = 0; - if (desktop_arr_b2t) sy = layout_rows - 1; else sy = 0; - + if (desktop_arr_r2l) + sx = layout_cols - 1; + else + sx = 0; + + if (desktop_arr_b2t) + sy = layout_rows - 1; + else + sy = 0; + val2 = auto_pos (sx, ex, sy, ey, &slot2); if (val2 < val1) slot = slot2; - }*/ + } +#endif *x = (slot / layout_rows) * DESKTOP_SNAP_X; *y = (slot % layout_rows) * DESKTOP_SNAP_Y; @@ -359,6 +401,8 @@ desktop_icon_info_destroy (DesktopIconInfo *dii) gtk_widget_destroy (dii->dicon); remove_from_slot (dii); + g_hash_table_remove (icon_hash, dii->filename); + g_free (dii->url); g_free (dii->filename); g_free (dii); @@ -542,10 +586,13 @@ desktop_reload_icons (int user_pos, int xpos, int ypos) fau = g_new0 (file_and_url_t, 1); fau->filename = g_strdup (dirent->d_name); + if (desktop_url) - fau->url = g_strdup (desktop_url); + fau->url = g_strdup (desktop_url); + if (caption) fau->caption = g_strdup (caption); + need_position_list = g_slist_prepend (need_position_list, fau); } @@ -664,36 +711,35 @@ static WPanel *create_panel_from_desktop(); /* Fwd decl */ static void free_panel_from_desktop(WPanel *panel); /* Perform automatic arrangement of the desktop icons */ -void +static void desktop_arrange_icons (SortType type) { WPanel *panel; - sortfn *sfn = NULL; + sortfn *sfn; DesktopIconInfo *dii; int i; dir_list dir; int xpos, ypos; panel = create_panel_from_desktop (); - sfn = sort_get_func_from_type(type); - g_return_if_fail(sfn != NULL); - - do_sort(&panel->dir, sfn, panel->count - 1, FALSE, FALSE); + sfn = sort_get_func_from_type (type); + g_assert (sfn != NULL); + + do_sort (&panel->dir, sfn, panel->count - 1, FALSE, FALSE); dir = panel->dir; - g_return_if_fail(dir.list != NULL); - + g_assert (dir.list != NULL); + for (i = 0; i < dir.size; i++) - remove_from_slot (desktop_icon_info_get_by_filename( - dir.list[i].fname)); + remove_from_slot (desktop_icon_info_get_by_filename (dir.list[i].fname)); for (i = 0; i < dir.size; i++) { - dii = desktop_icon_info_get_by_filename(dir.list[i].fname); + dii = desktop_icon_info_get_by_filename (dir.list[i].fname); xpos = ypos = 0; get_icon_auto_pos (&xpos, &ypos); desktop_icon_info_place (dii, xpos, ypos); } - - free_panel_from_desktop(panel); + + free_panel_from_desktop (panel); } /* Unselects all the desktop icons except the one in exclude */ @@ -947,8 +993,11 @@ text_changed (GnomeIconTextItem *iti, gpointer data) /* Set the new name */ + g_hash_table_remove (icon_hash, dii->filename); g_free (dii->filename); + dii->filename = g_strdup (new_name); + g_hash_table_insert (icon_hash, dii->filename, dii); set_icon_wmclass (dii); desktop_reload_icons (FALSE, 0, 0); @@ -1512,8 +1561,8 @@ DesktopIconInfo * desktop_icon_info_get_by_filename (char *filename) { g_return_val_if_fail (filename != NULL, NULL); - - return g_hash_table_lookup(infos_hash, filename); + + return g_hash_table_lookup (icon_hash, filename); } /* Used to execute the popup menu for desktop icons */ @@ -2136,12 +2185,11 @@ desktop_icon_info_new (char *filename, char *url, char *caption, int xpos, int y setup_icon_dnd_dest (dii); /* Place the icon and append it to the list */ - desktop_icon_info_place (dii, xpos, ypos); - /* Lookup for filename */ - g_hash_table_insert(infos_hash, dii->filename, dii); - + /* Put into icon hash table */ + g_hash_table_insert (icon_hash, dii->filename, dii); + return dii; } @@ -2310,7 +2358,7 @@ setup_motif_dnd_proxy (guint32 xid, GdkWindow *proxy_window) info.protocol_style = 5; /* XmDRAG_DYNAMIC */ info.proxy_window = proxy_xid; info.num_drop_sites = 0; - info.total_size = sizeof(info); + info.total_size = sizeof (info); XChangeProperty (gdk_display, xid, receiver_info_atom, @@ -2473,40 +2521,43 @@ find_click_proxy_window (void) return proxy_gdk_window; } -/* Callback for arranging the icons on the desktop */ -/* These are all NOT static because glayout.c calls them too */ - -void +/* Callback for arranging icons by name */ +static void handle_arrange_icons_name (GtkWidget *widget, gpointer data) { desktop_arrange_icons (SORT_NAME); } -void +/* Callback for arranging icons by file type */ +static void handle_arrange_icons_type (GtkWidget *widget, gpointer data) { desktop_arrange_icons (SORT_EXTENSION); } -void +/* Callback for arranging icons by file size */ +static void handle_arrange_icons_size (GtkWidget *widget, gpointer data) { desktop_arrange_icons (SORT_SIZE); } -void +/* Callback for arranging icons by access time */ +static void handle_arrange_icons_access (GtkWidget *widget, gpointer data) { desktop_arrange_icons (SORT_ACCESS); } -void +/* Callback for arranging icons by modification time */ +static void handle_arrange_icons_mod (GtkWidget *widget, gpointer data) { desktop_arrange_icons (SORT_MODIFY); } -void +/* Callback for arranging icons by change time */ +static void handle_arrange_icons_change (GtkWidget *widget, gpointer data) { desktop_arrange_icons (SORT_CHANGE); @@ -2519,13 +2570,12 @@ handle_new_window (GtkWidget *widget, gpointer data) new_panel_at (gnome_user_home_dir); } +/* Rescans the mountable devices in the desktop and re-creates their icons */ void desktop_rescan_devices (void) { desktop_cleanup_devices (); - gdesktop_init (); - desktop_reload_icons (FALSE, 0, 0); } @@ -2581,71 +2631,79 @@ new_terminal (GtkWidget *widget, gpointer data) } static GnomeUIInfo gnome_panel_new_menu [] = { - GNOMEUIINFO_ITEM_NONE(N_("_Terminal"), N_("Launch a new terminal in the current directory"), new_terminal), + GNOMEUIINFO_ITEM_NONE (N_("_Terminal"), N_("Launch a new terminal in the current directory"), new_terminal), /* If this ever changes, make sure you update create_new_menu accordingly. */ - GNOMEUIINFO_ITEM_NONE( N_("_Directory..."), N_("Creates a new directory"), gnome_mkdir_cmd ), - GNOMEUIINFO_ITEM_NONE( N_("URL L_ink..."), N_("Creates a new URL link"), gnome_new_link ), - GNOMEUIINFO_ITEM_NONE( N_("_Launcher..."), N_("Creates a new launcher"), gnome_new_launcher ), + GNOMEUIINFO_ITEM_NONE (N_("_Directory..."), N_("Creates a new directory"), gnome_mkdir_cmd), + GNOMEUIINFO_ITEM_NONE (N_("URL L_ink..."), N_("Creates a new URL link"), gnome_new_link), + GNOMEUIINFO_ITEM_NONE (N_("_Launcher..."), N_("Creates a new launcher"), gnome_new_launcher), GNOMEUIINFO_END }; -/* Ack. gnome_popup_menu's marshaller overrides the user_data. So - * instead of having a single nice function using that, we have to have - * many functions. That sucks. */ - -GnomeUIInfo arrange_icons_items[] = { - GNOMEUIINFO_ITEM_NONE (N_("By Name"), NULL, handle_arrange_icons_name), - GNOMEUIINFO_ITEM_NONE (N_("By File Type"), NULL, handle_arrange_icons_type), - GNOMEUIINFO_ITEM_NONE (N_("By Size"), NULL, handle_arrange_icons_size), - GNOMEUIINFO_ITEM_NONE (N_("By Time Last Accessed"), NULL, handle_arrange_icons_access), - GNOMEUIINFO_ITEM_NONE (N_("By Time Last Modified"), NULL, handle_arrange_icons_mod), - GNOMEUIINFO_ITEM_NONE (N_("By Time Last Changed"), NULL, handle_arrange_icons_change), +/* Menu items for arranging the desktop icons */ +GnomeUIInfo desktop_arrange_icons_items[] = { + GNOMEUIINFO_ITEM_NONE (N_("By _Name"), NULL, handle_arrange_icons_name), + GNOMEUIINFO_ITEM_NONE (N_("By File _Type"), NULL, handle_arrange_icons_type), + GNOMEUIINFO_ITEM_NONE (N_("By _Size"), NULL, handle_arrange_icons_size), + GNOMEUIINFO_ITEM_NONE (N_("By Time Last _Accessed"), NULL, handle_arrange_icons_access), + GNOMEUIINFO_ITEM_NONE (N_("By Time Last _Modified"), NULL, handle_arrange_icons_mod), + GNOMEUIINFO_ITEM_NONE (N_("By Time Last _Changed"), NULL, handle_arrange_icons_change), GNOMEUIINFO_END }; /* The popup menu for the desktop */ GnomeUIInfo desktop_popup_items[] = { - GNOMEUIINFO_MENU_NEW_SUBTREE(gnome_panel_new_menu), + GNOMEUIINFO_MENU_NEW_SUBTREE (gnome_panel_new_menu), GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_SUBTREE(N_("Arrange Icons..."), arrange_icons_items), - GNOMEUIINFO_ITEM_NONE (N_("Create New Window"), NULL, handle_new_window), + GNOMEUIINFO_SUBTREE (N_("_Arrange Icons"), desktop_arrange_icons_items), + GNOMEUIINFO_ITEM_NONE (N_("Create _New Window"), NULL, handle_new_window), GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_ITEM_NONE (N_("Recreate Desktop Shortcuts"), NULL, handle_rescan_devices), - GNOMEUIINFO_ITEM_NONE (N_("Rescan Desktop"), NULL, handle_rescan_desktop), - GNOMEUIINFO_ITEM_NONE (N_("Configure Background Image"), NULL, set_background_image), + GNOMEUIINFO_ITEM_NONE (N_("Recreate Desktop _Shortcuts"), NULL, handle_rescan_devices), + GNOMEUIINFO_ITEM_NONE (N_("Rescan _Desktop"), NULL, handle_rescan_desktop), + GNOMEUIINFO_ITEM_NONE (N_("Configure _Background Image"), NULL, set_background_image), GNOMEUIINFO_END }; -static GList* strip_tearoff_menu(GnomeUIInfo *infos) { +static int +strip_tearoff_menu_item (GnomeUIInfo *infos) +{ GtkWidget *shell; GList *child_list; - g_return_if_fail(infos != NULL); - + int n; + + g_assert (infos != NULL); + shell = infos[0].widget->parent; child_list = gtk_container_children (GTK_CONTAINER (shell)); - if (GTK_IS_TEAROFF_MENU_ITEM (child_list->data)) + n = g_list_length (child_list); + + if (child_list && GTK_IS_TEAROFF_MENU_ITEM (child_list->data)) { + n--; + gtk_widget_destroy (GTK_WIDGET (child_list->data)); +#if 0 gtk_widget_hide (GTK_WIDGET (child_list->data)); - return child_list; +#endif + } + + return n; } - + /* Executes the popup menu for the desktop */ static void desktop_popup (GdkEventButton *event) { GtkWidget *shell; GtkWidget *popup; - GList *child_list; gchar *file, *file2; WPanel *panel; gint i; + /* Create the menu and then strip the tearoff menu items, sigh... */ + popup = gnome_popup_menu_new (desktop_popup_items); - /* First thing we want to do is strip off the STUPID tear off menu... S-: */ - strip_tearoff_menu(arrange_icons_items); - child_list = strip_tearoff_menu(gnome_panel_new_menu); + + strip_tearoff_menu_item (desktop_arrange_icons_items); + i = strip_tearoff_menu_item (gnome_panel_new_menu); shell = gnome_panel_new_menu[0].widget->parent; - i = g_list_length (child_list); - g_list_free (child_list); file = gnome_unconditional_datadir_file ("mc/templates"); i = create_new_menu_from (file, shell, i); file2 = gnome_datadir_file ("mc/templates"); @@ -3091,8 +3149,8 @@ setup_desktop_clicks (void) void desktop_init (void) { - infos_hash = g_hash_table_new(g_str_hash, g_str_equal); - + icon_hash = g_hash_table_new (g_str_hash, g_str_equal); + gdnd_init (); gicon_init (); create_layout_info (); @@ -3139,7 +3197,7 @@ desktop_destroy (void) gtk_widget_destroy (proxy_invisible); XDeleteProperty (GDK_DISPLAY (), GDK_ROOT_WINDOW (), gdk_atom_intern ("XdndProxy", FALSE)); - g_hash_table_destroy(infos_hash); + g_hash_table_destroy (icon_hash); } void diff --git a/gnome/gdesktop.h b/gnome/gdesktop.h index 6f09a3bb9..a123f8fb8 100644 --- a/gnome/gdesktop.h +++ b/gnome/gdesktop.h @@ -10,7 +10,6 @@ #define GDESKTOP_H #include "dir.h" -#include "gcmd.h" /* Snap granularity for desktop icons -- maybe these should be calculated in @@ -33,7 +32,8 @@ extern int desktop_arr_b2t; /* Arrange from bottom to top */ extern int desktop_arr_rows; /* Arrange in rows instead of columns */ extern char *desktop_directory; -extern GnomeUIInfo arrange_icons_items[]; +/* Menu items for arranging the desktop icons */ +extern GnomeUIInfo desktop_arrange_icons_items[]; /* Initializes the desktop -- init DnD, load the default desktop icons, etc. */ void desktop_init (void); @@ -69,10 +69,6 @@ gboolean is_ejectable (char *filename); gboolean do_mount_umount (char *filename, gboolean is_mount); gboolean do_eject (char *filename); -void handle_arrange_icons(GtkWidget *widget, gpointer data); -/* Used from two places so no longer static ^^ */ -void desktop_arrange_icons (SortType type); - void desktop_rescan_devices (void); void desktop_reload_icons (int user_pos, int xpos, int ypos); void desktop_create_url (const char *filename, const char *title, const char *url, const char *icon); diff --git a/gnome/glayout.c b/gnome/glayout.c index ca56f259a..1f2519249 100644 --- a/gnome/glayout.c +++ b/gnome/glayout.c @@ -451,10 +451,10 @@ GnomeUIInfo gnome_panel_about_menu [] = { }; GnomeUIInfo gnome_panel_desktop_menu [] = { - GNOMEUIINFO_SUBTREE(N_("Arrange Icons..."), arrange_icons_items), + GNOMEUIINFO_SUBTREE(N_("_Arrange Icons"), desktop_arrange_icons_items), GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_ITEM_NONE (N_("Rescan System Devices"), NULL, desktop_rescan_devices), - GNOMEUIINFO_ITEM_NONE (N_("Rescan Desktop"), NULL, do_desktop_rescan_devices), + GNOMEUIINFO_ITEM_NONE (N_("Recreate Desktop _Shortcuts"), NULL, desktop_rescan_devices), + GNOMEUIINFO_ITEM_NONE (N_("Rescan _Desktop"), NULL, do_desktop_rescan_devices), GNOMEUIINFO_END }; diff --git a/gnome/gscreen.c b/gnome/gscreen.c index 52fc0e0d6..35409b8d1 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -1467,6 +1467,21 @@ file_list_popup (GdkEventButton *event, WPanel *panel) } +/* Returns whether an icon in the icon list is being edited. FIXME: This + * function uses a fantastically ugly hack to figure this out. It would be + * saner to have a function provided by the icon list widget to do it, but we + * can't break forwards compatibility at this point. It would be even saner to + * have a good DnD API for the icon list. + */ +static int +editing_icon_list (GnomeIconList *gil) +{ + GnomeCanvasItem *item; + + item = GNOME_CANVAS (gil)->focused_item; + return (item && GNOME_IS_ICON_TEXT_ITEM (item) && GNOME_ICON_TEXT_ITEM (item)->editing); +} + /* * Strategy for activaing the drags from the icon-list: * @@ -1482,6 +1497,9 @@ panel_icon_list_button_press (GtkWidget *widget, GdkEventButton *event, WPanel * GnomeIconList *gil = GNOME_ICON_LIST (widget); int icon; + if (editing_icon_list (gil)) + return FALSE; + if (event->type != GDK_BUTTON_PRESS) return FALSE; diff --git a/gnome/gview.c b/gnome/gview.c index 16a64581e..e5d36fd15 100644 --- a/gnome/gview.c +++ b/gnome/gview.c @@ -133,7 +133,7 @@ view_status (WView *view, gboolean update_gui) char buffer [80]; if (view->hex_mode) - g_snprintf (buffer, sizeof (buffer), _("Offset 0x%08x"), view->edit_cursor); + g_snprintf (buffer, sizeof (buffer), _("Offset 0x%08lx"), view->edit_cursor); else g_snprintf (buffer, sizeof (buffer), _("Col %d"), -view->start_col); if (strcmp (buffer, GTK_LABEL (view->gtk_offset)->label)) diff --git a/src/ChangeLog b/src/ChangeLog index ad2e497c5..5d14e8856 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +1999-08-09 Federico Mena Quintero + + * ext.c: Added missing include file. + 1999-08-08 David Martin * menu.c: (create_menu): Adjust "#ifdef ENABLE_NLS" so that menus diff --git a/src/ext.c b/src/ext.c index 9e1068bcd..db928ba73 100644 --- a/src/ext.c +++ b/src/ext.c @@ -48,6 +48,9 @@ #ifdef SCO_FLAVOR #include #endif /* SCO_FLAVOR */ +#ifdef HAVE_GNOME +#include "gcmd.h" +#endif /* If set, we execute the file command to check the file type */ int use_file_to_check_type = 1;