2005-06-14 [paul] 1.9.11cvs66
authorPaul Mangan <paul@claws-mail.org>
Tue, 14 Jun 2005 09:02:46 +0000 (09:02 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 14 Jun 2005 09:02:46 +0000 (09:02 +0000)
* src/account.c
change a couple stock icons
* src/inc.c
* src/send_message.c
* src/gtk/progressdialog.c
* src/gtk/progressdialog.h
sync main's GtkTreeView implementation

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/account.c
src/gtk/progressdialog.c
src/gtk/progressdialog.h
src/inc.c
src/send_message.c

index 396c72f..e32a8de 100644 (file)
@@ -1,3 +1,13 @@
+2005-06-14 [paul]      1.9.11cvs66
+
+       * src/account.c
+               change a couple stock icons
+       * src/inc.c
+       * src/send_message.c
+       * src/gtk/progressdialog.c
+       * src/gtk/progressdialog.h
+               sync main's GtkTreeView implementation
+
 2005-06-14 [colin]     1.9.11cvs65
 
        * src/imap.c
index b0adf73..4f3d63d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.213.2.31 -r 1.213.2.32 src/folder.c;  ) > 1.9.11cvs63.patchset
 ( cvs diff -u -r 1.213.2.32 -r 1.213.2.33 src/folder.c;  cvs diff -u -r 1.87.2.11 -r 1.87.2.12 src/folder.h;  cvs diff -u -r 1.3.2.4 -r 1.3.2.5 src/folderutils.c;  cvs diff -u -r 1.179.2.30 -r 1.179.2.31 src/imap.c;  cvs diff -u -r 1.75.2.6 -r 1.75.2.7 src/matcher.c;  cvs diff -u -r 1.150.2.27 -r 1.150.2.28 src/procmsg.c;  cvs diff -u -r 1.60.2.11 -r 1.60.2.12 src/procmsg.h;  cvs diff -u -r 1.395.2.79 -r 1.395.2.80 src/summaryview.c;  ) > 1.9.11cvs64.patchset
 ( cvs diff -u -r 1.179.2.31 -r 1.179.2.32 src/imap.c;  ) > 1.9.11cvs65.patchset
+( cvs diff -u -r 1.61.2.26 -r 1.61.2.27 src/account.c;  cvs diff -u -r 1.149.2.25 -r 1.149.2.26 src/inc.c;  cvs diff -u -r 1.17.2.12 -r 1.17.2.13 src/send_message.c;  cvs diff -u -r 1.1.4.10 -r 1.1.4.11 src/gtk/progressdialog.c;  cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/gtk/progressdialog.h;  ) > 1.9.11cvs66.patchset
index 628858c..52df776 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=65
+EXTRA_VERSION=66
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 59ec416..fd6e733 100644 (file)
@@ -672,13 +672,17 @@ static void account_edit_create(void)
        g_signal_connect (G_OBJECT(add_btn), "clicked",
                          G_CALLBACK (account_add), NULL);
 
+#ifdef GTK_STOCK_EDIT
+       edit_btn = gtk_button_new_from_stock (GTK_STOCK_EDIT);
+#else
        edit_btn = gtk_button_new_from_stock(GTK_STOCK_PROPERTIES);
+#endif
        gtk_widget_show (edit_btn);
        gtk_box_pack_start (GTK_BOX (vbox2), edit_btn, FALSE, FALSE, 4);
        g_signal_connect (G_OBJECT(edit_btn), "clicked",
                          G_CALLBACK (account_edit_prefs), NULL);
 
-       del_btn = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
+       del_btn = gtk_button_new_from_stock(GTK_STOCK_DELETE);
        gtk_widget_show (del_btn);
        gtk_box_pack_start (GTK_BOX (vbox2), del_btn, FALSE, FALSE, 4);
        g_signal_connect (G_OBJECT(del_btn), "clicked",
index d922bfd..b029df0 100644 (file)
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <gtk/gtk.h>
 #include <gtk/gtkdialog.h>
 #include <gtk/gtkhbox.h>
 #include <gtk/gtklabel.h>
 #include <gtk/gtkprogressbar.h>
 #include <gtk/gtkscrolledwindow.h>
+#include <gtk/gtkliststore.h>
+#include <gtk/gtktreeview.h>
+#include <gtk/gtktreeselection.h>
+#include <gtk/gtkcellrendererpixbuf.h>
+#include <gtk/gtkcellrenderertext.h>
 #include <gtk/gtkbutton.h>
 #include <gtk/gtkstock.h>
 
 #include "progressdialog.h"
 #include "gtkutils.h"
 #include "utils.h"
-#include "prefs_common.h"
-
-enum {
-       PROGRESS_IMAGE,
-       PROGRESS_ACCOUNT,
-       PROGRESS_STATE,
-       N_PROGRESS_COLUMNS
-};
-
-
-static GtkListStore* progress_dialog_create_data_store(void);
-static gint progress_dialog_list_view_insert_account(GtkWidget   *list_view,
-                                                    gint         row,
-                                                    const gchar *account,
-                                                    const gchar *status,
-                                                    GdkPixbuf   *image);
-static GtkWidget *progress_dialog_list_view_create(void);
-static void progress_dialog_create_list_view_columns(GtkTreeView *list_view);
 
 ProgressDialog *progress_dialog_create(void)
 {
@@ -63,12 +49,11 @@ ProgressDialog *progress_dialog_create(void)
        GtkWidget *cancel_btn;
        GtkWidget *progressbar;
        GtkWidget *scrolledwin;
-       GtkWidget *clist;
-       GtkWidget *list_view;
-       gchar *text[] = {NULL, NULL, NULL};
-
-       text[1] = _("Account");
-       text[2] = _("Status");
+       GtkWidget *treeview;
+       GtkListStore *store;
+       GtkTreeSelection *selection;
+       GtkTreeViewColumn *column;
+       GtkCellRenderer *renderer;
 
        debug_print("Creating progress dialog...\n");
        progress = g_new0(ProgressDialog, 1);
@@ -111,51 +96,57 @@ ProgressDialog *progress_dialog_create(void)
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
+       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
+                                           GTK_SHADOW_IN);
+
+       store = gtk_list_store_new(PROG_N_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING,
+                                  G_TYPE_STRING, G_TYPE_POINTER);
+
+       treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+       g_object_unref(G_OBJECT(store));
+       gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE);
+       gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE);
+       gtk_widget_show(treeview);
+       gtk_container_add(GTK_CONTAINER(scrolledwin), treeview);
+       gtk_widget_set_size_request(treeview, -1, 120);
+
+       selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
+       gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
 
-       /* GTK2: we hide the clist, but it is available for migration
-        * purposes. now if there only was a way to catch "set clist 
-        * things"!.. */
-       clist = gtk_clist_new_with_titles(3, text);
-       gtk_widget_hide(clist);
-       /* gtk_container_add(GTK_CONTAINER(scrolledwin), clist); */
-       /* gtk_widget_set_size_request(clist, -1, 120); */
-       gtk_clist_set_column_justification(GTK_CLIST(clist), 0,
-                                          GTK_JUSTIFY_CENTER);
-       gtk_clist_set_column_width(GTK_CLIST(clist), 0, 16);
-       gtk_clist_set_column_width(GTK_CLIST(clist), 1, 160);
-
-       list_view = progress_dialog_list_view_create();
-       gtk_widget_show(list_view);
-       gtk_container_add(GTK_CONTAINER(scrolledwin), list_view);
-       gtk_widget_set_size_request(list_view, -1, 120);
+       renderer = gtk_cell_renderer_pixbuf_new();
+       g_object_set(renderer, "xalign", 0.5, NULL);
+       column = gtk_tree_view_column_new_with_attributes
+               (NULL, renderer, "pixbuf", PROG_COL_PIXBUF, NULL);
+       gtk_tree_view_column_set_alignment(column, 0.5);
+       gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
+       gtk_tree_view_column_set_fixed_width(column, 20);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
+
+       renderer = gtk_cell_renderer_text_new();
+       column = gtk_tree_view_column_new_with_attributes
+               (_("Account"), renderer, "text", PROG_COL_NAME, NULL);
+       gtk_tree_view_column_set_resizable(column, TRUE);
+       gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
+       gtk_tree_view_column_set_fixed_width(column, 160);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
+
+       renderer = gtk_cell_renderer_text_new();
+       column = gtk_tree_view_column_new_with_attributes
+               (_("Status"), renderer, "text", PROG_COL_STATUS, NULL);
+       gtk_tree_view_column_set_resizable(column, TRUE);
+       gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
 
        progress->window      = dialog;
        progress->label       = label;
        progress->cancel_btn  = cancel_btn;
        progress->progressbar = progressbar;
-       progress->clist       = clist;
-       progress->list_view   = list_view;
+       progress->treeview    = treeview;
+       progress->store       = store;
 
        return progress;
 }
 
-void progress_dialog_set_label(ProgressDialog *progress, gchar *str)
-{
-       gtk_label_set_text(GTK_LABEL(progress->label), str);
-}
-
-void progress_dialog_get_fraction(ProgressDialog *progress)
-{
-       gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(progress->progressbar));
-}
-
-void progress_dialog_set_fraction(ProgressDialog *progress,
-                                 gfloat percentage)
-{
-       gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress->progressbar),
-                                     percentage);
-}
-
 void progress_dialog_destroy(ProgressDialog *progress)
 {
        if (progress) {
@@ -164,172 +155,106 @@ void progress_dialog_destroy(ProgressDialog *progress)
        }
 }
 
-/*!
- *\return      gint Row where account was set
- */
-gint progress_dialog_list_set_account(ProgressDialog *progress,
-                                     gint            row,
-                                     const gchar    *account_name)
-{
-       return progress_dialog_list_view_insert_account(progress->list_view,
-                                                       row, account_name, NULL, 
-                                                       NULL);
-}
-
-/*!
- *\return      gint Row where image was set
- */
-gint progress_dialog_list_set_image(ProgressDialog *progress,
-                                   gint            row,
-                                   GdkPixbuf      *image)
+void progress_dialog_set_label(ProgressDialog *progress, gchar *str)
 {
-       return progress_dialog_list_view_insert_account(progress->list_view,
-                                                       row, NULL, NULL, 
-                                                       image);
+       gtk_label_set_text(GTK_LABEL(progress->label), str);
 }
 
-/*!
- *\return      gint Row where status was set
- */
-gint progress_dialog_list_set_status(ProgressDialog *progress,
-                                    gint            row,
-                                    const gchar    *status)
+void progress_dialog_set_value(ProgressDialog *progress, gfloat value)
 {
-       return progress_dialog_list_view_insert_account(progress->list_view,
-                                                       row, NULL, status, 
-                                                       NULL);
+       gtk_progress_set_value(GTK_PROGRESS(progress->progressbar), value);
 }
 
-/*!
- *\return      gint Row where data were set 
- */
-gint progress_dialog_list_set(ProgressDialog   *progress,
-                             gint               row,
-                             GdkPixbuf         *image,
-                             const gchar       *account_name,
-                             const gchar       *status)
+void progress_dialog_set_percentage(ProgressDialog *progress,
+                                   gfloat percentage)
 {
-       return progress_dialog_list_view_insert_account(progress->list_view,
-                                                       row,  account_name, 
-                                                       status, image);
+       gtk_progress_set_percentage(GTK_PROGRESS(progress->progressbar),
+                                   percentage);
 }
 
-/* XXX: maybe scroll into view, but leaving that for someone else to
- * pickup: I don't have that many accounts... */
-gboolean progress_dialog_list_select_row(ProgressDialog *progress,
-                                        gint            row)
+void progress_dialog_append(ProgressDialog *progress, GdkPixbuf *pixbuf,
+                           const gchar *name, const gchar *status,
+                           gpointer data)
 {
-       GtkTreeSelection *selection = gtk_tree_view_get_selection
-                                       (GTK_TREE_VIEW(progress->list_view));
+       GtkListStore *store = progress->store;
        GtkTreeIter iter;
-       GtkTreeModel *model;
 
-       model = gtk_tree_view_get_model(GTK_TREE_VIEW(progress->list_view));
+       gtk_list_store_append(store, &iter);
 
-       if (!gtk_tree_model_iter_nth_child(model, &iter, NULL, row))
-               return FALSE;
+       gtk_list_store_set(store, &iter,
+                          PROG_COL_PIXBUF, pixbuf,
+                          PROG_COL_NAME, name,
+                          PROG_COL_STATUS, status,
+                          PROG_COL_POINTER, data,
+                          -1);
+}
 
-       gtk_tree_selection_select_iter(selection, &iter);               
+void progress_dialog_set_row(ProgressDialog *progress, gint row,
+                            GdkPixbuf *pixbuf, const gchar *name,
+                            const gchar *status, gpointer data)
+{
+       GtkListStore *store = progress->store;
+       GtkTreeIter iter;
 
-       return TRUE;
+       if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store),
+                                         &iter, NULL, row)) {
+               gtk_list_store_set(store, &iter,
+                                  PROG_COL_PIXBUF, pixbuf,
+                                  PROG_COL_NAME, name,
+                                  PROG_COL_STATUS, status,
+                                  PROG_COL_POINTER, data,
+                                  -1);
+       }
 }
 
-static GtkListStore* progress_dialog_create_data_store(void)
+void progress_dialog_set_row_pixbuf(ProgressDialog *progress, gint row,
+                                   GdkPixbuf *pixbuf)
 {
-       return gtk_list_store_new(N_PROGRESS_COLUMNS,
-                                 GDK_TYPE_PIXBUF,
-                                 G_TYPE_STRING,
-                                 G_TYPE_STRING,        
-                                 -1);
+       GtkListStore *store = progress->store;
+       GtkTreeIter iter;
+
+       if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store),
+                                         &iter, NULL, row)) {
+               gtk_list_store_set(store, &iter, PROG_COL_PIXBUF, pixbuf, -1);
+       }
 }
 
-static gint progress_dialog_list_view_insert_account(GtkWidget   *list_view,
-                                                    gint         row,
-                                                    const gchar *account,
-                                                    const gchar *status,
-                                                    GdkPixbuf   *image)
+void progress_dialog_set_row_name(ProgressDialog *progress, gint row,
+                                 const gchar *name)
 {
+       GtkListStore *store = progress->store;
        GtkTreeIter iter;
-       GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model
-                                       (GTK_TREE_VIEW(list_view)));
-       gint result = -1;                                       
-       
-       if (account == NULL && status == NULL && image == NULL)
-               return -1;
-
-       /* see if row exists, if not append */
-       if (row < 0 || !gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), 
-                                                     &iter, NULL, row)) {
-               result = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store),
-                                                       NULL);
-               gtk_list_store_append(store, &iter);
-       } else
-               result = row;
-
-       /*
-        * XXX: uhm, when does the iter invalidate? sure not while
-        * just setting a row's column i hope?
-        */
-       
-       if (account)
-               gtk_list_store_set(store, &iter, 
-                                  PROGRESS_ACCOUNT, account,
-                                  -1);
-       if (status)
-               gtk_list_store_set(store, &iter,
-                                  PROGRESS_STATE, status,
-                                  -1);
-       if (image)
-               gtk_list_store_set(store, &iter,
-                                  PROGRESS_IMAGE, image,
-                                  -1);
 
-       return result;
+       if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store),
+                                         &iter, NULL, row)) {
+               gtk_list_store_set(store, &iter, PROG_COL_NAME, name, -1);
+       }
 }
 
-static GtkWidget *progress_dialog_list_view_create(void)
+void progress_dialog_set_row_status(ProgressDialog *progress, gint row,
+                                   const gchar *status)
 {
-       GtkTreeView *list_view;
-       GtkTreeModel *model;
-
-       model = GTK_TREE_MODEL(progress_dialog_create_data_store());
-       list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model));
-       g_object_unref(model);  
-       
-       gtk_tree_view_set_rules_hint(list_view, prefs_common.enable_rules_hint);
-       
-       /* create the columns */
-       progress_dialog_create_list_view_columns(list_view);
-
-       return GTK_WIDGET(list_view);
+       GtkListStore *store = progress->store;
+       GtkTreeIter iter;
+
+       if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store),
+                                         &iter, NULL, row)) {
+               gtk_list_store_set(store, &iter, PROG_COL_STATUS, status, -1);
+       }
 }
 
-static void progress_dialog_create_list_view_columns(GtkTreeView *list_view)
+void progress_dialog_scroll_to_row(ProgressDialog *progress, gint row)
 {
-       GtkTreeViewColumn *column;
-       GtkCellRenderer *renderer;
-
-       renderer = gtk_cell_renderer_pixbuf_new();
-       column = gtk_tree_view_column_new_with_attributes
-                       ("", renderer, 
-                        "pixbuf", PROGRESS_IMAGE,
-                        NULL);
-       gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);                   
+       GtkTreeModel *model = GTK_TREE_MODEL(progress->store);
+       GtkTreeIter iter;
+       GtkTreePath *path;
 
-       renderer = gtk_cell_renderer_text_new();
-       column = gtk_tree_view_column_new_with_attributes
-               (_("Account"),
-                renderer,
-                "text", PROGRESS_ACCOUNT,
-                NULL);
-       gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);          
+       if (!gtk_tree_model_iter_nth_child(model, &iter, NULL, row))
+               return;
 
-       renderer = gtk_cell_renderer_text_new();
-       column = gtk_tree_view_column_new_with_attributes
-               (_("Status"),
-                renderer,
-                "text", PROGRESS_STATE,
-                NULL);
-       gtk_tree_view_append_column(GTK_TREE_VIEW(list_view), column);          
+       path = gtk_tree_model_get_path(model, &iter);
+       gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(progress->treeview),
+                                    path, NULL, FALSE, 0.0, 0.0);
+       gtk_tree_path_free(path);
 }
 
index 4fa5e7f..33cf983 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <glib.h>
 #include <gtk/gtkwidget.h>
+#include <gtk/gtkliststore.h>
+#include <gdk/gdkpixbuf.h>
 
 typedef struct _ProgressDialog ProgressDialog;
 
@@ -31,39 +33,53 @@ struct _ProgressDialog
        GtkWidget *label;
        GtkWidget *cancel_btn;
        GtkWidget *progressbar;
-       GtkWidget *clist;
-       GtkWidget *list_view;
+
+       GtkWidget *treeview;
+       GtkListStore *store;
 };
 
+typedef enum
+{
+       PROG_COL_PIXBUF,
+       PROG_COL_NAME,
+       PROG_COL_STATUS,
+       PROG_COL_POINTER,
+       PROG_N_COLS
+} ProgressColumn;
+
 ProgressDialog *progress_dialog_create (void);
+void progress_dialog_destroy           (ProgressDialog *progress);
+
 void progress_dialog_set_label         (ProgressDialog *progress,
                                         gchar          *str);
-void progress_dialog_get_fraction      (ProgressDialog *progress);
-void progress_dialog_set_fraction      (ProgressDialog *progress,
+void progress_dialog_set_value         (ProgressDialog *progress,
+                                        gfloat          value);
+void progress_dialog_set_percentage    (ProgressDialog *progress,
                                         gfloat          percentage);
-void progress_dialog_destroy           (ProgressDialog *progress);
 
-
-/*
- * Use these functions to access the dialog list
- */
-
-gint progress_dialog_list_set_account  (ProgressDialog *progress,
+void progress_dialog_append            (ProgressDialog *progress,
+                                        GdkPixbuf      *pixbuf,
+                                        const gchar    *name,
+                                        const gchar    *status,
+                                        gpointer        data);
+void progress_dialog_set_row           (ProgressDialog *progress,
                                         gint            row,
-                                        const gchar    *account_name);
-gint progress_dialog_list_set_image    (ProgressDialog *progress,
+                                        GdkPixbuf      *pixbuf,
+                                        const gchar    *name,
+                                        const gchar    *status,
+                                        gpointer        data);
+
+void progress_dialog_set_row_pixbuf    (ProgressDialog *progress,
                                         gint            row,
-                                        GdkPixbuf      *image);
-gint progress_dialog_list_set_status   (ProgressDialog *progress,
+                                        GdkPixbuf      *pixbuf);
+void progress_dialog_set_row_name      (ProgressDialog *progress,
                                         gint            row,
-                                        const gchar    *status);
-gint progress_dialog_list_set          (ProgressDialog *progress,
+                                        const gchar    *name);
+void progress_dialog_set_row_status    (ProgressDialog *progress,
                                         gint            row,
-                                        GdkPixbuf      *image,
-                                        const gchar    *account_name,
-                                        const gchar    *status);
+                                        const gchar    *status);
 
-gboolean progress_dialog_list_select_row(ProgressDialog *progress,
+void progress_dialog_scroll_to_row     (ProgressDialog *progress,
                                         gint            row);
 
 #endif /* __PROGRESS_H__ */
index d4b5de3..7329ac3 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * 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
@@ -71,9 +71,9 @@ static GList *inc_dialog_list = NULL;
 
 static guint inc_lock_count = 0;
 
-static GdkPixbuf *currentpix;
-static GdkPixbuf *errorpix;
-static GdkPixbuf *okpix;
+static GdkPixbuf *current_pixbuf;
+static GdkPixbuf *error_pixbuf;
+static GdkPixbuf *ok_pixbuf;
 
 #define MSGBUFSIZE     8192
 
@@ -383,14 +383,12 @@ static IncProgressDialog *inc_progress_dialog_create(gboolean autocheck)
                         G_CALLBACK(inc_dialog_delete_cb), dialog);
        /* manage_window_set_transient(GTK_WINDOW(progress->window)); */
 
-       progress_dialog_get_fraction(progress);
+       progress_dialog_set_value(progress, 0.0);
 
-       stock_pixbuf_gdk(progress->list_view, STOCK_PIXMAP_COMPLETE,
-                        &okpix);
-       stock_pixbuf_gdk(progress->list_view, STOCK_PIXMAP_CONTINUE,
-                        &currentpix);
-       stock_pixbuf_gdk(progress->list_view, STOCK_PIXMAP_ERROR,
-                        &errorpix);
+       stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_COMPLETE, &ok_pixbuf);
+       stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_CONTINUE,
+                        &current_pixbuf);
+       stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_ERROR, &error_pixbuf);
 
        if (prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS ||
            (prefs_common.recv_dialog_mode == RECV_DIALOG_MANUAL &&
@@ -419,17 +417,15 @@ static void inc_progress_dialog_set_list(IncProgressDialog *inc_dialog)
                Pop3Session *pop3_session = POP3_SESSION(session->session);
 
                session->data = inc_dialog;
-
-               progress_dialog_list_set(inc_dialog->dialog,
-                                        -1, NULL,
-                                        pop3_session->ac_prefs->account_name,
-                                        _("Standby"));
+               progress_dialog_append(inc_dialog->dialog, NULL,
+                                      pop3_session->ac_prefs->account_name,
+                                      _("Standby"), NULL);
        }
 }
 
 static void inc_progress_dialog_clear(IncProgressDialog *inc_dialog)
 {
-       progress_dialog_get_fraction(inc_dialog->dialog);
+       progress_dialog_set_value(inc_dialog->dialog, 0.0);
        progress_dialog_set_label(inc_dialog->dialog, "");
        if (inc_dialog->mainwin)
                main_window_progress_off(inc_dialog->mainwin);
@@ -538,13 +534,12 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                qlist = next;
        }
 
-#define SET_PIXMAP_AND_TEXT(pix, str)                                     \
-{                                                                         \
-       progress_dialog_list_set(inc_dialog->dialog,                       \
-                                inc_dialog->cur_row,                      \
-                                pix,                                      \
-                                NULL,                                     \
-                                str);                                     \
+#define SET_PIXMAP_AND_TEXT(pixbuf, str)                               \
+{                                                                      \
+       progress_dialog_set_row_pixbuf(inc_dialog->dialog,              \
+                                      inc_dialog->cur_row, pixbuf);    \
+       progress_dialog_set_row_status(inc_dialog->dialog,              \
+                                      inc_dialog->cur_row, str);       \
 }
 
        for (; inc_dialog->queue_list != NULL && !cancelled; inc_dialog->cur_row++) {
@@ -552,7 +547,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                pop3_session = POP3_SESSION(session->session);
 
                if (pop3_session->pass == NULL) {
-                       SET_PIXMAP_AND_TEXT(okpix, _("Cancelled"));
+                       SET_PIXMAP_AND_TEXT(ok_pixbuf, _("Cancelled"));
                        inc_session_destroy(session);
                        inc_dialog->queue_list =
                                g_list_remove(inc_dialog->queue_list, session);
@@ -560,10 +555,10 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                }
 
                inc_progress_dialog_clear(inc_dialog);
-               progress_dialog_list_select_row(inc_dialog->dialog,
-                                               inc_dialog->cur_row);
+               progress_dialog_scroll_to_row(inc_dialog->dialog,
+                                             inc_dialog->cur_row);
 
-               SET_PIXMAP_AND_TEXT(currentpix, _("Retrieving"));
+               SET_PIXMAP_AND_TEXT(current_pixbuf, _("Retrieving"));
 
                /* begin POP3 session */
                inc_state = inc_pop3_session_do(session);
@@ -579,30 +574,31 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                                         to_human_readable(pop3_session->cur_total_recv_bytes));
                        else
                                msg = g_strdup_printf(_("Done (no new messages)"));
-                       SET_PIXMAP_AND_TEXT(okpix, msg);
+                       SET_PIXMAP_AND_TEXT(ok_pixbuf, msg);
                        g_free(msg);
                        break;
                case INC_CONNECT_ERROR:
-                       SET_PIXMAP_AND_TEXT(errorpix, _("Connection failed"));
+                       SET_PIXMAP_AND_TEXT(error_pixbuf,
+                                           _("Connection failed"));
                        break;
                case INC_AUTH_FAILED:
-                       SET_PIXMAP_AND_TEXT(errorpix, _("Auth failed"));
+                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Auth failed"));
                        break;
                case INC_LOCKED:
-                       SET_PIXMAP_AND_TEXT(errorpix, _("Locked"));
+                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Locked"));
                        break;
                case INC_ERROR:
                case INC_NO_SPACE:
                case INC_IO_ERROR:
                case INC_SOCKET_ERROR:
                case INC_EOF:
-                       SET_PIXMAP_AND_TEXT(errorpix, _("Error"));
+                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Error"));
                        break;
                case INC_TIMEOUT:
-                       SET_PIXMAP_AND_TEXT(errorpix, _("Timeout"));
+                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Timeout"));
                        break;
                case INC_CANCEL:
-                       SET_PIXMAP_AND_TEXT(okpix, _("Cancelled"));
+                       SET_PIXMAP_AND_TEXT(ok_pixbuf, _("Cancelled"));
                        if (!inc_dialog->show_dialog)
                                cancelled = TRUE;
                        break;
@@ -922,14 +918,16 @@ static void inc_progress_dialog_set_progress(IncProgressDialog *inc_dialog,
                progress_dialog_set_label(inc_dialog->dialog, buf);
        }
 
-       progress_dialog_set_fraction
+       progress_dialog_set_percentage
                (inc_dialog->dialog,(gfloat)cur_total / (gfloat)total);
 
+       gtk_progress_set_show_text
+               (GTK_PROGRESS(inc_dialog->mainwin->progressbar), TRUE);
        g_snprintf(buf, sizeof(buf), "%d / %d",
                   pop3_session->cur_msg, pop3_session->count);
-       gtk_progress_bar_set_text
-               (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar), buf);
-       gtk_progress_bar_set_fraction
+       gtk_progress_set_format_string
+               (GTK_PROGRESS(inc_dialog->mainwin->progressbar), buf);
+       gtk_progress_bar_update
                (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar),
                 (gfloat)cur_total / (gfloat)total);
 
@@ -941,9 +939,8 @@ static void inc_progress_dialog_set_progress(IncProgressDialog *inc_dialog,
                           pop3_session->cur_total_num,
                           to_human_readable
                           (pop3_session->cur_total_recv_bytes));
-               progress_dialog_list_set_status(inc_dialog->dialog,
-                                               inc_dialog->cur_row,
-                                               buf);
+               progress_dialog_set_row_status(inc_dialog->dialog,
+                                              inc_dialog->cur_row, buf);
        }
 }
 
index fa9bd5b..3eb019e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * 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
@@ -28,7 +28,6 @@
 #include <gtk/gtkmain.h>
 #include <gtk/gtksignal.h>
 #include <gtk/gtkwindow.h>
-#include <gtk/gtkclist.h>
 #include <stdio.h>
 #include <string.h>
 #include <signal.h>
@@ -253,17 +252,18 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
                dialog->session = session;
                smtp_session->dialog = dialog;
 
-               progress_dialog_list_set(dialog->dialog, 0, NULL, 
-                                        ac_prefs->smtp_server, 
-                                        _("Connecting"));
+               progress_dialog_append(dialog->dialog, NULL, ac_prefs->smtp_server,
+                                      _("Connecting"), NULL);
 
+               
                if (ac_prefs->pop_before_smtp
                    && (ac_prefs->protocol == A_APOP || ac_prefs->protocol == A_POP3)
                    && (time(NULL) - ac_prefs->last_pop_login_time) > (60 * ac_prefs->pop_before_smtp_timeout)) {
                        g_snprintf(buf, sizeof(buf), _("Doing POP before SMTP..."));
-                       log_message(buf);
+                       log_message("%s\n", buf);
                        progress_dialog_set_label(dialog->dialog, buf);
-                       progress_dialog_list_set_status(dialog->dialog, 0, _("POP before SMTP"));
+                       progress_dialog_append(dialog->dialog, NULL, ac_prefs->smtp_server,
+                                              _("POP before SMTP"), NULL);
                        GTK_EVENTS_FLUSH();
                        inc_pop_before_smtp(ac_prefs);
                }
@@ -424,7 +424,7 @@ static gint send_recv_message(Session *session, const gchar *msg, gpointer data)
        }
 
        progress_dialog_set_label(dialog->dialog, buf);
-       progress_dialog_list_set_status(dialog->dialog, 0, state_str);
+       progress_dialog_set_row_status(dialog->dialog, 0, state_str);
 
        return 0;
 }
@@ -444,7 +444,7 @@ static gint send_send_data_progressive(Session *session, guint cur_len,
        g_snprintf(buf, sizeof(buf), _("Sending message (%d / %d bytes)"),
                   cur_len, total_len);
        progress_dialog_set_label(dialog->dialog, buf);
-       progress_dialog_set_fraction
+       progress_dialog_set_percentage
                (dialog->dialog, (gfloat)cur_len / (gfloat)total_len);
 
        return 0;
@@ -477,7 +477,9 @@ static SendProgressDialog *send_progress_dialog_create(void)
        gtk_window_set_modal(GTK_WINDOW(progress->window), TRUE);
        manage_window_set_transient(GTK_WINDOW(progress->window));
 
-       progress_dialog_get_fraction(progress);
+       progress_dialog_set_value(progress, 0.0);
+
+       gtk_widget_show_now(progress->window);
 
        if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS) {
                gtk_widget_show_now(progress->window);