commit 778610555ad276b2571db46ce6cc03db3732ad56
parent 3e992a014077ef68ffcc50df2e3b059068452e61
Author: Paweł Pękala <c0rn@gazeta.pl>
Date: Mon, 23 Aug 2010 18:24:07 +0000
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
Diffstat:
7 files changed, 28 insertions(+), 19 deletions(-)
diff --git 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
diff --git a/PATCHSETS b/PATCHSETS
@@ -4024,3 +4024,4 @@
( 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
diff --git a/configure.ac b/configure.ac
@@ -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=
diff --git 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),
diff --git a/src/send_message.c b/src/send_message.c
@@ -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;
}
diff --git a/src/statusbar.c b/src/statusbar.c
@@ -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));
}
}
diff --git a/src/toolbar.c b/src/toolbar.c
@@ -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;