Commit 1b1f2458 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Restore back to the default format instead of an empty format.

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.
parent 21f1b62d
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):
......
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):
......
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):
......
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):
......
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):
......
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):
......
......@@ -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 ##### -->
......
......@@ -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 *
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment