1999-08-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* 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.
Этот коммит содержится в:
родитель
be51568dc6
Коммит
d8e892cb48
9
BUGS
9
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.
|
||||
|
@ -1,3 +1,42 @@
|
||||
1999-08-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* 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 <hestgray@ionet.net>
|
||||
|
||||
* gcmd.[ch]
|
||||
|
14
gnome/gcmd.c
14
gnome/gcmd.c
@ -237,31 +237,41 @@ 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;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
return sfn;
|
||||
}
|
||||
|
||||
|
212
gnome/gdesktop.c
212
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,28 +171,39 @@ 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_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 0
|
||||
if (desktop_arr_r2l)
|
||||
swap (&sx, &ex);
|
||||
|
||||
if (desktop_arr_rows) swap (&xinc, &yinc);
|
||||
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) {
|
||||
@ -208,7 +222,9 @@ auto_pos (int sx, int ex, int sy, int ey, int *slot)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (val == 0) break;
|
||||
|
||||
if (val == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
*slot = min_slot;
|
||||
@ -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);*/
|
||||
#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_b2t) sy = layout_rows - 1; else sy = 0;
|
||||
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);
|
||||
|
||||
if (caption)
|
||||
fau->caption = g_strdup (caption);
|
||||
|
||||
need_position_list = g_slist_prepend (need_position_list, fau);
|
||||
}
|
||||
|
||||
@ -664,11 +711,11 @@ 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;
|
||||
@ -676,15 +723,14 @@ desktop_arrange_icons (SortType type)
|
||||
|
||||
panel = create_panel_from_desktop ();
|
||||
sfn = sort_get_func_from_type (type);
|
||||
g_return_if_fail(sfn != NULL);
|
||||
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);
|
||||
@ -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);
|
||||
@ -1513,7 +1562,7 @@ 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,11 +2185,10 @@ 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;
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -2589,17 +2639,14 @@ static GnomeUIInfo gnome_panel_new_menu [] = {
|
||||
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
|
||||
};
|
||||
|
||||
@ -2607,25 +2654,37 @@ GnomeUIInfo arrange_icons_items[] = {
|
||||
GnomeUIInfo desktop_popup_items[] = {
|
||||
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 */
|
||||
@ -2634,18 +2693,17 @@ 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,7 +3149,7 @@ 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 ();
|
||||
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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))
|
||||
|
@ -1,3 +1,7 @@
|
||||
1999-08-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* ext.c: Added missing include file.
|
||||
|
||||
1999-08-08 David Martin <dmartina@usa.net>
|
||||
|
||||
* menu.c: (create_menu): Adjust "#ifdef ENABLE_NLS" so that menus
|
||||
|
@ -48,6 +48,9 @@
|
||||
#ifdef SCO_FLAVOR
|
||||
#include <sys/wait.h>
|
||||
#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;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user