2005-06-15 [paul] 1.9.11cvs70
authorPaul Mangan <paul@claws-mail.org>
Wed, 15 Jun 2005 08:59:32 +0000 (08:59 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 15 Jun 2005 08:59:32 +0000 (08:59 +0000)
* src/inc.c
* src/send_message.c
* src/gtk/progressdialog.c
* src/gtk/progressdialog.h
revert yesterday's sync with main
it contains deprecated functions

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

index 9efc439..bd28ed6 100644 (file)
@@ -1,3 +1,12 @@
+2005-06-15 [paul]      1.9.11cvs70
+
+       * src/inc.c
+       * src/send_message.c
+       * src/gtk/progressdialog.c
+       * src/gtk/progressdialog.h
+               revert yesterday's sync with main
+               it contains deprecated functions
+
 2005-06-15 [colin]     1.9.11cvs69
 
        * src/headerview.c
index f74e80b..9665f1e 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.213.2.33 -r 1.213.2.34 src/folder.c;  cvs diff -u -r 1.179.2.32 -r 1.179.2.33 src/imap.c;  ) > 1.9.11cvs67.patchset
 ( cvs diff -u -r 1.382.2.130 -r 1.382.2.131 src/compose.c;  ) > 1.9.11cvs68.patchset
 ( cvs diff -u -r 1.8.2.5 -r 1.8.2.6 src/headerview.c;  ) > 1.9.11cvs69.patchset
+( cvs diff -u -r 1.149.2.26 -r 1.149.2.27 src/inc.c;  cvs diff -u -r 1.17.2.13 -r 1.17.2.14 src/send_message.c;  cvs diff -u -r 1.1.4.11 -r 1.1.4.12 src/gtk/progressdialog.c;  cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/gtk/progressdialog.h;  ) > 1.9.11cvs70.patchset
index e003a21..2320523 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=69
+EXTRA_VERSION=70
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b029df0..d922bfd 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)
 {
@@ -49,11 +63,12 @@ ProgressDialog *progress_dialog_create(void)
        GtkWidget *cancel_btn;
        GtkWidget *progressbar;
        GtkWidget *scrolledwin;
-       GtkWidget *treeview;
-       GtkListStore *store;
-       GtkTreeSelection *selection;
-       GtkTreeViewColumn *column;
-       GtkCellRenderer *renderer;
+       GtkWidget *clist;
+       GtkWidget *list_view;
+       gchar *text[] = {NULL, NULL, NULL};
+
+       text[1] = _("Account");
+       text[2] = _("Status");
 
        debug_print("Creating progress dialog...\n");
        progress = g_new0(ProgressDialog, 1);
@@ -96,57 +111,51 @@ 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);
 
-       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);
+       /* 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);
 
        progress->window      = dialog;
        progress->label       = label;
        progress->cancel_btn  = cancel_btn;
        progress->progressbar = progressbar;
-       progress->treeview    = treeview;
-       progress->store       = store;
+       progress->clist       = clist;
+       progress->list_view   = list_view;
 
        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) {
@@ -155,106 +164,172 @@ void progress_dialog_destroy(ProgressDialog *progress)
        }
 }
 
-void progress_dialog_set_label(ProgressDialog *progress, gchar *str)
+/*!
+ *\return      gint Row where account was set
+ */
+gint progress_dialog_list_set_account(ProgressDialog *progress,
+                                     gint            row,
+                                     const gchar    *account_name)
 {
-       gtk_label_set_text(GTK_LABEL(progress->label), str);
+       return progress_dialog_list_view_insert_account(progress->list_view,
+                                                       row, account_name, NULL, 
+                                                       NULL);
 }
 
-void progress_dialog_set_value(ProgressDialog *progress, gfloat value)
+/*!
+ *\return      gint Row where image was set
+ */
+gint progress_dialog_list_set_image(ProgressDialog *progress,
+                                   gint            row,
+                                   GdkPixbuf      *image)
 {
-       gtk_progress_set_value(GTK_PROGRESS(progress->progressbar), value);
+       return progress_dialog_list_view_insert_account(progress->list_view,
+                                                       row, NULL, NULL, 
+                                                       image);
 }
 
-void progress_dialog_set_percentage(ProgressDialog *progress,
-                                   gfloat percentage)
+/*!
+ *\return      gint Row where status was set
+ */
+gint progress_dialog_list_set_status(ProgressDialog *progress,
+                                    gint            row,
+                                    const gchar    *status)
 {
-       gtk_progress_set_percentage(GTK_PROGRESS(progress->progressbar),
-                                   percentage);
+       return progress_dialog_list_view_insert_account(progress->list_view,
+                                                       row, NULL, status, 
+                                                       NULL);
 }
 
-void progress_dialog_append(ProgressDialog *progress, GdkPixbuf *pixbuf,
-                           const gchar *name, const gchar *status,
-                           gpointer data)
+/*!
+ *\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)
 {
-       GtkListStore *store = progress->store;
-       GtkTreeIter iter;
-
-       gtk_list_store_append(store, &iter);
-
-       gtk_list_store_set(store, &iter,
-                          PROG_COL_PIXBUF, pixbuf,
-                          PROG_COL_NAME, name,
-                          PROG_COL_STATUS, status,
-                          PROG_COL_POINTER, data,
-                          -1);
+       return progress_dialog_list_view_insert_account(progress->list_view,
+                                                       row,  account_name, 
+                                                       status, image);
 }
 
-void progress_dialog_set_row(ProgressDialog *progress, gint row,
-                            GdkPixbuf *pixbuf, const gchar *name,
-                            const gchar *status, gpointer data)
+/* 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)
 {
-       GtkListStore *store = progress->store;
+       GtkTreeSelection *selection = gtk_tree_view_get_selection
+                                       (GTK_TREE_VIEW(progress->list_view));
        GtkTreeIter iter;
+       GtkTreeModel *model;
 
-       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);
-       }
+       model = gtk_tree_view_get_model(GTK_TREE_VIEW(progress->list_view));
+
+       if (!gtk_tree_model_iter_nth_child(model, &iter, NULL, row))
+               return FALSE;
+
+       gtk_tree_selection_select_iter(selection, &iter);               
+
+       return TRUE;
 }
 
-void progress_dialog_set_row_pixbuf(ProgressDialog *progress, gint row,
-                                   GdkPixbuf *pixbuf)
+static GtkListStore* progress_dialog_create_data_store(void)
 {
-       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);
-       }
+       return gtk_list_store_new(N_PROGRESS_COLUMNS,
+                                 GDK_TYPE_PIXBUF,
+                                 G_TYPE_STRING,
+                                 G_TYPE_STRING,        
+                                 -1);
 }
 
-void progress_dialog_set_row_name(ProgressDialog *progress, gint row,
-                                 const gchar *name)
+static gint progress_dialog_list_view_insert_account(GtkWidget   *list_view,
+                                                    gint         row,
+                                                    const gchar *account,
+                                                    const gchar *status,
+                                                    GdkPixbuf   *image)
 {
-       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);
 
-       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);
-       }
+       return result;
 }
 
-void progress_dialog_set_row_status(ProgressDialog *progress, gint row,
-                                   const gchar *status)
+static GtkWidget *progress_dialog_list_view_create(void)
 {
-       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);
-       }
+       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);
 }
 
-void progress_dialog_scroll_to_row(ProgressDialog *progress, gint row)
+static void progress_dialog_create_list_view_columns(GtkTreeView *list_view)
 {
-       GtkTreeModel *model = GTK_TREE_MODEL(progress->store);
-       GtkTreeIter iter;
-       GtkTreePath *path;
+       GtkTreeViewColumn *column;
+       GtkCellRenderer *renderer;
 
-       if (!gtk_tree_model_iter_nth_child(model, &iter, NULL, row))
-               return;
+       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);                   
+
+       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);          
 
-       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);
+       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);          
 }
 
index 33cf983..4fa5e7f 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <glib.h>
 #include <gtk/gtkwidget.h>
-#include <gtk/gtkliststore.h>
-#include <gdk/gdkpixbuf.h>
 
 typedef struct _ProgressDialog ProgressDialog;
 
@@ -33,53 +31,39 @@ struct _ProgressDialog
        GtkWidget *label;
        GtkWidget *cancel_btn;
        GtkWidget *progressbar;
-
-       GtkWidget *treeview;
-       GtkListStore *store;
+       GtkWidget *clist;
+       GtkWidget *list_view;
 };
 
-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_set_value         (ProgressDialog *progress,
-                                        gfloat          value);
-void progress_dialog_set_percentage    (ProgressDialog *progress,
+void progress_dialog_get_fraction      (ProgressDialog *progress);
+void progress_dialog_set_fraction      (ProgressDialog *progress,
                                         gfloat          percentage);
+void progress_dialog_destroy           (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,
-                                        GdkPixbuf      *pixbuf,
-                                        const gchar    *name,
-                                        const gchar    *status,
-                                        gpointer        data);
 
-void progress_dialog_set_row_pixbuf    (ProgressDialog *progress,
+/*
+ * Use these functions to access the dialog list
+ */
+
+gint progress_dialog_list_set_account  (ProgressDialog *progress,
+                                        gint            row,
+                                        const gchar    *account_name);
+gint progress_dialog_list_set_image    (ProgressDialog *progress,
                                         gint            row,
-                                        GdkPixbuf      *pixbuf);
-void progress_dialog_set_row_name      (ProgressDialog *progress,
+                                        GdkPixbuf      *image);
+gint progress_dialog_list_set_status   (ProgressDialog *progress,
                                         gint            row,
-                                        const gchar    *name);
-void progress_dialog_set_row_status    (ProgressDialog *progress,
+                                        const gchar    *status);
+gint progress_dialog_list_set          (ProgressDialog *progress,
                                         gint            row,
-                                        const gchar    *status);
+                                        GdkPixbuf      *image,
+                                        const gchar    *account_name,
+                                        const gchar    *status);
 
-void progress_dialog_scroll_to_row     (ProgressDialog *progress,
+gboolean progress_dialog_list_select_row(ProgressDialog *progress,
                                         gint            row);
 
 #endif /* __PROGRESS_H__ */
index 7329ac3..d4b5de3 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-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 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 *current_pixbuf;
-static GdkPixbuf *error_pixbuf;
-static GdkPixbuf *ok_pixbuf;
+static GdkPixbuf *currentpix;
+static GdkPixbuf *errorpix;
+static GdkPixbuf *okpix;
 
 #define MSGBUFSIZE     8192
 
@@ -383,12 +383,14 @@ 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_set_value(progress, 0.0);
+       progress_dialog_get_fraction(progress);
 
-       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);
+       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);
 
        if (prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS ||
            (prefs_common.recv_dialog_mode == RECV_DIALOG_MANUAL &&
@@ -417,15 +419,17 @@ static void inc_progress_dialog_set_list(IncProgressDialog *inc_dialog)
                Pop3Session *pop3_session = POP3_SESSION(session->session);
 
                session->data = inc_dialog;
-               progress_dialog_append(inc_dialog->dialog, NULL,
-                                      pop3_session->ac_prefs->account_name,
-                                      _("Standby"), NULL);
+
+               progress_dialog_list_set(inc_dialog->dialog,
+                                        -1, NULL,
+                                        pop3_session->ac_prefs->account_name,
+                                        _("Standby"));
        }
 }
 
 static void inc_progress_dialog_clear(IncProgressDialog *inc_dialog)
 {
-       progress_dialog_set_value(inc_dialog->dialog, 0.0);
+       progress_dialog_get_fraction(inc_dialog->dialog);
        progress_dialog_set_label(inc_dialog->dialog, "");
        if (inc_dialog->mainwin)
                main_window_progress_off(inc_dialog->mainwin);
@@ -534,12 +538,13 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                qlist = next;
        }
 
-#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);       \
+#define SET_PIXMAP_AND_TEXT(pix, str)                                     \
+{                                                                         \
+       progress_dialog_list_set(inc_dialog->dialog,                       \
+                                inc_dialog->cur_row,                      \
+                                pix,                                      \
+                                NULL,                                     \
+                                str);                                     \
 }
 
        for (; inc_dialog->queue_list != NULL && !cancelled; inc_dialog->cur_row++) {
@@ -547,7 +552,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                pop3_session = POP3_SESSION(session->session);
 
                if (pop3_session->pass == NULL) {
-                       SET_PIXMAP_AND_TEXT(ok_pixbuf, _("Cancelled"));
+                       SET_PIXMAP_AND_TEXT(okpix, _("Cancelled"));
                        inc_session_destroy(session);
                        inc_dialog->queue_list =
                                g_list_remove(inc_dialog->queue_list, session);
@@ -555,10 +560,10 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                }
 
                inc_progress_dialog_clear(inc_dialog);
-               progress_dialog_scroll_to_row(inc_dialog->dialog,
-                                             inc_dialog->cur_row);
+               progress_dialog_list_select_row(inc_dialog->dialog,
+                                               inc_dialog->cur_row);
 
-               SET_PIXMAP_AND_TEXT(current_pixbuf, _("Retrieving"));
+               SET_PIXMAP_AND_TEXT(currentpix, _("Retrieving"));
 
                /* begin POP3 session */
                inc_state = inc_pop3_session_do(session);
@@ -574,31 +579,30 @@ 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(ok_pixbuf, msg);
+                       SET_PIXMAP_AND_TEXT(okpix, msg);
                        g_free(msg);
                        break;
                case INC_CONNECT_ERROR:
-                       SET_PIXMAP_AND_TEXT(error_pixbuf,
-                                           _("Connection failed"));
+                       SET_PIXMAP_AND_TEXT(errorpix, _("Connection failed"));
                        break;
                case INC_AUTH_FAILED:
-                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Auth failed"));
+                       SET_PIXMAP_AND_TEXT(errorpix, _("Auth failed"));
                        break;
                case INC_LOCKED:
-                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Locked"));
+                       SET_PIXMAP_AND_TEXT(errorpix, _("Locked"));
                        break;
                case INC_ERROR:
                case INC_NO_SPACE:
                case INC_IO_ERROR:
                case INC_SOCKET_ERROR:
                case INC_EOF:
-                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Error"));
+                       SET_PIXMAP_AND_TEXT(errorpix, _("Error"));
                        break;
                case INC_TIMEOUT:
-                       SET_PIXMAP_AND_TEXT(error_pixbuf, _("Timeout"));
+                       SET_PIXMAP_AND_TEXT(errorpix, _("Timeout"));
                        break;
                case INC_CANCEL:
-                       SET_PIXMAP_AND_TEXT(ok_pixbuf, _("Cancelled"));
+                       SET_PIXMAP_AND_TEXT(okpix, _("Cancelled"));
                        if (!inc_dialog->show_dialog)
                                cancelled = TRUE;
                        break;
@@ -918,16 +922,14 @@ static void inc_progress_dialog_set_progress(IncProgressDialog *inc_dialog,
                progress_dialog_set_label(inc_dialog->dialog, buf);
        }
 
-       progress_dialog_set_percentage
+       progress_dialog_set_fraction
                (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_set_format_string
-               (GTK_PROGRESS(inc_dialog->mainwin->progressbar), buf);
-       gtk_progress_bar_update
+       gtk_progress_bar_set_text
+               (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar), buf);
+       gtk_progress_bar_set_fraction
                (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar),
                 (gfloat)cur_total / (gfloat)total);
 
@@ -939,8 +941,9 @@ 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_set_row_status(inc_dialog->dialog,
-                                              inc_dialog->cur_row, buf);
+               progress_dialog_list_set_status(inc_dialog->dialog,
+                                               inc_dialog->cur_row,
+                                               buf);
        }
 }
 
index 3eb019e..fa9bd5b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 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,6 +28,7 @@
 #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>
@@ -252,18 +253,17 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
                dialog->session = session;
                smtp_session->dialog = dialog;
 
-               progress_dialog_append(dialog->dialog, NULL, ac_prefs->smtp_server,
-                                      _("Connecting"), NULL);
+               progress_dialog_list_set(dialog->dialog, 0, NULL, 
+                                        ac_prefs->smtp_server, 
+                                        _("Connecting"));
 
-               
                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("%s\n", buf);
+                       log_message(buf);
                        progress_dialog_set_label(dialog->dialog, buf);
-                       progress_dialog_append(dialog->dialog, NULL, ac_prefs->smtp_server,
-                                              _("POP before SMTP"), NULL);
+                       progress_dialog_list_set_status(dialog->dialog, 0, _("POP before SMTP"));
                        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_set_row_status(dialog->dialog, 0, state_str);
+       progress_dialog_list_set_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_percentage
+       progress_dialog_set_fraction
                (dialog->dialog, (gfloat)cur_len / (gfloat)total_len);
 
        return 0;
@@ -477,9 +477,7 @@ 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_set_value(progress, 0.0);
-
-       gtk_widget_show_now(progress->window);
+       progress_dialog_get_fraction(progress);
 
        if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS) {
                gtk_widget_show_now(progress->window);