Commit Graph

427 Commits

Author SHA1 Message Date
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Timm Bäder
131e8d8905 Remove some unnecessary gtkwindow.h includes 2019-02-05 08:11:43 -05:00
Nelson Benítez León
65240967e4 gtkplacessidebar.c: move bookmark at the placeholder index
As that index is set in drag_motion_callback() and visually shown
on the widget as a drop target hint.

https://bugzilla.gnome.org/show_bug.cgi?id=787356
https://gitlab.gnome.org/GNOME/gtk/issues/904
2018-12-17 19:19:20 +00:00
segfault
61f50f2410 gtkplacessidebar: Improve error message when unlocking volume fails 2018-08-05 18:59:40 +02:00
segfault
791da76ae1 gtkplacessidebar: Show busy spinner in sidebar row during mount ops 2018-07-27 16:44:50 +02:00
Ernestas Kulik
4b2d63167e placessidebar: Take a GdkDrag in _set_drop_targets_visible()
Since the function is usually called from GtkWidget::drag-{begin,end} handlers,
taking a GdkDrop does not work, especially given that
::drag-action-requested is emitted without checking the type.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1220
2018-07-17 19:19:14 +03:00
Matthias Clasen
b94c3166bf dnd: Rename gtk_drag_begin_with_coordinates
Now that the coordiate-less variant is gone,
rename this back to the shorter gtk_drag_begin.
2018-07-12 13:02:42 +02:00
Matthias Clasen
7733f646d6 gdk: Rename GdkDragContext to GdkDrag
This is to go along with the newly introduced GdkDrop.

This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 14:59:26 +02:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Carlos Garnacho
f92ec7ce41 gtkplacessidebar: Replace ::event signal handlers with gestures
Set up a gesture on the sidebar rows to detect pointer clicks on
it. The row DnD management has been moved to the row widget itself,
it makes more sense even if the drag is began from the sidebar widget.
2018-06-21 12:54:03 +02:00
Benjamin Otte
b00609c21c dnd: Make drag-motion and drag-drop signals use GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
6d7cb2b781 dnd: Make drag-data-received use a GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
314eaf7d10 widget: Make GtkWidgetClass::drag_leave() take a GdkDrop
Drag Contexts are on their way out!
2018-06-18 23:49:20 +02:00
Benjamin Otte
5b0a6a52c1 dnd: Get rid of gtk_drag_finish()
It's just a wrapper around gdk_drag_finish(), so use that one instead.
2018-06-18 23:49:20 +02:00
Carlos Garnacho
15e00759c7 eventcontrollerkey: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
bf82149271 longpressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Carlos Garnacho
585aafc2df gtkplacessidebar: Stop using ::key-press-event
Use GtkEventControllerKey for the task
2018-04-05 19:26:54 +02:00
Timm Bäder
0b9dca3d55 placessidebar: Don't create a GtkWindow for drag icons
Just use the drag_widget we create before, since GtkWindow drag icons
are not allowed anymore.
2018-02-23 11:08:53 +01:00
Carlos Soriano
6cef9514ae gtkplacessidebar: Rename favorites to starred
To have more consistency in the name. The same was done in Nautilus in
commit 27b039b37c.
2018-02-15 10:51:04 +01:00
Emmanuele Bassi
3a2aa2bd80 Remove unnecessary gtk-doc stanza
The places sidebar is not a publicly documented API, so there's no need
to use a gtk-doc stanza — especially if the syntax of the stanza is
wrong.
2018-02-01 16:08:51 +01:00
Matthias Clasen
15e67e27ca places sidebar: Stop using ::button-press/release-event
We'll use a generic ::event signal instead.
2018-01-16 14:14:10 -05:00
Matthias Clasen
f90659cde8 places sidebar: Stop using ::motion-notify-event
We can use the generic ::event signal here.
2018-01-16 14:14:10 -05:00
Matthias Clasen
9a3b61ec9d Drop GtkPlacesSidebar from public API
This is a bit of filechooser internals that gets shared with
nautilus, which is fine, but it shouldn't be part of our
public API. There are no other users than nautilus.
2018-01-08 14:38:55 -05:00
Emmanuele Bassi
f27dd8834b docs: Add missing signal parameter
The `flags` parameter is missing, and the introspection scanner is
complaining about it.
2017-12-21 19:00:28 +00:00
Matthias Clasen
54a6273191 Drop gdk_atom_intern
Atoms are just interned strings now, so we can just
use g_intern_string.
2017-12-13 23:39:03 -05:00
Benjamin Otte
b80d14ba19 placessidebar: Don't use root coordinates 2017-12-12 00:31:49 +01:00
Benjamin Otte
04ac4c66ae dnd: Pass device, not event
You don't start a dnd operation with a device, you start it with an
event.
2017-12-12 00:31:49 +01:00
Benjamin Otte
756b276070 dnd: Remove button argument from drag_begin()
It was unused.
2017-12-12 00:29:51 +01:00
Benjamin Otte
7a17865b22 dnd: Remove "delete" argument from gtk_drag_finish()
The argument is ignored by anything but X11.
It's treated like suggested_action == MOVE.

So do that in gtk_drag_finish(), too.
2017-12-10 01:33:38 +01:00
Matthias Clasen
f57aa47a40 Remove some unused includes
These show up in a grep for "pixbuf".
2017-11-29 23:39:06 -05:00
Daniel Boles
98c1f16002 doc: Replace uses of #NULL with %NULL 2017-11-22 20:58:28 +00:00
Benjamin Otte
fc2ce5a925 gdk: Make GdkContentFormats immutable 2017-11-20 23:13:10 +01:00
Benjamin Otte
9a6ec4e959 contentformats: Rename GtkTargetList
It's now called GdkContentsFormat
2017-11-20 23:12:33 +01:00
Benjamin Otte
c863ac0f90 dnd: Remove GtkTargetEntry and GtkTargetFlags
warning: We don't do any same-app checks anymore so you currently can
copy local data into external apps.

This will be fixed later.
2017-11-20 23:12:33 +01:00
Matthias Clasen
a8531605db Some more interning
This avoids more strdups at startup.
2017-11-18 08:18:11 -05:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Benjamin Otte
3f5178dc21 selection: Remove the info uint
Instead of allowing people to pass a uint user-data, insist on them
comparing mime types.

The user data was a uint instead of a pointer anyway, so uniqueness
could not be guaranteed and it caused more issues than it was worth.
And that's ignoring the fact that it basically wasn't used.
2017-11-16 22:59:43 +01:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Benjamin Otte
5a1a11bcde dnd: Make GtkDragDest and GtkDragSource use GtkTargetList
This gets rid of GtkTargetEntry in the API and consistently uses
GtkTargetList.
2017-11-15 19:07:17 +01:00
Benjamin Otte
77efc60a15 placessiderbar: Fix sunny compilation
Make compilation not warn about unused variables when compiling with
HAVE_CLOUDPROVIDERS undefined.
2017-11-13 23:45:18 +01:00
Carlos Soriano
1b1cb8295b gtkplacessidebar: Fix new tab/window handling for cloud accounts
It wasn't taking into account whether the sidebar had support for them
or not, resulting in a file chooser with open in new tab/window menu
items when it's not supported.

To fix it, do as with the other menus and check for the availability of
new tab/window flags.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-11-13 16:57:02 +01:00
Carlos Soriano
f54e7712c5 gtkplacessidebar: Adapt to libcloudproviders 0.2.x
And a few improvements on the way.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-11-13 16:55:10 +01:00
Piotr Drąg
08d5ed5875 placessidebar: correct quotation marks in a new string 2017-11-05 21:18:53 +01:00
Alexandru Pandelea
2421e745b9 placessidebar: add starred location item
Add an item for showing all files marked as favorite. This item will
open all files that have the nao:predefined-tag-favorite tag

https://bugzilla.gnome.org/show_bug.cgi?id=785176
2017-11-05 21:02:04 +01:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Matthias Clasen
5d5ae459c4 place sidebar: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Carlos Garnacho
2abfc602ca placessidebar: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Daniel Boles
7178ab8e41 PlacesSidebar: Avoid unused mem if !CLOUDPROVIDERS
The member GList *cloud_rows is only ever used if HAVE_CLOUDPROVIDERS is
defined, so don’t declare it if not.
2017-09-19 00:20:17 +01:00
Daniel Boles
94eecf57dc PlacesSidebar: Unref cloud_manager in dispose()
We ref the CloudProviders singleton in init() but did not unref it in
dispose(). Do so, using g_clear_object().

https://bugzilla.gnome.org/show_bug.cgi?id=787600
2017-09-18 23:30:57 +01:00
Julius Härtl
a1635b6188 gtkplacessidebar: implement libcloudproviders support
Add integration of the libcloudproviders DBus API to the
GtkPlacesSidebar by showing name and sync status of the cloud providers.
The exported menu is rendered as a GtkPopover.

The sidebar will be updated if the list of cloudproviders changes e.g.
by adding or removing an account. If any cloud provider changes detailed
information like sync status only the individual sidebar row gets
updated.

Co-authored-by: Carlos Soriano <csoriano@gnome.org>
Co-authored-by: Daniel Boles <dboles@src.gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-09-04 11:32:03 -04:00
Benjamin Otte
6b7503b83e placessidebar: Remove EventBox usage 2017-08-02 14:05:02 +01:00
Timm Bäder
0d2debad48 placessidebar: Fix css node name typo 2017-03-02 15:16:08 +01:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00
Benjamin Otte
95a2a5c54c gtk: Remove GtkJunctionSides 2016-12-20 18:01:12 +01:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Matthias Clasen
3c27774a5d places sidebar: Don't leak a reference
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774185
2016-11-10 15:16:05 -05:00
Rico Tzschichholz
bdaa2bf531 gtkplacessidebar: Remove deprecated "show-other-locations" signal 2016-10-23 19:13:15 +02:00
Rico Tzschichholz
5c526c9926 gtkplacessidebar: Remove deprecated "show-connect-to-server" 2016-10-23 18:23:59 +02:00
Emmanuele Bassi
5880d1b990 gtk: Cast static strings assigned to non-const variables
GtkTargetEntry.target is particularly egregious, and it should really be
constified.
2016-10-17 11:44:10 +01:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Carlos Soriano
cfe4c9e0f4 gtkplacessidebar: fix signal marshal
We were using __VOID for the SHOW_OTHER_LOCATION signal that
uses flags named SHOR_OTHER_LOCATION_WITH_FLAGS.
However, if a signal uses flags the marshal needs to use __FLAGS.

This patch addresses this using VOID__FLAGS as the marshaler parameter.

Thanks to Jan Steffens for pointing this out.

https://bugzilla.gnome.org/show_bug.cgi?id=770550
2016-08-29 15:01:12 +02:00
Timm Bäder
a985e62b25 Use gtk_popover_popdown/popup where appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=769706
2016-08-16 11:49:26 -04:00
Ondrej Holy
55751fc6fb Improve external drives detection
Use g_drive_is_removable for external drives detection. Current heuristic
fails in some cases (e.g. when removable drive is attached before login),
see Bug 765457.

Bump GLib version accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=765924
2016-05-20 10:40:14 +02:00
Matthias Clasen
7c21a32b28 places sidebar: Avoid markup confusion in tooltips
At one point, the sidebar was using gtk_treeview_set_tooltip_column,
which expects tooltips to be markup. With the listbox-based sidebar,
we don't do that anymore. So don't escape the tooltip text.

https://bugzilla.gnome.org/show_bug.cgi?id=766175
2016-05-10 21:47:20 -04:00
Sebastien Bacher
e92eaaa049 gtkplacessidebar: don't margins in the code
those should rather be defined by the theme
https://bugzilla.gnome.org/show_bug.cgi?id=763768
2016-04-14 11:46:34 +02:00
Matthias Clasen
5dabfa7b39 places sidebar: Plug a small memory leak
_gtk_trash_moniotr_get_icon is transfer full, so we have
to unref the icon.
2016-03-27 18:42:25 -04:00
Matthias Clasen
6ac7b54378 dnd: Move GtkDragDest to a separate file
This follows what was done for GtkDragSource in
415030d25f and shaves another
500 lines off gtkdnd.c.
2016-03-25 15:37:20 -04:00
Matthias Clasen
804d330195 Typo fixes
Fix s/occurence/occurrence in many places.
2016-03-10 22:46:02 -05:00
Carlos Soriano
fdde27ea9c gtkplacessidebar: add new other locations with flags signal
We weren't using the open flags on the other locations signal, which
makes impossible for applications like nautilus to act in the same
way that for any other location where the user can choose between
opening in the current view, in a new window or in a new tab.

Add a new signal with an open flags parameter and deprecate
the other-location signal.

https://bugzilla.gnome.org/show_bug.cgi?id=754743
2016-03-04 20:15:52 -05:00
Carlos Soriano
fec0c4c201 Revert "gtkplacessidebar: add open flags to other locations"
This reverts commit 63a204e1c5 since it broke the API.
We will add a new signal instead in an upcomming patch.

https://bugzilla.gnome.org/show_bug.cgi?id=754743
2016-03-04 20:15:52 -05:00
Carlos Soriano
ea9e8221b1 gtkplacessidebar: use gpointers in trash row
It's the right casting. Forgot to push it with the previous patch.
2016-02-26 11:55:05 +01:00
Carlos Soriano
377ac909b7 gtkplacessidebar: clean up trash row on destroy
Track with a weak ref the trash row, so we can clean up the data in the
private struct.

Spotted and reviewed by Christian Hergert.
2016-02-26 11:52:50 +01:00
Carlos Soriano
20cf42c9ea gtkplacessidebar: avoid unresponsive UI while trashing
We were updating the whole places sidebar when the trash changed.
This effectively removes all rows and create new ones for every trash
state change.

Although when using GtkTreeView it was somehow ok, with the new
implementation with GtkListBox this effectively locks the UI while the
trash operations are being performed.

When performing operations for i.e. 100 files, the UI can be locked
for more than 1 minute since gvfs-trash usually takes time.

To fix this just update the icon of the trash when the state of the
trash change instead of the whole sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=762677
2016-02-25 14:44:40 +01:00
Carlos Soriano
63a204e1c5 gtkplacessidebar: add open flags to other locations
We weren't using the open flags on the other locations signal, which
makes impossible for applications like nautilus to act in the same
way that for any other location where the user can choose between
opening in the current view, in a new window or in a new tab.

Add the signal missing parameter in order to allow it.

https://bugzilla.gnome.org/show_bug.cgi?id=754743
2016-02-23 20:29:03 -05:00
Carlos Soriano
40c0a6aa87 gtkplacessidebar: remove unneeded condition
We check for it before anyway, and in this case make sense to show the
eject button in both cases.
2016-02-18 15:32:54 +01:00
Matthias Clasen
da47ceb4c0 places sidebar: Use the right marshallers
We are passing the mount operation as argument, so use
a marshaller that expects an object argument.
2016-02-16 19:20:22 -05:00
Carlos Soriano
b8e2ebb840 gtkplacessidebar: remove notification handling
We were notifying when an unmount operation was performed. However,
creating notifications from the gtk+ library is not that expected, and
makes notification handling difficult to do from the application point
of view since we cannot dismiss those notifications.

This cause issues like notifications of unmount drives stay there after
a system reboot, which confuses the user.

Instead of that, remove the notification handling for mount operations
on gtk+ and instead create a new signal on the gtkplacessidebar in order
to inform applications using it about an operation about to start.

Only drawback about this is that the GtkFileChooser loses its
notifications when unmounting, that although we could use the new signal
to do it, we actually don't want to notify from any part of gtk+ for
now.

https://bugzilla.gnome.org/show_bug.cgi?id=753351
2016-02-16 18:36:59 -05:00
Alberto Ruiz
496f0892fc introspection: This patch fixes nullable return values fixes for the following symbols in gtk
gtk_accel_group_query
  gtk_accel_group_from_accel_closure
  gtk_accel_label_get_accel_widget
  gtk_accessible_get_widget
  gtk_actionable_get_action_name
  gtk_app_chooser_get_app_info
  gtk_app_chooser_button_get_heading
  gtk_app_chooser_dialog_get_heading
  gtk_application_get_window_by_id
  gtk_assistant_get_nth_page
  gtk_binding_set_find
  gtk_builder_get_object
  gtk_builder_lookup_callback_symbol
  gtk_builder_get_application
  gtk_button_get_image
  gtk_cell_area_get_focus_from_sibling
  gtk_cell_renderer_start_editing
  gtk_cell_view_get_model
  gtk_cell_view_get_displayed_row
  gtk_clipboard_get_owner
  gtk_container_get_focus_child
  gtk_container_get_focus_vadjustment
  gtk_container_get_focus_hadjustment
  gtk_dialog_get_widget_for_response
  gtk_drag_get_source_widget
  gtk_drag_dest_get_target_list
  gtk_drag_source_get_target_list
  gtk_entry_completion_get_model
  gtk_entry_completion_compute_prefix
  gtk_expander_get_label_widget
  gtk_file_chooser_get_filename
  gtk_file_chooser_get_current_folder
  gtk_file_chooser_get_uri
  gtk_file_chooser_get_current_folder_uri
  gtk_file_chooser_get_preview_widget
  gtk_file_chooser_get_preview_file
  gtk_file_chooser_get_preview_filename
  gtk_file_chooser_get_preview_uri
  gtk_file_chooser_get_extra_widget
  gtk_file_chooser_get_filter
  gtk_file_chooser_native_get_accept_label
  gtk_file_chooser_native_get_cancel_label
  gtk_file_filter_get_name
  gtk_font_chooser_get_font_family
  gtk_font_chooser_get_font_face
  gtk_font_chooser_get_font
  gtk_font_chooser_get_font_desc
  gtk_font_chooser_get_font_map
  gtk_frame_get_label
  gtk_gesture_get_device
  gtk_gesture_get_window
  gtk_gl_area_get_error
  gtk_header_bar_get_title
  gtk_header_bar_get_subtitle
  gtk_header_bar_get_custom_title
  gtk_icon_info_get_filename
  gtk_icon_view_get_path_at_pos
  gtk_icon_view_get_model
  gtk_image_get_pixbuf
  gtk_image_get_animation
  gtk_label_get_mnemonic_widget
  gtk_label_get_attributes
  gtk_check_version
  gtk_menu_button_get_popup
  gtk_menu_button_get_menu_model
  gtk_menu_button_get_align_widget
  gtk_menu_button_get_popover
  gtk_menu_item_get_submenu
  gtk_menu_item_get_accel_path
  gtk_native_dialog_get_title
  gtk_native_dialog_get_transient_for
  gtk_notebook_get_nth_page
  gtk_notebook_get_tab_label_text
  gtk_notebook_get_menu_label
  gtk_notebook_get_menu_label_text
  gtk_notebook_get_group_name
  gtk_notebook_get_action_widget
  gtk_offscreen_window_get_surface
  gtk_offscreen_window_get_pixbuf
  gtk_paned_get_child1
  gtk_paned_get_child2
  gtk_places_sidebar_get_location
  gtk_places_sidebar_get_nth_bookmark
  gtk_plug_get_socket_window
  gtk_popover_get_default_widget
  gtk_progress_bar_get_text
  gtk_recent_filter_get_name
  gtk_recent_manager_lookup_item
  gtk_settings_get_default
  gtk_socket_get_plug_window
  gtk_stack_sidebar_get_stack
  gtk_stack_switcher_get_stack
  gtk_style_context_get_section
  gtk_style_context_get_parent
  gtk_style_context_get_frame_clock
  gtk_test_find_widget
  gtk_text_buffer_get_mark
  gtk_text_tag_table_lookup
  gtk_text_view_get_tabs
  gtk_text_view_toggle_cursor_visible
  gtk_text_view_get_window
  gtk_toolbar_get_nth_item
  gtk_tool_button_get_label
  gtk_tool_button_get_icon_name
  gtk_tool_button_get_label_widget
  gtk_tool_button_get_icon_widget
  gtk_tool_palette_get_drop_item
  gtk_tool_palette_get_drop_group
  gtk_tree_model_filter_convert_child_path_to_path
  gtk_tree_model_filter_convert_path_to_child_path
  gtk_tree_model_sort_convert_child_path_to_path
  gtk_tree_model_sort_convert_path_to_child_path
  gtk_tree_view_get_column
  gtk_tree_view_get_bin_window
  gtk_tree_view_column_get_widget
  gtk_tree_view_column_get_tree_view
  gtk_widget_get_frame_clock
  gtk_window_group_get_current_device_grab
  GtkTextBufferSerializeFunc
2016-01-08 12:18:23 +00:00
Emmanuele Bassi
1ddf204745 Fix the licensing blurb in GtkPlacesSidebar
The code is released under the terms of the LGPL v2.1+, as is the rest
of the GTK+ code.
2015-11-19 12:52:46 +00:00
Matthias Clasen
cd798d5aed places sidebar: Document style classes
Document the style classes that GtkPlacesSidebar uses on its rows.
2015-11-05 12:56:16 -05:00
Matthias Clasen
de3ad3781c placessidebar: Use an element name
Set the element name placessidebar.
2015-11-05 10:43:02 -05:00
Dominique Leuenberger
4f24c8569c placessidebar: do not crash if uris is NULL
On Drag'n'Drop actions across system boundaries (VM host to guest), the
happen to be null.

https://bugzilla.gnome.org/show_bug.cgi?id=757298
2015-10-29 17:32:13 +01:00
Carlos Soriano
0cd4e7ec43 gtkplacessidebar: improve heuristics for external drives
Since the change to use GtkPlacesView we don't want to show
internal storage on the sidebar.

In our case we were checking for drive_can_eject and
drive_is_media_removable.

However for some external hard drives it's reported that they
are not ejectable nor the have removable media. So the only
attribute that they have different from internal drives is that
they can be stopped.
So check for if the drive can be stopped to decide if it is
external or internal.

On the way realized we don't need to check for the mounts associated
with the volume to know if the volume can be ejected or not. So remove
that code.

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Ross Lagerwall
f2b848a531 gtkplacessidebar: Show drives with removable media
Some drives have removable media that is not ejectable (e.g. a laptop's
SD card reader). Show volumes on these drives in the sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=755654
2015-10-14 17:38:25 +01:00
Carlos Soriano
ecc698a282 gtkplacessidebar: avoid to use a freed string
The string we were using is the representation of the internal text
in the popover entry. However that can be freed before setting the
bookmark label, if i.e. the row is destroyed and therefore the popover
as well.
To avoid that, duplicate the label in a local variable.

One of the consequences is that for those people using development version
we migth screwed its bookmarks file, since the bookmark manager wrote
garbage from the already freed label.

https://bugzilla.gnome.org/show_bug.cgi?id=755215
2015-09-25 16:10:32 +02:00
Carlos Soriano
5c0447fa44 gtkplacessidebar: avoid accessing destroyed popover
The row and rename popovers are always relative_to a row.
We also keep a pointer to them so we can interact with them in
callbacks.

However, if the row is destroyed its associated popovers will be
destroyed as well as relative_to destroyes and frees memory of its
associated widget when its relative_to widget is destroyed.
If we, for example, update the places while the popover is shown we are
going to access and invalid widget on the next time.

To avoid that, connect to the destroy signal of the popovers and clean
the sidebar pointers when that happens.

https://bugzilla.gnome.org/show_bug.cgi?id=755444
2015-09-23 23:29:22 -04:00
Matthias Clasen
0db331d244 file chooser: make rows with popovers visible
Without this, the popovers are just dangling in the middle of
nowhere.

https://bugzilla.gnome.org/show_bug.cgi?id=754411
2015-09-13 22:53:42 -04:00
Matthias Clasen
0175cd8ae7 places sidebar: keep open variants sensitive
Add a separate action for "Open in Tab" and "Open in new window"
so we can keep them enabled when we disable "Open" for the selected
row.

https://bugzilla.gnome.org/show_bug.cgi?id=754410
2015-09-13 12:44:17 -04:00
Matthias Clasen
90bcde5951 places sidebar: Disable 'Open' for selected rows
If the row is selected, it is already opened, so we should not
offer the Open action anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=754410
2015-09-01 22:05:46 -04:00
Carlos Soriano
6d0edd0056 gtkplacessidebar: order mounts by label
We were not ordering them at all, and therefore they were
jumping around

https://bugzilla.gnome.org/show_bug.cgi?id=753925
2015-08-21 15:01:22 +02:00
Georges Basile Stavracas Neto
88edada0d9 placessidebar: set Other Locations uri
By assigning an URI to Other Locations item, we
can programaticaly select it. Fixes a bug in Nautilus,
where the Other Locations item is unselected imediately
after being clicked.
2015-08-18 19:34:21 -03:00
Matthias Clasen
9ecfffa830 Formatting fixes 2015-08-08 23:10:00 +02:00
Matthias Clasen
9f24b54786 Code cleanup
Use g_slist_free_full more consistently. This commit just converts
the obvious cases where g_slist_forall is directly followed by
g_slist_free.
2015-07-31 22:23:35 -04:00
Georges Basile Stavracas Neto
ea3a80c19f placessidebar: fix documentation
Use the same explanation of why GtkPlacesSidebar::show-connect-server
was deprecated and its replacements on getter and setter.

Also, fix a mistakenly deprecated function.
2015-07-28 07:03:09 -03:00
Georges Basile Stavracas Neto
e0339c5244 placessidebar: show Computer item when not in Other Locations
Previous commits removed from places sidebar the code related
to displaying the Computer item, which should be shown when
the sidebar is not displaying the Other Locations item.

Add back the item when the sidebar is not in Other Locations'
mode.
2015-07-27 12:21:36 -03:00
Matthias Clasen
69d90d4f50 places view: Documentation fixups
Rewrite gtk_places_sidebar_set_show_enter_location docs, add
references to the relevant signals, remove mentions of
GtkPlacesView from the docs, since it is not public at this point.

https://bugzilla.gnome.org/show_bug.cgi?id=752633
2015-07-25 12:11:05 -04:00
Matthias Clasen
a8512e097a Fix a typo
https://bugzilla.gnome.org/show_bug.cgi?id=752810
2015-07-24 11:28:59 -04:00
Chun-wei Fan
d9985dad5b gtk/gtkplacessidebar.c: Fix Build on C89
Ensure variables are declared at the top of the block, and remove a ';;',
which C89 compilers don't like.
2015-07-24 16:25:01 +08:00
Matthias Clasen
3243ae6e08 places sidebar: Don't leak shortcuts
Poined out by valgrind.
2015-07-21 21:00:12 -04:00
Matthias Clasen
3e6177d2dd places sidebar: Plug a memory leak 2015-07-21 19:52:54 -04:00