1999-03-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (update_url): Made static. (desktop_reload_icons): Call update_url() when updating an existing icon. * gpopup2.c (handle_properties): Do not update the icon url here.
Этот коммит содержится в:
родитель
4663c905a2
Коммит
0bd0f7dac2
@ -1,3 +1,11 @@
|
|||||||
|
1999-03-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* gdesktop.c (update_url): Made static.
|
||||||
|
(desktop_reload_icons): Call update_url() when updating an
|
||||||
|
existing icon.
|
||||||
|
|
||||||
|
* gpopup2.c (handle_properties): Do not update the icon url here.
|
||||||
|
|
||||||
1999-03-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
1999-03-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
This is a semi-big slew of changes to integrate the DESKTOP_BRANCH
|
This is a semi-big slew of changes to integrate the DESKTOP_BRANCH
|
||||||
|
@ -364,6 +364,31 @@ icon_exists_in_list (GList *list, char *filename)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Loads from the metadata updated versions of the caption and the url */
|
||||||
|
static void
|
||||||
|
update_url (DesktopIconInfo *dii)
|
||||||
|
{
|
||||||
|
char *fullname = g_concat_dir_and_file (desktop_directory, dii->filename);
|
||||||
|
char *caption = NULL;
|
||||||
|
char *url = NULL;
|
||||||
|
int size;
|
||||||
|
|
||||||
|
gnome_metadata_get (fullname, "icon-caption", &size, &caption);
|
||||||
|
if (caption){
|
||||||
|
desktop_icon_set_text (DESKTOP_ICON (dii->dicon), caption);
|
||||||
|
g_free (caption);
|
||||||
|
}
|
||||||
|
|
||||||
|
gnome_metadata_get (fullname, "desktop-url", &size, &url);
|
||||||
|
if (url){
|
||||||
|
if (dii->url)
|
||||||
|
g_free (dii->url);
|
||||||
|
dii->url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_free (fullname);
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *filename;
|
char *filename;
|
||||||
char *url;
|
char *url;
|
||||||
@ -437,6 +462,8 @@ desktop_reload_icons (int user_pos, int xpos, int ypos)
|
|||||||
dii = l->data;
|
dii = l->data;
|
||||||
desktop_icon_set_icon (DESKTOP_ICON (dii->dicon), im);
|
desktop_icon_set_icon (DESKTOP_ICON (dii->dicon), im);
|
||||||
|
|
||||||
|
update_url (dii);
|
||||||
|
|
||||||
/* Leave the icon in the desktop by removing it from the list */
|
/* Leave the icon in the desktop by removing it from the list */
|
||||||
|
|
||||||
all_icons = g_list_remove_link (all_icons, l);
|
all_icons = g_list_remove_link (all_icons, l);
|
||||||
@ -1958,37 +1985,6 @@ desktop_icon_info_new (char *filename, char *url, char *caption, int xpos, int y
|
|||||||
return dii;
|
return dii;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* desktop_icon_update_url:
|
|
||||||
* @dii: the desktop icon
|
|
||||||
*
|
|
||||||
* Loads from the metadata updated versions of the caption
|
|
||||||
* and the url
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
desktop_icon_update_url (DesktopIconInfo *dii)
|
|
||||||
{
|
|
||||||
char *fullname = g_concat_dir_and_file (desktop_directory, dii->filename);
|
|
||||||
char *caption = NULL;
|
|
||||||
char *url = NULL;
|
|
||||||
int size;
|
|
||||||
|
|
||||||
gnome_metadata_get (fullname, "icon-caption", &size, &caption);
|
|
||||||
if (caption){
|
|
||||||
desktop_icon_set_text (DESKTOP_ICON (dii->dicon), caption);
|
|
||||||
g_free (caption);
|
|
||||||
}
|
|
||||||
|
|
||||||
gnome_metadata_get (fullname, "desktop-url", &size, &url);
|
|
||||||
if (url){
|
|
||||||
if (dii->url)
|
|
||||||
g_free (dii->url);
|
|
||||||
dii->url = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (fullname);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Creates the layout information array */
|
/* Creates the layout information array */
|
||||||
static void
|
static void
|
||||||
create_layout_info (void)
|
create_layout_info (void)
|
||||||
|
@ -102,12 +102,6 @@ dicon_properties (GtkWidget *widget, DesktopIconInfo *dii)
|
|||||||
if (gnome_dialog_run (GNOME_DIALOG (dlg)) == 0)
|
if (gnome_dialog_run (GNOME_DIALOG (dlg)) == 0)
|
||||||
retval = gnome_file_property_dialog_make_changes (GNOME_FILE_PROPERTY_DIALOG (dlg));
|
retval = gnome_file_property_dialog_make_changes (GNOME_FILE_PROPERTY_DIALOG (dlg));
|
||||||
|
|
||||||
/*
|
|
||||||
* Apply: desktop icon name change and url change
|
|
||||||
*/
|
|
||||||
if (dii->url)
|
|
||||||
desktop_icon_update_url (dii);
|
|
||||||
|
|
||||||
gtk_widget_destroy (dlg);
|
gtk_widget_destroy (dlg);
|
||||||
g_free(path);
|
g_free(path);
|
||||||
|
|
||||||
|
@ -687,12 +687,6 @@ handle_properties (GtkWidget *widget, WPanel *panel)
|
|||||||
retval = gnome_file_property_dialog_make_changes (
|
retval = gnome_file_property_dialog_make_changes (
|
||||||
GNOME_FILE_PROPERTY_DIALOG (dialog));
|
GNOME_FILE_PROPERTY_DIALOG (dialog));
|
||||||
|
|
||||||
if (is_a_desktop_panel (panel)) {
|
|
||||||
dii = desktop_icon_info_get_by_filename (selection (panel)->fname);
|
|
||||||
g_assert (dii != NULL);
|
|
||||||
desktop_icon_update_url (dii);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_destroy (dialog);
|
gtk_widget_destroy (dialog);
|
||||||
g_free (full_name);
|
g_free (full_name);
|
||||||
if (retval && !is_a_desktop_panel (panel))
|
if (retval && !is_a_desktop_panel (panel))
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user