Display retrieved comment only as placeholder

This commit is contained in:
Markus Koch 2019-07-26 21:55:52 +02:00
parent 0cae59aeb1
commit 40aba2eb44

View File

@ -179,7 +179,11 @@ static void yacos_cart_item_fetch_meta_cb (SoupSession *session, SoupMessage *ms
json_reader_read_member (reader, "comment"); json_reader_read_member (reader, "comment");
temp = json_reader_get_string_value (reader); temp = json_reader_get_string_value (reader);
gtk_entry_set_text(GTK_ENTRY(self->priv.entry_comment), temp); if (*temp)
gtk_entry_set_placeholder_text(GTK_ENTRY(self->priv.entry_comment), temp);
else
gtk_entry_set_placeholder_text(GTK_ENTRY(self->priv.entry_comment),
"Click here to add a comment.");
json_reader_end_member (reader); json_reader_end_member (reader);
g_object_unref (reader); g_object_unref (reader);
@ -197,7 +201,7 @@ void yacos_cart_item_fetch_meta(YacosCartItem *self)
gtk_label_set_text(GTK_LABEL(self->priv.label_title), "Loading ..."); gtk_label_set_text(GTK_LABEL(self->priv.label_title), "Loading ...");
gtk_label_set_text(GTK_LABEL(self->priv.label_description), ""); gtk_label_set_text(GTK_LABEL(self->priv.label_description), "");
gtk_entry_set_text(GTK_ENTRY(self->priv.entry_comment), " "); gtk_entry_set_text(GTK_ENTRY(self->priv.entry_comment), "");
id_str = yacos_tag_id_to_str(self->priv.tag_id); id_str = yacos_tag_id_to_str(self->priv.tag_id);