[gnome-software] Make the moderator panel easier to use
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Make the moderator panel easier to use
- Date: Mon, 10 Jul 2017 21:25:38 +0000 (UTC)
commit 849fcd78f26d1db0207f1216dc1e449bd891c3ad
Author: Richard Hughes <richard hughsie com>
Date: Mon Jul 10 22:25:19 2017 +0100
Make the moderator panel easier to use
Hide the application when there are no more apps to moderate.
src/gs-moderate-page.c | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-moderate-page.c b/src/gs-moderate-page.c
index b8b0ac8..0f054c1 100644
--- a/src/gs-moderate-page.c
+++ b/src/gs-moderate-page.c
@@ -64,6 +64,39 @@ gs_moderate_page_app_set_review_cb (GObject *source,
}
static void
+gs_moderate_page_perhaps_hide_app_row (GsModeratePage *self, GsApp *app)
+{
+ GList *children;
+ GsAppRow *app_row = NULL;
+ gboolean is_visible = FALSE;
+
+ children = gtk_container_get_children (GTK_CONTAINER (self->list_box_install));
+ for (GList *l = children; l != NULL; l = l->next) {
+ GtkWidget *w = GTK_WIDGET (l->data);
+ if (!gtk_widget_get_visible (w))
+ continue;
+ if (GS_IS_APP_ROW (w)) {
+ GsApp *app_tmp = gs_app_row_get_app (GS_APP_ROW (w));
+ if (g_strcmp0 (gs_app_get_id (app),
+ gs_app_get_id (app_tmp)) == 0) {
+ app_row = GS_APP_ROW (w);
+ continue;
+ }
+ }
+ if (GS_IS_REVIEW_ROW (w)) {
+ GsApp *app_tmp = g_object_get_data (G_OBJECT (w), "GsApp");
+ if (g_strcmp0 (gs_app_get_id (app),
+ gs_app_get_id (app_tmp)) == 0) {
+ is_visible = TRUE;
+ break;
+ }
+ }
+ }
+ if (!is_visible && app_row != NULL)
+ gs_app_row_unreveal (app_row);
+}
+
+static void
gs_moderate_page_review_clicked_cb (GsReviewRow *row,
GsPluginAction action,
GsModeratePage *self)
@@ -81,6 +114,9 @@ gs_moderate_page_review_clicked_cb (GsReviewRow *row,
gs_moderate_page_app_set_review_cb,
self);
gtk_widget_set_visible (GTK_WIDGET (row), FALSE);
+
+ /* if there are no more visble rows, hide the app */
+ gs_moderate_page_perhaps_hide_app_row (self, app);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]