diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/ChangeLog | 27 | ||||
-rw-r--r-- | widgets/Makefile.am | 3 | ||||
-rw-r--r-- | widgets/e-msg-composer-address-dialog.c | 311 | ||||
-rw-r--r-- | widgets/e-msg-composer-address-dialog.glade | 574 | ||||
-rw-r--r-- | widgets/e-msg-composer-address-dialog.h | 67 | ||||
-rw-r--r-- | widgets/e-msg-composer-attachment-bar.c | 3 | ||||
-rw-r--r-- | widgets/e-msg-composer-attachment.c | 3 | ||||
-rw-r--r-- | widgets/e-msg-composer.c | 59 | ||||
-rw-r--r-- | widgets/e-msg-composer.glade | 15 | ||||
-rw-r--r-- | widgets/e-msg-composer.h | 2 | ||||
-rw-r--r-- | widgets/e-table/ChangeLog | 27 | ||||
-rw-r--r-- | widgets/e-table/Makefile.am | 3 |
12 files changed, 1089 insertions, 5 deletions
diff --git a/widgets/ChangeLog b/widgets/ChangeLog index 77a6c36c61..e8426055fc 100644 --- a/widgets/ChangeLog +++ b/widgets/ChangeLog @@ -1,3 +1,27 @@ +1999-11-06 Ettore Perazzoli <ettore@gnu.org> + + * e-msg-composer-attachment-bar.c (destroy): Call the destroy + method of the parent class. + + * e-msg-composer.c: #include "e-msg-composer-address-dialog.h". + (address_dialog_cb): New callback to start the address dialog. + (setup_signals): Connect it to the appropriate button/menu item. + (init): Initialize the new `address_dialog' member to NULL. + (destroy): Destroy the `address_dialog' if not NULL. + + * e-msg-composer.h: New member `address_dialog' in `struct + _EMsgComposer'. + + * e-msg-composer.glade: Added button to activate the address + composition dialog. + + * e-msg-composer-address-dialog.h, e-msg-composer-address-dialog.c: + New files implementing the address composition dialog for Evolution. + + * e-msg-composer-address-dialog.glade: New file. + + * e-msg-composer-attachment.c: `signals' made static. + 1999-11-05 Ettore Perazzoli <ettore@gnu.org> * Makefile.am: Compile the new files in a `libevolutionwidgets' @@ -21,6 +45,9 @@ * e-msg-composer-hdrs.c, e-msg-composer-hdrs.h: New files implementing a widget for editing of email message headers. + * e-msg-composer-attachment.glade: New file. + * e-msg-composer.glade: New file. + 1999-10-31 Miguel de Icaza <miguel@gnu.org> * widgets/e-table-column.c, e-table-column.h: New file, implements the diff --git a/widgets/Makefile.am b/widgets/Makefile.am index 35d1bc64a4..a9614cf1d7 100644 --- a/widgets/Makefile.am +++ b/widgets/Makefile.am @@ -1,6 +1,7 @@ guidir = $(datadir)/evolution/gui gui_DATA = \ + e-msg-composer-address-dialog.glade \ e-msg-composer-attachment.glade \ e-msg-composer.glade @@ -16,6 +17,8 @@ noinst_LTLIBRARIES = \ libevolutionwidgets.la libevolutionwidgets_la_SOURCES = \ + e-msg-composer-address-dialog.c \ + e-msg-composer-address-dialog.h \ e-msg-composer-address-entry.c \ e-msg-composer-address-entry.h \ e-msg-composer-attachment-bar.c \ diff --git a/widgets/e-msg-composer-address-dialog.c b/widgets/e-msg-composer-address-dialog.c new file mode 100644 index 0000000000..aed0a61c9d --- /dev/null +++ b/widgets/e-msg-composer-address-dialog.c @@ -0,0 +1,311 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-msg-composer-address-dialog.c + * + * Copyright (C) 1999 Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ettore Perazzoli + */ + +#include <gnome.h> +#include "e-msg-composer-address-dialog.h" + + +enum { + APPLY, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +static GnomeDialogClass *parent_class = NULL; + + +/* This function should load the addresses we know of into the dialog. We + don't have a precise setup for the addressbook yet, so we will just put some + fake entries in. */ +static void +load_addresses (EMsgComposerAddressDialog *dialog) +{ + gchar *text[][3] = { + { "Bertrand Guiheneuf", "Bertrand.Guiheneuf@aful.org", NULL }, + { "Ettore Perazzoli", "ettore@gnu.org", NULL }, + { "Miguel de Icaza", "miguel@gnu.org", NULL }, + { "Nat Friedman", "nat@nat.org", NULL }, + { NULL, NULL, NULL } + }; + GtkCList *clist; + guint i; + + clist = GTK_CLIST (glade_xml_get_widget (dialog->gui, "address_clist")); + + for (i = 0; text[i][0] != NULL; i++) + gtk_clist_append (clist, text[i]); +} + +/* This loads the selected address in the address GtkCList into the requested + GtkList. */ +static void +add_address (EMsgComposerAddressDialog *dialog, + const gchar *list_name) +{ + GtkCList *src_clist; + GtkCList *dest_clist; + guint row; + gchar *text[2]; + + src_clist = GTK_CLIST (glade_xml_get_widget (dialog->gui, "address_clist")); + dest_clist = GTK_CLIST (glade_xml_get_widget (dialog->gui, list_name)); + row = GPOINTER_TO_INT (src_clist->selection->data); + + gtk_clist_get_text (src_clist, row, 0, &text[0]); + text[1] = NULL; + gtk_clist_append (dest_clist, text); + gtk_clist_set_row_data (dest_clist, dest_clist->rows - 1, + GINT_TO_POINTER (row)); +} + + +/* Signals. */ + +static void +add_to_cb (GtkWidget *widget, + gpointer data) +{ + add_address (E_MSG_COMPOSER_ADDRESS_DIALOG (data), "to_clist"); +} + +static void +add_cc_cb (GtkWidget *widget, + gpointer data) +{ + add_address (E_MSG_COMPOSER_ADDRESS_DIALOG (data), "cc_clist"); +} + +static void +add_bcc_cb (GtkWidget *widget, + gpointer data) +{ + add_address (E_MSG_COMPOSER_ADDRESS_DIALOG (data), "bcc_clist"); +} + +static void +glade_connect (GladeXML *gui, + const gchar *widget_name, + const gchar *signal_name, + GtkSignalFunc callback, + gpointer callback_data) +{ + GtkWidget *widget; + + widget = glade_xml_get_widget (gui, widget_name); + if (widget == NULL) + g_warning ("Widget `%s' was not found.", widget_name); + else + gtk_signal_connect (GTK_OBJECT (widget), signal_name, + GTK_SIGNAL_FUNC (callback), callback_data); +} + +static void +setup_signals (EMsgComposerAddressDialog *dialog) +{ + glade_connect (dialog->gui, "to_add_button", "clicked", add_to_cb, + dialog); + glade_connect (dialog->gui, "cc_add_button", "clicked", add_cc_cb, + dialog); + glade_connect (dialog->gui, "bcc_add_button", "clicked", add_bcc_cb, + dialog); +} + + +/* GtkObject methods. */ + +static void +destroy (GtkObject *object) +{ + EMsgComposerAddressDialog *dialog; + GtkCList *address_clist; + GList *p; + + dialog = E_MSG_COMPOSER_ADDRESS_DIALOG (object); + + gtk_object_unref (GTK_OBJECT (dialog->gui)); + + if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL) + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); +} + + +/* Initialization. */ + +static void +class_init (EMsgComposerAddressDialogClass *class) +{ + GtkObjectClass *object_class; + + object_class = GTK_OBJECT_CLASS (class); + object_class->destroy = destroy; + + parent_class = gtk_type_class (gnome_dialog_get_type ()); + + signals[APPLY] + = gtk_signal_new ("apply", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EMsgComposerAddressDialogClass, + apply), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + + gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); +} + +static void +init (EMsgComposerAddressDialog *dialog) +{ + dialog->gui = NULL; +} + + +GtkType +e_msg_composer_address_dialog_get_type (void) +{ + static GtkType type = 0; + + if (type == 0) { + static const GtkTypeInfo info = { + "EMsgComposerAddressDialog", + sizeof (EMsgComposerAddressDialog), + sizeof (EMsgComposerAddressDialogClass), + (GtkClassInitFunc) class_init, + (GtkObjectInitFunc) init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + type = gtk_type_unique (gnome_dialog_get_type (), &info); + } + + return type; +} + +void +e_msg_composer_address_dialog_construct (EMsgComposerAddressDialog *dialog) +{ + static const gchar *buttons[] = { + GNOME_STOCK_BUTTON_OK, + GNOME_STOCK_BUTTON_APPLY, + GNOME_STOCK_BUTTON_CANCEL, + NULL + }; + + g_return_if_fail (dialog != NULL); + g_return_if_fail (E_IS_MSG_COMPOSER_ADDRESS_DIALOG (dialog)); + + gnome_dialog_constructv (GNOME_DIALOG (dialog), + _("Select recipients' addresses"), + buttons); + + dialog->gui = glade_xml_new + (E_GUIDIR "/e-msg-composer-address-dialog.glade", "main_table"); + if (dialog->gui == NULL) { + g_warning ("Cannot load `e-msg-composer-address-dialog.glade"); + return; + } + + gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (dialog)->vbox), + glade_xml_get_widget (dialog->gui, "main_table")); + + load_addresses (dialog); + setup_signals (dialog); +} + +GtkWidget * +e_msg_composer_address_dialog_new (void) +{ + EMsgComposerAddressDialog *new; + + new = gtk_type_new (e_msg_composer_address_dialog_get_type ()); + e_msg_composer_address_dialog_construct (new); + + return GTK_WIDGET (new); +} + + +static gchar * +make_full_address (const gchar *name, + const gchar *email) +{ + /* FIXME handle quoting. */ + + return g_strconcat (name, " <", email, ">", NULL); +} + +static GList * +get_list (EMsgComposerAddressDialog *dialog, + const gchar *clist_name) +{ + GtkCList *address_clist; + GtkCList *clist; + GList *list; + guint i; + + address_clist = GTK_CLIST (glade_xml_get_widget (dialog->gui, + "address_clist")); + clist = GTK_CLIST (glade_xml_get_widget (dialog->gui, clist_name)); + + list = NULL; + for (i = 0; i < clist->rows; i++) { + gchar *name, *email; + guint addr_row; + + addr_row = GPOINTER_TO_INT (gtk_clist_get_row_data (clist, i)); + gtk_clist_get_text (clist, addr_row, 0, &name); + gtk_clist_get_text (clist, addr_row, 0, &email); + + list = g_list_prepend (list, make_full_address (name, email)); + } + + return g_list_reverse (list); +} + +GList * +e_msg_composer_address_dialog_get_to_list (EMsgComposerAddressDialog *dialog) +{ + g_return_val_if_fail (dialog != NULL, NULL); + g_return_val_if_fail (E_IS_MSG_COMPOSER_ADDRESS_DIALOG (dialog), NULL); + + return get_list (dialog, "to_clist"); +} + +GList * +e_msg_composer_address_dialog_get_cc_list (EMsgComposerAddressDialog *dialog) +{ + g_return_val_if_fail (dialog != NULL, NULL); + g_return_val_if_fail (E_IS_MSG_COMPOSER_ADDRESS_DIALOG (dialog), NULL); + + return get_list (dialog, "cc_clist"); +} + +GList * +e_msg_composer_address_dialog_get_bcc_list (EMsgComposerAddressDialog *dialog) +{ + g_return_val_if_fail (dialog != NULL, NULL); + g_return_val_if_fail (E_IS_MSG_COMPOSER_ADDRESS_DIALOG (dialog), NULL); + + return get_list (dialog, "bcc_clist"); +} diff --git a/widgets/e-msg-composer-address-dialog.glade b/widgets/e-msg-composer-address-dialog.glade new file mode 100644 index 0000000000..7a66d9ab8c --- /dev/null +++ b/widgets/e-msg-composer-address-dialog.glade @@ -0,0 +1,574 @@ +<?xml version="1.0"?> +<GTK-Interface> + +<project> + <name>address-composer</name> + <program_name>address-composer</program_name> + <directory></directory> + <source_directory>src</source_directory> + <pixmaps_directory>pixmaps</pixmaps_directory> + <language>C</language> + <gnome_support>True</gnome_support> + <gettext_support>True</gettext_support> + <use_widget_names>False</use_widget_names> + <output_main_file>True</output_main_file> + <output_support_files>True</output_support_files> + <output_build_files>True</output_build_files> + <backup_source_files>True</backup_source_files> + <main_source_file>interface.c</main_source_file> + <main_header_file>interface.h</main_header_file> + <handler_source_file>callbacks.c</handler_source_file> + <handler_header_file>callbacks.h</handler_header_file> + <support_source_file>support.c</support_source_file> + <support_header_file>support.h</support_header_file> + <translatable_strings_file></translatable_strings_file> +</project> + +<widget> + <class>GnomeDialog</class> + <name>dialog1</name> + <type>GTK_WINDOW_TOPLEVEL</type> + <position>GTK_WIN_POS_NONE</position> + <modal>False</modal> + <allow_shrink>False</allow_shrink> + <allow_grow>False</allow_grow> + <auto_shrink>False</auto_shrink> + <auto_close>False</auto_close> + <hide_on_close>False</hide_on_close> + + <widget> + <class>GtkVBox</class> + <child_name>GnomeDialog:vbox</child_name> + <name>dialog-vbox1</name> + <homogeneous>False</homogeneous> + <spacing>8</spacing> + <child> + <padding>4</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkTable</class> + <name>main_table</name> + <rows>3</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>0</row_spacing> + <column_spacing>0</column_spacing> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLabel</class> + <name>label3</name> + <label></label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox2</name> + <homogeneous>True</homogeneous> + <spacing>0</spacing> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + + <widget> + <class>GtkButton</class> + <name>button5</name> + <can_focus>True</can_focus> + <label>Properties...</label> + <child> + <padding>10</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkButton</class> + <name>button6</name> + <can_focus>True</can_focus> + <label>Add...</label> + <child> + <padding>10</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + </widget> + + <widget> + <class>GtkScrolledWindow</class> + <name>scrolledwindow1</name> + <width>200</width> + <height>200</height> + <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>5</xpad> + <ypad>10</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + + <widget> + <class>GtkCList</class> + <name>address_clist</name> + <can_focus>True</can_focus> + <columns>2</columns> + <column_widths>128,80</column_widths> + <selection_mode>GTK_SELECTION_SINGLE</selection_mode> + <show_titles>True</show_titles> + <shadow_type>GTK_SHADOW_IN</shadow_type> + + <widget> + <class>GtkLabel</class> + <child_name>CList:title</child_name> + <name>label5</name> + <width>150</width> + <label>Name</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + + <widget> + <class>GtkLabel</class> + <child_name>CList:title</child_name> + <name>label6</name> + <width>1024</width> + <label>Address</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + </widget> + </widget> + + <widget> + <class>GtkTable</class> + <name>table2</name> + <rows>3</rows> + <columns>2</columns> + <homogeneous>False</homogeneous> + <row_spacing>0</row_spacing> + <column_spacing>0</column_spacing> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>10</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + + <widget> + <class>GtkButton</class> + <name>cc_add_button</name> + <width>60</width> + <can_focus>True</can_focus> + <label>Cc: -></label> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>10</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkButton</class> + <name>to_add_button</name> + <width>60</width> + <can_focus>True</can_focus> + <label>To: -></label> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>10</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkButton</class> + <name>bcc_add_button</name> + <width>60</width> + <can_focus>True</can_focus> + <label>Bcc: -></label> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>10</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>False</yfill> + </child> + </widget> + + <widget> + <class>GtkScrolledWindow</class> + <name>scrolledwindow2</name> + <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>5</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + + <widget> + <class>GtkCList</class> + <name>to_clist</name> + <width>200</width> + <height>100</height> + <can_focus>True</can_focus> + <columns>1</columns> + <column_widths>80</column_widths> + <selection_mode>GTK_SELECTION_SINGLE</selection_mode> + <show_titles>False</show_titles> + <shadow_type>GTK_SHADOW_IN</shadow_type> + + <widget> + <class>GtkLabel</class> + <child_name>CList:title</child_name> + <name>label7</name> + <label>label7</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + </widget> + </widget> + + <widget> + <class>GtkScrolledWindow</class> + <name>scrolledwindow4</name> + <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>2</top_attach> + <bottom_attach>3</bottom_attach> + <xpad>5</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + + <widget> + <class>GtkCList</class> + <name>bcc_clist</name> + <width>200</width> + <height>100</height> + <can_focus>True</can_focus> + <columns>1</columns> + <column_widths>80</column_widths> + <selection_mode>GTK_SELECTION_SINGLE</selection_mode> + <show_titles>False</show_titles> + <shadow_type>GTK_SHADOW_IN</shadow_type> + + <widget> + <class>GtkLabel</class> + <child_name>CList:title</child_name> + <name>label9</name> + <label>label9</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + </widget> + </widget> + + <widget> + <class>GtkScrolledWindow</class> + <name>scrolledwindow3</name> + <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>5</xpad> + <ypad>10</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + + <widget> + <class>GtkCList</class> + <name>cc_clist</name> + <width>200</width> + <height>100</height> + <can_focus>True</can_focus> + <columns>1</columns> + <column_widths>80</column_widths> + <selection_mode>GTK_SELECTION_SINGLE</selection_mode> + <show_titles>False</show_titles> + <shadow_type>GTK_SHADOW_IN</shadow_type> + + <widget> + <class>GtkLabel</class> + <child_name>CList:title</child_name> + <name>label8</name> + <label>label8</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + </widget> + </widget> + </widget> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label1</name> + <label>Recipient list:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <left_attach>1</left_attach> + <right_attach>2</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>True</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkHBox</class> + <name>hbox1</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + <child> + <left_attach>0</left_attach> + <right_attach>1</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>5</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>False</yfill> + </child> + + <widget> + <class>GtkLabel</class> + <name>label2</name> + <label>Name:</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <padding>5</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkEntry</class> + <name>name_entry</name> + <can_focus>True</can_focus> + <editable>True</editable> + <text_visible>True</text_visible> + <text_max_length>0</text_max_length> + <text></text> + <child> + <padding>5</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>GtkButton</class> + <name>search_button</name> + <width>65</width> + <can_focus>True</can_focus> + <label>Search...</label> + <child> + <padding>5</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + </widget> + </widget> + + <widget> + <class>GtkHButtonBox</class> + <child_name>GnomeDialog:action_area</child_name> + <name>dialog-action_area1</name> + <layout_style>GTK_BUTTONBOX_END</layout_style> + <spacing>8</spacing> + <child_min_width>85</child_min_width> + <child_min_height>27</child_min_height> + <child_ipad_x>7</child_ipad_x> + <child_ipad_y>0</child_ipad_y> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + <pack>GTK_PACK_END</pack> + </child> + + <widget> + <class>GtkButton</class> + <name>button1</name> + <can_default>True</can_default> + <can_focus>True</can_focus> + <stock_button>GNOME_STOCK_BUTTON_OK</stock_button> + </widget> + + <widget> + <class>GtkButton</class> + <name>button2</name> + <can_default>True</can_default> + <can_focus>True</can_focus> + <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button> + </widget> + + <widget> + <class>GtkButton</class> + <name>button3</name> + <can_default>True</can_default> + <can_focus>True</can_focus> + <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button> + </widget> + </widget> + </widget> +</widget> + +</GTK-Interface> diff --git a/widgets/e-msg-composer-address-dialog.h b/widgets/e-msg-composer-address-dialog.h new file mode 100644 index 0000000000..5ff4723aa9 --- /dev/null +++ b/widgets/e-msg-composer-address-dialog.h @@ -0,0 +1,67 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-msg-composer-address-dialog.h + * + * Copyright (C) 1999 Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Ettore Perazzoli + */ +#ifndef __E_MSG_COMPOSER_ADDRESS_DIALOG_H__ +#define __E_MSG_COMPOSER_ADDRESS_DIALOG_H__ + +#include <gnome.h> +#include <glade/glade-xml.h> + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + + +#define E_TYPE_MSG_COMPOSER_ADDRESS_DIALOG (e_msg_composer_address_dialog_get_type ()) +#define E_MSG_COMPOSER_ADDRESS_DIALOG(obj) (GTK_CHECK_CAST ((obj), E_TYPE_MSG_COMPOSER_ADDRESS_DIALOG, EMsgComposerAddressDialog)) +#define E_MSG_COMPOSER_ADDRESS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_MSG_COMPOSER_ADDRESS_DIALOG, EMsgComposerAddressDialogClass)) +#define E_IS_MSG_COMPOSER_ADDRESS_DIALOG(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_MSG_COMPOSER_ADDRESS_DIALOG)) +#define E_IS_MSG_COMPOSER_ADDRESS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_MSG_COMPOSER_ADDRESS_DIALOG)) + + +typedef struct _EMsgComposerAddressDialog EMsgComposerAddressDialog; +typedef struct _EMsgComposerAddressDialogClass EMsgComposerAddressDialogClass; + +struct _EMsgComposerAddressDialog { + GnomeDialog parent; + + GladeXML *gui; +}; + +struct _EMsgComposerAddressDialogClass { + GnomeDialogClass parent_class; + + void (* apply) (EMsgComposerAddressDialog *dialog); +}; + + +GtkType e_msg_composer_address_dialog_get_type (void); +GtkWidget *e_msg_composer_address_dialog_new (void); +void e_msg_composer_address_dialog_construct (EMsgComposerAddressDialog *dialog); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __E_MSG_COMPOSER_ADDRESS_DIALOG_H__ */ diff --git a/widgets/e-msg-composer-attachment-bar.c b/widgets/e-msg-composer-attachment-bar.c index 25cc2ff138..9722741a0c 100644 --- a/widgets/e-msg-composer-attachment-bar.c +++ b/widgets/e-msg-composer-attachment-bar.c @@ -369,6 +369,9 @@ destroy (GtkObject *object) bar = E_MSG_COMPOSER_ATTACHMENT_BAR (object); free_attachment_list (bar); + + if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL) + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } diff --git a/widgets/e-msg-composer-attachment.c b/widgets/e-msg-composer-attachment.c index 9e0f7e218e..c9e5029c9b 100644 --- a/widgets/e-msg-composer-attachment.c +++ b/widgets/e-msg-composer-attachment.c @@ -29,7 +29,7 @@ enum { CHANGED, LAST_SIGNAL }; -guint signals[LAST_SIGNAL] = { 0 }; +static guint signals[LAST_SIGNAL] = { 0 }; static GtkObjectClass *parent_class = NULL; @@ -90,7 +90,6 @@ real_changed (EMsgComposerAttachment *msg_composer_attachment) { g_return_if_fail (msg_composer_attachment != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_ATTACHMENT (msg_composer_attachment)); - } diff --git a/widgets/e-msg-composer.c b/widgets/e-msg-composer.c index 70602c0018..6654ddfd17 100644 --- a/widgets/e-msg-composer.c +++ b/widgets/e-msg-composer.c @@ -39,6 +39,7 @@ #include <camel/camel.h> #include "e-msg-composer.h" +#include "e-msg-composer-address-dialog.h" #include "e-msg-composer-attachment-bar.h" #include "e-msg-composer-hdrs.h" @@ -121,7 +122,20 @@ show_attachments (EMsgComposer *composer, } -/* Callbacks. */ +/* Address dialog callbacks. */ + +static void +address_dialog_destroy_cb (GtkWidget *widget, + gpointer data) +{ + EMsgComposer *composer; + + composer = E_MSG_COMPOSER (data); + composer->address_dialog = NULL; +} + + +/* Message composer window callbacks. */ static void send_cb (GtkWidget *widget, @@ -164,6 +178,24 @@ add_attachment_cb (GtkWidget *widget, } static void +address_dialog_cb (GtkWidget *widget, + gpointer data) +{ + EMsgComposer *composer; + + composer = E_MSG_COMPOSER (data); + if (composer->address_dialog == NULL) { + composer->address_dialog = e_msg_composer_address_dialog_new (); + gtk_signal_connect (GTK_OBJECT (composer->address_dialog), + "destroy", address_dialog_destroy_cb, + composer); + } + + gtk_widget_show (composer->address_dialog); + gdk_window_show (composer->address_dialog->window); +} + +static void glade_connect (GladeXML *gui, const gchar *widget_name, const gchar *signal_name, @@ -218,6 +250,13 @@ setup_signals (EMsgComposer *composer) "clicked", GTK_SIGNAL_FUNC (add_attachment_cb), composer); + glade_connect (composer->menubar_gui, "menubar_address_dialog", + "activate", + GTK_SIGNAL_FUNC (address_dialog_cb), composer); + glade_connect (composer->toolbar_gui, "toolbar_address_dialog", + "clicked", + GTK_SIGNAL_FUNC (address_dialog_cb), composer); + gtk_signal_connect (GTK_OBJECT (composer->attachment_bar), "changed", GTK_SIGNAL_FUNC (attachment_bar_changed), @@ -238,6 +277,9 @@ destroy (GtkObject *object) gtk_object_unref (GTK_OBJECT (composer->toolbar_gui)); gtk_object_unref (GTK_OBJECT (composer->appbar_gui)); + if (composer->address_dialog != NULL) + gtk_widget_destroy (composer->address_dialog); + if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -285,6 +327,8 @@ init (EMsgComposer *composer) composer->text = NULL; composer->text_scrolled_window = NULL; + composer->address_dialog = NULL; + composer->attachment_bar = NULL; composer->attachment_scrolled_window = NULL; } @@ -314,6 +358,12 @@ e_msg_composer_get_type (void) } +/** + * e_msg_composer_construct: + * @composer: A message composer widget + * + * Construct @composer. + **/ void e_msg_composer_construct (EMsgComposer *composer) { @@ -390,6 +440,13 @@ e_msg_composer_construct (EMsgComposer *composer) setup_signals (composer); } +/** + * e_msg_composer_new: + * + * Create a new message composer widget. + * + * Return value: A pointer to the newly created widget + **/ GtkWidget * e_msg_composer_new (void) { diff --git a/widgets/e-msg-composer.glade b/widgets/e-msg-composer.glade index c2d18b8125..b747c6f979 100644 --- a/widgets/e-msg-composer.glade +++ b/widgets/e-msg-composer.glade @@ -460,7 +460,7 @@ <widget> <class>GtkPixmapMenuItem</class> - <name>address_book</name> + <name>menubar_address_dialog</name> <signal> <name>activate</name> <handler>on_address_book_activate</handler> @@ -528,7 +528,8 @@ <child_name>Toolbar:button</child_name> <name>toolbar_send</name> <tooltip>Send this message</tooltip> - <label>Send</label> + <label>Send +</label> <stock_pixmap>GNOME_STOCK_PIXMAP_MAIL_SND</stock_pixmap> </widget> @@ -550,6 +551,16 @@ attachments</label> <label>Attach file</label> </widget> + + <widget> + <class>GtkButton</class> + <child_name>Toolbar:button</child_name> + <name>toolbar_address_dialog</name> + <tooltip>Go to addressbook</tooltip> + <label>Edit +addresses</label> + <stock_pixmap>GNOME_STOCK_PIXMAP_BOOK_RED</stock_pixmap> + </widget> </widget> </widget> diff --git a/widgets/e-msg-composer.h b/widgets/e-msg-composer.h index 46657479a3..3028dedca3 100644 --- a/widgets/e-msg-composer.h +++ b/widgets/e-msg-composer.h @@ -61,6 +61,8 @@ struct _EMsgComposer { GtkWidget *attachment_bar; GtkWidget *attachment_scrolled_window; + GtkWidget *address_dialog; + gboolean attachment_bar_visible : 1; }; diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 77a6c36c61..e8426055fc 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,27 @@ +1999-11-06 Ettore Perazzoli <ettore@gnu.org> + + * e-msg-composer-attachment-bar.c (destroy): Call the destroy + method of the parent class. + + * e-msg-composer.c: #include "e-msg-composer-address-dialog.h". + (address_dialog_cb): New callback to start the address dialog. + (setup_signals): Connect it to the appropriate button/menu item. + (init): Initialize the new `address_dialog' member to NULL. + (destroy): Destroy the `address_dialog' if not NULL. + + * e-msg-composer.h: New member `address_dialog' in `struct + _EMsgComposer'. + + * e-msg-composer.glade: Added button to activate the address + composition dialog. + + * e-msg-composer-address-dialog.h, e-msg-composer-address-dialog.c: + New files implementing the address composition dialog for Evolution. + + * e-msg-composer-address-dialog.glade: New file. + + * e-msg-composer-attachment.c: `signals' made static. + 1999-11-05 Ettore Perazzoli <ettore@gnu.org> * Makefile.am: Compile the new files in a `libevolutionwidgets' @@ -21,6 +45,9 @@ * e-msg-composer-hdrs.c, e-msg-composer-hdrs.h: New files implementing a widget for editing of email message headers. + * e-msg-composer-attachment.glade: New file. + * e-msg-composer.glade: New file. + 1999-10-31 Miguel de Icaza <miguel@gnu.org> * widgets/e-table-column.c, e-table-column.h: New file, implements the diff --git a/widgets/e-table/Makefile.am b/widgets/e-table/Makefile.am index 35d1bc64a4..a9614cf1d7 100644 --- a/widgets/e-table/Makefile.am +++ b/widgets/e-table/Makefile.am @@ -1,6 +1,7 @@ guidir = $(datadir)/evolution/gui gui_DATA = \ + e-msg-composer-address-dialog.glade \ e-msg-composer-attachment.glade \ e-msg-composer.glade @@ -16,6 +17,8 @@ noinst_LTLIBRARIES = \ libevolutionwidgets.la libevolutionwidgets_la_SOURCES = \ + e-msg-composer-address-dialog.c \ + e-msg-composer-address-dialog.h \ e-msg-composer-address-entry.c \ e-msg-composer-address-entry.h \ e-msg-composer-attachment-bar.c \ |