aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-10-25 00:25:24 +0200
committerGravatar Tom Willemsen2012-10-25 00:25:24 +0200
commit337a0ba2d28f837138aeebda5eda6fb566f3c39b (patch)
tree41eafbec4e5611cff68c1e1291d00677bdf4d5a0
parent18d4d38e8d1ca928102b56153b091759dee27860 (diff)
downloadeye-on-manga-337a0ba2d28f837138aeebda5eda6fb566f3c39b.tar.gz
eye-on-manga-337a0ba2d28f837138aeebda5eda6fb566f3c39b.zip
Show an "infinite" list when total is unknown
* src/eom-detail-window.c (eom_detail_window_load): If the currently selected manga's `total_qty' is `0', take, for viewing/editing purposes, the manga's `current_qty' + `1' instead. (on_volume_toggled): If the current manga's `total_qty' is `0' reload the screen after toggling a manga as collected.
-rw-r--r--src/eom-detail-window.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/eom-detail-window.c b/src/eom-detail-window.c
index 5f3de4a..00c7453 100644
--- a/src/eom-detail-window.c
+++ b/src/eom-detail-window.c
@@ -36,13 +36,19 @@ void
eom_detail_window_load(EomDetailWindow *self)
{
gint i, j = 0, row = 0, col = 0;
- int rows = (int)floor(self->manga->total_qty / COLUMNS);
+ int total_qty = self->manga->total_qty;
+ int rows;
+
+ if (!total_qty)
+ total_qty = self->manga->current_qty + 1;
+
+ rows = (int)floor(total_qty / COLUMNS);
gtk_window_set_title(GTK_WINDOW(self), self->manga->name);
gtk_table_resize(GTK_TABLE(self->ctable), rows, COLUMNS);
gtk_table_resize(GTK_TABLE(self->rtable), rows, COLUMNS);
- for (i = 0; i < self->manga->total_qty; i++) {
+ for (i = 0; i < total_qty; i++) {
GtkWidget *cbtn, *rbtn;
gchar *txt;
@@ -275,6 +281,9 @@ on_volume_toggled(GtkToggleButton *togglebutton, gpointer user_data)
}
self->manga->current_qty--;
}
+
+ if (!self->manga->total_qty)
+ eom_detail_window_load(self);
}
static void