replace deprecated gtk_progress*
authorPaul Mangan <paul@claws-mail.org>
Wed, 28 Jul 2004 13:44:01 +0000 (13:44 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 28 Jul 2004 13:44:01 +0000 (13:44 +0000)
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/action.c
src/gtk/progressdialog.c
src/gtk/progressdialog.h
src/inc.c
src/mainwindow.c
src/send_message.c

index 043f208..5d7b0f6 100644 (file)
@@ -1,3 +1,13 @@
+2004-07-28 [paul]      0.9.12cvs37.6
+
+       * src/action.c
+       * src/inc.c
+       * src/mainwindow.c
+       * src/send_message.c
+       * src/gtk/progressdialog.c
+       * src/gtk/progressdialog.h
+               replace deprecated gtk_progress_*
+
 2004-07-28 [paul]      0.9.12cvs37.5
 
        * src/gtk/filesel.c
index 1cc4df8..83ff670 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -88,3 +88,4 @@
 ( cvs diff -u -r 1.61.2.7 -r 1.61.2.8 src/account.c; cvs diff -u -r 1.60.2.6 -r 1.60.2.7 src/addressbook.c; cvs diff -u -r 1.17.2.6 -r 1.17.2.7 src/alertpanel.c; cvs diff -u -r 1.5.2.1 -r 1.5.2.2 src/alertpanel.h; cvs diff -u -r 1.382.2.36 -r 1.382.2.37 src/compose.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/expldifdlg.c; cvs diff -u -r 1.115.2.10 -r 1.115.2.11 src/main.c; cvs diff -u -r 1.94.2.24 -r 1.94.2.25 src/messageview.c; cvs diff -u -r 1.395.2.25 -r 1.395.2.26 src/summaryview.c; cvs diff -u -r 1.96.2.14 -r 1.96.2.15 src/textview.c; cvs diff -u -r 1.9.2.1 -r 1.9.2.2 src/gtk/sslcertwindow.c; ) > 0.9.12cvs37.3.patchset
 ( cvs diff -u -r 1.60.2.7 -r 1.60.2.8 src/addressbook.c; cvs diff -u -r 1.382.2.37 -r 1.382.2.38 src/compose.c; cvs diff -u -r 1.26.2.3 -r 1.26.2.4 src/foldersel.c; cvs diff -u -r 1.274.2.14 -r 1.274.2.15 src/mainwindow.c; cvs diff -u -r 1.94.2.25 -r 1.94.2.26 src/messageview.c; cvs diff -u -r 1.59.2.7 -r 1.59.2.8 src/prefs_filtering.c; cvs diff -u -r 1.1.4.6 -r 1.1.4.7 src/prefs_filtering_action.c; cvs diff -u -r 1.4.2.4 -r 1.4.2.5 src/prefs_fonts.c; cvs diff -u -r 1.10.2.5 -r 1.10.2.6 src/prefs_gtk.c; cvs diff -u -r 1.43.2.7 -r 1.43.2.8 src/prefs_matcher.c; cvs diff -u -r 1.9.2.5 -r 1.9.2.6 src/sourcewindow.c; cvs diff -u -r 1.3.2.3 -r 1.3.2.4 src/ssl_manager.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/gtk/logwindow.c; cvs diff -u -r 1.12.2.3 -r 1.12.2.4 src/gtk/prefswindow.c; ) > 0.9.12cvs37.4.patchset
 ( cvs diff -u -r 1.2.2.10 -r 1.2.2.11 src/gtk/filesel.c; ) > 0.9.12cvs37.5.patchset
+( cvs diff -u -r 1.12.2.8 -r 1.12.2.9 src/action.c; cvs diff -u -r 1.149.2.12 -r 1.149.2.13 src/inc.c; cvs diff -u -r 1.274.2.15 -r 1.274.2.16 src/mainwindow.c; cvs diff -u -r 1.17.2.4 -r 1.17.2.5 src/send_message.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/gtk/progressdialog.c; cvs diff -u -r 1.1.4.1 -r 1.1.4.2 src/gtk/progressdialog.h; ) > 0.9.12cvs37.6.patchset
index 83de88f..59cc92b 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=37
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.5
+EXTRA_GTK2_VERSION=.6
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index 2a00e18..6e58000 100644 (file)
@@ -1048,12 +1048,6 @@ static void update_io_dialog(Children *children)
 
        debug_print("Updating actions input/output dialog.\n");
 
-       if (children->progress_bar) {
-               gtk_progress_configure(GTK_PROGRESS(children->progress_bar),
-                               children->initial_nb -children->nb,
-                               0.0, children->initial_nb);
-       }
-
        if (!children->nb) {
                gtk_widget_set_sensitive(children->abort_btn, FALSE);
                gtk_widget_set_sensitive(children->close_btn, TRUE);
@@ -1186,18 +1180,10 @@ static void create_io_dialog(Children *children)
 
        if (children->initial_nb > 1) {
                progress_bar = gtk_progress_bar_new();
-               gtk_progress_bar_set_bar_style(GTK_PROGRESS_BAR(progress_bar),
-                               GTK_PROGRESS_CONTINUOUS);
                gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(progress_bar),
                                GTK_PROGRESS_LEFT_TO_RIGHT);
-               gtk_progress_set_activity_mode(GTK_PROGRESS(progress_bar), 
-                               FALSE);
-               gtk_progress_set_format_string(GTK_PROGRESS(progress_bar),
-                               _("Completed %v/%u"));
-               gtk_progress_set_show_text(GTK_PROGRESS(progress_bar), TRUE);
-               gtk_progress_configure(GTK_PROGRESS(progress_bar),
-                               children->initial_nb -children->nb,
-                               0.0, children->initial_nb);
+               gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress_bar),
+                                         _("Completed %v/%u"));
 
                gtk_box_pack_start(GTK_BOX(vbox), progress_bar, FALSE, FALSE, 0);
                gtk_widget_show(progress_bar);
index 422c82f..572b36b 100644 (file)
@@ -113,16 +113,16 @@ void progress_dialog_set_label(ProgressDialog *progress, gchar *str)
        gtk_label_set_text(GTK_LABEL(progress->label), str);
 }
 
-void progress_dialog_set_value(ProgressDialog *progress, gfloat value)
+void progress_dialog_get_fraction(ProgressDialog *progress)
 {
-       gtk_progress_set_value(GTK_PROGRESS(progress->progressbar), value);
+       gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(progress->progressbar));
 }
 
-void progress_dialog_set_percentage(ProgressDialog *progress,
-                                   gfloat percentage)
+void progress_dialog_set_fraction(ProgressDialog *progress,
+                                 gfloat percentage)
 {
-       gtk_progress_set_percentage(GTK_PROGRESS(progress->progressbar),
-                                   percentage);
+       gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress->progressbar),
+                                     percentage);
 }
 
 void progress_dialog_destroy(ProgressDialog *progress)
index 047524e..d7b5b66 100644 (file)
@@ -37,9 +37,8 @@ struct _ProgressDialog
 ProgressDialog *progress_dialog_create (void);
 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);
 
index 5f32f9e..e8cd432 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -386,7 +386,7 @@ 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_pixmap_gdk(progress->clist, STOCK_PIXMAP_COMPLETE,
                         &okxpm, &okxpmmask);
@@ -433,7 +433,7 @@ static void inc_progress_dialog_set_list(IncProgressDialog *inc_dialog)
 
 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);
@@ -915,16 +915,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);
 
index 12ae40a..4aad56c 100644 (file)
@@ -1543,15 +1543,13 @@ void main_window_get_position(MainWindow *mainwin)
 
 void main_window_progress_on(MainWindow *mainwin)
 {
-       gtk_progress_set_show_text(GTK_PROGRESS(mainwin->progressbar), TRUE);
-       gtk_progress_set_format_string(GTK_PROGRESS(mainwin->progressbar), "");
+       gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), "");
 }
 
 void main_window_progress_off(MainWindow *mainwin)
 {
-       gtk_progress_set_show_text(GTK_PROGRESS(mainwin->progressbar), FALSE);
-       gtk_progress_bar_update(GTK_PROGRESS_BAR(mainwin->progressbar), 0.0);
-       gtk_progress_set_format_string(GTK_PROGRESS(mainwin->progressbar), "");
+       gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mainwin->progressbar), 0.0);
+       gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), "");
 }
 
 void main_window_progress_set(MainWindow *mainwin, gint cur, gint total)
@@ -1559,8 +1557,8 @@ void main_window_progress_set(MainWindow *mainwin, gint cur, gint total)
        gchar buf[32];
 
        g_snprintf(buf, sizeof(buf), "%d / %d", cur, total);
-       gtk_progress_set_format_string(GTK_PROGRESS(mainwin->progressbar), buf);
-       gtk_progress_bar_update(GTK_PROGRESS_BAR(mainwin->progressbar),
+       gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), buf);
+       gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mainwin->progressbar),
                                (cur == 0 && total == 0) ? 0 :
                                (gfloat)cur / (gfloat)total);
 }
@@ -3093,10 +3091,10 @@ gboolean mainwindow_progressindicator_hook(gpointer source, gpointer userdata)
        switch (data->cmd) {
        case PROGRESS_COMMAND_START:
        case PROGRESS_COMMAND_STOP:
-               gtk_progress_set_percentage(GTK_PROGRESS(mainwin->progressbar), 0.0);
-               break;
+/*             gtk_progress_set_percentage(GTK_PROGRESS(mainwin->progressbar), 0.0);
+               break; */
        case PROGRESS_COMMAND_SET_PERCENTAGE:
-               gtk_progress_set_percentage(GTK_PROGRESS(mainwin->progressbar), data->value);
+/*             gtk_progress_set_percentage(GTK_PROGRESS(mainwin->progressbar), data->value); */
                break;          
        }
        while (gtk_events_pending()) gtk_main_iteration ();
index e49c01f..54e844c 100644 (file)
@@ -506,7 +506,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;
@@ -539,7 +539,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);
+       progress_dialog_get_fraction(progress);
 
        if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS) {
                gtk_widget_show_now(progress->window);