1
1

1999-01-28 Jonathan Blandford <jrb@redhat.com>

* gnome-file-property-dialog.c (create_settings_pane): We only let
	you set info if we are a regular file, or a link to a regular file.

	* gdesktop-icon.c (desktop_icon_reshape): Cut-n-paste error fixed
	by Quartic.

1999-01-27  Jonathan Blandford  <jrb@redhat.com>

	* 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.

	* gicon.c: make we_can_afford_the_speed non-static
Этот коммит содержится в:
Jonathan Blandford 1999-01-28 05:48:02 +00:00
родитель 53c34b967d
Коммит abc8c20b29
9 изменённых файлов: 249 добавлений и 208 удалений

Просмотреть файл

@ -1,3 +1,22 @@
1999-01-28 Jonathan Blandford <jrb@redhat.com>
* gnome-file-property-dialog.c (create_settings_pane): We only let
you set info if we are a regular file, or a link to a regular file.
* gdesktop-icon.c (desktop_icon_reshape): Cut-n-paste error fixed
by Quartic.
1999-01-27 Jonathan Blandford <jrb@redhat.com>
* 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.
* gicon.c: make we_can_afford_the_speed non-static
1999-01-27 Miguel de Icaza <miguel@nuclecu.unam.mx> 1999-01-27 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gcorba.c: Provide new code to activate an existing * gcorba.c: Provide new code to activate an existing

Просмотреть файл

@ -374,7 +374,7 @@ desktop_icon_reshape (DesktopIcon *dicon)
args[1].name = "height"; args[1].name = "height";
gtk_object_getv (GTK_OBJECT (dicon->icon), 2, args); gtk_object_getv (GTK_OBJECT (dicon->icon), 2, args);
icon_width = GTK_VALUE_DOUBLE (args[0]); icon_width = GTK_VALUE_DOUBLE (args[0]);
icon_height = GTK_VALUE_DOUBLE (args[0]); icon_height = GTK_VALUE_DOUBLE (args[1]);
/* Get size of icon text */ /* Get size of icon text */

Просмотреть файл

@ -39,7 +39,7 @@ static gid_t our_gid;
/* /*
* If true, we choose the icon in a way that might be a bit slow * If true, we choose the icon in a way that might be a bit slow
*/ */
static int we_can_affort_the_speed = 0; int we_can_afford_the_speed = 0;
/** /**
* gicon_init: * gicon_init:
@ -246,7 +246,7 @@ gicon_get_icon_for_file_speed (char *directory, file_entry *fe, gboolean do_quic
/* /*
* 2. Expensive tests * 2. Expensive tests
*/ */
if (!do_quick || we_can_affort_the_speed) { if (!do_quick || we_can_afford_the_speed) {
char *full_name; char *full_name;
full_name = g_concat_dir_and_file (directory, fe->fname); full_name = g_concat_dir_and_file (directory, fe->fname);

Просмотреть файл

@ -1,10 +1,10 @@
#ifndef GNOME_GICON_H #ifndef GNOME_GICON_H
#define GNOME_GICON_H #define GNOME_GICON_H
GdkImlibImage *gicon_get_by_filename (char *fname); GdkImlibImage *gicon_get_by_filename (char *fname);
GdkImlibImage *gicon_stock_load (char *basename); GdkImlibImage *gicon_stock_load (char *basename);
GdkImlibImage *gicon_get_icon_for_file (char *directory, file_entry *fe); GdkImlibImage *gicon_get_icon_for_file (char *directory, file_entry *fe);
GdkImlibImage *gicon_get_icon_for_file_speed (char *directory, file_entry *fe, gboolean do_quick); GdkImlibImage *gicon_get_icon_for_file_speed (char *directory, file_entry *fe, gboolean do_quick);
char *gicon_image_to_name (GdkImlibImage *image); char *gicon_image_to_name (GdkImlibImage *image);

Просмотреть файл

@ -28,6 +28,9 @@
#include <sys/stat.h> #include <sys/stat.h>
#include "fileopctx.h" #include "fileopctx.h"
#include "file.h" #include "file.h"
#include "../vfs/vfs.h"
#include "gicon.h"
#include "dialog.h"
static void gnome_file_property_dialog_init (GnomeFilePropertyDialog *file_property_dialog); static void gnome_file_property_dialog_init (GnomeFilePropertyDialog *file_property_dialog);
static void gnome_file_property_dialog_class_init (GnomeFilePropertyDialogClass *klass); static void gnome_file_property_dialog_class_init (GnomeFilePropertyDialogClass *klass);
@ -134,7 +137,7 @@ create_general_properties (GnomeFilePropertyDialog *fp_dlg)
/* first, we set the icon */ /* first, we set the icon */
direc = g_strdup (fp_dlg->file_name); direc = g_strdup (fp_dlg->file_name);
rindex (direc, '/')[0] = NULL; rindex (direc, '/')[0] = '\0';
fe = file_entry_from_file (fp_dlg->file_name); fe = file_entry_from_file (fp_dlg->file_name);
fp_dlg->im = gicon_get_icon_for_file (direc, fe); fp_dlg->im = gicon_get_icon_for_file (direc, fe);
g_free (direc); g_free (direc);
@ -182,7 +185,7 @@ create_general_properties (GnomeFilePropertyDialog *fp_dlg)
label = gtk_label_new (_("File Type: Symbolic Link")); label = gtk_label_new (_("File Type: Symbolic Link"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
n = readlink (fp_dlg->file_name, size, 49); n = mc_readlink (fp_dlg->file_name, size, 49);
if (n < 0) if (n < 0)
label = gtk_label_new (_("Target Name: INVALID LINK")); label = gtk_label_new (_("Target Name: INVALID LINK"));
else { else {
@ -275,11 +278,22 @@ metadata_toggled (GtkWidget *cbox, GnomeFilePropertyDialog *fp_dlg)
{ {
if (fp_dlg->changing) if (fp_dlg->changing)
return; return;
if (cbox == fp_dlg->prop1_cbox) { if (cbox == fp_dlg->open_cbox) {
if (GTK_TOGGLE_BUTTON (cbox)->active) {
gtk_widget_set_sensitive (fp_dlg->open_entry, FALSE);
if (fp_dlg->mime_fm_open)
gtk_entry_set_text (GTK_ENTRY (fp_dlg->open_entry), fp_dlg->mime_fm_open);
} else {
gtk_widget_set_sensitive (fp_dlg->open_entry, TRUE);
if (fp_dlg->fm_open) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->open_entry), fp_dlg->fm_open);
}
}
} else if (cbox == fp_dlg->prop1_cbox) {
if (GTK_TOGGLE_BUTTON (cbox)->active) { if (GTK_TOGGLE_BUTTON (cbox)->active) {
gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE); gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE);
if (fp_dlg->executable && fp_dlg->mime_fm_open) { if (fp_dlg->executable && fp_dlg->mime_drop_target) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->mime_fm_open); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->mime_drop_target);
} else if (!fp_dlg->executable && fp_dlg->mime_fm_view) { } else if (!fp_dlg->executable && fp_dlg->mime_fm_view) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->mime_fm_view); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->mime_fm_view);
} else { } else {
@ -287,8 +301,8 @@ metadata_toggled (GtkWidget *cbox, GnomeFilePropertyDialog *fp_dlg)
} }
} else { } else {
gtk_widget_set_sensitive (fp_dlg->prop1_entry, TRUE); gtk_widget_set_sensitive (fp_dlg->prop1_entry, TRUE);
if (fp_dlg->executable && fp_dlg->fm_open) { if (fp_dlg->executable && fp_dlg->drop_target) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->fm_open); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->drop_target);
} else if (!fp_dlg->executable && fp_dlg->fm_view) { } else if (!fp_dlg->executable && fp_dlg->fm_view) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->fm_view); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->fm_view);
} }
@ -296,18 +310,14 @@ metadata_toggled (GtkWidget *cbox, GnomeFilePropertyDialog *fp_dlg)
} else { } else {
if (GTK_TOGGLE_BUTTON (cbox)->active) { if (GTK_TOGGLE_BUTTON (cbox)->active) {
gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE); gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE);
if (fp_dlg->executable && fp_dlg->mime_drop_target) { if (fp_dlg->mime_edit) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->mime_drop_target);
} else if (!fp_dlg->executable && fp_dlg->mime_edit) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->mime_edit); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->mime_edit);
} else { } else {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), ""); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), "");
} }
} else { } else {
gtk_widget_set_sensitive (fp_dlg->prop2_entry, TRUE); gtk_widget_set_sensitive (fp_dlg->prop2_entry, TRUE);
if (fp_dlg->executable && fp_dlg->drop_target) { if (fp_dlg->edit) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->drop_target);
} else if (!fp_dlg->executable && fp_dlg->edit) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->edit); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->edit);
} }
} }
@ -320,16 +330,14 @@ switch_metadata_box (GnomeFilePropertyDialog *fp_dlg)
return; return;
fp_dlg->changing = TRUE; fp_dlg->changing = TRUE;
if (fp_dlg->executable) { if (fp_dlg->executable) {
gtk_label_set_text (GTK_LABEL (fp_dlg->prop1_label), "Open"); gtk_label_set_text (GTK_LABEL (fp_dlg->prop1_label), "Drop Action");
gtk_label_set_text (GTK_LABEL (fp_dlg->prop2_label), "Drop Action"); gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop1_cbox)->child), "Use default Drop Action options");
gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop1_cbox)->child), "Use default Open options"); if (fp_dlg->drop_target) {
gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop2_cbox)->child), "Use default Drop Action options");
if (fp_dlg->fm_open) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->fm_open);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), FALSE); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), FALSE);
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->drop_target);
gtk_widget_set_sensitive (fp_dlg->prop1_entry, TRUE); gtk_widget_set_sensitive (fp_dlg->prop1_entry, TRUE);
} else if (fp_dlg->mime_fm_open) { } else if (fp_dlg->mime_drop_target) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->mime_fm_open); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->mime_drop_target);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), TRUE); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE); gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE);
} else { } else {
@ -337,24 +345,9 @@ switch_metadata_box (GnomeFilePropertyDialog *fp_dlg)
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), TRUE); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE); gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE);
} }
if (fp_dlg->drop_target) {
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), FALSE);
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->drop_target);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, TRUE);
} else if (fp_dlg->mime_drop_target) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->mime_drop_target);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE);
} else {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), "");
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE);
}
} else { } else {
gtk_label_set_text (GTK_LABEL (fp_dlg->prop1_label), "View"); gtk_label_set_text (GTK_LABEL (fp_dlg->prop1_label), "View");
gtk_label_set_text (GTK_LABEL (fp_dlg->prop2_label), "Edit");
gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop1_cbox)->child), "Use default View options"); gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop1_cbox)->child), "Use default View options");
gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop2_cbox)->child), "Use default Edit options");
if (fp_dlg->fm_view) { if (fp_dlg->fm_view) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->fm_view); gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->fm_view);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), FALSE); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), FALSE);
@ -368,100 +361,31 @@ switch_metadata_box (GnomeFilePropertyDialog *fp_dlg)
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), TRUE); gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE); gtk_widget_set_sensitive (fp_dlg->prop1_entry, FALSE);
} }
if (fp_dlg->edit) { }
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), FALSE); if (fp_dlg->executable) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->edit); gtk_widget_hide (fp_dlg->prop2_label);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, TRUE); gtk_widget_hide (fp_dlg->prop2_entry);
} else if (fp_dlg->mime_edit) { gtk_widget_hide (fp_dlg->prop2_cbox);
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->mime_edit); gtk_widget_hide (fp_dlg->prop2_hline);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), TRUE); } else {
gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE); gtk_widget_show (fp_dlg->prop2_label);
} else { gtk_widget_show (fp_dlg->prop2_entry);
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), ""); gtk_widget_show (fp_dlg->prop2_cbox);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), TRUE); gtk_widget_show (fp_dlg->prop2_hline);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE);
}
} }
fp_dlg->changing = FALSE; fp_dlg->changing = FALSE;
} }
/* Stolen from gnome-icon-entry.c */
/* - jrb */
static void
icon_selected_cb(GtkButton * button, GnomeFilePropertyDialog *fp_dlg)
{
const gchar * icon;
GnomeIconSelection * gis;
gis = gtk_object_get_user_data(GTK_OBJECT(fp_dlg));
icon = gnome_icon_selection_get_icon(gis, TRUE);
if (icon != NULL) {
g_print ("icon:%s:\n",icon);
}
}
#if 0
static void
gil_icon_selected_cb(GnomeIconList *gil, gint num, GdkEvent *event, GnomeIconEntry *ientry)
{
if(event && event->type == GDK_2BUTTON_PRESS && ((GdkEventButton *)event)->button == 1) {
icon_selected_cb(NULL, ientry);
gtk_widget_hide(ientry->pick_dialog);
}
g_print ("in gil_icon_selected_cb callback \n");
}
#endif
static void
icon_sel_callback (GtkWidget *button, GnomeFilePropertyDialog *fp_dlg)
{
GtkWidget *icon_sel;
if (fp_dlg->dlg)
fp_dlg->dlg = gnome_dialog_new("Select An Icon",
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL,
NULL);
gnome_dialog_close_hides(GNOME_DIALOG(fp_dlg->dlg), TRUE);
gnome_dialog_set_close (GNOME_DIALOG(fp_dlg->dlg), TRUE);
gtk_window_set_policy(GTK_WINDOW(fp_dlg->dlg),
TRUE, TRUE, TRUE);
icon_sel = gnome_icon_selection_new();
gnome_icon_selection_add_directory(GNOME_ICON_SELECTION(icon_sel),
"/opt/gnome/share/pixmaps/");
gtk_container_add(GTK_CONTAINER(GNOME_DIALOG(fp_dlg->dlg)->vbox), icon_sel);
gtk_widget_show_all(fp_dlg->dlg);
gnome_icon_selection_show_icons(GNOME_ICON_SELECTION(icon_sel));
gtk_object_set_user_data(GTK_OBJECT(fp_dlg), icon_sel);
gnome_dialog_button_connect(GNOME_DIALOG(fp_dlg->dlg),
0, /* OK button */
GTK_SIGNAL_FUNC(icon_selected_cb),
fp_dlg);
#if 0
gtk_signal_connect_after(GTK_OBJECT(GNOME_ICON_SELECTION(iconsel)->gil), "select_icon",
GTK_SIGNAL_FUNC(gil_icon_selected_cb),
ientry);
#endif
}
static GtkWidget * static GtkWidget *
generate_icon_sel (GnomeFilePropertyDialog *fp_dlg) generate_icon_sel (GnomeFilePropertyDialog *fp_dlg)
{ {
GtkWidget *retval; GtkWidget *retval;
GtkWidget *icon; gchar *icon;
retval = gtk_button_new ();
gtk_widget_set_usize (retval, 64, 64);
icon = gnome_pixmap_new_from_imlib (fp_dlg->im);
gtk_container_add (GTK_CONTAINER (retval), icon);
gtk_signal_connect (GTK_OBJECT (retval), "clicked", icon_sel_callback, fp_dlg);
retval = gnome_icon_entry_new ("gmc_file_icon", "Select an Icon");
icon = gicon_image_to_name (fp_dlg->im);
if (!icon || !icon[0])
return retval;
gnome_icon_entry_set_icon (GNOME_ICON_ENTRY (retval), icon);
return retval; return retval;
} }
static GtkWidget * static GtkWidget *
@ -471,7 +395,8 @@ generate_actions_box (GnomeFilePropertyDialog *fp_dlg)
GtkWidget *table; GtkWidget *table;
/* Here's the Logic: */ /* Here's the Logic: */
/* If we are a file, and an Executable, we want to edit our "open" and "drop-target" */ /* All tops of files (other then folders) should let us edit "open" */
/* If we are a file, and an executable, we want to edit our "drop-target" */
/* Metadata, as it is meaningful to us. */ /* Metadata, as it is meaningful to us. */
/* If we are non-executable, we want to edit our "edit" and "view" fields. */ /* If we are non-executable, we want to edit our "edit" and "view" fields. */
/* Sym links want to have the same options as above, but use their Target's */ /* Sym links want to have the same options as above, but use their Target's */
@ -479,86 +404,141 @@ generate_actions_box (GnomeFilePropertyDialog *fp_dlg)
/* Note, symlinks can set their own metadata, independent from their */ /* Note, symlinks can set their own metadata, independent from their */
/* targets. */ /* targets. */
table = gtk_table_new (5, 2, FALSE); table = gtk_table_new (8, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), GNOME_PAD_SMALL); gtk_container_set_border_width (GTK_CONTAINER (table), GNOME_PAD_SMALL);
/* we do open first */
fp_dlg->open_label = gtk_label_new ("Open");
gtk_misc_set_alignment (GTK_MISC (fp_dlg->open_label), 0.0, 0.5);
gtk_misc_set_padding (GTK_MISC (fp_dlg->open_label), 2, 0);
gtk_table_attach_defaults (GTK_TABLE (table),
fp_dlg->open_label,
0, 1, 0, 1);
fp_dlg->open_entry = gtk_entry_new ();
gtk_table_attach_defaults (GTK_TABLE (table),
fp_dlg->open_entry,
1, 2, 0, 1);
fp_dlg->open_cbox = gtk_check_button_new_with_label (_("Use default Open options"));
gtk_signal_connect (GTK_OBJECT (fp_dlg->open_cbox), "toggled", metadata_toggled, fp_dlg);
gtk_table_attach_defaults (GTK_TABLE (table), fp_dlg->open_cbox, 0, 2, 1, 2);
vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, GNOME_PAD_SMALL);
gtk_table_attach_defaults (GTK_TABLE (table), vbox, 0, 2, 2, 3);
if (fp_dlg->executable) if (fp_dlg->executable)
fp_dlg->prop1_label = gtk_label_new (_("Open")); fp_dlg->prop1_label = gtk_label_new (_("Drop Action"));
else else
fp_dlg->prop1_label = gtk_label_new (_("View")); fp_dlg->prop1_label = gtk_label_new (_("View"));
gtk_misc_set_alignment (GTK_MISC (fp_dlg->prop1_label), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (fp_dlg->prop1_label), 0.0, 0.5);
gtk_misc_set_padding (GTK_MISC (fp_dlg->prop1_label), 2, 0); gtk_misc_set_padding (GTK_MISC (fp_dlg->prop1_label), 2, 0);
gtk_table_attach_defaults (GTK_TABLE (table), gtk_table_attach_defaults (GTK_TABLE (table),
fp_dlg->prop1_label, fp_dlg->prop1_label,
0, 1, 0, 1); 0, 1, 3, 4);
fp_dlg->prop1_entry = gtk_entry_new (); fp_dlg->prop1_entry = gtk_entry_new ();
gtk_table_attach_defaults (GTK_TABLE (table), gtk_table_attach_defaults (GTK_TABLE (table),
fp_dlg->prop1_entry, fp_dlg->prop1_entry,
1, 2, 0, 1); 1, 2, 3, 4);
if (fp_dlg->executable) if (fp_dlg->executable)
fp_dlg->prop1_cbox = gtk_check_button_new_with_label (_("Use default Open options")); fp_dlg->prop1_cbox = gtk_check_button_new_with_label (_("Use default Drop action options"));
else else
fp_dlg->prop1_cbox = gtk_check_button_new_with_label (_("Use default View options")); fp_dlg->prop1_cbox = gtk_check_button_new_with_label (_("Use default View options"));
gtk_signal_connect (GTK_OBJECT (fp_dlg->prop1_cbox), "toggled", metadata_toggled, fp_dlg); gtk_signal_connect (GTK_OBJECT (fp_dlg->prop1_cbox), "toggled", metadata_toggled, fp_dlg);
gtk_table_attach_defaults (GTK_TABLE (table), fp_dlg->prop1_cbox, 0, 2, 1, 2); gtk_table_attach_defaults (GTK_TABLE (table), fp_dlg->prop1_cbox, 0, 2, 4, 5);
vbox = gtk_vbox_new (FALSE, 0); vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, GNOME_PAD_SMALL); fp_dlg->prop2_hline = gtk_hseparator_new ();
gtk_table_attach_defaults (GTK_TABLE (table), vbox, 0, 2, 2, 3); gtk_box_pack_start (GTK_BOX (vbox), fp_dlg->prop2_hline, FALSE, FALSE, GNOME_PAD_SMALL);
gtk_table_attach_defaults (GTK_TABLE (table), vbox, 0, 2, 5, 6);
if (fp_dlg->executable) fp_dlg->prop2_label = gtk_label_new (_("Edit"));
fp_dlg->prop2_label = gtk_label_new (_("Drop Action"));
else
fp_dlg->prop2_label = gtk_label_new (_("Edit"));
gtk_misc_set_alignment (GTK_MISC (fp_dlg->prop2_label), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (fp_dlg->prop2_label), 0.0, 0.5);
gtk_misc_set_padding (GTK_MISC (fp_dlg->prop2_label), 2, 0); gtk_misc_set_padding (GTK_MISC (fp_dlg->prop2_label), 2, 0);
gtk_table_attach_defaults (GTK_TABLE (table), gtk_table_attach_defaults (GTK_TABLE (table),
fp_dlg->prop2_label, fp_dlg->prop2_label,
0, 1, 3, 4); 0, 1, 6, 7);
fp_dlg->prop2_entry = gtk_entry_new (); fp_dlg->prop2_entry = gtk_entry_new ();
gtk_table_attach_defaults (GTK_TABLE (table), gtk_table_attach_defaults (GTK_TABLE (table),
fp_dlg->prop2_entry, fp_dlg->prop2_entry,
1, 2, 3, 4); 1, 2, 6, 7);
if (fp_dlg->executable) fp_dlg->prop2_cbox = gtk_check_button_new_with_label (_("Use default Edit options"));
fp_dlg->prop2_cbox = gtk_check_button_new_with_label (_("Use default Drop Action options"));
else
fp_dlg->prop2_cbox = gtk_check_button_new_with_label (_("Use default Edit options"));
gtk_signal_connect (GTK_OBJECT (fp_dlg->prop2_cbox), "toggled", metadata_toggled, fp_dlg); gtk_signal_connect (GTK_OBJECT (fp_dlg->prop2_cbox), "toggled", metadata_toggled, fp_dlg);
gtk_table_attach_defaults (GTK_TABLE (table), fp_dlg->prop2_cbox, 0, 2, 4, 5); gtk_table_attach_defaults (GTK_TABLE (table), fp_dlg->prop2_cbox, 0, 2, 7, 8);
/* It's okay to do this now... */
switch_metadata_box (fp_dlg); /* we set the open field */
fp_dlg->changing = TRUE;
if (fp_dlg->fm_open) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->open_entry), fp_dlg->fm_open);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->open_cbox), FALSE);
gtk_widget_set_sensitive (fp_dlg->open_entry, TRUE);
} else if (fp_dlg->mime_fm_open) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->open_entry), fp_dlg->mime_fm_open);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->open_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->open_entry, FALSE);
} else {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->open_entry), "");
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->open_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->open_entry, FALSE);
}
if (fp_dlg->edit) {
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), FALSE);
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->edit);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, TRUE);
} else if (fp_dlg->mime_edit) {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), fp_dlg->mime_edit);
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE);
} else {
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop2_entry), "");
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop2_cbox), TRUE);
gtk_widget_set_sensitive (fp_dlg->prop2_entry, FALSE);
}
fp_dlg->changing = FALSE;
return table; return table;
} }
static GtkWidget * static GtkWidget *
create_settings_pane (GnomeFilePropertyDialog *fp_dlg) create_settings_pane (GnomeFilePropertyDialog *fp_dlg)
{ {
GtkWidget *vbox; GtkWidget *vbox = NULL;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *vbox2; GtkWidget *vbox2;
GtkWidget *button;
GtkWidget *frame; GtkWidget *frame;
GtkWidget *align; GtkWidget *align;
GtkWidget *table; GtkWidget *table;
struct stat linkstat;
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL); vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD); gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD);
frame = gtk_frame_new (_("Icon")); if (fp_dlg->can_set_icon) {
vbox2 = gtk_vbox_new (FALSE, 0);
hbox = gtk_hbox_new (FALSE, 0);
align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
button = generate_icon_sel (fp_dlg);
gtk_container_add (GTK_CONTAINER (frame), vbox2);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), align, TRUE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (align), button);
/* Are we a directory? If so, we do nothing else. */ frame = gtk_frame_new (_("Icon"));
if (!(S_ISREG (fp_dlg->st.st_mode) || S_ISLNK (fp_dlg->st.st_mode))) vbox2 = gtk_vbox_new (FALSE, 0);
hbox = gtk_hbox_new (FALSE, 0);
align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
fp_dlg->button = generate_icon_sel (fp_dlg);
gtk_container_add (GTK_CONTAINER (frame), vbox2);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), align, TRUE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (align), fp_dlg->button);
}
/* Are we a directory or device? If so, we do nothing else. */
if (S_ISLNK (fp_dlg->st.st_mode))
mc_stat (fp_dlg->file_name, &linkstat);
if (!(S_ISREG (fp_dlg->st.st_mode) || (S_ISLNK (fp_dlg->st.st_mode) && !S_ISREG (linkstat.st_mode)))) {
if (!fp_dlg->can_set_icon) {
gtk_widget_unref (vbox);
vbox = NULL;
}
return vbox; return vbox;
/* We must be a file or a link. */ }
/* We must be a file or a link to a file. */
frame = gtk_frame_new (_("Actions")); frame = gtk_frame_new (_("Actions"));
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
table = generate_actions_box (fp_dlg); table = generate_actions_box (fp_dlg);
@ -904,6 +884,9 @@ init_metadata (GnomeFilePropertyDialog *fp_dlg)
{ {
gint size; gint size;
gchar *mime_type; gchar *mime_type;
gchar link_name[60];
gint n;
gchar *file_name;
if (gnome_metadata_get (fp_dlg->file_name, "fm-open", &size, &fp_dlg->fm_open) != 0) if (gnome_metadata_get (fp_dlg->file_name, "fm-open", &size, &fp_dlg->fm_open) != 0)
gnome_metadata_get (fp_dlg->file_name, "open", &size, &fp_dlg->fm_open); gnome_metadata_get (fp_dlg->file_name, "open", &size, &fp_dlg->fm_open);
@ -912,7 +895,17 @@ init_metadata (GnomeFilePropertyDialog *fp_dlg)
gnome_metadata_get (fp_dlg->file_name, "edit", &size, &fp_dlg->edit); gnome_metadata_get (fp_dlg->file_name, "edit", &size, &fp_dlg->edit);
gnome_metadata_get (fp_dlg->file_name, "drop-target", &size, &fp_dlg->drop_target); gnome_metadata_get (fp_dlg->file_name, "drop-target", &size, &fp_dlg->drop_target);
mime_type = gnome_mime_type_or_default (fp_dlg->file_name, NULL); /* Mime stuff */
file_name = fp_dlg->file_name;
if (S_ISLNK (fp_dlg->st.st_mode)) {
n = mc_readlink (fp_dlg->file_name, link_name, 59);
if (n > 0) {
link_name[n] = '\0';
file_name = link_name;
}
}
mime_type = gnome_mime_type_or_default (file_name, NULL);
if (!mime_type) if (!mime_type)
return; return;
fp_dlg->mime_fm_open = gnome_mime_get_value (mime_type, "fm-open"); fp_dlg->mime_fm_open = gnome_mime_get_value (mime_type, "fm-open");
@ -923,25 +916,18 @@ init_metadata (GnomeFilePropertyDialog *fp_dlg)
fp_dlg->mime_fm_view = gnome_mime_get_value (mime_type, "view"); fp_dlg->mime_fm_view = gnome_mime_get_value (mime_type, "view");
fp_dlg->mime_edit = gnome_mime_get_value (mime_type, "edit"); fp_dlg->mime_edit = gnome_mime_get_value (mime_type, "edit");
fp_dlg->mime_edit = gnome_mime_get_value (mime_type, "drop-target"); fp_dlg->mime_edit = gnome_mime_get_value (mime_type, "drop-target");
g_print ("mime_type:%s:\n", mime_type);
g_print ("fm-open:%s:\n", fp_dlg->fm_open); gnome_metadata_get (fp_dlg->file_name, "icon-filename", &size, &fp_dlg->icon_filename);
g_print ("fm-view:%s:\n", fp_dlg->fm_view); if (fp_dlg->icon_filename)
g_print ("edit:%s:\n", fp_dlg->edit); g_print ("we have an icon-filename:%s:\n", fp_dlg->icon_filename);
g_print ("drop-target:%s:\n", fp_dlg->drop_target);
g_print ("mime-fm-open:%s:\n", fp_dlg->mime_fm_open);
g_print ("mime-fm-view:%s:\n", fp_dlg->mime_fm_view);
g_print ("mime-edit:%s:\n", fp_dlg->mime_edit);
g_print ("mime-drop-target:%s:\n", fp_dlg->mime_drop_target);
} }
GtkWidget * GtkWidget *
gnome_file_property_dialog_new (gchar *file_name) gnome_file_property_dialog_new (gchar *file_name, gboolean can_set_icon)
{ {
GnomeFilePropertyDialog *fp_dlg; GnomeFilePropertyDialog *fp_dlg;
GtkWidget *notebook; GtkWidget *notebook;
GtkWidget *new_page;
gchar *title_string; gchar *title_string;
gint size;
g_return_val_if_fail (file_name != NULL, NULL); g_return_val_if_fail (file_name != NULL, NULL);
fp_dlg = gtk_type_new (gnome_file_property_dialog_get_type ()); fp_dlg = gtk_type_new (gnome_file_property_dialog_get_type ());
@ -962,6 +948,7 @@ gnome_file_property_dialog_new (gchar *file_name)
fp_dlg->file_name = g_strdup (file_name); fp_dlg->file_name = g_strdup (file_name);
fp_dlg->euid = geteuid (); fp_dlg->euid = geteuid ();
fp_dlg->can_set_icon = can_set_icon;
if (S_ISCHR (fp_dlg->st.st_mode) || S_ISBLK (fp_dlg->st.st_mode) if (S_ISCHR (fp_dlg->st.st_mode) || S_ISBLK (fp_dlg->st.st_mode)
|| ((fp_dlg->euid != fp_dlg->st.st_uid) && (fp_dlg->euid != 0))) || ((fp_dlg->euid != fp_dlg->st.st_uid) && (fp_dlg->euid != 0)))
fp_dlg->modifyable = FALSE; fp_dlg->modifyable = FALSE;
@ -972,9 +959,11 @@ gnome_file_property_dialog_new (gchar *file_name)
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
create_general_properties (fp_dlg), create_general_properties (fp_dlg),
gtk_label_new (_("Statistics"))); gtk_label_new (_("Statistics")));
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), new_page = create_settings_pane (fp_dlg);
create_settings_pane (fp_dlg), if (new_page)
gtk_label_new (_("Options"))); gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
new_page,
gtk_label_new (_("Options")));
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
create_perm_properties (fp_dlg), create_perm_properties (fp_dlg),
gtk_label_new (_("Permissions"))); gtk_label_new (_("Permissions")));
@ -988,7 +977,11 @@ gnome_file_property_dialog_new (gchar *file_name)
gnome_dialog_append_button ( GNOME_DIALOG(fp_dlg), gnome_dialog_append_button ( GNOME_DIALOG(fp_dlg),
GNOME_STOCK_BUTTON_CANCEL); GNOME_STOCK_BUTTON_CANCEL);
gtk_widget_show_all (GNOME_DIALOG (fp_dlg)->vbox); gtk_widget_show_all (GNOME_DIALOG (fp_dlg)->vbox);
/* It's okay to do this now... */
/* and set the rest of the fields */
switch_metadata_box (fp_dlg);
return GTK_WIDGET (fp_dlg); return GTK_WIDGET (fp_dlg);
} }
static gint static gint
@ -1092,24 +1085,26 @@ static gint
apply_metadata_change (GnomeFilePropertyDialog *fpd) apply_metadata_change (GnomeFilePropertyDialog *fpd)
{ {
gchar *text; gchar *text;
gchar *icon_name;
if (!GTK_TOGGLE_BUTTON (fpd->open_cbox)->active) {
text = gtk_entry_get_text (GTK_ENTRY (fpd->open_entry));
if (text && text[0])
gnome_metadata_set (fpd->file_name,
"fm_open",
strlen (text) + 1,
text);
else
gnome_metadata_remove (fpd->file_name,
"fm_open");
} else {
if (fpd->fm_open)
gnome_metadata_remove (fpd->file_name,
"fm_open");
}
if (fpd->executable) { if (fpd->executable) {
if (!GTK_TOGGLE_BUTTON (fpd->prop1_cbox)->active) { if (!GTK_TOGGLE_BUTTON (fpd->prop1_cbox)->active) {
text = gtk_entry_get_text (GTK_ENTRY (fpd->prop1_entry)); text = gtk_entry_get_text (GTK_ENTRY (fpd->prop1_entry));
if (text && text[0])
gnome_metadata_set (fpd->file_name,
"fm_open",
strlen (text) + 1,
text);
else
gnome_metadata_remove (fpd->file_name,
"fm_open");
} else {
if (fpd->fm_open)
gnome_metadata_remove (fpd->file_name,
"fm_open");
}
if (!GTK_TOGGLE_BUTTON (fpd->prop2_cbox)->active) {
text = gtk_entry_get_text (GTK_ENTRY (fpd->prop2_entry));
if (text && text[0]) if (text && text[0])
gnome_metadata_set (fpd->file_name, gnome_metadata_set (fpd->file_name,
"drop-target", "drop-target",
@ -1155,6 +1150,22 @@ apply_metadata_change (GnomeFilePropertyDialog *fpd)
"edit"); "edit");
} }
} }
if (!fpd->can_set_icon)
return 1;
/* And finally, we set the metadata on the icon filename */
text = gtk_entry_get_text (GTK_ENTRY (gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (fpd->button))));
icon_name = gicon_image_to_name (fpd->im);
if (text) {
if (strcmp (text, icon_name))
/* FIXME: We make a big assumption here. If the file doesn't exist, it will
* default to the basic icon. We prolly should check that this is a valid
* file here, but I'm too tired to do it now -- jrb */
gnome_metadata_set (fpd->file_name, "icon-filename", strlen (text) + 1, text);
else
gnome_metadata_remove (fpd->file_name, "icon-filename");
}
/* I suppose we should only do this if we know there's been a change -- I'll try to figure it
* out later if it turns out to be important. */
return 1; return 1;
} }

Просмотреть файл

@ -64,9 +64,10 @@ struct _GnomeFilePropertyDialog
gint euid; gint euid;
/* Settings Stuff */ /* Settings Stuff */
GtkWidget *open_label, *open_entry, *open_cbox;
GtkWidget *prop1_label, *prop1_entry, *prop1_cbox; GtkWidget *prop1_label, *prop1_entry, *prop1_cbox;
GtkWidget *prop2_label, *prop2_entry, *prop2_cbox; GtkWidget *prop2_label, *prop2_entry, *prop2_cbox, *prop2_hline;
GtkWidget *dlg; GtkWidget *button;
gchar *fm_open; gchar *fm_open;
gchar *fm_view; gchar *fm_view;
@ -76,6 +77,8 @@ struct _GnomeFilePropertyDialog
gchar *mime_fm_view; gchar *mime_fm_view;
gchar *mime_drop_target; gchar *mime_drop_target;
gchar *mime_edit; gchar *mime_edit;
gchar *icon_filename;
gboolean can_set_icon;
GdkImlibImage *im; GdkImlibImage *im;
/* Private Data */ /* Private Data */
@ -88,7 +91,7 @@ struct _GnomeFilePropertyDialogClass
GtkType gnome_file_property_dialog_get_type (void); GtkType gnome_file_property_dialog_get_type (void);
GtkWidget *gnome_file_property_dialog_new (gchar *file_name); GtkWidget *gnome_file_property_dialog_new (gchar *file_name, gboolean can_set_icon);
gint gnome_file_property_dialog_make_changes (GnomeFilePropertyDialog *file_property_dialog); gint gnome_file_property_dialog_make_changes (GnomeFilePropertyDialog *file_property_dialog);
#ifdef __cplusplus #ifdef __cplusplus

Просмотреть файл

@ -21,6 +21,8 @@
#define CLIST_FROM_SW(panel_list) GTK_CLIST (GTK_BIN (panel_list)->child) #define CLIST_FROM_SW(panel_list) GTK_CLIST (GTK_BIN (panel_list)->child)
extern int we_can_afford_the_speed;
/* Flags for the popup menu entries. They specify to which kinds of files an entry is valid for. */ /* Flags for the popup menu entries. They specify to which kinds of files an entry is valid for. */
enum { enum {
F_ALL = 1 << 0, /* Applies to all files */ F_ALL = 1 << 0, /* Applies to all files */
@ -88,7 +90,7 @@ dicon_properties (GtkWidget *widget, DesktopIconInfo *dii)
path = g_strconcat (getenv("HOME"), "/desktop/", dii->filename, NULL); path = g_strconcat (getenv("HOME"), "/desktop/", dii->filename, NULL);
/* retval = item_properties (dii->dicon, path, dii);*/ /* retval = item_properties (dii->dicon, path, dii);*/
dlg = gnome_file_property_dialog_new (path); dlg = gnome_file_property_dialog_new (path, TRUE);
gtk_widget_show_all (dlg); gtk_widget_show_all (dlg);
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));
@ -115,7 +117,8 @@ panel_action_properties (GtkWidget *widget, WPanel *panel)
/* if (item_properties (GTK_WIDGET (CLIST_FROM_SW (panel->list)), full_name, NULL) != 0) /* if (item_properties (GTK_WIDGET (CLIST_FROM_SW (panel->list)), full_name, NULL) != 0)
reread_cmd ();*/ reread_cmd ();*/
dlg = gnome_file_property_dialog_new (full_name); dlg = gnome_file_property_dialog_new (full_name, we_can_afford_the_speed);
gnome_dialog_set_parent (GNOME_DIALOG (dlg), GTK_WINDOW (gtk_widget_get_toplevel (panel->ministatus)));
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));
gtk_widget_destroy (dlg); gtk_widget_destroy (dlg);

Просмотреть файл

@ -31,6 +31,7 @@ extern int vfs_timeout;
extern int ftpfs_always_use_proxy; extern int ftpfs_always_use_proxy;
extern char* ftpfs_anonymous_passwd; extern char* ftpfs_anonymous_passwd;
extern int file_op_compute_totals; extern int file_op_compute_totals;
extern int we_can_afford_the_speed;
typedef enum typedef enum
{ {
PROPERTY_NONE, PROPERTY_NONE,
@ -162,6 +163,10 @@ static Property caching_and_optimization_props [] =
N_("FTP directory cache timeout :"), PROPERTY_INT, N_("FTP directory cache timeout :"), PROPERTY_INT,
&ftpfs_directory_timeout, N_("Seconds"), NULL, NULL &ftpfs_directory_timeout, N_("Seconds"), NULL, NULL
}, },
{
N_("Allow customization of icons in panels"), PROPERTY_BOOL,
&we_can_afford_the_speed, NULL, NULL, NULL
},
PROPERTIES_DONE PROPERTIES_DONE
}; };

Просмотреть файл

@ -2243,7 +2243,7 @@ static GnomeUIInfo viewbar[] = {
GNOME_APP_PIXMAP_DATA, listing_brief_list_xpm, 0, (GdkModifierType) 0, NULL }, GNOME_APP_PIXMAP_DATA, listing_brief_list_xpm, 0, (GdkModifierType) 0, NULL },
{ GNOME_APP_UI_ITEM, N_("Detailed"), N_("Switch view to show detailed file statistics"), do_switch_to_full_listing, NULL, NULL, \ { GNOME_APP_UI_ITEM, N_("Detailed"), N_("Switch view to show detailed file statistics"), do_switch_to_full_listing, NULL, NULL, \
GNOME_APP_PIXMAP_DATA, listing_list_xpm, 0, (GdkModifierType) 0, NULL }, GNOME_APP_PIXMAP_DATA, listing_list_xpm, 0, (GdkModifierType) 0, NULL },
{ GNOME_APP_UI_ITEM, N_("Custom"), N_("Switch view to show custom determined statistics. You can set this in the "), do_switch_to_custom_listing, NULL, NULL, \ { GNOME_APP_UI_ITEM, N_("Custom"), N_("Switch view to show custom determined statistics."), do_switch_to_custom_listing, NULL, NULL, \
GNOME_APP_PIXMAP_DATA, listing_custom_xpm, 0, (GdkModifierType) 0, NULL }, GNOME_APP_PIXMAP_DATA, listing_custom_xpm, 0, (GdkModifierType) 0, NULL },
GNOMEUIINFO_END GNOMEUIINFO_END
}; };