summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLog.pre-2-109
-rw-r--r--ChangeLog.pre-2-29
-rw-r--r--ChangeLog.pre-2-49
-rw-r--r--ChangeLog.pre-2-69
-rw-r--r--ChangeLog.pre-2-89
-rw-r--r--docs/reference/gtk/tmpl/gtkprogress.sgml3
-rw-r--r--gtk/gtkprogress.c24
-rw-r--r--gtk/gtkprogressbar.c2
9 files changed, 71 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a7c32983..94d05ef37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon Sep 23 18:53:35 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkprogressbar.c (gtk_progress_bar_set_text):
+ Restore back to the default format instead of an
+ empty format.
+
+ * gtk/gtkprogress.c (gtk_progress_set_format_string):
+ Make NULL restore back to the default format.
+
Mon Sep 23 18:45:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 8a7c32983..94d05ef37 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,12 @@
+Mon Sep 23 18:53:35 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkprogressbar.c (gtk_progress_bar_set_text):
+ Restore back to the default format instead of an
+ empty format.
+
+ * gtk/gtkprogress.c (gtk_progress_set_format_string):
+ Make NULL restore back to the default format.
+
Mon Sep 23 18:45:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path):
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 8a7c32983..94d05ef37 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,12 @@
+Mon Sep 23 18:53:35 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkprogressbar.c (gtk_progress_bar_set_text):
+ Restore back to the default format instead of an
+ empty format.
+
+ * gtk/gtkprogress.c (gtk_progress_set_format_string):
+ Make NULL restore back to the default format.
+
Mon Sep 23 18:45:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path):
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 8a7c32983..94d05ef37 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,12 @@
+Mon Sep 23 18:53:35 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkprogressbar.c (gtk_progress_bar_set_text):
+ Restore back to the default format instead of an
+ empty format.
+
+ * gtk/gtkprogress.c (gtk_progress_set_format_string):
+ Make NULL restore back to the default format.
+
Mon Sep 23 18:45:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path):
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 8a7c32983..94d05ef37 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,12 @@
+Mon Sep 23 18:53:35 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkprogressbar.c (gtk_progress_bar_set_text):
+ Restore back to the default format instead of an
+ empty format.
+
+ * gtk/gtkprogress.c (gtk_progress_set_format_string):
+ Make NULL restore back to the default format.
+
Mon Sep 23 18:45:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 8a7c32983..94d05ef37 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,12 @@
+Mon Sep 23 18:53:35 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkprogressbar.c (gtk_progress_bar_set_text):
+ Restore back to the default format instead of an
+ empty format.
+
+ * gtk/gtkprogress.c (gtk_progress_set_format_string):
+ Make NULL restore back to the default format.
+
Mon Sep 23 18:45:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path):
diff --git a/docs/reference/gtk/tmpl/gtkprogress.sgml b/docs/reference/gtk/tmpl/gtkprogress.sgml
index f6652bfd3..9b418531e 100644
--- a/docs/reference/gtk/tmpl/gtkprogress.sgml
+++ b/docs/reference/gtk/tmpl/gtkprogress.sgml
@@ -75,7 +75,8 @@ current progress. The string can contain the following substitution characters:
</para>
@progress: a #GtkProgress.
-@format: a string used to display progress text.
+@format: a string used to display progress text, or %NULL
+ to restore to the default format.
<!-- ##### FUNCTION gtk_progress_set_adjustment ##### -->
diff --git a/gtk/gtkprogress.c b/gtk/gtkprogress.c
index cd151ef99..41f09598a 100644
--- a/gtk/gtkprogress.c
+++ b/gtk/gtkprogress.c
@@ -32,6 +32,7 @@
#include "gtkintl.h"
#define EPSILON 1e-5
+#define DEFAULT_FORMAT "%P %%";
enum {
PROP_0,
@@ -221,7 +222,7 @@ gtk_progress_init (GtkProgress *progress)
{
progress->adjustment = NULL;
progress->offscreen_pixmap = NULL;
- progress->format = g_strdup ("%P %%");
+ progress->format = g_strdup (DEFAULT_FORMAT);
progress->x_align = 0.5;
progress->y_align = 0.5;
progress->show_text = FALSE;
@@ -656,22 +657,25 @@ void
gtk_progress_set_format_string (GtkProgress *progress,
const gchar *format)
{
+ gchar *old_format;
+
g_return_if_fail (GTK_IS_PROGRESS (progress));
/* Turn on format, in case someone called
* gtk_progress_bar_set_text() and turned it off.
*/
progress->use_text_format = TRUE;
-
- if (format)
- {
- if (progress->format)
- g_free (progress->format);
- progress->format = g_strdup (format);
- if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress)))
- gtk_widget_queue_resize (GTK_WIDGET (progress));
- }
+ old_format = progress->format;
+
+ if (!format)
+ format = DEFAULT_FORMAT;
+
+ progress->format = g_strdup (format);
+ g_free (old_format);
+
+ if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress)))
+ gtk_widget_queue_resize (GTK_WIDGET (progress));
}
gchar *
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 7e6bb152f..e5ac4eeb3 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -918,7 +918,7 @@ gtk_progress_bar_set_text (GtkProgressBar *pbar,
else
{
gtk_progress_set_show_text (GTK_PROGRESS (pbar), FALSE);
- gtk_progress_set_format_string (GTK_PROGRESS (pbar), "");
+ gtk_progress_set_format_string (GTK_PROGRESS (pbar), NULL);
}
/* We don't support formats in this interface */