[gnome-packagekit] Do not show '0 bytes' in the confirmation dialog, just show the message title
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Do not show '0 bytes' in the confirmation dialog, just show the message title
- Date: Mon, 15 Feb 2010 14:28:09 +0000 (UTC)
commit 05f94b3b3546949906ec9c38f0785b33522669b0
Author: Richard Hughes <richard hughsie com>
Date: Mon Feb 15 14:27:22 2010 +0000
Do not show '0 bytes' in the confirmation dialog, just show the message title
src/gpk-dialog.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/gpk-dialog.c b/src/gpk-dialog.c
index b91aa4f..680a41b 100644
--- a/src/gpk-dialog.c
+++ b/src/gpk-dialog.c
@@ -330,10 +330,21 @@ gpk_dialog_embed_download_size_widget (GtkDialog *dialog, const gchar *title, gu
GtkWidget *label;
GtkWidget *hbox;
GtkWidget *widget;
- gchar *text;
- gchar *size_str;
+ gchar *text = NULL;
+ gchar *size_str = NULL;
+
+ /* size is zero, don't show "0 bytes" */
+ if (size == 0) {
+ label = gtk_label_new (title);
+ widget = gtk_dialog_get_content_area (GTK_DIALOG(dialog));
+ gtk_container_add_with_properties (GTK_CONTAINER (widget), label,
+ "expand", FALSE,
+ "fill", FALSE,
+ NULL);
+ goto out;
+ }
- /* add a checkbutton for deps screen */
+ /* add a hbox with the size for deps screen */
size_str = g_format_size_for_display (size);
text = g_strdup_printf ("%s: %s", title, size_str);
hbox = gtk_hbox_new (FALSE, 6);
@@ -346,8 +357,9 @@ gpk_dialog_embed_download_size_widget (GtkDialog *dialog, const gchar *title, gu
/* add a label */
label = gtk_label_new (text);
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
gtk_widget_show (hbox);
+out:
+ gtk_widget_show (label);
g_free (text);
g_free (size_str);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]