[gtk+/merge-places-sidebar: 184/195] Merge branch 'places-sidebar' into master



commit 5b827c53e5579a926c64abf89e88b406c732a422
Merge: 2108397 0ae26b9
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Apr 11 19:45:12 2013 -0500

    Merge branch 'places-sidebar' into master
    
    This lands the GtkPlacesSidebar widget.  It is used in
    GtkFileChooserDefault, and it can also be used by third-party
    applications.

 docs/reference/gtk/gtk-docs.sgml             |    1 +
 docs/reference/gtk/gtk3-sections.txt         |   26 +
 gtk/Makefile.am                              |    6 +
 gtk/gtk-default.css                          |    7 +
 gtk/gtk.h                                    |    1 +
 gtk/gtkbookmarksmanager.c                    |  596 ++++
 gtk/gtkbookmarksmanager.h                    |   91 +
 gtk/gtkfilechooser.c                         |    5 +-
 gtk/gtkfilechooserbutton.c                   |   35 +-
 gtk/gtkfilechooserdefault.c                  | 3975 ++++--------------------
 gtk/gtkfilechooserprivate.h                  |   27 +-
 gtk/gtkfilesystem.c                          |  433 ---
 gtk/gtkfilesystem.h                          |   20 -
 gtk/gtkgladecatalog.c                        |    2 -
 gtk/gtkmarshalers.list                       |    8 +
 gtk/gtkplacessidebar.c                       | 4336 ++++++++++++++++++++++++++
 gtk/gtkplacessidebar.h                       |  100 +
 gtk/gtktrashmonitor.c                        |  267 ++
 gtk/gtktrashmonitor.h                        |   48 +
 gtk/org.gtk.Settings.FileChooser.gschema.xml |    8 +
 po/POTFILES.in                               |    1 +
 21 files changed, 6058 insertions(+), 3935 deletions(-)
---
diff --cc gtk/Makefile.am
index 4741e2a,7f7addf..6d621d3
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@@ -421,9 -421,9 +422,10 @@@ gtk_private_h_sources =           
        gtkbindingsprivate.h    \
        gtkbitmaskprivate.h     \
        gtkbitmaskprivateimpl.h \
+       gtkbookmarksmanager.h   \
        gtkborderimageprivate.h \
        gtkboxprivate.h         \
 +      gtkbubblewindowprivate.h        \
        gtkbuilderprivate.h     \
        gtkbuttonprivate.h      \
        gtkcairoblurprivate.h   \
diff --cc gtk/gtkfilechooserbutton.c
index 86403d6,c38bae6..8c744ce
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@@ -185,8 -181,11 +185,7 @@@ struct _GtkFileChooserButtonPrivat
    GFile *selection_while_inactive;
    GFile *current_folder_while_inactive;
  
 -  gulong combo_box_changed_id;
 -  gulong dialog_file_activated_id;
 -  gulong dialog_folder_changed_id;
 -  gulong dialog_selection_changed_id;
    gulong fs_volumes_changed_id;
-   gulong fs_bookmarks_changed_id;
  
    GCancellable *dnd_select_folder_cancellable;
    GCancellable *update_button_cancellable;
@@@ -500,8 -483,72 +500,10 @@@ gtk_file_chooser_button_init (GtkFileCh
    priv->icon_size = FALLBACK_ICON_SIZE;
    priv->focus_on_click = TRUE;
  
 -  gtk_widget_push_composite_child ();
 +  gtk_widget_init_template (GTK_WIDGET (button));
  
+   /* Bookmarks manager */
+   priv->bookmarks_manager = _gtk_bookmarks_manager_new (bookmarks_changed_cb, button);
 -
 -  /* Button */
 -  priv->button = gtk_button_new ();
 -  g_signal_connect (priv->button, "clicked",
 -                    G_CALLBACK (button_clicked_cb), button);
 -  gtk_box_pack_start (GTK_BOX (button), priv->button, TRUE, TRUE, 0);
 -  gtk_widget_set_halign (priv->button, GTK_ALIGN_FILL);
 -  gtk_widget_show (priv->button);
 -
 -  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
 -  gtk_container_add (GTK_CONTAINER (priv->button), box);
 -  gtk_widget_show (box);
 -
 -  priv->image = gtk_image_new ();
 -  gtk_box_pack_start (GTK_BOX (box), priv->image, FALSE, FALSE, 0);
 -  gtk_widget_show (priv->image);
 -
 -  priv->label = gtk_label_new (_(FALLBACK_DISPLAY_NAME));
 -  gtk_label_set_ellipsize (GTK_LABEL (priv->label), PANGO_ELLIPSIZE_END);
 -  gtk_widget_set_halign (priv->label, GTK_ALIGN_START);
 -  gtk_widget_set_valign (priv->label, GTK_ALIGN_CENTER);
 -  gtk_box_pack_start (GTK_BOX (box), priv->label, TRUE, TRUE, 0);
 -  //gtk_container_add (GTK_CONTAINER (box), priv->label);
 -  gtk_widget_show (priv->label);
 -
 -  sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
 -  gtk_box_pack_start (GTK_BOX (box), sep, FALSE, FALSE, 0);
 -  gtk_widget_show (sep);
 -
 -  image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
 -  gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
 -  gtk_widget_show (image);
 -
 -  /* Combo Box */
 -  /* Keep in sync with columns enum, line 88 */
 -  priv->model =
 -    GTK_TREE_MODEL (gtk_list_store_new (NUM_COLUMNS,
 -                                      GDK_TYPE_PIXBUF, /* Icon */
 -                                      G_TYPE_STRING,   /* Display Name */
 -                                      G_TYPE_CHAR,     /* Row Type */
 -                                      G_TYPE_POINTER   /* Volume || Path */,
 -                                      G_TYPE_BOOLEAN   /* Is Folder? */,
 -                                      G_TYPE_POINTER   /* cancellable */));
 -
 -  priv->combo_box = gtk_combo_box_new ();
 -  priv->combo_box_changed_id =
 -    g_signal_connect (priv->combo_box, "changed",
 -                    G_CALLBACK (combo_box_changed_cb), button);
 -  gtk_box_pack_start (GTK_BOX (button), priv->combo_box, TRUE, TRUE, 0);
 -  gtk_widget_set_halign (priv->combo_box, GTK_ALIGN_FILL);
 -
 -  priv->icon_cell = gtk_cell_renderer_pixbuf_new ();
 -  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->combo_box),
 -                            priv->icon_cell, FALSE);
 -  gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->combo_box),
 -                               priv->icon_cell, "pixbuf", ICON_COLUMN);
 -
 -  priv->name_cell = gtk_cell_renderer_text_new ();
 -  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->combo_box),
 -                            priv->name_cell, TRUE);
 -  gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->combo_box),
 -                               priv->name_cell, "text", DISPLAY_NAME_COLUMN);
    gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (priv->combo_box),
                                      priv->name_cell, name_cell_data_func,
                                      NULL, NULL);
@@@ -878,13 -935,7 +880,10 @@@ gtk_file_chooser_button_constructor (GT
    priv->fs_volumes_changed_id =
      g_signal_connect (priv->fs, "volumes-changed",
                      G_CALLBACK (fs_volumes_changed_cb), object);
-   priv->fs_bookmarks_changed_id =
-     g_signal_connect (priv->fs, "bookmarks-changed",
-                     G_CALLBACK (fs_bookmarks_changed_cb), object);
  
 +  update_label_and_image (button);
 +  update_combo_box (button);
 +
    return object;
  }
  
diff --cc gtk/gtkfilechooserdefault.c
index 99c4200,996c7fc..26ced92
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@@ -5152,14 -2796,8 +2796,8 @@@ set_local_only (GtkFileChooserDefault *
        if (impl->location_entry)
        _gtk_file_chooser_entry_set_local_only (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), local_only);
  
-       if (impl->shortcuts_model && impl->file_system)
-       {
-         shortcuts_add_volumes (impl);
-         shortcuts_add_bookmarks (impl);
-       }
- 
        if (local_only && impl->current_folder &&
 -           !g_file_is_native (impl->current_folder))
 +           !_gtk_file_has_native_path (impl->current_folder))
        {
          /* If we are pointing to a non-local folder, make an effort to change
           * back to a local folder, but it's really up to the app to not cause
diff --cc gtk/gtkgladecatalog.c
index 310aa2b,0000000..30e0e6c
mode 100644,000000..100644
--- a/gtk/gtkgladecatalog.c
+++ b/gtk/gtkgladecatalog.c
@@@ -1,52 -1,0 +1,50 @@@
 +/* gtkgladecatalog.c
 + *
 + * Copyright (C) 2013 Openismus GmbH
 + *
 + * Authors:
 + *      Tristan Van Berkom <tristanvb openismus com>
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Library General Public
 + * License as published by the Free Software Foundation; either
 + * version 2 of the License, or (at your option) any later version.
 + *
 + * This library is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Library General Public License for more details.
 + *
 + * You should have received a copy of the GNU Library General Public
 + * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 + */
 +
 +#include "gtkpathbar.h"
 +#include "gtkcolorswatchprivate.h"
 +#include "gtkcolorplaneprivate.h"
 +#include "gtkcolorscaleprivate.h"
 +
 +#ifdef G_OS_UNIX
 +#  include "gtkprinteroptionwidget.h"
 +#endif
 +
 +/* Some forward declarations of internal types */
 +GType _gtk_scale_button_scale_get_type (void);
- GType _shortcuts_pane_model_filter_get_type (void);
 +
 +/* This function is referred to in gtk/glade/gtk-private-widgets.xml
 + * and is used to ensure the private types for use in Glade while
 + * editing UI files that define GTK+'s various composite widget classes.
 + */
 +void
 +gtk_glade_catalog_init (const gchar *catalog_name)
 +{
 +  g_type_ensure (GTK_TYPE_PATH_BAR);
 +  g_type_ensure (GTK_TYPE_COLOR_SWATCH);
 +  g_type_ensure (GTK_TYPE_COLOR_PLANE);
 +  g_type_ensure (GTK_TYPE_COLOR_SCALE);
 +  g_type_ensure (_gtk_scale_button_scale_get_type ());
-   g_type_ensure (_shortcuts_pane_model_filter_get_type ());
 +
 +#ifdef G_OS_UNIX
 +  g_type_ensure (GTK_TYPE_PRINTER_OPTION_WIDGET);
 +#endif
 +}
diff --cc po/POTFILES.in
index 763e5c5,681ebef..d97e1ba
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@@ -57,8 -57,8 +57,9 @@@ gtk/gtkassistant.
  gtk/gtkbbox.c
  gtk/gtkbin.c
  gtk/gtkbindings.c
+ gtk/gtkbookmarksmanager.c
  gtk/gtkbox.c
 +gtk/gtkbubblewindow.c
  gtk/gtkbuildable.c
  gtk/gtkbuilder.c
  gtk/gtkbuilder-menus.c


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