diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2003-03-28 05:01:41 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2003-03-28 05:01:41 +0800 |
commit | 892aab7fcad7de9654b22648cad8783f5e0f3d8f (patch) | |
tree | 353d292a69308ad3022b967083796ffcc60ab466 | |
parent | 6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a (diff) | |
download | gsoc2013-evolution-892aab7fcad7de9654b22648cad8783f5e0f3d8f.tar gsoc2013-evolution-892aab7fcad7de9654b22648cad8783f5e0f3d8f.tar.gz gsoc2013-evolution-892aab7fcad7de9654b22648cad8783f5e0f3d8f.tar.bz2 gsoc2013-evolution-892aab7fcad7de9654b22648cad8783f5e0f3d8f.tar.lz gsoc2013-evolution-892aab7fcad7de9654b22648cad8783f5e0f3d8f.tar.xz gsoc2013-evolution-892aab7fcad7de9654b22648cad8783f5e0f3d8f.tar.zst gsoc2013-evolution-892aab7fcad7de9654b22648cad8783f5e0f3d8f.zip |
Renamed from update_dialog_clist, Ported to GtkTreeView.
* e-shell-offline-handler.c (update_dialog_tree_view): Renamed
from update_dialog_clist, Ported to GtkTreeView.
(update_dialog_tree_view_hash_foreach): Likewise.
* glade/e-active-connection-dialog.glade: Rename
"active_connection_clist" to "active_connection_treeview".
svn path=/trunk/; revision=20550
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-shell-offline-handler.c | 44 | ||||
-rw-r--r-- | shell/glade/e-active-connection-dialog.glade | 2 |
3 files changed, 34 insertions, 21 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index e0aa2d093f..c94cfd3744 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,12 @@ +2003-03-27 Ettore Perazzoli <ettore@ximian.com> + + * e-shell-offline-handler.c (update_dialog_tree_view): Renamed + from update_dialog_clist, Ported to GtkTreeView. + (update_dialog_tree_view_hash_foreach): Likewise. + + * glade/e-active-connection-dialog.glade: Rename + "active_connection_clist" to "active_connection_treeview". + 2003-03-27 Not Zed <NotZed@Ximian.com> * e-shell-about-box.c: Make Radek's surname correct, Doulík, diff --git a/shell/e-shell-offline-handler.c b/shell/e-shell-offline-handler.c index e1bcc3d66d..4b22bdbf1d 100644 --- a/shell/e-shell-offline-handler.c +++ b/shell/e-shell-offline-handler.c @@ -37,6 +37,8 @@ #include <gtk/gtkdialog.h> #include <gtk/gtklabel.h> #include <gtk/gtksignal.h> +#include <gtk/gtkliststore.h> +#include <gtk/gtktreeview.h> #include <gtk/gtktypeutils.h> #include <gtk/gtkwidget.h> @@ -520,28 +522,24 @@ finalize_offline (EShellOfflineHandler *offline_handler) /* The confirmation dialog. */ static void -update_dialog_clist_hash_foreach (void *key, - void *data, - void *user_data) +update_dialog_tree_view_hash_foreach (void *key, + void *data, + void *user_data) { ComponentInfo *component_info; const GNOME_Evolution_Connection *p; - GtkWidget *clist; + GtkTreeModel *model = GTK_TREE_MODEL (user_data); int i; - clist = GTK_WIDGET (user_data); - component_info = (ComponentInfo *) data; for (i = 0, p = component_info->active_connection_list->_buffer; i < component_info->active_connection_list->_length; i++, p++) { - char *columns[3]; - - columns[0] = p->hostName; - columns[1] = p->type; - columns[2] = NULL; + GtkTreeIter iter; + char *host = g_strdup_printf ("%s (%s)", p->hostName, p->type); - gtk_clist_prepend (GTK_CLIST (clist), columns); + gtk_list_store_prepend (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, host, -1); } } @@ -549,23 +547,29 @@ static void update_dialog_clist (EShellOfflineHandler *offline_handler) { EShellOfflineHandlerPrivate *priv; - GtkWidget *clist; + GtkWidget *tree_view; + GtkTreeModel *model; + GtkTreeModel *model_sort; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; priv = offline_handler->priv; if (priv->dialog_gui == NULL) return; - clist = glade_xml_get_widget (priv->dialog_gui, "active_connection_clist"); + tree_view = glade_xml_get_widget (priv->dialog_gui, "active_connection_treeview"); + g_assert (GTK_IS_TREE_VIEW (tree_view)); - gtk_clist_set_auto_sort (GTK_CLIST (clist), TRUE); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE); - gtk_clist_freeze (GTK_CLIST (clist)); + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Host", renderer, "text", 0, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); - /* Populate the GtkCList. */ - gtk_clist_clear (GTK_CLIST (clist)); - g_hash_table_foreach (priv->id_to_component_info, update_dialog_clist_hash_foreach, clist); + model = gtk_list_store_new (1, G_TYPE_STRING); + g_hash_table_foreach (priv->id_to_component_info, update_dialog_tree_view_hash_foreach, model); - gtk_clist_thaw (GTK_CLIST (clist)); + gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model); } static void diff --git a/shell/glade/e-active-connection-dialog.glade b/shell/glade/e-active-connection-dialog.glade index 091937de76..29f1d5fba3 100644 --- a/shell/glade/e-active-connection-dialog.glade +++ b/shell/glade/e-active-connection-dialog.glade @@ -92,7 +92,7 @@ <property name="window_placement">GTK_CORNER_TOP_LEFT</property> <child> - <widget class="GtkTreeView" id="active_connection_clist"> + <widget class="GtkTreeView" id="active_connection_treeview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="headers_visible">True</property> |