diff options
author | Christopher James Lahey <clahey@ximian.com> | 2002-03-13 05:36:24 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2002-03-13 05:36:24 +0800 |
commit | 338ad5b44323951b4b9a00ba6f40fabee71e99e8 (patch) | |
tree | c79a83ed8a4efcc44ebb2d1777720ea94655b83f /widgets | |
parent | 3a734a5af4b728bbed98f056f06653006c0ddc56 (diff) | |
download | gsoc2013-evolution-338ad5b44323951b4b9a00ba6f40fabee71e99e8.tar.gz gsoc2013-evolution-338ad5b44323951b4b9a00ba6f40fabee71e99e8.tar.zst gsoc2013-evolution-338ad5b44323951b4b9a00ba6f40fabee71e99e8.zip |
Use Use e_table_memory_store instead of e_table_memory_callbacks. Use
2002-03-12 Christopher James Lahey <clahey@ximian.com>
* e-multi-config-dialog.c (init): Use Use e_table_memory_store
instead of e_table_memory_callbacks. Use e_cell_vbox to include a
pixbuf cell and a text cell.
svn path=/trunk/; revision=16130
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/ChangeLog | 6 | ||||
-rw-r--r-- | widgets/misc/e-multi-config-dialog.c | 137 |
2 files changed, 44 insertions, 99 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 1469b80d87..7127146d30 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,9 @@ +2002-03-12 Christopher James Lahey <clahey@ximian.com> + + * e-multi-config-dialog.c (init): Use Use e_table_memory_store + instead of e_table_memory_callbacks. Use e_cell_vbox to include a + pixbuf cell and a text cell. + 2002-03-11 Ettore Perazzoli <ettore@ximian.com> * e-multi-config-dialog.c (init): Use GNOME_STOCK_BUTTON_CLOSE, diff --git a/widgets/misc/e-multi-config-dialog.c b/widgets/misc/e-multi-config-dialog.c index a843a0178c..df773f90f1 100644 --- a/widgets/misc/e-multi-config-dialog.c +++ b/widgets/misc/e-multi-config-dialog.c @@ -29,7 +29,10 @@ #include "e-clipped-label.h" #include <gal/e-table/e-table-scrolled.h> -#include <gal/e-table/e-table-memory-callbacks.h> +#include <gal/e-table/e-table-memory-store.h> +#include <gal/e-table/e-cell-pixbuf.h> +#include <gal/e-table/e-cell-vbox.h> +#include <gal/e-table/e-cell-text.h> #include <gdk-pixbuf/gdk-pixbuf.h> @@ -63,10 +66,12 @@ struct _EMultiConfigDialogPrivate { static char *list_e_table_spec = "<ETableSpecification cursor-mode=\"line\"" " selection-mode=\"browse\"" - " no-headers=\"true\">" + " no-headers=\"true\"" +/* " horizontal-resize=\"true\""*/ + ">" " <ETableColumn model_col=\"0\"" " expansion=\"1.0\"" - " cell=\"string\"" + " cell=\"vbox\"" " minimum_width=\"32\"" " resizable=\"true\"" " _title=\"blah\"" @@ -218,89 +223,6 @@ do_ok (EMultiConfigDialog *dialog) } -/* ETable mess. */ - -static int -table_model_column_count (ETableModel *etm, - void *data) -{ - return 1; -} - -static void * -table_model_value_at (ETableModel *etm, - int col, - int row, - void *model_data) -{ - EMultiConfigDialog *dialog; - EMultiConfigDialogPrivate *priv; - const Page *page; - GSList *p; - - dialog = E_MULTI_CONFIG_DIALOG (model_data); - priv = dialog->priv; - - p = g_slist_nth (priv->pages, row); - if (p == NULL) - return NULL; - - page = (const Page *) p->data; - return page->title; -} - -static gboolean -table_model_is_editable (ETableModel *etm, - int col, - int row, - void *model_data) -{ - return FALSE; -} - -static void * -table_model_duplicate_value (ETableModel *etm, - int col, - const void *value, - void *data) -{ - return g_strdup (value); -} - -static void -table_model_free_value (ETableModel *etm, - int col, - void *value, - void *data) -{ - g_free (value); -} - -static void * -table_model_initialize_value (ETableModel *etm, - int col, - void *data) -{ - return g_strdup (""); -} - -static gboolean -table_model_value_is_empty (ETableModel *etm, - int col, - const void *value, - void *data) -{ - return !(value && *(char *)value); -} - -static char * -table_model_value_to_string (ETableModel *etm, - int col, - const void *value, - void *data) -{ - return (char *)value; -} /* ETable signals. */ @@ -387,6 +309,12 @@ class_init (EMultiConfigDialogClass *class) parent_class = gtk_type_class (PARENT_TYPE); } +ETableMemoryStoreColumnInfo columns[] = { + E_TABLE_MEMORY_STORE_STRING, + E_TABLE_MEMORY_STORE_PIXBUF, + E_TABLE_MEMORY_STORE_TERMINATOR +}; + static void init (EMultiConfigDialog *multi_config_dialog) { @@ -396,27 +324,38 @@ init (EMultiConfigDialog *multi_config_dialog) GtkWidget *hbox; GtkWidget *notebook; GtkWidget *list_e_table; + ETableExtras *extras; + ECell *pixbuf; + ECell *text; + ECell *vbox; hbox = gtk_hbox_new (FALSE, 2); gnome_dialog_vbox = GNOME_DIALOG (multi_config_dialog)->vbox; gtk_container_add (GTK_CONTAINER (gnome_dialog_vbox), hbox); - list_e_table_model = e_table_memory_callbacks_new (table_model_column_count, - table_model_value_at, - NULL, /* set_value_at */ - table_model_is_editable, - table_model_duplicate_value, - table_model_free_value, - table_model_initialize_value, - table_model_value_is_empty, - table_model_value_to_string, - multi_config_dialog); - - list_e_table = e_table_scrolled_new (list_e_table_model, NULL, list_e_table_spec, NULL); + list_e_table_model = e_table_memory_store_new (columns); + + vbox = e_cell_vbox_new (); + + pixbuf = e_cell_pixbuf_new(); + e_cell_vbox_append (E_CELL_VBOX (vbox), pixbuf, 1); + gtk_object_unref (GTK_OBJECT (pixbuf)); + + text = e_cell_text_new (NULL, GTK_JUSTIFY_CENTER); + e_cell_vbox_append (E_CELL_VBOX (vbox), text, 0); + gtk_object_unref (GTK_OBJECT (text)); + + extras = e_table_extras_new (); + e_table_extras_add_cell (extras, "vbox", vbox); + + list_e_table = e_table_scrolled_new (list_e_table_model, extras, list_e_table_spec, NULL); + e_scroll_frame_set_policy (E_SCROLL_FRAME (list_e_table), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_signal_connect (GTK_OBJECT (e_table_scrolled_get_table (E_TABLE_SCROLLED (list_e_table))), "cursor_change", GTK_SIGNAL_FUNC (table_cursor_change_callback), multi_config_dialog); + gtk_object_unref (GTK_OBJECT (extras)); + gtk_widget_set_usize (list_e_table, 150, -1); gtk_box_pack_start (GTK_BOX (hbox), list_e_table, FALSE, TRUE, 0); @@ -495,7 +434,7 @@ e_multi_config_dialog_add_page (EMultiConfigDialog *dialog, e_selection_model_select_all (e_table_get_selection_model (table)); } - e_table_memory_insert (E_TABLE_MEMORY (priv->list_e_table_model), -1, new_page->title); + e_table_memory_store_insert_list (E_TABLE_MEMORY_STORE (priv->list_e_table_model), -1, NULL, title, icon); gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), create_page_container (new_page->description, GTK_WIDGET (page_widget)), |