[nautilus] gtkplacesview: Update to last code



commit 7e4d73d68231b5d665628277002e62fbed2fd543
Author: Carlos Soriano <csoriano gnome org>
Date:   Sat Apr 22 20:11:37 2017 +0200

    gtkplacesview: Update to last code

 src/gtk/nautilusgtkplacesview.c     |   40 +++++++++++++++++----------
 src/gtk/nautilusgtkplacesview.ui    |   51 ++++++++++++++++++++++++++++++++--
 src/gtk/nautilusgtkplacesviewrow.ui |    2 +-
 3 files changed, 74 insertions(+), 19 deletions(-)
---
diff --git a/src/gtk/nautilusgtkplacesview.c b/src/gtk/nautilusgtkplacesview.c
index 4eb0275..de0610e 100644
--- a/src/gtk/nautilusgtkplacesview.c
+++ b/src/gtk/nautilusgtkplacesview.c
@@ -27,7 +27,7 @@
 #include "nautilusgtkplacesviewprivate.h"
 #include "nautilusgtkplacesviewrowprivate.h"
 
-/*
+/**
  * SECTION:nautilusgtkplacesview
  * @Short_description: Widget that displays persistent drives and manages mounted networks
  * @Title: NautilusGtkPlacesView
@@ -187,7 +187,7 @@ server_list_load (NautilusGtkPlacesView *view)
 
   priv = nautilus_gtk_places_view_get_instance_private (view);
   bookmarks = g_bookmark_file_new ();
-  datadir = g_build_filename (g_get_user_config_dir (), "gtk-4.0", NULL);
+  datadir = g_build_filename (g_get_user_config_dir (), "gtk-3.0", NULL);
   filename = g_build_filename (datadir, "servers", NULL);
 
   g_mkdir_with_parents (datadir, 0700);
@@ -245,7 +245,7 @@ server_list_save (GBookmarkFile *bookmarks)
 {
   gchar *filename;
 
-  filename = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "servers", NULL);
+  filename = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "servers", NULL);
   g_bookmark_file_to_file (bookmarks, filename, NULL);
   g_free (filename);
 }
@@ -573,6 +573,7 @@ populate_servers (NautilusGtkPlacesView *view)
 
       grid = g_object_new (GTK_TYPE_GRID,
                            "orientation", GTK_ORIENTATION_VERTICAL,
+                           "border-width", 3,
                            NULL);
 
       /* name of the connected uri, if any */
@@ -614,6 +615,8 @@ populate_servers (NautilusGtkPlacesView *view)
                                 G_CALLBACK (on_remove_server_button_clicked),
                                 data);
 
+      gtk_widget_show_all (row);
+
       g_free (name);
     }
 
@@ -885,14 +888,14 @@ update_network_state (NautilusGtkPlacesView *view)
        * otherwise just show the spinner in the header */
       if (!has_networks (view))
         {
-          gtk_widget_show (priv->network_placeholder);
+          gtk_widget_show_all (priv->network_placeholder);
           gtk_label_set_text (GTK_LABEL (priv->network_placeholder_label),
                               _("Searching for network locations"));
         }
     }
   else if (!has_networks (view))
     {
-      gtk_widget_show (priv->network_placeholder);
+      gtk_widget_show_all (priv->network_placeholder);
       gtk_label_set_text (GTK_LABEL (priv->network_placeholder_label),
                           _("No network locations found"));
     }
@@ -1629,6 +1632,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
                     "activate",
                     G_CALLBACK (open_cb),
                     row);
+  gtk_widget_show (item);
   gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
 
   if (priv->open_flags & GTK_PLACES_OPEN_NEW_TAB)
@@ -1638,6 +1642,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
                         "activate",
                         G_CALLBACK (open_in_new_tab_cb),
                         row);
+      gtk_widget_show (item);
       gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
     }
 
@@ -1648,6 +1653,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
                         "activate",
                         G_CALLBACK (open_in_new_window_cb),
                         row);
+      gtk_widget_show (item);
       gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
     }
 
@@ -1660,6 +1666,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
 
   /* Separator */
   item = gtk_separator_menu_item_new ();
+  gtk_widget_show (item);
   gtk_menu_shell_insert (GTK_MENU_SHELL (priv->popup_menu), item, -1);
 
   /* Mount/Unmount items */
@@ -1670,6 +1677,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
                         "activate",
                         G_CALLBACK (unmount_cb),
                         row);
+      gtk_widget_show (item);
       gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
     }
   else
@@ -1679,6 +1687,7 @@ build_popup_menu (NautilusGtkPlacesView    *view,
                         "activate",
                         G_CALLBACK (mount_cb),
                         row);
+      gtk_widget_show (item);
       gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), item);
     }
 }
@@ -2016,6 +2025,7 @@ listbox_header_func (GtkListBoxRow *row,
         }
 
       gtk_container_add (GTK_CONTAINER (header), separator);
+      gtk_widget_show_all (header);
 
       gtk_list_box_row_set_header (row, header);
 
@@ -2147,7 +2157,7 @@ nautilus_gtk_places_view_class_init (NautilusGtkPlacesViewClass *klass)
   widget_class->destroy = nautilus_gtk_places_view_destroy;
   widget_class->map = nautilus_gtk_places_view_map;
 
-  /*
+  /**
    * NautilusGtkPlacesView::open-location:
    * @view: the object which received the signal.
    * @location: (type Gio.File): #GFile to which the caller should switch.
@@ -2171,7 +2181,7 @@ nautilus_gtk_places_view_class_init (NautilusGtkPlacesViewClass *klass)
                         G_TYPE_OBJECT,
                         GTK_TYPE_PLACES_OPEN_FLAGS);
 
-  /*
+  /**
    * NautilusGtkPlacesView::show-error-message:
    * @view: the object which received the signal.
    * @primary: primary message with a summary of the error to show.
@@ -2266,7 +2276,7 @@ nautilus_gtk_places_view_init (NautilusGtkPlacesView *self)
   gtk_widget_init_template (GTK_WIDGET (self));
 }
 
-/*
+/**
  * nautilus_gtk_places_view_new:
  *
  * Creates a new #NautilusGtkPlacesView widget.
@@ -2285,7 +2295,7 @@ nautilus_gtk_places_view_new (void)
   return g_object_new (NAUTILUS_TYPE_GTK_PLACES_VIEW, NULL);
 }
 
-/*
+/**
  * nautilus_gtk_places_view_set_open_flags:
  * @view: a #NautilusGtkPlacesView
  * @flags: Bitmask of modes in which the calling application can open locations
@@ -2325,7 +2335,7 @@ nautilus_gtk_places_view_set_open_flags (NautilusGtkPlacesView      *view,
     }
 }
 
-/*
+/**
  * nautilus_gtk_places_view_get_open_flags:
  * @view: a #GtkPlacesSidebar
  *
@@ -2347,7 +2357,7 @@ nautilus_gtk_places_view_get_open_flags (NautilusGtkPlacesView *view)
   return priv->open_flags;
 }
 
-/*
+/**
  * nautilus_gtk_places_view_get_search_query:
  * @view: a #NautilusGtkPlacesView
  *
@@ -2367,7 +2377,7 @@ nautilus_gtk_places_view_get_search_query (NautilusGtkPlacesView *view)
   return priv->search_query;
 }
 
-/*
+/**
  * nautilus_gtk_places_view_set_search_query:
  * @view: a #NautilusGtkPlacesView
  * @query_text: the query, or NULL.
@@ -2397,7 +2407,7 @@ nautilus_gtk_places_view_set_search_query (NautilusGtkPlacesView *view,
     }
 }
 
-/*
+/**
  * nautilus_gtk_places_view_get_loading:
  * @view: a #NautilusGtkPlacesView
  *
@@ -2479,7 +2489,7 @@ nautilus_gtk_places_view_set_fetching_networks (NautilusGtkPlacesView *view,
     }
 }
 
-/*
+/**
  * nautilus_gtk_places_view_get_local_only:
  * @view: a #NautilusGtkPlacesView
  *
@@ -2502,7 +2512,7 @@ nautilus_gtk_places_view_get_local_only (NautilusGtkPlacesView *view)
   return priv->local_only;
 }
 
-/*
+/**
  * nautilus_gtk_places_view_set_local_only:
  * @view: a #NautilusGtkPlacesView
  * @local_only: %TRUE to hide remote locations, %FALSE to show.
diff --git a/src/gtk/nautilusgtkplacesview.ui b/src/gtk/nautilusgtkplacesview.ui
index 39a1c5d..c366fde 100644
--- a/src/gtk/nautilusgtkplacesview.ui
+++ b/src/gtk/nautilusgtkplacesview.ui
@@ -19,11 +19,13 @@
     <property name="relative-to">address_entry</property>
     <child>
       <object class="GtkBox">
+        <property name="visible">1</property>
+        <property name="border-width">18</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
-        <property name="margin">18</property>
         <child>
           <object class="GtkLabel">
+            <property name="visible">1</property>
             <property name="hexpand">1</property>
             <property name="label" translatable="yes">Server Addresses</property>
             <attributes>
@@ -36,6 +38,7 @@
         </child>
         <child>
           <object class="GtkLabel">
+            <property name="visible">1</property>
             <property name="hexpand">1</property>
             <property name="label" translatable="yes">Server addresses are made up of a protocol prefix and 
an address. Examples:</property>
             <property name="wrap">1</property>
@@ -49,8 +52,9 @@
         </child>
         <child>
           <object class="GtkLabel">
+            <property name="visible">1</property>
             <property name="hexpand">1</property>
-            <property name="label" translatable="yes">smb://foo.example.com, ssh://192.168.0.1, 
ftp://[2001:db8::1]</property>
+            <property name="label">smb://gnome.org, ssh://192.168.0.1, ftp://[2001:db8::1]</property>
             <property name="wrap">1</property>
             <property name="width-chars">40</property>
             <property name="max-width-chars">40</property>
@@ -62,12 +66,14 @@
         </child>
         <child>
           <object class="GtkGrid">
+            <property name="visible">1</property>
             <property name="margin-top">12</property>
             <property name="hexpand">1</property>
             <property name="row-spacing">6</property>
             <property name="column-spacing">12</property>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="hexpand">1</property>
                 <property name="label" translatable="yes">Available Protocols</property>
                 <property name="xalign">0</property>
@@ -82,6 +88,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">AppleTalk</property>
                 <property name="xalign">0</property>
               </object>
@@ -92,6 +99,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">File Transfer Protocol</property>
                 <property name="xalign">0</property>
               </object>
@@ -102,6 +110,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">Network File System</property>
                 <property name="xalign">0</property>
               </object>
@@ -112,6 +121,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">Samba</property>
                 <property name="xalign">0</property>
               </object>
@@ -122,6 +132,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">SSH File Transfer Protocol</property>
                 <property name="xalign">0</property>
               </object>
@@ -132,6 +143,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">WebDAV</property>
                 <property name="xalign">0</property>
               </object>
@@ -142,6 +154,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">Prefix</property>
                 <property name="xalign">0</property>
                 <attributes>
@@ -155,6 +168,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label">afp://</property>
                 <property name="xalign">0</property>
               </object>
@@ -165,6 +179,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes" comments="Translators: do not translate ftp:// and 
ftps://">ftp:// or ftps://</property>
                 <property name="xalign">0</property>
               </object>
@@ -175,6 +190,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label">nfs://</property>
                 <property name="xalign">0</property>
               </object>
@@ -185,6 +201,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">smb://</property>
                 <property name="xalign">0</property>
               </object>
@@ -195,6 +212,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes" comments="Translators: do not translate sftp:// 
and ssh://">sftp:// or ssh://</property>
                 <property name="xalign">0</property>
               </object>
@@ -205,6 +223,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes" comments="Translators: do not translate dav:// and 
davs://">dav:// or davs://</property>
                 <property name="xalign">0</property>
               </object>
@@ -224,14 +243,17 @@
   <object class="GtkPopover" id="recent_servers_popover">
     <child>
       <object class="GtkStack" id="recent_servers_stack">
+        <property name="visible">1</property>
         <child>
           <object class="GtkBox">
+            <property name="visible">1</property>
             <property name="vexpand">1</property>
             <property name="valign">center</property>
             <property name="orientation">vertical</property>
             <property name="spacing">18</property>
             <child>
               <object class="GtkImage">
+                <property name="visible">1</property>
                 <property name="pixel-size">48</property>
                 <property name="icon-name">network-server-symbolic</property>
                 <style>
@@ -241,6 +263,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes" comments="Translators: Server as any successfully 
connected network address">No recent servers found</property>
                 <style>
                   <class name="dim-label"/>
@@ -257,11 +280,13 @@
         </child>
         <child>
           <object class="GtkBox">
+            <property name="visible">1</property>
+            <property name="border-width">12</property>
             <property name="orientation">vertical</property>
             <property name="spacing">12</property>
-            <property name="margin">12</property>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">Recent Servers</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
@@ -270,6 +295,7 @@
             </child>
             <child>
               <object class="GtkScrolledWindow">
+                <property name="visible">1</property>
                 <property name="can-focus">1</property>
                 <property name="vexpand">1</property>
                 <property name="shadow-type">in</property>
@@ -277,9 +303,11 @@
                 <property name="min-content-height">200</property>
                 <child>
                   <object class="GtkViewport">
+                    <property name="visible">1</property>
                     <property name="shadow-type">none</property>
                     <child>
                       <object class="GtkListBox" id="recent_servers_listbox">
+                        <property name="visible">1</property>
                         <property name="can-focus">1</property>
                         <property name="selection-mode">none</property>
                         <signal name="row-activated" handler="on_recent_servers_listbox_row_activated" 
object="NautilusGtkPlacesView" swapped="yes"/>
@@ -301,25 +329,31 @@
     </child>
   </object>
   <template class="NautilusGtkPlacesView" parent="GtkBox">
+    <property name="visible">True</property>
     <property name="can-focus">False</property>
     <property name="orientation">vertical</property>
     <signal name="key-press-event" handler="on_key_press_event" object="NautilusGtkPlacesView" swapped="no"/>
     <child>
       <object class="GtkStack" id="stack">
+        <property name="visible">1</property>
         <property name="vhomogeneous">0</property>
         <property name="transition-type">crossfade</property>
         <child>
           <object class="GtkFrame">
+            <property name="visible">1</property>
             <property name="shadow-type">none</property>
             <child>
               <object class="GtkScrolledWindow">
+                <property name="visible">1</property>
                 <property name="hexpand">1</property>
                 <property name="vexpand">1</property>
                 <child>
                   <object class="GtkViewport">
+                    <property name="visible">1</property>
                     <property name="shadow-type">none</property>
                     <child>
                       <object class="GtkListBox" id="listbox">
+                        <property name="visible">1</property>
                         <property name="can-focus">1</property>
                         <property name="selection-mode">none</property>
                         <signal name="row-activated" handler="on_listbox_row_activated" 
object="NautilusGtkPlacesView" swapped="yes"/>
@@ -336,6 +370,7 @@
         </child>
         <child>
           <object class="GtkBox">
+            <property name="visible">1</property>
             <property name="halign">center</property>
             <property name="valign">center</property>
             <property name="hexpand">1</property>
@@ -344,6 +379,7 @@
             <property name="spacing">12</property>
             <child>
               <object class="GtkImage">
+                <property name="visible">1</property>
                 <property name="pixel-size">72</property>
                 <property name="icon-name">edit-find-symbolic</property>
                 <style>
@@ -353,6 +389,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">No results found</property>
                 <attributes>
                   <attribute name="weight" value="bold"/>
@@ -365,6 +402,7 @@
             </child>
             <child>
               <object class="GtkLabel">
+                <property name="visible">1</property>
                 <property name="label" translatable="yes">Try a different search</property>
                 <style>
                   <class name="dim-label"/>
@@ -388,12 +426,14 @@
     </child>
     <child>
       <object class="GtkActionBar" id="actionbar">
+        <property name="visible">1</property>
         <property name="hexpand">1</property>
         <style>
           <class name="background"/>
         </style>
         <child>
           <object class="GtkLabel">
+            <property name="visible">1</property>
             <property name="hexpand">1</property>
             <property name="xalign">0</property>
             <property name="label" translatable="yes">Connect to _Server</property>
@@ -408,6 +448,7 @@
           <object class="GtkButton" id="connect_button">
             <property name="label" translatable="yes">Con_nect</property>
             <property name="use-underline">1</property>
+            <property name="visible">1</property>
             <property name="can-focus">1</property>
             <property name="sensitive">0</property>
             <property name="receives-default">1</property>
@@ -420,9 +461,11 @@
         </child>
         <child>
           <object class="GtkBox">
+            <property name="visible">1</property>
             <property name="hexpand">1</property>
             <child>
               <object class="GtkEntry" id="address_entry">
+                <property name="visible">1</property>
                 <property name="can-focus">1</property>
                 <property name="hexpand">1</property>
                 <property name="width-chars">20</property>
@@ -436,6 +479,7 @@
             </child>
             <child>
               <object class="GtkMenuButton" id="server_list_button">
+                <property name="visible">1</property>
                 <property name="can-focus">1</property>
                 <property name="receives-default">1</property>
                 <property name="direction">up</property>
@@ -445,6 +489,7 @@
                 </style>
                 <child>
                   <object class="GtkImage">
+                    <property name="visible">1</property>
                     <property name="icon-name">pan-down-symbolic</property>
                   </object>
                 </child>
diff --git a/src/gtk/nautilusgtkplacesviewrow.ui b/src/gtk/nautilusgtkplacesviewrow.ui
index e7e425e..99d2dcb 100644
--- a/src/gtk/nautilusgtkplacesviewrow.ui
+++ b/src/gtk/nautilusgtkplacesviewrow.ui
@@ -66,7 +66,7 @@
                 <property name="vhomogeneous">1</property>
                 <child>
                   <object class="GtkButton" id="eject_button">
-                    <property name="visible">0</property>
+                    <property name="visible">1</property>
                     <property name="halign">center</property>
                     <property name="valign">center</property>
                     <property name="tooltip-text" translatable="yes">Unmount</property>


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