gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29171 - in gnunet-gtk: contrib src/fs


From: gnunet
Subject: [GNUnet-SVN] r29171 - in gnunet-gtk: contrib src/fs
Date: Tue, 10 Sep 2013 21:04:41 +0200

Author: grothoff
Date: 2013-09-10 21:04:41 +0200 (Tue, 10 Sep 2013)
New Revision: 29171

Added:
   gnunet-gtk/contrib/gnunet_fs_gtk_enter_nick_dialog.glade
   gnunet-gtk/contrib/gnunet_fs_gtk_pseu_progress_dialog.glade
Modified:
   gnunet-gtk/contrib/Makefile.am
   gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade
   gnunet-gtk/contrib/gnunet_fs_gtk_open_url_dialog.glade
   gnunet-gtk/src/fs/Makefile.am
   gnunet-gtk/src/fs/gnunet-fs-gtk.h
   gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c
   gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c
Log:
implemented #3024, but untested

Modified: gnunet-gtk/contrib/Makefile.am
===================================================================
--- gnunet-gtk/contrib/Makefile.am      2013-09-10 19:04:16 UTC (rev 29170)
+++ gnunet-gtk/contrib/Makefile.am      2013-09-10 19:04:41 UTC (rev 29171)
@@ -31,6 +31,7 @@
   gnunet_fs_gtk_download_as_dialog.glade \
   gnunet_fs_gtk_main_window.glade \
   gnunet_fs_gtk_edit_publication.glade \
+  gnunet_fs_gtk_enter_nick_dialog.glade \
   gnunet_fs_gtk_open_directory_dialog.glade \
   gnunet_fs_gtk_open_url_dialog.glade \
   gnunet_fs_gtk_publish_dialog.glade \
@@ -39,6 +40,7 @@
   gnunet_fs_gtk_publish_tab.glade \
   gnunet_fs_gtk_search_tab.glade \
   gnunet_fs_gtk_unindex.glade \
+  gnunet_fs_gtk_pseu_progress_dialog.glade \
   gnunet_fs_gtk_progress_dialog.glade \
   gnunet_gtk_status_bar_menu.glade \
   gnunet_identity_gtk_about_window.glade \

Added: gnunet-gtk/contrib/gnunet_fs_gtk_enter_nick_dialog.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_fs_gtk_enter_nick_dialog.glade                    
        (rev 0)
+++ gnunet-gtk/contrib/gnunet_fs_gtk_enter_nick_dialog.glade    2013-09-10 
19:04:41 UTC (rev 29171)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="2.24"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkWindow" id="GNUNET_GTK_enter_nick_window">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Enter the desired nickname for 
the namespace</property>
+    <property name="modal">True</property>
+    <property name="default_width">640</property>
+    <property name="default_height">240</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="skip_taskbar_hint">True</property>
+    <property name="skip_pager_hint">True</property>
+    <property name="deletable">False</property>
+    <signal name="delete-event" 
handler="GNUNET_GTK_enter_nick_window_delete_event_cb" swapped="no"/>
+    <child>
+      <object class="GtkVBox" id="GNUNET_GTK_enter_nick_window_main_vbox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkHBox" id="GNUNET_GTK_enter_nick_window__nick_hbox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" 
id="GNUNET_GTK_enter_nick_window_nick_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">_Nickname:</property>
+                <property name="use_underline">True</property>
+                <property 
name="mnemonic_widget">GNUNET_GTK_open_url_dialog_url_textview</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">5</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" 
id="GNUNET_GTK_enter_nick_window_nick_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <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_GTK_enter_nick_window_nick_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>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">5</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" 
id="GNUNET_GTK_enter_nick_window_dialog_button_hbox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" 
id="GNUNET_GTK_enter_nick_window_execute_button">
+                <property name="label">gtk-execute</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_underline">True</property>
+                <property name="use_stock">True</property>
+                <property name="image_position">right</property>
+                <signal name="clicked" 
handler="GNUNET_GTK_enter_nick_window_execute_button_clicked_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" 
id="GNUNET_GTK_enter_nick_window_cancel_button">
+                <property name="label">gtk-cancel</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" 
handler="GNUNET_GTK_enter_nick_window_cancel_button_clicked_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">4</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkImage" id="execute-stock-image">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-execute</property>
+  </object>
+</interface>

Modified: gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade  2013-09-10 19:04:16 UTC 
(rev 29170)
+++ gnunet-gtk/contrib/gnunet_fs_gtk_main_window.glade  2013-09-10 19:04:41 UTC 
(rev 29171)
@@ -32,6 +32,30 @@
       <column type="guint"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="GNUNET_GTK_meta_data_list_store">
+    <columns>
+      <!-- column-name extractor_meta_type -->
+      <column type="guint"/>
+      <!-- column-name extractor_meta_format -->
+      <column type="guint"/>
+      <!-- column-name extractor_meta_type_string -->
+      <column type="gchararray"/>
+      <!-- column-name extracotr_meta_value -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+    <property name="page_size">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment2">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+    <property name="page_size">10</property>
+  </object>
   <object class="GtkWindow" id="GNUNET_GTK_main_window">
     <property name="can_focus">False</property>
     <property name="events">GDK_BUTTON_PRESS_MASK | 
GDK_STRUCTURE_MASK</property>
@@ -352,8 +376,8 @@
                 <property name="use_action_appearance">False</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="tooltip_text" translatable="yes">Remember the 
specified namespace for later.</property>
-                <property name="relief">none</property>
+                <property name="tooltip_text" translatable="yes">Remember the 
specified namespace for later.
+This operation will be executed using the anonymity level specified on the 
right.</property>
                 <property name="use_stock">True</property>
                 <property name="image_position">top</property>
                 <signal name="clicked" 
handler="GNUNET_FS_GTK_save_button_clicked_cb" swapped="no"/>
@@ -417,6 +441,9 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
+                    <property name="tooltip_text" translatable="yes">Search 
using the given keywords.  The search may be narrowed by the given mime type 
and/or restricted to a namespace.
+This operation will be executed using the anonymity level specified on the 
right.
+</property>
                     <property name="image">find_stock_image</property>
                     <property name="image_position">top</property>
                     <signal name="clicked" 
handler="main_window_search_button_clicked_cb" swapped="no"/>
@@ -907,38 +934,6 @@
       </object>
     </child>
   </object>
-  <object class="GtkListStore" id="GNUNET_GTK_select_pseudonym_liststore">
-    <columns>
-      <!-- column-name namespace_name -->
-      <column type="gchararray"/>
-      <!-- column-name namespace_handle -->
-      <column type="gpointer"/>
-    </columns>
-  </object>
-  <object class="GtkAdjustment" id="adjustment1">
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-    <property name="page_size">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment2">
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-    <property name="page_size">10</property>
-  </object>
-  <object class="GtkListStore" id="GNUNET_GTK_meta_data_list_store">
-    <columns>
-      <!-- column-name extractor_meta_type -->
-      <column type="guint"/>
-      <!-- column-name extractor_meta_format -->
-      <column type="guint"/>
-      <!-- column-name extractor_meta_type_string -->
-      <column type="gchararray"/>
-      <!-- column-name extracotr_meta_value -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
   <object class="GtkListStore" id="GNUNET_GTK_peer_info_list_store">
     <columns>
       <!-- column-name peer_identity -->
@@ -953,6 +948,14 @@
       <column type="guint64"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="GNUNET_GTK_select_pseudonym_liststore">
+    <columns>
+      <!-- column-name namespace_name -->
+      <column type="gchararray"/>
+      <!-- column-name namespace_handle -->
+      <column type="gpointer"/>
+    </columns>
+  </object>
   <object class="GtkAdjustment" id="adjustment3">
     <property name="upper">100</property>
     <property name="step_increment">1</property>

Modified: gnunet-gtk/contrib/gnunet_fs_gtk_open_url_dialog.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_fs_gtk_open_url_dialog.glade      2013-09-10 
19:04:16 UTC (rev 29170)
+++ gnunet-gtk/contrib/gnunet_fs_gtk_open_url_dialog.glade      2013-09-10 
19:04:41 UTC (rev 29171)
@@ -1,8 +1,17 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="2.20"/>
   <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkTextBuffer" 
id="GNUNET_GTK_open_url_dialog_url_textview_buffer">
+    <signal name="changed" 
handler="GNUNET_GTK_open_url_dialog_url_textview_buffer_changed_cb" 
swapped="no"/>
+  </object>
+  <object class="GtkImage" id="execute-stock-image">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-execute</property>
+  </object>
   <object class="GtkWindow" id="GNUNET_GTK_open_url_window">
+    <property name="can_focus">False</property>
     <property name="title" translatable="yes">Enter the URI to be 
downloaded</property>
     <property name="modal">True</property>
     <property name="default_width">640</property>
@@ -11,18 +20,20 @@
     <property name="skip_taskbar_hint">True</property>
     <property name="skip_pager_hint">True</property>
     <property name="deletable">False</property>
-    <signal name="delete_event" 
handler="GNUNET_GTK_open_url_window_delete_event_cb"/>
+    <signal name="delete-event" 
handler="GNUNET_GTK_open_url_window_delete_event_cb" swapped="no"/>
     <child>
       <object class="GtkVBox" id="GNUNET_GTK_open_url_dialog_main_vbox">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
+        <property name="can_focus">False</property>
         <property name="spacing">2</property>
         <child>
           <object class="GtkHBox" id="GNUNET_GTK_open_url_dialog_query_hbox">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <child>
               <object class="GtkLabel" 
id="GNUNET_GTK_open_url_dialog_url_label">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_URI:</property>
                 <property name="use_underline">True</property>
                 <property 
name="mnemonic_widget">GNUNET_GTK_open_url_dialog_url_textview</property>
@@ -37,11 +48,13 @@
             <child>
               <object class="GtkFrame" 
id="GNUNET_GTK_open_url_dialog_url_frame">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">in</property>
                 <child>
                   <object class="GtkAlignment" 
id="GNUNET_GTK_open_url_dialog_url_alignment">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkTextView" 
id="GNUNET_GTK_open_url_dialog_url_textview">
                         <property name="visible">True</property>
@@ -51,7 +64,7 @@
                         <property name="indent">20</property>
                         <property 
name="buffer">GNUNET_GTK_open_url_dialog_url_textview_buffer</property>
                         <property name="accepts_tab">False</property>
-                        <signal name="key_press_event" 
handler="GNUNET_GTK_open_url_dialog_url_textview_key_press_event_cb"/>
+                        <signal name="key-press-event" 
handler="GNUNET_GTK_open_url_dialog_url_textview_key_press_event_cb" 
swapped="no"/>
                       </object>
                     </child>
                   </object>
@@ -61,40 +74,83 @@
                 </child>
               </object>
               <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="padding">5</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkHBox" 
id="GNUNET_GTK_open_url_dialog_anonymity_hbox">
+          <object class="GtkHBox" id="GNUNET_GTK_open_url_dialog_button_hbox">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <child>
-              <object class="GtkLabel" 
id="GNUNET_GTK_open_url_dialog_anonymity_label">
+              <object class="GtkButton" 
id="GNUNET_GTK_open_url_dialog_execute_button">
+                <property name="label">_Execute</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
-                <property name="label" 
translatable="yes">_Anonymity:</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="image">execute-stock-image</property>
                 <property name="use_underline">True</property>
-                <property 
name="mnemonic_widget">GNUNET_GTK_open_url_dialog_anonymity_combobox</property>
+                <signal name="clicked" 
handler="GNUNET_GTK_open_url_dialog_execute_button_clicked_cb" swapped="no"/>
               </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
                 <property name="padding">4</property>
                 <property name="pack_type">end</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" 
id="GNUNET_GTK_open_url_dialog_cancel_button">
+                <property name="label">gtk-cancel</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" 
handler="GNUNET_GTK_open_url_dialog_cancel_button_clicked_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="pack_type">end</property>
                 <property name="position">1</property>
               </packing>
             </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="padding">4</property>
+            <property name="pack_type">end</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" 
id="GNUNET_GTK_open_url_dialog_anonymity_hbox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <child>
               <object class="GtkAlignment" 
id="GNUNET_GTK_open_url_dialog_anonymity_combobox_alignment">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="yscale">0</property>
                 <child>
                   <object class="GtkComboBox" 
id="GNUNET_GTK_open_url_dialog_anonymity_combobox">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="active">1</property>
                     <child>
                       <object class="GtkCellRendererText" 
id="GNUNET_GTK_open_url_dialog_anonymity_combobox_renderer"/>
@@ -119,24 +175,13 @@
                 <property name="position">0</property>
               </packing>
             </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHBox" id="GNUNET_GTK_open_url_dialog_button_hbox">
-            <property name="visible">True</property>
             <child>
-              <object class="GtkButton" 
id="GNUNET_GTK_open_url_dialog_cancel_button">
-                <property name="label">gtk-cancel</property>
+              <object class="GtkLabel" 
id="GNUNET_GTK_open_url_dialog_anonymity_label">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-                <signal name="clicked" 
handler="GNUNET_GTK_open_url_dialog_cancel_button_clicked_cb"/>
+                <property name="can_focus">False</property>
+                <property name="label" 
translatable="yes">_Anonymity:</property>
+                <property name="use_underline">True</property>
+                <property 
name="mnemonic_widget">GNUNET_GTK_open_url_dialog_anonymity_combobox</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -146,42 +191,14 @@
                 <property name="position">1</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkButton" 
id="GNUNET_GTK_open_url_dialog_execute_button">
-                <property name="label">_Execute</property>
-                <property name="visible">True</property>
-                <property name="sensitive">False</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="image">execute-stock-image</property>
-                <property name="use_underline">True</property>
-                <signal name="clicked" 
handler="GNUNET_GTK_open_url_dialog_execute_button_clicked_cb"/>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="padding">4</property>
-                <property name="pack_type">end</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="padding">4</property>
-            <property name="pack_type">end</property>
-            <property name="position">1</property>
+            <property name="position">2</property>
           </packing>
         </child>
       </object>
     </child>
   </object>
-  <object class="GtkTextBuffer" 
id="GNUNET_GTK_open_url_dialog_url_textview_buffer">
-    <signal name="changed" 
handler="GNUNET_GTK_open_url_dialog_url_textview_buffer_changed_cb"/>
-  </object>
-  <object class="GtkImage" id="execute-stock-image">
-    <property name="visible">True</property>
-    <property name="stock">gtk-execute</property>
-  </object>
 </interface>

Added: gnunet-gtk/contrib/gnunet_fs_gtk_pseu_progress_dialog.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_fs_gtk_pseu_progress_dialog.glade                 
        (rev 0)
+++ gnunet-gtk/contrib/gnunet_fs_gtk_pseu_progress_dialog.glade 2013-09-10 
19:04:41 UTC (rev 29171)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="2.20"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkAdjustment" 
id="GNUNET_FS_GTK_pseu_progress_bar_adjustment">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+    <property name="page_size">10</property>
+  </object>
+  <object class="GtkWindow" id="GNUNET_FS_GTK_pseu_progress_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">2</property>
+    <property name="title" translatable="yes">Preparing to save namespace in 
GNS zone</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">800</property>
+    <property name="default_height">600</property>
+    <property name="destroy_with_parent">True</property>
+    <signal name="delete-event" 
handler="GNUNET_FS_GTK_pseu_progress_dialog_delete_event_cb" swapped="no"/>
+    <child>
+      <object class="GtkVBox" 
id="GNUNET_FS_GTK_pseu_progress_dialog_main_vbox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkProgressBar" 
id="GNUNET_FS_GTK_pseu_progress_dialog_progressbar">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="activity_mode">True</property>
+            <property name="show_text">True</property>
+            <property name="pulse_step">0.050000000000000003</property>
+            <property name="text" translatable="yes">Trying to discover 
nickname...</property>
+            <property 
name="adjustment">GNUNET_FS_GTK_pseu_progress_bar_adjustment</property>
+            <property name="discrete_blocks">5</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" 
id="GNUNET_FS_GTK_pseu_progress_dialog_buttons_hbox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">2</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkButton" 
id="GNUNET_FS_GTK_pseu_progress_dialog_cancel_button">
+                <property name="label">gtk-cancel</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="tooltip_text" translatable="yes">If you cancel 
this operation, you can enter a nickname manually.</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" 
handler="GNUNET_FS_GTK_pseu_progress_dialog_cancel_button_clicked_cb" 
swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>

Modified: gnunet-gtk/src/fs/Makefile.am
===================================================================
--- gnunet-gtk/src/fs/Makefile.am       2013-09-10 19:04:16 UTC (rev 29170)
+++ gnunet-gtk/src/fs/Makefile.am       2013-09-10 19:04:41 UTC (rev 29171)
@@ -34,6 +34,7 @@
   -lextractor \
   -lgnunetutil \
   -lgnunetarm \
+  -lgnunetdnsparser \
   -lgnunetfs \
   -lgnunetgns \
   -lgnunetnamestore \

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk.h
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk.h   2013-09-10 19:04:16 UTC (rev 29170)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk.h   2013-09-10 19:04:41 UTC (rev 29171)
@@ -97,7 +97,48 @@
   /**
    * Lookup request with GNS.
    */
-  struct GNUNET_GNS_LookupRequest *lr;
+  struct GNUNET_GNS_LookupRequest *lr;  
+
+  /**
+   * Builder for the progress dialog that is displayed.
+   */
+  GtkBuilder *progress_dialog_builder;
+
+  /**
+   * The progress dialog itself.
+   */
+  GtkWidget *progress_dialog;
+
+  /**
+   * Builder for the nickname dialog that is displayed.
+   */
+  GtkBuilder *nick_dialog_builder;
+
+  /**
+   * The nick dialog itself.
+   */
+  GtkWidget *nick_dialog;
+
+  /**
+   * Handle to the namestore.
+   */
+  struct GNUNET_NAMESTORE_Handle *namestore;
+
+  /**
+   * Handle to our namestore request.
+   */
+  struct GNUNET_NAMESTORE_QueueEntry *qe;
+
+  /**
+   * Public key of the namespace we are trying to save.
+   */
+  struct GNUNET_CRYPTO_EccPublicKey pkey;  
+
+  /**
+   * Nickname we're saving under.
+   */
+  char *nick;
+
 };
 
 

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c        2013-09-10 
19:04:16 UTC (rev 29170)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c        2013-09-10 
19:04:41 UTC (rev 29171)
@@ -307,28 +307,212 @@
 {
   struct GNUNET_GTK_MainWindowContext *main_ctx = lctx->main_ctx;
 
+  if (NULL != lctx->progress_dialog_builder)
+  {
+    gtk_widget_destroy (lctx->progress_dialog);
+    g_object_unref (G_OBJECT (lctx->progress_dialog_builder));  
+    lctx->progress_dialog_builder = NULL;
+  }
+  if (NULL != lctx->nick_dialog_builder)
+  {
+    gtk_widget_destroy (lctx->nick_dialog);
+    g_object_unref (G_OBJECT (lctx->nick_dialog_builder));  
+    lctx->nick_dialog_builder = NULL;
+  }
+
   if (NULL != lctx->lr)
   {
     GNUNET_GNS_lookup_cancel (lctx->lr);
     lctx->lr = NULL;
   }
+  if (NULL != lctx->qe)
+  {
+    GNUNET_NAMESTORE_cancel (lctx->qe);
+    lctx->qe = NULL;
+  }
+  if (NULL != lctx->namestore)
+  {
+    GNUNET_NAMESTORE_disconnect (lctx->namestore);
+    lctx->namestore = NULL;
+  }
   GNUNET_CONTAINER_DLL_remove (main_ctx->lctx_head,
                               main_ctx->lctx_tail,
                               lctx);
+  GNUNET_free_non_null (lctx->nick);
   GNUNET_free (lctx);
 }
 
 
 /**
+ * Continuation called to notify client about result of the
+ * operation.
+ *
+ * @param cls closure
+ * @param success #GNUNET_SYSERR on failure (including timeout/queue 
drop/failure to validate)
+ *                #GNUNET_NO if content was already there or not found
+ *                #GNUNET_YES (or other positive value) on success
+ * @param emsg NULL on success, otherwise an error message
+ */
+static void
+store_continuation (void *cls,
+                   int32_t success,
+                   const char *emsg)
+{
+  struct PseuLookupContext *lctx = cls;
+
+  lctx->qe = NULL;
+  if (NULL != emsg)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               _("Failed to save record: %s\n"),
+               emsg);
+    gdk_beep ();
+  }
+  abort_pseu_lookup (lctx);
+}
+
+
+/**
+ * Save the namespace under the given nickname.
+ *
+ * @param lctx namespace request we are processing
+ * @param nick nickname to store the namespace under
+ */
+static void
+save_pseudonym_with_nick (struct PseuLookupContext *lctx,
+                         const char *nick)
+{
+  struct GNUNET_NAMESTORE_RecordData rd;
+  struct GNUNET_GTK_MainWindowContext *main_ctx;
+
+  GNUNET_break (NULL == lctx->nick);
+  lctx->nick = GNUNET_strdup (nick);
+  /* again, show progress indicator, this should be fast though... */
+  lctx->progress_dialog_builder
+    = GNUNET_GTK_get_new_builder 
+    ("gnunet_fs_gtk_pseu_progress_dialog.glade", 
+     lctx);
+  lctx->progress_dialog 
+    = GTK_WIDGET (gtk_builder_get_object 
+                 (lctx->progress_dialog_builder,
+                  "GNUNET_FS_GTK_pseu_progress_dialog"));
+  /* show the window */
+  gtk_window_present (GTK_WINDOW (lctx->progress_dialog));
+  memset (&rd, 0, sizeof (rd));
+  rd.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicKey);
+  rd.data = &lctx->pkey;
+  rd.flags = GNUNET_NAMESTORE_RF_PRIVATE;
+  rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
+  rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
+  main_ctx = GNUNET_FS_GTK_get_main_context ();
+  lctx->namestore = GNUNET_NAMESTORE_connect (main_ctx->cfg);
+  GNUNET_assert (NULL != lctx->namestore);
+  lctx->qe = GNUNET_NAMESTORE_records_store (lctx->namestore,
+                                            main_ctx->sks_zone,
+                                            nick,
+                                            1, &rd,
+                                            &store_continuation, lctx);
+}
+
+
+/**
+ * User clicked on the 'execute' button in nickname dialog.
+ * Store the selected namespace in the "sks-fs" zone under
+ * the given nickname.
+ *
+ * @param button the "execute" button
+ * @param user_data the `struct PseuLookupContext`
+ */
+void
+GNUNET_GTK_enter_nick_window_execute_button_clicked_cb (GtkButton * button, 
+                                                       gpointer user_data)
+{
+  struct PseuLookupContext *lctx = user_data;
+  GtkEntry *entry;
+  const char *nick;
+  
+  entry = GTK_ENTRY (gtk_builder_get_object 
+                    (lctx->nick_dialog_builder,
+                     "GNUNET_GTK_enter_nick_window_nick_entry"));
+  nick = gtk_entry_get_text (entry);
+  if ( (NULL == nick) ||
+       (0 == strlen (nick) ))
+  {
+    GNUNET_break (0);
+    abort_pseu_lookup (lctx);
+    return;
+  }
+  save_pseudonym_with_nick (lctx, nick);
+  gtk_widget_destroy (lctx->nick_dialog);
+  g_object_unref (G_OBJECT (lctx->nick_dialog_builder));  
+  lctx->nick_dialog_builder = NULL;  
+}
+
+
+/**
+ * User edited the nickname.  Update sensitivity of the execute button.
+ *
+ * @param widget the entry that was changed
+ * @param user_data the `struct PseuLookupContext`
+ */
+void
+GNUNET_GTK_enter_nick_window_nick_entry_changed_cb (GtkWidget *widget, 
+                                                   gpointer user_data)
+{
+  struct PseuLookupContext *lctx = user_data;
+  const gchar *new_text;
+  GtkButton * button;
+
+  new_text = gtk_entry_get_text (GTK_ENTRY (widget));
+  button = GTK_BUTTON (gtk_builder_get_object (lctx->nick_dialog_builder,
+                                              
"GNUNET_GTK_enter_nick_window_execute_button"));
+  gtk_widget_set_sensitive (GTK_WIDGET (button),
+                           (GNUNET_OK == GNUNET_DNSPARSER_check_label 
(new_text)) ? TRUE : FALSE);
+}
+
+
+/**
+ * User clicked on the 'cancel' button in nickname dialog.
+ * Abort the operation.
+ *
+ * @param button the "cancel" button
+ * @param user_data the `struct PseuLookupContext`
+ */
+void
+GNUNET_GTK_enter_nick_window_cancel_button_clicked_cb (GtkButton * button, 
+                                                      gpointer user_data)
+{
+  struct PseuLookupContext *lctx = user_data;
+
+  abort_pseu_lookup (lctx);
+}
+
+
+/**
+ * Run the dialog asking the user to specify a nickname for
+ * the namespace.
+ *
+ * @param lctx namespace request we are processing
+ */
+static void
+ask_for_nickname (struct PseuLookupContext *lctx)
+{
+  /* setup the dialog and get the widgets we need most */
+  lctx->nick_dialog_builder = GNUNET_GTK_get_new_builder 
("gnunet_fs_gtk_enter_nick_dialog.glade",
+                                                         lctx);
+  lctx->progress_dialog = GTK_WIDGET (gtk_builder_get_object 
(lctx->progress_dialog_builder,
+                                                             
"GNUNET_GTK_enter_nick_window"));
+  /* show the window */
+  gtk_window_present (GTK_WINDOW (lctx->progress_dialog));  
+}
+
+
+/**
  * Iterator called on obtained result for a GNS lookup for
  * the PSEU lookup when "saving" a zone.  The actual saving
  * should already have happened via the shortening of GNS,
  * so we only need to clean up.
  *
- * FIXME: this is a drastic simplification, as shortening
- * may fail (name used, PSEU record not found); in those
- * cases, we should _still_ do something here...
- *
  * @param cls closure with the `struct PseuLookupContext`
  * @param rd_count number of records in @a rd
  * @param rd the records in reply
@@ -339,21 +523,107 @@
                 const struct GNUNET_NAMESTORE_RecordData *rd)
 {
   struct PseuLookupContext *lctx = cls;
+  unsigned int i;
+  const char *nick;
 
-  /* FIXME: might want to give visual feedback to the user here */
   lctx->lr = NULL;
-  abort_pseu_lookup (lctx);
+  if (NULL != lctx->progress_dialog_builder)
+  {
+    gtk_widget_destroy (lctx->progress_dialog);
+    g_object_unref (G_OBJECT (lctx->progress_dialog_builder));  
+    lctx->progress_dialog_builder = NULL;
+  }
+  for (i=0;i<rd_count;i++)
+  {
+    if (GNUNET_NAMESTORE_TYPE_PSEU == rd[i].record_type)
+    {
+      nick = rd[i].data;
+      if ('\0' != nick[rd[i].data_size - 1])
+      {
+       GNUNET_break (0);
+       continue;
+      }
+      save_pseudonym_with_nick (lctx,
+                               nick);
+      return;
+    }
+  }
+  /* no valid PSEU record found */
+  ask_for_nickname (lctx);
 }
 
 
 /**
+ * User clicked on the 'cancel' button of the progress dialog.
+ * Cancel the operation.
+ *
+ * @param button the cancel button
+ * @param user_data the `struct PseuLookupContext` of our window
+ */
+void
+GNUNET_FS_GTK_pseu_progress_dialog_cancel_button_clicked_cb (GtkButton *button,
+                                                            gpointer user_data)
+{
+  struct PseuLookupContext *lctx = user_data;
+
+  if (NULL != lctx->progress_dialog_builder)
+  {
+    gtk_widget_destroy (lctx->progress_dialog);
+    g_object_unref (G_OBJECT (lctx->progress_dialog_builder));  
+    lctx->progress_dialog_builder = NULL;
+  }
+  if (NULL != lctx->nick)
+    abort_pseu_lookup (lctx);
+  else
+    ask_for_nickname (lctx);
+}
+
+
+/**
+ * User attempted to close the nick dialog.  Refuse.
+ *
+ * @param widget the widget emitting the event
+ * @param event the event
+ * @param cls progress dialog context of our window
+ * @return TRUE to refuse to close
+ */
+gboolean
+GNUNET_GTK_enter_nick_window_delete_event_cb (GtkWidget *widget,
+                                             GdkEvent * event,
+                                             void *cls)
+{
+  /* Don't allow GTK to kill the window, user must click execute or cancel */
+  gdk_beep ();
+  return TRUE;
+}
+
+
+/**
+ * User attempted to close the progress dialog.  Refuse.
+ *
+ * @param widget the widget emitting the event
+ * @param event the event
+ * @param cls progress dialog context of our window
+ * @return TRUE to refuse to close
+ */
+gboolean
+GNUNET_FS_GTK_pseu_progress_dialog_delete_event_cb (GtkWidget *widget,
+                                                   GdkEvent * event,
+                                                   void *cls)
+{
+  /* Don't allow GTK to kill the window, until the search is finished */
+  gdk_beep ();
+  return TRUE;
+}
+
+
+/**
  * User clicked on the 'save' button in the search line of the main window.
  * Store the selected namespace in the "sks-fs" zone.
  *
  * @param button the "save" button
  * @param user_data the main window context builder
  */
-
 void
 GNUNET_FS_GTK_save_button_clicked_cb (GtkButton * button, 
                                      gpointer user_data)
@@ -364,12 +634,20 @@
   struct GNUNET_CRYPTO_EccPublicKey pkey;
   int ret;
   struct PseuLookupContext *lctx;
+  guint anonymity_level;
 
   if (NULL == main_ctx->gns)
   {
     GNUNET_break (0);
     return;
   }
+  /* get anonymity level */
+  if (!GNUNET_GTK_get_selected_anonymity_level
+      (main_ctx->builder, "main_window_search_anonymity_combobox", 
&anonymity_level))
+  {
+    GNUNET_break (0);
+    return;
+  }
   widget = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object
                       ("main_window_search_namespace_combobox"));
   text = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))));
@@ -380,20 +658,37 @@
     return;
   }
   lctx = GNUNET_new (struct PseuLookupContext);
+  lctx->pkey = pkey;
   lctx->main_ctx = main_ctx;
   GNUNET_CONTAINER_DLL_insert (main_ctx->lctx_head,
                               main_ctx->lctx_tail,
                               lctx);
-  lctx->lr = GNUNET_GNS_lookup (main_ctx->gns,
-                               GNUNET_GNS_MASTERZONE_STR,
-                               &pkey,
-                               GNUNET_NAMESTORE_TYPE_PSEU,
-                               GNUNET_NO,
-                               main_ctx->sks_zone /* FIXME: may want more 
explicit
-                                                     control than using 
shortening here */,
-                               &lookup_finished,
-                               lctx);
-  /* give visual feedback that something is happening */
+
+  if (0 == anonymity_level)
+  {
+    /* setup the dialog and get the widgets we need most */
+    lctx->progress_dialog_builder = GNUNET_GTK_get_new_builder 
("gnunet_fs_gtk_pseu_progress_dialog.glade", 
+                                                               lctx);
+    lctx->progress_dialog = GTK_WIDGET (gtk_builder_get_object 
(lctx->progress_dialog_builder,
+                                                               
"GNUNET_FS_GTK_pseu_progress_dialog"));
+    /* show the window */
+    gtk_window_present (GTK_WINDOW (lctx->progress_dialog));
+    lctx->lr = GNUNET_GNS_lookup (main_ctx->gns,
+                                 GNUNET_GNS_MASTERZONE_STR,
+                                 &pkey,
+                                 GNUNET_NAMESTORE_TYPE_PSEU,
+                                 GNUNET_NO,
+                                 NULL,
+                                 &lookup_finished,
+                                 lctx);
+  }
+  else
+  {
+    /* anonymous operation; cannot use GNS/DHT, so user
+       must make a suggestion himself */
+    ask_for_nickname (lctx);
+  }
+  /* do not allow save again just yet */
   gtk_widget_set_sensitive (GTK_WIDGET (button),
                            FALSE);
 }

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c    2013-09-10 19:04:16 UTC 
(rev 29170)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c    2013-09-10 19:04:41 UTC 
(rev 29171)
@@ -1472,7 +1472,7 @@
  *
  * @param cls  progress dialog context of our window
  * @param filename filename this update is about, can be NULL
- * @param is_directory is this file a directory, SYSERR if not applicable
+ * @param is_directory is this file a directory, #GNUNET_SYSERR if not 
applicable
  * @param reason kind of progress that was made
  */
 static void




reply via email to

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