1999-02-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
* 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.
Этот коммит содержится в:
родитель
9f9da99b3d
Коммит
6eb9a08b29
@ -1,9 +1,13 @@
|
|||||||
1999-02-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
1999-02-17 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
* gpopup.c (create_actions): Add ejectable
|
* gpopup.c (create_actions): Add ejectable
|
||||||
|
|
||||||
* gdesktop.c (do_eject): Add eject command.
|
* gdesktop.c (do_eject): Add eject command.
|
||||||
|
|
||||||
1999-02-16 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
1999-02-16 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gpopup.c (create_actions): Add support for mountable icons.
|
* gpopup.c (create_actions): Add support for mountable icons.
|
||||||
|
@ -368,6 +368,7 @@ reload_desktop_icons (int user_pos, int xpos, int ypos)
|
|||||||
GSList *need_position_list, *sl;
|
GSList *need_position_list, *sl;
|
||||||
GList *all_icons, *l;
|
GList *all_icons, *l;
|
||||||
char *desktop_url, *caption;
|
char *desktop_url, *caption;
|
||||||
|
const char *mime;
|
||||||
int orig_xpos, orig_ypos;
|
int orig_xpos, orig_ypos;
|
||||||
|
|
||||||
dir = mc_opendir (desktop_directory);
|
dir = mc_opendir (desktop_directory);
|
||||||
@ -502,6 +503,33 @@ reload_desktop_icons (int user_pos, int xpos, int ypos)
|
|||||||
get_icon_auto_pos (&xpos, &ypos);
|
get_icon_auto_pos (&xpos, &ypos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the file dropped was a .desktop file, pull the suggested
|
||||||
|
* title and icon from there
|
||||||
|
*/
|
||||||
|
mime = gnome_mime_type_or_default (fau->filename, NULL);
|
||||||
|
if (mime && strcmp (mime, "application/x-gnome-app-info") == 0){
|
||||||
|
GnomeDesktopEntry *entry;
|
||||||
|
char *fullname = g_concat_dir_and_file (desktop_directory, fau->filename);
|
||||||
|
|
||||||
|
entry = gnome_desktop_entry_load (fullname);
|
||||||
|
if (entry){
|
||||||
|
if (entry->name){
|
||||||
|
if (fau->caption)
|
||||||
|
g_free (fau->caption);
|
||||||
|
fau->caption = g_strdup (entry->name);
|
||||||
|
gnome_metadata_set (fullname, "icon-caption",
|
||||||
|
strlen (fau->caption)+1, fau->caption);
|
||||||
|
}
|
||||||
|
if (entry->icon){
|
||||||
|
gnome_metadata_set (fullname, "icon-filename",
|
||||||
|
strlen (entry->icon)+1, entry->icon);
|
||||||
|
}
|
||||||
|
gnome_desktop_entry_free (entry);
|
||||||
|
}
|
||||||
|
g_free (fullname);
|
||||||
|
}
|
||||||
|
|
||||||
dii = desktop_icon_info_new (fau->filename, fau->url, fau->caption, xpos, ypos);
|
dii = desktop_icon_info_new (fau->filename, fau->url, fau->caption, xpos, ypos);
|
||||||
gtk_widget_show (dii->dicon);
|
gtk_widget_show (dii->dicon);
|
||||||
|
|
||||||
@ -1587,7 +1615,8 @@ desktop_icon_info_new (char *filename, char *url, char *caption, int xpos, int y
|
|||||||
caption = url;
|
caption = url;
|
||||||
} else {
|
} else {
|
||||||
dii->url = NULL;
|
dii->url = NULL;
|
||||||
caption = filename;
|
if (caption == NULL)
|
||||||
|
caption = filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
icon_im = gicon_get_icon_for_file (desktop_directory, fe, FALSE);
|
icon_im = gicon_get_icon_for_file (desktop_directory, fe, FALSE);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user