2005-06-15 [paul] 1.9.11cvs71
authorPaul Mangan <paul@claws-mail.org>
Wed, 15 Jun 2005 10:36:21 +0000 (10:36 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 15 Jun 2005 10:36:21 +0000 (10:36 +0000)
* COPYING
updated
* src/codeconv.c
replace deprecated function
* src/inc.c
* src/send_message.c
* src/gtk/progressdialog.c
* src/gtk/progressdialog.h
salvage and reuse parts of reverted sync

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

diff --git a/COPYING b/COPYING
index 1d35334..5b67f7b 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,5 @@
-The code in this distribution is Copyright 1999-2002 by Hiroyuki Yamamoto.
+The code in this distribution is Copyright 1999-2005 by Hiroyuki Yamamoto
+and the Sylpheed-Claws team.
 
 Specific permission is granted for the GPLed code in this distribition to
 be linked to OpenSSL without invoking GPL clause 2(b).
index bd28ed6..6bba518 100644 (file)
@@ -1,3 +1,15 @@
+2005-06-15 [paul]      1.9.11cvs71
+
+       * COPYING
+               updated
+       * src/codeconv.c
+               replace deprecated function
+       * src/inc.c
+       * src/send_message.c
+       * src/gtk/progressdialog.c
+       * src/gtk/progressdialog.h
+               salvage and reuse parts of reverted sync
+
 2005-06-15 [paul]      1.9.11cvs70
 
        * src/inc.c
index 9665f1e..353b906 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
+( cvs diff -u -r 1.5 -r 1.6 COPYING;  cvs diff -u -r 1.65.2.31 -r 1.65.2.32 src/codeconv.c;  cvs diff -u -r 1.149.2.27 -r 1.149.2.28 src/inc.c;  cvs diff -u -r 1.17.2.14 -r 1.17.2.15 src/send_message.c;  cvs diff -u -r 1.1.4.12 -r 1.1.4.13 src/gtk/progressdialog.c;  cvs diff -u -r 1.1.4.6 -r 1.1.4.7 src/gtk/progressdialog.h;  ) > 1.9.11cvs71.patchset
index 2320523..13f9921 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=70
+EXTRA_VERSION=71
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 2c91695..cc2eeb3 100644 (file)
@@ -1421,7 +1421,7 @@ gboolean conv_is_ja_locale(void)
        is_ja_locale = 0;
        cur_locale = conv_get_current_locale();
        if (cur_locale) {
-               if (g_strncasecmp(cur_locale, "ja", 2) == 0)
+               if (g_ascii_strncasecmp(cur_locale, "ja", 2) == 0)
                        is_ja_locale = 1;
        }
 
index d922bfd..7ad66fc 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>
 
@@ -44,15 +48,11 @@ enum {
        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);
+static gint progress_dialog_insert_account(ProgressDialog *progress,
+                                          gint            row,
+                                          const gchar    *account,
+                                          const gchar    *status,
+                                          GdkPixbuf      *image);
 
 ProgressDialog *progress_dialog_create(void)
 {
@@ -63,12 +63,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);
@@ -112,29 +111,51 @@ ProgressDialog *progress_dialog_create(void)
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
 
-       /* 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);
 
+       store = gtk_list_store_new(N_PROGRESS_COLUMNS, 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", PROGRESS_IMAGE, 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", PROGRESS_ACCOUNT, 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", PROGRESS_STATE, 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;
 }
@@ -171,9 +192,8 @@ 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 progress_dialog_insert_account(progress, row, account_name,
+                                             NULL, NULL);
 }
 
 /*!
@@ -183,9 +203,8 @@ gint progress_dialog_list_set_image(ProgressDialog *progress,
                                    gint            row,
                                    GdkPixbuf      *image)
 {
-       return progress_dialog_list_view_insert_account(progress->list_view,
-                                                       row, NULL, NULL, 
-                                                       image);
+       return progress_dialog_insert_account(progress, row, NULL,
+                                             NULL, image);
 }
 
 /*!
@@ -195,9 +214,8 @@ gint progress_dialog_list_set_status(ProgressDialog *progress,
                                     gint            row,
                                     const gchar    *status)
 {
-       return progress_dialog_list_view_insert_account(progress->list_view,
-                                                       row, NULL, status, 
-                                                       NULL);
+       return progress_dialog_insert_account(progress, row, NULL,
+                                             status, NULL);
 }
 
 /*!
@@ -209,49 +227,33 @@ gint progress_dialog_list_set(ProgressDialog      *progress,
                              const gchar       *account_name,
                              const gchar       *status)
 {
-       return progress_dialog_list_view_insert_account(progress->list_view,
-                                                       row,  account_name, 
-                                                       status, image);
+       return progress_dialog_insert_account(progress, row, account_name,
+                                             status, image);
 }
 
-/* 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_scroll_to_row(ProgressDialog *progress, gint row)
 {
-       GtkTreeSelection *selection = gtk_tree_view_get_selection
-                                       (GTK_TREE_VIEW(progress->list_view));
+       GtkTreeModel *model = GTK_TREE_MODEL(progress->store);
        GtkTreeIter iter;
-       GtkTreeModel *model;
-
-       model = gtk_tree_view_get_model(GTK_TREE_VIEW(progress->list_view));
+       GtkTreePath *path;
 
        if (!gtk_tree_model_iter_nth_child(model, &iter, NULL, row))
-               return FALSE;
-
-       gtk_tree_selection_select_iter(selection, &iter);               
+               return;
 
-       return TRUE;
-}
-
-static GtkListStore* progress_dialog_create_data_store(void)
-{
-       return gtk_list_store_new(N_PROGRESS_COLUMNS,
-                                 GDK_TYPE_PIXBUF,
-                                 G_TYPE_STRING,
-                                 G_TYPE_STRING,        
-                                 -1);
+       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);
 }
 
-static gint progress_dialog_list_view_insert_account(GtkWidget   *list_view,
-                                                    gint         row,
-                                                    const gchar *account,
-                                                    const gchar *status,
-                                                    GdkPixbuf   *image)
+static gint progress_dialog_insert_account(ProgressDialog *progress,
+                                          gint            row,
+                                          const gchar    *account,
+                                          const gchar    *status,
+                                          GdkPixbuf      *image)
 {
        GtkTreeIter iter;
-       GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model
-                                       (GTK_TREE_VIEW(list_view)));
+       GtkListStore *store = progress->store;
        gint result = -1;                                       
        
        if (account == NULL && status == NULL && image == NULL)
@@ -286,50 +288,3 @@ static gint progress_dialog_list_view_insert_account(GtkWidget   *list_view,
 
        return result;
 }
-
-static GtkWidget *progress_dialog_list_view_create(void)
-{
-       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);
-}
-
-static void progress_dialog_create_list_view_columns(GtkTreeView *list_view)
-{
-       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);                   
-
-       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);          
-
-       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 4fa5e7f..bcb386e 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <glib.h>
 #include <gtk/gtkwidget.h>
+#include <gtk/gtkliststore.h>
 
 typedef struct _ProgressDialog ProgressDialog;
 
@@ -31,8 +32,8 @@ struct _ProgressDialog
        GtkWidget *label;
        GtkWidget *cancel_btn;
        GtkWidget *progressbar;
-       GtkWidget *clist;
-       GtkWidget *list_view;
+       GtkWidget *treeview;
+       GtkListStore *store;
 };
 
 ProgressDialog *progress_dialog_create (void);
@@ -63,7 +64,7 @@ gint progress_dialog_list_set         (ProgressDialog *progress,
                                         const gchar    *account_name,
                                         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..2413fe1 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -385,11 +385,11 @@ static IncProgressDialog *inc_progress_dialog_create(gboolean autocheck)
 
        progress_dialog_get_fraction(progress);
 
-       stock_pixbuf_gdk(progress->list_view, STOCK_PIXMAP_COMPLETE,
+       stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_COMPLETE,
                         &okpix);
-       stock_pixbuf_gdk(progress->list_view, STOCK_PIXMAP_CONTINUE,
+       stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_CONTINUE,
                         &currentpix);
-       stock_pixbuf_gdk(progress->list_view, STOCK_PIXMAP_ERROR,
+       stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_ERROR,
                         &errorpix);
 
        if (prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS ||
@@ -560,8 +560,8 @@ 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"));
 
index fa9bd5b..9f51e17 100644 (file)
@@ -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>