gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet-gtk] 01/03: attempt to freeze tv to speed up gnunet


From: gnunet
Subject: [GNUnet-SVN] [gnunet-gtk] 01/03: attempt to freeze tv to speed up gnunet-peerinfo-gtk
Date: Tue, 26 Jun 2018 09:04:55 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet-gtk.

commit aa282263ac88247165e75371994730de10731703
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Jun 26 08:44:06 2018 +0200

    attempt to freeze tv to speed up gnunet-peerinfo-gtk
---
 src/peerinfo/gnunet-peerinfo-gtk.c | 41 +++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/peerinfo/gnunet-peerinfo-gtk.c 
b/src/peerinfo/gnunet-peerinfo-gtk.c
index f6227cc7..a5ae486a 100644
--- a/src/peerinfo/gnunet-peerinfo-gtk.c
+++ b/src/peerinfo/gnunet-peerinfo-gtk.c
@@ -398,6 +398,16 @@ static GtkTreeViewColumn *tvc_plugin_connectivity;
  */
 static GtkTreeViewColumn *tvc_neighbour_state;
 
+/**
+ * The main tree view.
+ */
+static GtkTreeView *tv;
+
+/**
+ * Task to actually update the tree view.
+ */
+static struct GNUNET_SCHEDULER_Task *update_task;
+
 
 #if HAVE_LIBUNIQUE
 static UniqueApp *unique_app;
@@ -405,6 +415,23 @@ static UniqueApp *unique_app;
 
 
 /**
+ * Periodically unfreezes the tree view to allow updates to show.
+ *
+ * @param cls NULL
+ */
+static void
+do_update (void *cls)
+{
+  (void) cls;
+  update_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+                                              &do_update,
+                                              NULL);
+  gtk_widget_thaw_child_notify (GTK_WIDGET (tv));
+  gtk_widget_freeze_child_notify (GTK_WIDGET (tv));
+}
+
+
+/**
  * Get cfg.
  */
 static const struct GNUNET_CONFIGURATION_Handle *
@@ -488,6 +515,11 @@ free_paths (void *cts,
 static void
 shutdown_task (void *cts)
 {
+  if (NULL != update_task)
+  {
+    GNUNET_SCHEDULER_cancel (update_task);
+    update_task = NULL;
+  }
   if (NULL == ml)
   {
     GNUNET_break (0);
@@ -1459,13 +1491,13 @@ static void
 run (void *cts)
 {
   GtkWidget *main_window;
-  GtkTreeView *tv;
   const struct GNUNET_CONFIGURATION_Handle *cfg;
   int can_edit_friends;
 
   ml = cts;
   if (GNUNET_OK !=
-      GNUNET_GTK_main_loop_build_window (ml, NULL))
+      GNUNET_GTK_main_loop_build_window (ml,
+                                         NULL))
     return;
   cfg = get_configuration ();
   led_green = load_led ("green");
@@ -1535,7 +1567,7 @@ run (void *cts)
   g_signal_connect (tv, "query-tooltip",
                    G_CALLBACK (query_tooltip_cb),
                     NULL);
-
+  gtk_widget_freeze_child_notify (GTK_WIDGET (tv));
 #if HAVE_LIBUNIQUE
   unique_app_watch_window (unique_app,
                            GTK_WINDOW (main_window));
@@ -1543,6 +1575,9 @@ run (void *cts)
   /* make GUI visible */
   gtk_widget_show (main_window);
   gtk_window_present (GTK_WINDOW (main_window));
+  update_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+                                              &do_update,
+                                              NULL);
   GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
                                 NULL);
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]