2010-08-23 [pawel] 3.7.6cvs29
authorPaweł Pękala <c0rn@gazeta.pl>
Mon, 23 Aug 2010 18:24:07 +0000 (18:24 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Mon, 23 Aug 2010 18:24:07 +0000 (18:24 +0000)
* src/inc.c
* src/send_message.c
* src/statusbar.c
* src/toolbar.c
Hide progressbar on statusbar when not needed

ChangeLog
PATCHSETS
configure.ac
src/inc.c
src/send_message.c
src/statusbar.c
src/toolbar.c

index be12026cf844d30d422b9333d7f3cd408f3fcbc1..6b3b3e93c472e3f2516b762418b26d5895912cc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-08-23 [pawel]     3.7.6cvs29
+
+       * src/inc.c
+       * src/send_message.c
+       * src/statusbar.c
+       * src/toolbar.c
+               Hide progressbar on statusbar when not needed
+
 2010-08-17 [colin]     3.7.6cvs28
 
        * src/main.c
index a3ae654b23fc149d0820d6a36927546b38d81bd0..1bd21b8b166681a84ba96070ab342ee161666417 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.4.12 -r 1.1.4.13 src/gtk/gtkshruler.c;  ) > 3.7.6cvs26.patchset
 ( cvs diff -u -r 1.115.2.226 -r 1.115.2.227 src/main.c;  ) > 3.7.6cvs27.patchset
 ( cvs diff -u -r 1.115.2.227 -r 1.115.2.228 src/main.c;  ) > 3.7.6cvs28.patchset
+( cvs diff -u -r 1.149.2.100 -r 1.149.2.101 src/inc.c;  cvs diff -u -r 1.17.2.56 -r 1.17.2.57 src/send_message.c;  cvs diff -u -r 1.5.2.26 -r 1.5.2.27 src/statusbar.c;  cvs diff -u -r 1.43.2.116 -r 1.43.2.117 src/toolbar.c;  ) > 3.7.6cvs29.patchset
index dc3e84a03ee428d4e70bc3a2197ccd5055cc2542..01800016fa057ee5e57ca39bd4616cc2abc9e9d0 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=28
+EXTRA_VERSION=29
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4bdeaec52acbb15ecd073518584230bff6ea7b1e..755060030e9e512dde16b7f0e57633854e868988 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -970,13 +970,7 @@ static void inc_progress_dialog_set_progress(IncProgressDialog *inc_dialog,
        progress_dialog_set_fraction
                (inc_dialog->dialog, (total == 0) ? 0: (gfloat)cur_total / (gfloat)total);
 
-       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_BAR(inc_dialog->mainwin->progressbar),
-                (total == 0) ? 0 : (gfloat)cur_total / (gfloat)total);
+       statusbar_progress_all(pop3_session->cur_msg, pop3_session->count, 1);
 
        if (pop3_session->cur_total_num > 0) {
                g_snprintf(buf, sizeof(buf),
index 2dffc490ea77a6b8513b2dc7ee654dd7366350e4..faccb735774b598844c0f875da72c46b3267682f 100644 (file)
@@ -508,10 +508,13 @@ static gint send_send_data_progressive(Session *session, guint cur_len,
        progress_dialog_set_fraction
                (dialog->dialog, (total_len == 0) ? 0 : (gfloat)cur_len / (gfloat)total_len);
 
-       if (mainwin)
+       if (mainwin) {
+               if (!gtkut_widget_get_visible(mainwin->progressbar))    
+                       gtk_widget_show(mainwin->progressbar);
                gtk_progress_bar_set_fraction
                        (GTK_PROGRESS_BAR(mainwin->progressbar),
                         (total_len == 0) ? 0 : (gfloat)cur_len / (gfloat)total_len);
+       }
 
        return 0;
 }
@@ -524,9 +527,11 @@ static gint send_send_data_finished(Session *session, guint len, gpointer data)
        cm_return_val_if_fail(dialog != NULL, -1);
 
        send_send_data_progressive(session, len, len, dialog);
-       if (mainwin)
+       if (mainwin) {
+               gtk_widget_hide(mainwin->progressbar);
                gtk_progress_bar_set_fraction
                        (GTK_PROGRESS_BAR(mainwin->progressbar),(gfloat)0);
+       }
 
        return 0;
 }
index 179da57dd8de3b91709153b248ce7ed9973fe665..bb419b9243ccd946ea45dd625499f72db0aac7a6 100644 (file)
@@ -235,18 +235,20 @@ void statusbar_verbosity_set(gboolean verbose)
 
 void statusbar_progress_all (gint done, gint total, gint step) 
 {
+       GtkProgressBar *progressbar = GTK_PROGRESS_BAR(
+                                       mainwindow_get_mainwindow()->progressbar);
        gchar buf[32];
+       
        if (total && done % step == 0) {
                g_snprintf(buf, sizeof(buf), "%d / %d", done, total);
-               gtk_progress_bar_set_text
-                       (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), buf);
-               gtk_progress_bar_set_fraction
-                       (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar),
+               gtk_progress_bar_set_text(progressbar, buf);
+               gtk_progress_bar_set_fraction(progressbar,
                         (total == 0) ? 0 : (gfloat)done / (gfloat)total);
+               if (!gtkut_widget_get_visible(GTK_WIDGET(progressbar)))
+                       gtk_widget_show(GTK_WIDGET(progressbar));
        } else if (total == 0) {
-               gtk_progress_bar_set_text
-                       (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), "");
-               gtk_progress_bar_set_fraction
-                       (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), 0.0);
+               gtk_progress_bar_set_text(progressbar, "");
+               gtk_progress_bar_set_fraction(progressbar, 0.0);
+               gtk_widget_hide(GTK_WIDGET(progressbar));
        }
 }
index 6d7fec6d2e3276201139506e1358025a9f441165..13616d66ad96324bc74dc225974722354456eaf0 100644 (file)
@@ -2148,7 +2148,6 @@ Toolbar *toolbar_create(ToolbarType        type,
                item = GTK_WIDGET(gtk_tool_item_new());
                gtk_container_add (GTK_CONTAINER (item), progressbar);
                gtk_widget_show(item);
-               gtk_widget_show(progressbar);
                gtk_widget_set_size_request(progressbar, 70, -1);
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(item), -1);
                mainwin->progressbar = progressbar;