From 1e53a6e3d58c50e1f28c8cc289f7d6da8e9d76aa Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Sat, 30 Jun 2001 23:29:46 +0000 Subject: Allow new RDFs to be added. svn path=/trunk/; revision=10640 --- my-evolution/ChangeLog | 7 ++++++ my-evolution/e-summary-preferences.c | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 9bffe15343..cffdd1e85e 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,10 @@ +2001-06-30 Iain Holmes + + * e-summary-preferences.c (add_dialog_clicked_cb): Add the new url to + the list. + (rdf_new_url_clicked_cb): Create a dialog and allow the user to add + new urls. + 2001-06-30 Iain Holmes * e-summary-rdf.c (tree_walk): Remove spewage. diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index 8611109944..5ef93c6970 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -13,9 +13,12 @@ #include #include +#include #include #include +#include + #include static void make_initial_mail_list (ESummaryPrefs *prefs) @@ -358,6 +361,7 @@ struct _CalendarPage { typedef struct _PropertyData { ESummary *summary; GnomePropertyBox *box; + GtkWidget *new_entry; GladeXML *xml; struct _MailPage *mail; @@ -626,11 +630,51 @@ rdf_remove_clicked_cb (GtkButton *button, gnome_property_box_changed (pd->box); } +static void +add_dialog_clicked_cb (GnomeDialog *dialog, + int button, + PropertyData *pd) +{ + char *text[1]; + + if (button == 1) { + return; + } + + text[0] = gtk_entry_get_text (GTK_ENTRY (pd->new_entry)); + gtk_clist_append (GTK_CLIST (pd->rdf->all), text); + + gnome_dialog_close (dialog); +} + static void rdf_new_url_clicked_cb (GtkButton *button, PropertyData *pd) { + static GtkWidget *add_dialog = NULL; + GtkWidget *label; + if (add_dialog != NULL) { + gdk_window_raise (add_dialog->window); + gdk_window_show (add_dialog->window); + return; + } + + add_dialog = gnome_dialog_new (_("Add a new RDF"), + GNOME_STOCK_BUTTON_OK, + GNOME_STOCK_BUTTON_CANCEL, NULL); + gtk_signal_connect (GTK_OBJECT (add_dialog), "clicked", + GTK_SIGNAL_FUNC (add_dialog_clicked_cb), pd); + gtk_signal_connect (GTK_OBJECT (add_dialog), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroyed), &add_dialog); + + label = gtk_label_new (_("Enter the URL of the RDF file you wish to add")); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (add_dialog)->vbox), label, + TRUE, TRUE, 0); + pd->new_entry = gtk_entry_new (); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (add_dialog)->vbox), + pd->new_entry, TRUE, TRUE, 0); + gtk_widget_show_all (add_dialog); } static void -- cgit