<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Make demo extensible for other type of annotations"
href="https://bugs.freedesktop.org/show_bug.cgi?id=69978#c13">Comment # 13</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Make demo extensible for other type of annotations"
href="https://bugs.freedesktop.org/show_bug.cgi?id=69978">bug 69978</a>
from <span class="vcard"><a class="email" href="mailto:carlosgc@gnome.org" title="Carlos Garcia Campos <carlosgc@gnome.org>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=86867" name="attach_86867" title="glib: Prepare UI to add multiple annotations type in demo">attachment 86867</a> <a href="attachment.cgi?id=86867&action=edit" title="glib: Prepare UI to add multiple annotations type in demo">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=69978&attachment=86867'>[review]</a>
glib: Prepare UI to add multiple annotations type in demo
Review of <span class=""><a href="attachment.cgi?id=86867" name="attach_86867" title="glib: Prepare UI to add multiple annotations type in demo">attachment 86867</a> <a href="attachment.cgi?id=86867&action=edit" title="glib: Prepare UI to add multiple annotations type in demo">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=69978&attachment=86867'>[review]</a>:
-----------------------------------------------------------------
::: glib/demo/annots.c
@@ +38,5 @@
<span class="quote">>
> +enum {
> + ANNOTS_NONE,
> + ANNOTS_TEXT
> +};</span >
Why not using PopplerAnnotType?
@@ +52,4 @@
<span class="quote">> GtkWidget *timer_label;
>
> gint num_page;
> + gint type_selector;</span >
type_selector sounds like the widget not the value. I would use selected_type
or new_annot_type. I don't see why we need to save the value if we are using a
modal dialgo to add annots.
@@ +670,5 @@
<span class="quote">> static void
> +pgd_annots_type_selector_changed (GtkComboBox *widget,
> + PgdAnnotsDemo *demo)
> +{
> + demo->type_selector = gtk_combo_box_get_active (widget);</span >
Same here, we can get the value directly from the selector right after the
dialog_run and before destroying the dialog.
@@ +766,4 @@
<span class="quote">> PopplerAnnot *annot;
> PopplerRectangle rect;
>
> + g_return_if_fail (demo->type_selector != ANNOTS_NONE);</span >
Do not use g_return macros here, either return early or use an assert.
@@ +973,5 @@
<span class="quote">>
> gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
> +
> + type_selector = gtk_combo_box_text_new ();
> + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (type_selector), "None");</span >
I don't remember why we allowed to add unknown annots, but I think it doesn't
make sense</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>