--- applets/fish/fish.c.orig Thu May 4 21:20:39 2000 +++ applets/fish/fish.c Sat Sep 23 23:33:02 2000 @@ -29,6 +29,7 @@ struct _FishProp { char *name; char *image; + char *command; int frames; float speed; gboolean rotate; @@ -37,6 +38,7 @@ static FishProp defaults = { "Wanda", /*name*/ NULL, /*image*/ + "/usr/games/fortune", /*command*/ 3, /*frames*/ 1.0, /*speed*/ TRUE /*rotate*/ @@ -246,6 +248,10 @@ g_snprintf(buf,256,"fish/image=%s",defaults.image); fish->prop.image = gnome_config_get_string(buf); + g_free(fish->prop.command); + g_snprintf(buf,256,"fish/command=%s",defaults.command); + fish->prop.command = gnome_config_get_string(buf); + g_snprintf(buf,256,"fish/frames=%d",defaults.frames); fish->prop.frames = gnome_config_get_int(buf); if(fish->prop.frames <= 0) fish->prop.frames = 1; @@ -370,6 +376,8 @@ "name"); GtkWidget *image = gtk_object_get_data(GTK_OBJECT(pb), "image"); + GtkWidget *command = gtk_object_get_data(GTK_OBJECT(pb), + "command"); GtkAdjustment *frames = gtk_object_get_data(GTK_OBJECT(pb), "frames"); GtkAdjustment *speed = @@ -389,6 +397,11 @@ g_free(fish->prop.image); fish->prop.image = g_strdup(s); } + s = gtk_entry_get_text(GTK_ENTRY(command)); + if (s) { + g_free(fish->prop.command); + fish->prop.command = g_strdup(s); + } fish->prop.frames = frames->value; fish->prop.speed = speed->value; fish->prop.rotate = @@ -462,6 +475,20 @@ hbox = gtk_hbox_new(FALSE, GNOME_PAD); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + w = gtk_label_new(_("Fortune Command:")); + gtk_box_pack_start(GTK_BOX(hbox), w, FALSE, FALSE, 0); + e = gtk_entry_new(); + gtk_entry_set_text(GTK_ENTRY(e), fish->prop.command); + gtk_box_pack_start(GTK_BOX(hbox), e, TRUE, TRUE, 0); + gtk_object_set_data(GTK_OBJECT(fish->pb),"command",e); + + gtk_signal_connect_object_while_alive(GTK_OBJECT(e), "changed", + GTK_SIGNAL_FUNC(gnome_property_box_changed), + GTK_OBJECT(fish->pb)); + + hbox = gtk_hbox_new(FALSE, GNOME_PAD); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + w = gtk_label_new(_("Frames In Animation:")); gtk_box_pack_start(GTK_BOX(hbox), w, FALSE, FALSE, 0); adj = (GtkAdjustment *) gtk_adjustment_new (fish->prop.frames, @@ -559,9 +586,11 @@ if (!GTK_WIDGET_VISIBLE(fish->fortune_dialog)) gtk_widget_show(fish->fortune_dialog); - fortune_command = g_file_exists("/usr/games/fortune")? - g_strdup("/usr/games/fortune"): - gnome_is_program_in_path("fortune"); + if (fish->prop.command) { + fortune_command = g_strdup(fish->prop.command); + } else { + fortune_command = gnome_is_program_in_path("fortune"); + } if(fortune_command) { gnome_less_show_command(GNOME_LESS(fish->fortune_less), @@ -710,6 +739,7 @@ gnome_config_push_prefix(privcfgpath); gnome_config_set_string("fish/name",fish->prop.name); gnome_config_set_string("fish/image",fish->prop.image); + gnome_config_set_string("fish/command",fish->prop.command); gnome_config_set_int("fish/frames",fish->prop.frames); gnome_config_set_float("fish/speed",fish->prop.speed); gnome_config_set_bool("fish/rotate",fish->prop.rotate); @@ -726,6 +756,7 @@ { g_free(fish->prop.name); g_free(fish->prop.image); + g_free(fish->prop.command); if(fish->pix) gdk_pixmap_unref(fish->pix);