gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet-gtk] branch master updated (899f2c73 -> a33900f1)


From: gnunet
Subject: [GNUnet-SVN] [gnunet-gtk] branch master updated (899f2c73 -> a33900f1)
Date: Tue, 26 Jun 2018 09:04:54 +0200

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

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

    from 899f2c73 fix namestore gtk segv on exit
     new aa282263 attempt to freeze tv to speed up gnunet-peerinfo-gtk
     new 9b413841 get rid of jitter in rendering, as well as incomprehensible 
column
     new a33900f1 cleaning up peerinfo tree model

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 contrib/gnunet_peerinfo_gtk_main_window.glade | 30 ++-------
 src/peerinfo/gnunet-peerinfo-gtk.c            | 95 ++++++++++++++++++++-------
 2 files changed, 75 insertions(+), 50 deletions(-)

diff --git a/contrib/gnunet_peerinfo_gtk_main_window.glade 
b/contrib/gnunet_peerinfo_gtk_main_window.glade
index c9bd805b..4040e962 100644
--- a/contrib/gnunet_peerinfo_gtk_main_window.glade
+++ b/contrib/gnunet_peerinfo_gtk_main_window.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3
+<!-- Generated with glade 3.22.1
 
 Copyright (C)
 
@@ -61,12 +61,6 @@ along with gnunet-peerinfo-gtk.  If not, see 
<http://www.gnu.org/licenses/>.
       <column type="gchararray"/>
       <!-- column-name transport_neighbour_state_timeout_as_string -->
       <column type="gchararray"/>
-      <!-- column-name transport_validation_state_led__DEAD -->
-      <column type="GdkPixbuf"/>
-      <!-- column-name transport_validation_is_valid__DEAD -->
-      <column type="gboolean"/>
-      <!-- column-name transport_validation_timeout_as_string__DEAD -->
-      <column type="gchararray"/>
       <!-- column-name plugin_connectivity_led -->
       <column type="GdkPixbuf"/>
       <!-- column-name plugin_connectivity_status -->
@@ -134,6 +128,9 @@ along with gnunet-peerinfo-gtk.  If not, see 
<http://www.gnu.org/licenses/>.
     <property name="icon_name">gnunet-gtk</property>
     <signal name="delete-event" handler="GNUNET_PEERINFO_GTK_quit_cb" 
after="yes" swapped="no"/>
     <child>
+      <placeholder/>
+    </child>
+    <child>
       <object class="GtkBox" id="GNUNET_PEERINFO_GTK_main_window_vbox">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
@@ -248,11 +245,11 @@ along with gnunet-peerinfo-gtk.  If not, see 
<http://www.gnu.org/licenses/>.
                 </child>
                 <child>
                   <object class="GtkTreeViewColumn" 
id="GNUNET_PEERINFO_GTK_main_window_validation_status_treeviewcolumn">
+                    <property name="visible">False</property>
                     <property name="widget">validated_image</property>
                     <property name="reorderable">True</property>
                     <property name="sort_indicator">True</property>
                     <property name="sort_column_id">19</property>
-                    <property name="visible">false</property>
                     <child>
                       <object class="GtkCellRendererPixbuf" 
id="GNUNET_PEERINFO_GTK_main_window_valdiation_led_cellrendererpixbuf"/>
                       <attributes>
@@ -378,23 +375,6 @@ along with gnunet-peerinfo-gtk.  If not, see 
<http://www.gnu.org/licenses/>.
                     </child>
                   </object>
                 </child>
-                <child>
-                  <object class="GtkTreeViewColumn" 
id="GNUNET_PEERINFO_GTK_main_window_neighbour_state_treeviewcolumn">
-                    <property name="sizing">autosize</property>
-                    <property name="title" translatable="yes">State</property>
-                    <property name="reorderable">True</property>
-                    <property name="sort_indicator">True</property>
-                    <property name="sort_column_id">16</property>
-                    <child>
-                      <object class="GtkCellRendererText" 
id="GNUNET_PEERINFO_GTK_main_window_neighbour_state_cellrenderertext">
-                        <property name="width_chars">30</property>
-                      </object>
-                      <attributes>
-                        <attribute name="text">16</attribute>
-                      </attributes>
-                    </child>
-                  </object>
-                </child>
               </object>
             </child>
           </object>
diff --git a/src/peerinfo/gnunet-peerinfo-gtk.c 
b/src/peerinfo/gnunet-peerinfo-gtk.c
index f6227cc7..e7eef60d 100644
--- a/src/peerinfo/gnunet-peerinfo-gtk.c
+++ b/src/peerinfo/gnunet-peerinfo-gtk.c
@@ -35,6 +35,7 @@
 #include <unique/unique.h>
 #endif
 
+#define UPDATE_FREQUENCY GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 10)
 
 /**
  * Should we show peers that have no connections and
@@ -141,42 +142,32 @@ enum PEERINFO_ModelColumns
   /**
    * A GdkPixbuf
    */
-  PEERINFO_MC_VALIDATION_STATE_LED__DEAD = 18,
+  PEERINFO_MC_PLUGIN_CONNECTIVITY_LED = 18,
 
   /**
    * A gboolean
    */
-  PEERINFO_MC_VALIDATION_IS_VALID__DEAD = 19,
+  PEERINFO_MC_PLUGIN_CONNECTIVITY_STATUS = 19,
 
   /**
    * A gchararray
    */
-  PEERINFO_MC_VALIDATION_TIMEOUT_AS_STRING__DEAD = 20,
-
-  /**
-   * A GdkPixbuf
-   */
-  PEERINFO_MC_PLUGIN_CONNECTIVITY_LED = 21,
+  PEERINFO_MC_PLUGIN_CONNECTIVITY_TIMEOUT_AS_STRING = 20,
 
   /**
    * A gboolean
    */
-  PEERINFO_MC_PLUGIN_CONNECTIVITY_STATUS = 22,
+  PEERINFO_MC_SHOW_FRIEND = 21,
 
   /**
    * A gchararray
    */
-  PEERINFO_MC_PLUGIN_CONNECTIVITY_TIMEOUT_AS_STRING = 23,
+  PEERINFO_MC_PEERINFO_ADDRESS_EXPIRATION = 22,
 
   /**
-   * A gboolean
+   * Last "column" (does not actually exist).
    */
-  PEERINFO_MC_SHOW_FRIEND = 24,
-
-  /**
-   * A gchararray
-   */
-  PEERINFO_MC_PEERINFO_ADDRESS_EXPIRATION = 25
+  PEERINFO_MC_END = 26
 
 };
 
@@ -394,9 +385,14 @@ static GtkTreeViewColumn *tvc_ats_connectivity;
 static GtkTreeViewColumn *tvc_plugin_connectivity;
 
 /**
- * Tree view column for neighbour_state
+ * The main tree view.
+ */
+static GtkTreeView *tv;
+
+/**
+ * Task to actually update the tree view.
  */
-static GtkTreeViewColumn *tvc_neighbour_state;
+static struct GNUNET_SCHEDULER_Task *update_task;
 
 
 #if HAVE_LIBUNIQUE
@@ -405,6 +401,50 @@ 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 (UPDATE_FREQUENCY,
+                                              &do_update,
+                                              NULL);
+#if 0
+  GtkTreeStore *sts;
+
+  sts = gtk_tree_store_new (PEERINFO_MC_END,
+                            G_TYPE_STRING, /* pid */
+                            G_TYPE_STRING, /* country name */
+                            GDK_TYPE_PIXBUF, /* country flag */
+                            G_TYPE_UINT, /* bandwidth_in */
+                            G_TYPE_UINT, /* bandwidth_out */
+                            GDK_TYPE_PIXBUF, /* ATS led */
+                            G_TYPE_BOOLEAN, /* ATS selected */
+                            GDK_TYPE_PIXBUF, /* CORE led */
+                            G_TYPE_UINT, /* core status */
+                            G_TYPE_BOOLEAN, /* is friend */
+                            G_TYPE_POINTER, /* peerinfo */
+                            G_TYPE_STRING, /* plugin name */
+                            G_TYPE_STRING, /* address */
+                            GDK_TYPE_PIXBUF, /* neighbour connectivity */
+                            G_TYPE_BOOLEAN, /* connected status */
+                            G_TYPE_STRING, /* timeout as string */
+                            G_TYPE_STRING, /* neighbour state as string */
+                            G_TYPE_STRING, /* neighbour state timeout as 
string */
+                            GDK_TYPE_PIXBUF, /* plugin connectivity led */
+                            G_TYPE_BOOLEAN, /* plugin connectivity status */
+                            G_TYPE_STRING, /* connectivity timeout plugin */
+                            G_TYPE_BOOLEAN, /* show friend */
+                            G_TYPE_STRING /* peerinfo addr expiration */
+                            );
+#endif
+}
+
+
+/**
  * Get cfg.
  */
 static const struct GNUNET_CONFIGURATION_Handle *
@@ -488,6 +528,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);
@@ -1425,8 +1470,6 @@ query_tooltip_cb (GtkWidget *widget,
     model_column = PEERINFO_MC_PEERINFO_ADDRESS_EXPIRATION;
   else if (tvc_transport_connectivity == column)
     model_column = PEERINFO_MC_NEIGHBOUR_CONNECTIVITY_TIMEOUT_AS_STRING;
-  else if (tvc_neighbour_state == column)
-    model_column = PEERINFO_MC_NEIGHBOUR_STATE_TIMEOUT_AS_STRING;
   if (-1 == model_column)
     return FALSE;
 
@@ -1459,13 +1502,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");
@@ -1522,7 +1565,6 @@ run (void *cts)
   tvc_ats_connectivity = GTK_TREE_VIEW_COLUMN (get_object 
("GNUNET_PEERINFO_GTK_main_window_ats_connectivity_treeviewcolumn"));
   tvc_plugin_connectivity = GTK_TREE_VIEW_COLUMN (get_object 
("GNUNET_PEERINFO_GTK_main_window_plugin_connectivity_treeviewcolumn"));
   tvc_transport_connectivity = GTK_TREE_VIEW_COLUMN (get_object 
("GNUNET_PEERINFO_GTK_main_window_transport_connectivity_treeviewcolumn"));
-  tvc_neighbour_state = GTK_TREE_VIEW_COLUMN (get_object 
("GNUNET_PEERINFO_GTK_main_window_neighbour_state_treeviewcolumn"));
   /* setup main window */
   main_window = GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window"));
   main_window = GNUNET_GTK_plug_me ("GNUNET_PEERINFO_GTK_PLUG",
@@ -1535,7 +1577,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 +1585,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]