gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20573 - in gnunet-gtk: contrib src/gns


From: gnunet
Subject: [GNUnet-SVN] r20573 - in gnunet-gtk: contrib src/gns
Date: Fri, 16 Mar 2012 16:05:23 +0100

Author: wachs
Date: 2012-03-16 16:05:23 +0100 (Fri, 16 Mar 2012)
New Revision: 20573

Modified:
   gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade
   gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c
Log:
- more changes


Modified: gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade 2012-03-16 14:49:29 UTC 
(rev 20572)
+++ gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade 2012-03-16 15:05:23 UTC 
(rev 20573)
@@ -2,6 +2,56 @@
 <interface>
   <requires lib="gtk+" version="2.20"/>
   <!-- interface-naming-policy project-wide -->
+  <object class="GtkListStore" id="GNUNET_GNS_GTK_type_liststore">
+    <columns>
+      <!-- column-name type -->
+      <column type="guint"/>
+      <!-- column-name typename -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">1</col>
+        <col id="1" translatable="yes">A</col>
+      </row>
+      <row>
+        <col id="0">2</col>
+        <col id="1" translatable="yes">NS</col>
+      </row>
+      <row>
+        <col id="0">5</col>
+        <col id="1" translatable="yes">CNAME</col>
+      </row>
+      <row>
+        <col id="0">6</col>
+        <col id="1" translatable="yes">SOA</col>
+      </row>
+      <row>
+        <col id="0">12</col>
+        <col id="1" translatable="yes">PTR</col>
+      </row>
+      <row>
+        <col id="0">15</col>
+        <col id="1" translatable="yes">MX</col>
+      </row>
+      <row>
+        <col id="0">16</col>
+        <col id="1" translatable="yes">TXT</col>
+      </row>
+      <row>
+        <col id="0">28</col>
+        <col id="1" translatable="yes">AAAA</col>
+      </row>
+      <row>
+        <col id="0">65536</col>
+        <col id="1" translatable="yes">PKEY</col>
+      </row>
+      <row>
+        <col id="0">65537</col>
+        <col id="1" translatable="yes">PSEU</col>
+      </row>
+    </data>
+  </object>
   <object class="GtkWindow" id="GNUNET_GNS_GTK_main_window">
     <property name="can_focus">False</property>
     <property name="default_height">500</property>
@@ -353,58 +403,8 @@
       <column type="gchararray"/>
       <!-- column-name name_is_editable -->
       <column type="gboolean"/>
-      <!-- column-name name_row -->
+      <!-- column-name name_is_row -->
       <column type="gboolean"/>
     </columns>
   </object>
-  <object class="GtkListStore" id="GNUNET_GNS_GTK_type_liststore">
-    <columns>
-      <!-- column-name type -->
-      <column type="guint"/>
-      <!-- column-name typename -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0">1</col>
-        <col id="1" translatable="yes">A</col>
-      </row>
-      <row>
-        <col id="0">2</col>
-        <col id="1" translatable="yes">NS</col>
-      </row>
-      <row>
-        <col id="0">5</col>
-        <col id="1" translatable="yes">CNAME</col>
-      </row>
-      <row>
-        <col id="0">6</col>
-        <col id="1" translatable="yes">SOA</col>
-      </row>
-      <row>
-        <col id="0">12</col>
-        <col id="1" translatable="yes">PTR</col>
-      </row>
-      <row>
-        <col id="0">15</col>
-        <col id="1" translatable="yes">MX</col>
-      </row>
-      <row>
-        <col id="0">16</col>
-        <col id="1" translatable="yes">TXT</col>
-      </row>
-      <row>
-        <col id="0">28</col>
-        <col id="1" translatable="yes">AAAA</col>
-      </row>
-      <row>
-        <col id="0">65536</col>
-        <col id="1" translatable="yes">PKEY</col>
-      </row>
-      <row>
-        <col id="0">65537</col>
-        <col id="1" translatable="yes">PSEU</col>
-      </row>
-    </data>
-  </object>
 </interface>

Modified: gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c    2012-03-16 14:49:29 UTC (rev 
20572)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c    2012-03-16 15:05:23 UTC (rev 
20573)
@@ -40,7 +40,7 @@
   TREE_COL_VAL_AS_STR,
   TREE_COL_VAL_COLOR,
   TREE_COL_NAME_IS_EDITABLE,
-  TREE_COL_IS_NAME_ROW,
+  TREE_COL_IS_RECORD_ROW = 10
 };
 
 enum
@@ -69,11 +69,25 @@
   GtkTreeIter it;
   GtkTreeModel *tm = GTK_TREE_MODEL(gns->ts);
   guint type;
+//  int is_row;
   char *type_str;
   char *value_str;
   void *data;
   size_t data_size;
 
+  /* check if this is a new record */
+  /*
+  gtk_tree_model_get(tm, &it, TREE_COL_IS_NAME_ROW, &is_row, -1);
+
+  if (0 == is_row)
+  {
+
+  }
+  else
+  {
+
+  }
+*/
   gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, 0, &type, -1);
   gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, TYPE_LIST_TYPENAME, 
&type_str, -1);
 
@@ -96,6 +110,7 @@
     else
       gtk_tree_store_set (gns->ts, &it, TREE_COL_VAL_COLOR, NULL, -1);
   }
+  GNUNET_free (value_str);
 }
 
 
@@ -219,6 +234,7 @@
         TREE_COL_NAME, _(NEW_RECORD_STR),
         TREE_COL_RECORD_TYPE, 1,
         TREE_COL_NAME_IS_EDITABLE, 1,
+        //TREE_COL_IS_NAME_ROW, 1
         -1);
 #if 0
     gtk_tree_store_append(gns->ts, &it, NULL);
@@ -307,7 +323,7 @@
   gtk_tree_store_set(zc_ctx->gns->ts, &iter_name,
                      TREE_COL_NAME, name,
                      TREE_COL_NAME_IS_EDITABLE, 1,
-                     TREE_COL_IS_NAME_ROW, 1
+                     TREE_COL_IS_RECORD_ROW, GNUNET_NO,
                      -1);
 
 
@@ -338,7 +354,6 @@
     val = GNUNET_NAMESTORE_value_to_string (rd[c].record_type,
                                             rd[c].data,
                                             rd[c].data_size);
-
     gtk_tree_store_insert_with_values(zc_ctx->gns->ts, &iter_record , 
&iter_name, 0,
                                        TREE_COL_NAME, "",
                                        TREE_COL_RECORD_TYPE, rd[c].record_type,
@@ -347,7 +362,7 @@
                                        TREE_COL_EXP_TIME_AS_STR, exp,
                                        TREE_COL_EXP_TIME_IS_REL, 
time_is_relative,
                                        TREE_COL_VAL_AS_STR, val,
-                                       TREE_COL_IS_NAME_ROW, 0
+                                       TREE_COL_IS_RECORD_ROW, GNUNET_YES,
                                        -1);
 
     GNUNET_free (exp);
@@ -375,6 +390,7 @@
                                      TREE_COL_NAME, _(NEW_RECORD_STR),
                                      TREE_COL_RECORD_TYPE, 1,
                                      TREE_COL_NAME_IS_EDITABLE, 1,
+                                     TREE_COL_IS_RECORD_ROW, GNUNET_NO,
                                      -1);
 
   zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context));




reply via email to

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