diff options
author | Havoc Pennington <hp@pobox.com> | 1998-04-26 11:22:37 +0800 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 1998-04-26 11:22:37 +0800 |
commit | 5d80262bb53f00a69aacc16720034d403f6c6b5f (patch) | |
tree | 66982f745669ba13624d6cdd15094bbd8707c71f /calendar | |
parent | 95b6ff339e69befec13b7a5f3831d1b74db0d87e (diff) | |
download | gsoc2013-evolution-5d80262bb53f00a69aacc16720034d403f6c6b5f.tar.gz gsoc2013-evolution-5d80262bb53f00a69aacc16720034d403f6c6b5f.tar.zst gsoc2013-evolution-5d80262bb53f00a69aacc16720034d403f6c6b5f.zip |
Descend from GnomeDialog. Took vbox out of class structure; use
Sat Apr 25 22:20:45 1998 Havoc Pennington <hp@pobox.com>
* eventedit.c, eventedit.h: Descend from GnomeDialog. Took vbox
out of class structure; use GnomeDialog vbox
instead. gnome_dialog_set_destroy instead of destroying in button
callbacks. Don't create buttons, separator, or vbox manually.
#include <libgnomeui/gnome-dialog.h>.
svn path=/trunk/; revision=197
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/eventedit.c | 43 | ||||
-rw-r--r-- | calendar/eventedit.h | 6 | ||||
-rw-r--r-- | calendar/gui/eventedit.c | 43 | ||||
-rw-r--r-- | calendar/gui/eventedit.h | 6 |
5 files changed, 44 insertions, 62 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index b3cb57885b..690604da9f 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +Sat Apr 25 22:20:45 1998 Havoc Pennington <hp@pobox.com> + + * eventedit.c, eventedit.h: Descend from GnomeDialog. Took vbox + out of class structure; use GnomeDialog vbox + instead. gnome_dialog_set_destroy instead of destroying in button + callbacks. Don't create buttons, separator, or vbox manually. + #include <libgnomeui/gnome-dialog.h>. + 1998-04-24 Miguel de Icaza <miguel@nuclecu.unam.mx> * calobj.c (ical_object_create_from_vobject): Fixed alarm loading; diff --git a/calendar/eventedit.c b/calendar/eventedit.c index e6e2ea6b55..30068867a3 100644 --- a/calendar/eventedit.c +++ b/calendar/eventedit.c @@ -21,7 +21,7 @@ static void event_editor_destroy (GtkObject *object); /* Note: do not i18n these strings, they are part of the vCalendar protocol */ static char *class_names [] = { "PUBLIC", "PRIVATE", "CONFIDENTIAL" }; -static GtkWindowClass *parent_class; +static GnomeDialogClass *parent_class; struct numbered_item { char *text; @@ -44,7 +44,7 @@ event_editor_get_type (void) (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL, }; - event_editor_type = gtk_type_unique (gtk_window_get_type (), &event_editor_info); + event_editor_type = gtk_type_unique (gnome_dialog_get_type (), &event_editor_info); } return event_editor_type; } @@ -54,7 +54,7 @@ event_editor_class_init (EventEditorClass *class) { GtkObjectClass *object_class; - parent_class = gtk_type_class (gtk_window_get_type ()); + parent_class = gtk_type_class (gnome_dialog_get_type ()); object_class = (GtkObjectClass*) class; object_class->destroy = event_editor_destroy; } @@ -712,7 +712,6 @@ ee_ok (GtkWidget *widget, EventEditor *ee) gnome_calendar_object_changed (ee->gnome_cal, ee->ical, CHANGE_ALL); ee->ical->new = 0; - gtk_widget_destroy (GTK_WIDGET (ee)); } static void @@ -723,25 +722,19 @@ ee_cancel (GtkWidget *widget, EventEditor *ee) ee->ical = NULL; } - gtk_widget_destroy (GTK_WIDGET (ee)); } -static GtkWidget * +static void ee_create_buttons (EventEditor *ee) { - GtkWidget *box = gtk_hbox_new (1, 5); - GtkWidget *ok, *cancel; - - ok = gnome_stock_button (GNOME_STOCK_BUTTON_OK); - cancel = gnome_stock_button (GNOME_STOCK_BUTTON_CANCEL); - - gtk_box_pack_start (GTK_BOX (box), ok, 0, 0, 5); - gtk_box_pack_start (GTK_BOX (box), cancel, 0, 0, 5); + gnome_dialog_append_buttons(GNOME_DIALOG(ee), + GNOME_STOCK_BUTTON_OK, + GNOME_STOCK_BUTTON_CANCEL, NULL); - gtk_signal_connect (GTK_OBJECT (ok), "clicked", GTK_SIGNAL_FUNC(ee_ok), ee); - gtk_signal_connect (GTK_OBJECT (cancel), "clicked", GTK_SIGNAL_FUNC(ee_cancel), ee); + gnome_dialog_button_connect (GNOME_DIALOG (ee), 0, GTK_SIGNAL_FUNC(ee_ok), ee); + gnome_dialog_button_connect (GNOME_DIALOG (ee), 1, GTK_SIGNAL_FUNC(ee_cancel), ee); - return box; + return; } /* @@ -1424,24 +1417,17 @@ ee_init_recurrence_page (EventEditor *ee) static void event_editor_init_widgets (EventEditor *ee) -{ - ee->vbox = gtk_vbox_new (0, 0); - gtk_container_add (GTK_CONTAINER (ee), ee->vbox); - gtk_container_border_width (GTK_CONTAINER (ee), 5); - +{ ee->notebook = gtk_notebook_new (); - gtk_box_pack_start (GTK_BOX (ee->vbox), ee->notebook, 1, 1, 0); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG(ee)->vbox), ee->notebook, 1, 1, 0); /* Init the various configuration pages */ ee_init_general_page (ee); ee_init_summary_page (ee); ee_init_recurrence_page (ee); - - /* Separator */ - gtk_box_pack_start (GTK_BOX (ee->vbox), gtk_hseparator_new (), 0, 0, 0); - + /* Buttons */ - gtk_box_pack_start (GTK_BOX (ee->vbox), ee_create_buttons (ee), 0, 0, 5); + ee_create_buttons(ee); /* We show all of the contained widgets */ gtk_widget_show_all (GTK_BIN (ee)->child); @@ -1451,6 +1437,7 @@ static void event_editor_init (EventEditor *ee) { ee->ical = 0; + gnome_dialog_set_destroy(GNOME_DIALOG(ee), TRUE); } static void diff --git a/calendar/eventedit.h b/calendar/eventedit.h index 73dd677d44..9cb80e3912 100644 --- a/calendar/eventedit.h +++ b/calendar/eventedit.h @@ -9,6 +9,7 @@ #define EVENT_EDITOR_H #include "gnome-cal.h" +#include <libgnomeui/gnome-dialog.h> BEGIN_GNOME_DECLS @@ -19,9 +20,8 @@ BEGIN_GNOME_DECLS typedef struct { - GtkWindow window; + GnomeDialog dialog; GtkWidget *notebook; - GtkWidget *vbox; GtkWidget *general; GtkWidget *general_table; @@ -64,7 +64,7 @@ typedef struct { } EventEditor; typedef struct { - GtkWindowClass parent_class; + GnomeDialogClass parent_class; } EventEditorClass; diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c index e6e2ea6b55..30068867a3 100644 --- a/calendar/gui/eventedit.c +++ b/calendar/gui/eventedit.c @@ -21,7 +21,7 @@ static void event_editor_destroy (GtkObject *object); /* Note: do not i18n these strings, they are part of the vCalendar protocol */ static char *class_names [] = { "PUBLIC", "PRIVATE", "CONFIDENTIAL" }; -static GtkWindowClass *parent_class; +static GnomeDialogClass *parent_class; struct numbered_item { char *text; @@ -44,7 +44,7 @@ event_editor_get_type (void) (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL, }; - event_editor_type = gtk_type_unique (gtk_window_get_type (), &event_editor_info); + event_editor_type = gtk_type_unique (gnome_dialog_get_type (), &event_editor_info); } return event_editor_type; } @@ -54,7 +54,7 @@ event_editor_class_init (EventEditorClass *class) { GtkObjectClass *object_class; - parent_class = gtk_type_class (gtk_window_get_type ()); + parent_class = gtk_type_class (gnome_dialog_get_type ()); object_class = (GtkObjectClass*) class; object_class->destroy = event_editor_destroy; } @@ -712,7 +712,6 @@ ee_ok (GtkWidget *widget, EventEditor *ee) gnome_calendar_object_changed (ee->gnome_cal, ee->ical, CHANGE_ALL); ee->ical->new = 0; - gtk_widget_destroy (GTK_WIDGET (ee)); } static void @@ -723,25 +722,19 @@ ee_cancel (GtkWidget *widget, EventEditor *ee) ee->ical = NULL; } - gtk_widget_destroy (GTK_WIDGET (ee)); } -static GtkWidget * +static void ee_create_buttons (EventEditor *ee) { - GtkWidget *box = gtk_hbox_new (1, 5); - GtkWidget *ok, *cancel; - - ok = gnome_stock_button (GNOME_STOCK_BUTTON_OK); - cancel = gnome_stock_button (GNOME_STOCK_BUTTON_CANCEL); - - gtk_box_pack_start (GTK_BOX (box), ok, 0, 0, 5); - gtk_box_pack_start (GTK_BOX (box), cancel, 0, 0, 5); + gnome_dialog_append_buttons(GNOME_DIALOG(ee), + GNOME_STOCK_BUTTON_OK, + GNOME_STOCK_BUTTON_CANCEL, NULL); - gtk_signal_connect (GTK_OBJECT (ok), "clicked", GTK_SIGNAL_FUNC(ee_ok), ee); - gtk_signal_connect (GTK_OBJECT (cancel), "clicked", GTK_SIGNAL_FUNC(ee_cancel), ee); + gnome_dialog_button_connect (GNOME_DIALOG (ee), 0, GTK_SIGNAL_FUNC(ee_ok), ee); + gnome_dialog_button_connect (GNOME_DIALOG (ee), 1, GTK_SIGNAL_FUNC(ee_cancel), ee); - return box; + return; } /* @@ -1424,24 +1417,17 @@ ee_init_recurrence_page (EventEditor *ee) static void event_editor_init_widgets (EventEditor *ee) -{ - ee->vbox = gtk_vbox_new (0, 0); - gtk_container_add (GTK_CONTAINER (ee), ee->vbox); - gtk_container_border_width (GTK_CONTAINER (ee), 5); - +{ ee->notebook = gtk_notebook_new (); - gtk_box_pack_start (GTK_BOX (ee->vbox), ee->notebook, 1, 1, 0); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG(ee)->vbox), ee->notebook, 1, 1, 0); /* Init the various configuration pages */ ee_init_general_page (ee); ee_init_summary_page (ee); ee_init_recurrence_page (ee); - - /* Separator */ - gtk_box_pack_start (GTK_BOX (ee->vbox), gtk_hseparator_new (), 0, 0, 0); - + /* Buttons */ - gtk_box_pack_start (GTK_BOX (ee->vbox), ee_create_buttons (ee), 0, 0, 5); + ee_create_buttons(ee); /* We show all of the contained widgets */ gtk_widget_show_all (GTK_BIN (ee)->child); @@ -1451,6 +1437,7 @@ static void event_editor_init (EventEditor *ee) { ee->ical = 0; + gnome_dialog_set_destroy(GNOME_DIALOG(ee), TRUE); } static void diff --git a/calendar/gui/eventedit.h b/calendar/gui/eventedit.h index 73dd677d44..9cb80e3912 100644 --- a/calendar/gui/eventedit.h +++ b/calendar/gui/eventedit.h @@ -9,6 +9,7 @@ #define EVENT_EDITOR_H #include "gnome-cal.h" +#include <libgnomeui/gnome-dialog.h> BEGIN_GNOME_DECLS @@ -19,9 +20,8 @@ BEGIN_GNOME_DECLS typedef struct { - GtkWindow window; + GnomeDialog dialog; GtkWidget *notebook; - GtkWidget *vbox; GtkWidget *general; GtkWidget *general_table; @@ -64,7 +64,7 @@ typedef struct { } EventEditor; typedef struct { - GtkWindowClass parent_class; + GnomeDialogClass parent_class; } EventEditorClass; |