2006-09-05 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Tue, 5 Sep 2006 12:01:43 +0000 (12:01 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Tue, 5 Sep 2006 12:01:43 +0000 (12:01 +0000)
* hildon-widgets/hildon-note.c: Fixing the behaviour of
hildon_note_new_confirmation_with_icon_stock. Fixes #NB22825.

ChangeLog
hildon-widgets/hildon-note.c

index 8e18ce5..f6fcf97 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-09-05  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * hildon-widgets/hildon-note.c: Fixing the behaviour of
+       hildon_note_new_confirmation_with_icon_stock. Fixes #NB22825.
+
+2006-09-05  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        * hildon-widgets/hildon-font-selection-dialog.c: Adding a
        "font-scaling" property that allows to customize the output of the
        Preview dialog during font selection. By default font-scaling equals
index 2046a49..f6df468 100644 (file)
@@ -104,7 +104,8 @@ enum {
     PROP_HILDON_NOTE_TYPE,
     PROP_HILDON_NOTE_DESCRIPTION,
     PROP_HILDON_NOTE_ICON,
-    PROP_HILDON_NOTE_PROGRESSBAR
+    PROP_HILDON_NOTE_PROGRESSBAR,
+    PROP_HILDON_NOTE_STOCK_ICON
 };
 
 static void
@@ -136,6 +137,10 @@ hildon_note_set_property(GObject * object,
         gtk_image_set_from_icon_name(GTK_IMAGE(priv->icon), 
             g_value_get_string(value), HILDON_ICON_SIZE_BIG_NOTE);
         break;
+    case PROP_HILDON_NOTE_STOCK_ICON:
+        gtk_image_set_from_stock(GTK_IMAGE(priv->icon), 
+            g_value_get_string(value), HILDON_ICON_SIZE_BIG_NOTE);
+        break;
     case PROP_HILDON_NOTE_PROGRESSBAR:
         widget = g_value_get_object(value);
         if (widget != priv->progressbar)
@@ -179,6 +184,9 @@ hildon_note_get_property(GObject * object,
     case PROP_HILDON_NOTE_ICON:
         g_object_get_property(G_OBJECT(priv->icon), "icon-name", value);
         break;
+    case PROP_HILDON_NOTE_STOCK_ICON:
+        g_object_get_property(G_OBJECT(priv->icon), "stock", value);
+        break;
     case PROP_HILDON_NOTE_PROGRESSBAR:
         g_value_set_object(value, priv->progressbar);
         break;
@@ -279,6 +287,19 @@ static void hildon_note_class_init(HildonNoteClass * class)
                             "",
                             G_PARAM_READWRITE));
 
+   /**
+   * HildonNote:stock-icon:
+   *
+   * Stock icon for note.
+   */
+    g_object_class_install_property(object_class,
+        PROP_HILDON_NOTE_STOCK_ICON,
+        g_param_spec_string("stock-icon",
+                            "Stock note icon",
+                            "The stock name of the icon that appears in the note dialog",
+                            "",
+                            G_PARAM_READWRITE));
+
   /**
    * HildonNote:progressbar:
    *
@@ -560,14 +581,10 @@ GtkWidget *hildon_note_new_confirmation_with_icon_stock(GtkWindow * parent,
                                                         const gchar *
                                                         stock_id)
 {
-    /* FIXME: This function is broken. We cannot detect if the "icon"
-              means icon name or stock-id, since the type is the same
-              as in the following function. Anyway, since we really
-              do not support stock icons properly, this is a minor issue. */
     GtkWidget *dialog = g_object_new(HILDON_TYPE_NOTE,
                                      "note_type",
                                      HILDON_NOTE_CONFIRMATION_TYPE,
-                                     "description", description, "icon",
+                                     "description", description, "stock-icon",
                                      stock_id, NULL);
 
     if (parent != NULL)