gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r20506 - in gnunet-gtk: contrib src/gns
Date: Wed, 14 Mar 2012 22:25:59 +0100

Author: wachs
Date: 2012-03-14 22:25:59 +0100 (Wed, 14 Mar 2012)
New Revision: 20506

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


Modified: gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade 2012-03-14 20:46:46 UTC 
(rev 20505)
+++ gnunet-gtk/contrib/gnunet_gns_gtk_main_window.glade 2012-03-14 21:25:59 UTC 
(rev 20506)
@@ -1,126 +1,66 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy project-wide -->
-  <object class="GtkTreeStore" id="GNUNET_GNS_GTK_treestore">
-    <columns>
-      <!-- column-name name -->
-      <column type="gchararray"/>
-      <!-- column-name is_public -->
-      <column type="gboolean"/>
-      <!-- column-name record_type -->
-      <column type="guint"/>
-      <!-- column-name record_type_as_string -->
-      <column type="gchararray"/>
-      <!-- column-name expiration_time -->
-      <column type="guint64"/>
-      <!-- column-name expiration_time_is_relative -->
-      <column type="gboolean"/>
-      <!-- column-name expiration_time_as_string -->
-      <column type="gchararray"/>
-      <!-- column-name value_as_string -->
-      <column type="gchararray"/>
-      <!-- column-name value_color -->
-      <column type="gchararray"/>
-    </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>
   <object class="GtkWindow" id="GNUNET_GNS_GTK_main_window">
-    <signal name="delete_event" 
handler="GNUNET_GNS_GTK_main_window_delete_event_cb"/>
+    <property name="can_focus">False</property>
+    <signal name="delete-event" 
handler="GNUNET_GNS_GTK_main_window_delete_event_cb" swapped="no"/>
     <child>
       <object class="GtkVBox" id="GNUNET_GNS_GTK_main_vbox">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
+        <property name="can_focus">False</property>
         <child>
           <object class="GtkMenuBar" id="GNUNET_GNS_GTK_menubar">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <child>
               <object class="GtkMenuItem" id="GNUNET_GNS_GTK_file_menuitem">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="use_action_appearance">False</property>
                 <property name="label" translatable="yes">_File</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu1">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkImageMenuItem" 
id="GNUNET_GNS_GTK_new_imagemenuitem">
                         <property name="label">gtk-new</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" 
handler="GNUNET_GNS_GTK_new_imagemenuitem_activate_cb"/>
+                        <signal name="activate" 
handler="GNUNET_GNS_GTK_new_imagemenuitem_activate_cb" swapped="no"/>
                       </object>
                     </child>
                     <child>
                       <object class="GtkImageMenuItem" 
id="GNUNET_GNS_GTK_open_imagemenuitem">
                         <property name="label">gtk-open</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" 
handler="GNUNET_GNS_GTK_open_imagemenuitem_activate_cb"/>
+                        <signal name="activate" 
handler="GNUNET_GNS_GTK_open_imagemenuitem_activate_cb" swapped="no"/>
                       </object>
                     </child>
                     <child>
                       <object class="GtkSeparatorMenuItem" 
id="separatormenuitem1">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                       </object>
                     </child>
                     <child>
                       <object class="GtkImageMenuItem" 
id="GNUNET_GNS_GTK_quit_imagemenuitem">
                         <property name="label">gtk-quit</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" 
handler="GNUNET_GNS_GTK_quit_imagemenuitem_activate_cb"/>
+                        <signal name="activate" 
handler="GNUNET_GNS_GTK_quit_imagemenuitem_activate_cb" swapped="no"/>
                       </object>
                     </child>
                   </object>
@@ -130,17 +70,22 @@
             <child>
               <object class="GtkMenuItem" id="GNUNET_GNS_GTK_options_menuitem">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="use_action_appearance">False</property>
                 <property name="label" translatable="yes">_Options</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu2">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkCheckMenuItem" 
id="GNUNET_GNS_GTK_autoshort_imagemenuitem">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="label" 
translatable="yes">Automatically shorten names</property>
                         <property name="use_underline">True</property>
-                        <signal name="toggled" 
handler="GNUNET_GNS_GTK_autoshort_imagemenuitem_toggled_cb"/>
+                        <signal name="toggled" 
handler="GNUNET_GNS_GTK_autoshort_imagemenuitem_toggled_cb" swapped="no"/>
                       </object>
                     </child>
                   </object>
@@ -150,18 +95,23 @@
             <child>
               <object class="GtkMenuItem" id="GNUNET_GNS_GTK_help_menuitem">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="use_action_appearance">False</property>
                 <property name="label" translatable="yes">_Help</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu3">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkImageMenuItem" 
id="GNUNET_GNS_GTK_about_imagemenuitem">
                         <property name="label">gtk-about</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" 
handler="GNUNET_GNS_GTK_about_imagemenuitem_activate_cb"/>
+                        <signal name="activate" 
handler="GNUNET_GNS_GTK_about_imagemenuitem_activate_cb" swapped="no"/>
                       </object>
                     </child>
                   </object>
@@ -171,24 +121,29 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
           <object class="GtkFrame" id="GNUNET_GNS_GTK_main_frame">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="label_xalign">0</property>
             <property name="shadow_type">none</property>
             <child>
               <object class="GtkAlignment" id="GNUNET_GNS_GTK_main_alignment">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="left_padding">12</property>
                 <child>
                   <object class="GtkHBox" id="GNUNET_GNS_GTK_pseu_hbox">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkLabel" id="GNUNET_GNS_GTK_pseu_label">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Preferred 
zone name (PSEU):</property>
                       </object>
                       <packing>
@@ -204,10 +159,16 @@
                         <property name="can_focus">True</property>
                         <property name="tooltip_text" translatable="yes">Enter 
the preferred name for this zone here.  The value will be stored in the PSEU 
record for your public key.  This is the GNS equivalent of your domain name.  
You should try to pick a name that is globally unique.</property>
                         <property name="max_length">63</property>
-                        <property name="invisible_char">&#x25CF;</property>
-                        <signal name="changed" 
handler="GNUNET_GNS_GTK_pseu_entry_changed_cb"/>
+                        <property name="invisible_char">●</property>
+                        <property 
name="primary_icon_activatable">False</property>
+                        <property 
name="secondary_icon_activatable">False</property>
+                        <property name="primary_icon_sensitive">True</property>
+                        <property 
name="secondary_icon_sensitive">True</property>
+                        <signal name="changed" 
handler="GNUNET_GNS_GTK_pseu_entry_changed_cb" swapped="no"/>
                       </object>
                       <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
                         <property name="padding">5</property>
                         <property name="position">1</property>
                       </packing>
@@ -219,8 +180,9 @@
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="tooltip_text" translatable="yes">Copy 
the public key of this zone to the clipboard.</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="use_stock">True</property>
-                        <signal name="clicked" 
handler="GNUNET_GNS_GTK_public_key_copy_button_clicked_cb"/>
+                        <signal name="clicked" 
handler="GNUNET_GNS_GTK_public_key_copy_button_clicked_cb" swapped="no"/>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -236,6 +198,7 @@
             <child type="label">
               <object class="GtkLabel" id="GNUNET_GNS_GTK_zone_label">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">&lt;b&gt;SET TO 
PUBLIC KEY OF THE ZONE&lt;/b&gt;</property>
                 <property name="use_markup">True</property>
               </object>
@@ -259,8 +222,8 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="model">GNUNET_GNS_GTK_treestore</property>
-                <signal name="realize" 
handler="GNUNET_GNS_GTK_main_treeview_realize_cb"/>
-                <signal name="popup_menu" 
handler="GNUNET_GNS_GTK_main_treeview_popup_menu_cb"/>
+                <signal name="realize" 
handler="GNUNET_GNS_GTK_main_treeview_realize_cb" swapped="no"/>
+                <signal name="popup-menu" 
handler="GNUNET_GNS_GTK_main_treeview_popup_menu_cb" swapped="no"/>
                 <child>
                   <object class="GtkTreeViewColumn" 
id="GNUNET_GNS_GTK_name_treeviewcolumn">
                     <property name="title">Name</property>
@@ -268,10 +231,11 @@
                     <property name="reorderable">True</property>
                     <property name="sort_indicator">True</property>
                     <property name="sort_column_id">0</property>
+                    <signal name="clicked" 
handler="GNUNET_GNS_GTK_main_treeview_click_cb" swapped="no"/>
                     <child>
                       <object class="GtkCellRendererText" 
id="GNUNET_GNS_GTK_name_cellrenderertext">
                         <property name="editable">True</property>
-                        <signal name="edited" 
handler="GNUNET_GNS_GTK_name_cellrenderertext_edited_cb"/>
+                        <signal name="edited" 
handler="GNUNET_GNS_GTK_name_cellrenderertext_edited_cb" swapped="no"/>
                       </object>
                       <attributes>
                         <attribute name="text">0</attribute>
@@ -287,7 +251,7 @@
                     <property name="clickable">True</property>
                     <child>
                       <object class="GtkCellRendererToggle" 
id="GNUNET_GNS_GTK_ispublic_cellrenderertoggle">
-                        <signal name="toggled" 
handler="GNUNET_GNS_GTK_ispublic_cellrenderertoggle_toggled_cb"/>
+                        <signal name="toggled" 
handler="GNUNET_GNS_GTK_ispublic_cellrenderertoggle_toggled_cb" swapped="no"/>
                       </object>
                       <attributes>
                         <attribute name="active">1</attribute>
@@ -307,7 +271,7 @@
                     <child>
                       <object class="GtkCellRendererCombo" 
id="GNUNET_GNS_GTK_type_cellrenderercombo">
                         <property name="editable">True</property>
-                        <signal name="changed" 
handler="GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb"/>
+                        <signal name="changed" 
handler="GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb" swapped="no"/>
                       </object>
                       <attributes>
                         <attribute name="text-column">3</attribute>
@@ -324,7 +288,7 @@
                     <child>
                       <object class="GtkCellRendererText" 
id="GNUNET_GNS_GTK_expiration_cellrenderertext">
                         <property name="editable">True</property>
-                        <signal name="edited" 
handler="GNUNET_GNS_GTK_expiration_cellrenderertext_edited_cb"/>
+                        <signal name="edited" 
handler="GNUNET_GNS_GTK_expiration_cellrenderertext_edited_cb" swapped="no"/>
                       </object>
                       <attributes>
                         <attribute name="text">6</attribute>
@@ -340,7 +304,7 @@
                     <property name="sort_column_id">7</property>
                     <child>
                       <object class="GtkCellRendererText" 
id="GNUNET_GNS_GTK_value_cellrenderertext">
-                        <signal name="edited" 
handler="GNUNET_GNS_GTK_value_cellrenderertext_edited_cb"/>
+                        <signal name="edited" 
handler="GNUNET_GNS_GTK_value_cellrenderertext_edited_cb" swapped="no"/>
                       </object>
                       <attributes>
                         <attribute name="background">8</attribute>
@@ -353,10 +317,84 @@
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">2</property>
           </packing>
         </child>
       </object>
     </child>
   </object>
+  <object class="GtkTreeStore" id="GNUNET_GNS_GTK_treestore">
+    <columns>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name is_public -->
+      <column type="gboolean"/>
+      <!-- column-name record_type -->
+      <column type="guint"/>
+      <!-- column-name record_type_as_string -->
+      <column type="gchararray"/>
+      <!-- column-name expiration_time -->
+      <column type="guint64"/>
+      <!-- column-name expiration_time_is_relative -->
+      <column type="gboolean"/>
+      <!-- column-name expiration_time_as_string -->
+      <column type="gchararray"/>
+      <!-- column-name value_as_string -->
+      <column type="gchararray"/>
+      <!-- column-name value_color -->
+      <column type="gchararray"/>
+    </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.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk.c 2012-03-14 20:46:46 UTC (rev 20505)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk.c 2012-03-14 21:25:59 UTC (rev 20506)
@@ -67,7 +67,7 @@
    */
   struct GNUNET_NAMESTORE_Handle *ns;
 
-  GtkBuilder builder;
+  GtkBuilder *builder;
 
 
 };
@@ -245,6 +245,7 @@
 static void
 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
+
   struct GNUNET_GNS_Context *gns = cls;
   GNUNET_assert (gns != NULL);
   if (NULL != gns->ns)
@@ -383,20 +384,14 @@
     return;
   }
 
-  struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct 
ZoneIteration_Context));
-  zc_ctx->zone = zone;
-  GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &zone,
-      GNUNET_NAMESTORE_RF_NONE,
-      GNUNET_NAMESTORE_RF_NONE,
-      &zone_iteration_proc,
-      zc_ctx);
-
   if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, gns))
   {
     GNUNET_break (0);
     GNUNET_SCHEDULER_add_now (&shutdown_task, gns);
     return;
   }
+  gns->builder = GNUNET_GTK_main_loop_get_builder(ml);
+
   zone_as_string = GNUNET_strdup (GNUNET_h2s_full (&zone));
   label = g_markup_printf_escaped (_("<b>Editing zone %s</b>"),
                                   zone_as_string);
@@ -413,12 +408,21 @@
                                "gnunet-gtk" /* FIXME: different icon? */ ,
                                "gnunet-gns-gtk");
 
+  struct ZoneIteration_Context * zc_ctx = GNUNET_malloc (sizeof (struct 
ZoneIteration_Context));
+  zc_ctx->zone = zone;
+  GNUNET_NAMESTORE_zone_iteration_start(gns->ns, &zone,
+      GNUNET_NAMESTORE_RF_NONE,
+      GNUNET_NAMESTORE_RF_NONE,
+      &zone_iteration_proc,
+      zc_ctx);
+
   /* make GUI visible */
   if (!tray_only)
   {
     gtk_widget_show (main_window);
     gtk_window_present (GTK_WINDOW (main_window));
   }
+
 }
 
 

Modified: gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c    2012-03-14 20:46:46 UTC (rev 
20505)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk_zone.c    2012-03-14 21:25:59 UTC (rev 
20506)
@@ -140,7 +140,43 @@
   return FALSE;
 }
 
+enum
+{
+  COL_FIRST_NAME = 0,
+  COL_LAST_NAME,
+  COL_YEAR_BORN,
+  NUM_COLS
+} ;
 
+static void
+test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  struct GNUNET_GNS_Context *gns=cls;
+  GtkBuilder *builder = gns->builder;
+  GtkTreeStore *ts;
+  GtkTreeIter  toplevel, child;
+
+  ts  = GTK_TREE_STORE (gtk_builder_get_object (builder, 
"GNUNET_GNS_GTK_treestore"));
+  GNUNET_assert (ts != NULL);
+
+  GNUNET_break (0);
+  /* Append a top level row and leave it empty */
+  gtk_tree_store_append(ts, &toplevel, NULL);
+  /*
+  gtk_tree_store_set(ts, &toplevel,
+                     COL_FIRST_NAME, "Maria",
+                     COL_LAST_NAME, "Incognito",
+                     -1);*/
+}
+
+void
+GNUNET_GNS_GTK_main_treeview_click_cb (GtkTreeViewColumn *treeviewcolumn,
+                                      gpointer user_data)
+{
+
+  GNUNET_SCHEDULER_add_now (&test, user_data);
+}
+
 /**
  * The zone treeview was realized.   Setup the model.
  *




reply via email to

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