From c16bfb866ab831764e6cea3793bc6529f129ab0c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 14 Sep 2013 15:23:46 +0200 Subject: [PATCH] Show some messages for errors When certain actions can't be completed messages are now shown. --- src/eom-detail-window.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/eom-detail-window.c b/src/eom-detail-window.c index f676b18..75a98cf 100644 --- a/src/eom-detail-window.c +++ b/src/eom-detail-window.c @@ -281,6 +281,10 @@ on_delete(GtkWidget *widget, gpointer user_data) gtk_widget_hide(GTK_WIDGET(self)); gtk_widget_destroy(GTK_WIDGET(self)); } + else + hildon_banner_show_information( + self, NULL, "Could not delete manga" + ); } } @@ -305,6 +309,10 @@ on_edit(GtkWidget *widget, EomDetailWindow *self) if (name != NULL) { if (data_update_manga(self->manga->id, name, total_qty)) set_manga_id(self, self->manga->id); + else + hildon_banner_show_information( + self, NULL, "Could not update manga information" + ); } gtk_widget_destroy(dialog); @@ -318,7 +326,9 @@ on_volume_read_toggled(GtkToggleButton *togglebutton, gpointer user_data) gint volume = atoi(gtk_button_get_label(GTK_BUTTON(togglebutton))); if (!data_mark_volume_read(active, self->manga->id, volume)) - g_print("coulnd't mark volume as read\n"); + hildon_banner_show_information( + self, NULL, "Could not mark volume as read" + ); } static void @@ -331,20 +341,33 @@ on_volume_toggled(GtkToggleButton *togglebutton, gpointer user_data) if (active) { /* Add 1 to mangas collected */ if (!data_add_to_manga(self->manga->id, 1)) { + hildon_banner_show_information( + self, NULL, + "Could not increase the collected manga count" + ); return; } if (!data_add_volume_to_manga(self->manga->id, volume)) { data_add_to_manga(self->manga->id, -1); + hildon_banner_show_information( + self, NULL, "Could not add volume to collection"); return; } } else { /* Remove 1 from mangas collected */ if (!data_add_to_manga(self->manga->id, -1)) { + hildon_banner_show_information( + self, NULL, + "Could not decrease the collected manga count" + ); return; } if (!data_remove_volume_from_manga(self->manga->id, volume)) { data_add_to_manga(self->manga->id, 1); /* Undo */ + hildon_banner_show_information( + self, NULL, "Could not remove volume from collection" + ); return; } }