Commit Graph

289 Commits

Author SHA1 Message Date
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
Matthias Clasen
1e981790de places sidebar: Improve docs
Clarify the deprecation note for ::show-connect-to-server.
https://bugzilla.gnome.org/show_bug.cgi?id=752633
2015-07-21 15:07:37 -04:00
Matthias Clasen
7a84c26d0b places sidebar: Improve the docs
Reword the docs of gtk_places_sidebar_set_drop_targets_visible().
2015-07-21 15:07:37 -04:00
Matthias Clasen
b4b46b74e5 places sidebar: Fix a copy-paste leftover
The ::populate-all nick and blurb where not referrering to this
property at all.
https://bugzilla.gnome.org/show_bug.cgi?id=752633
2015-07-21 15:07:37 -04:00
Matthias Clasen
55652b6b09 places sidebar: Improve keynav
Remove the code in the sidebar keypress handler that imperfectly
reproduces what GtkListBox already does: moving selection and
focus in response to arrow keys.
2015-07-19 22:07:21 -04:00
Matthias Clasen
bd41c92b28 trivial: Some reformatting 2015-07-19 17:39:23 -04:00
Matthias Clasen
5b5b4de495 places sidebar: Remove pointless code
No need to set or unset adjustments explicitly.
2015-07-19 17:37:39 -04:00
Matthias Clasen
7627ed8000 places sidebar: Preserve ::populate-popup functionality
We "fix" this signal the same way we did for GtkEntry and
GtkTextView: slightly change the signature so that the passed
widget may be a container other than a GtkMenu, and add a
property to explicitly opt in to receiving the signal in
this case.
2015-07-17 08:57:39 -04:00
Matthias Clasen
e08c5262b7 places sidebar: Use a popover for the context menu
Use a popover for the context menu, and add a long press gesture
to allow opening it with touch.
2015-07-17 08:57:39 -04:00
Georges Basile Stavracas Neto
3b41daca78 placessidebar: show persistent drives when not showing Other Locations
Previous commits changes the behavior of GtkPlacesSidebar, as it stops
handling persistent devices and only manages mounted networks, XDG
directories and bookmarks.

By radically breaking the previous behavior, we may have trouble
since we provide no alternatives to that besides the private widget
GtkPlacesView.

Fix that by showing the persistent devices when not showing Other
Locations item.
2015-07-16 11:41:03 -03:00
Georges Basile Stavracas Neto
a39b8f67ba placessidebar: fix Connect to Server position
Commit 7db399d975 introduces
the Other Locations item, as well as some behavioral changes
to GtkPlacesSidebar. It, howevers, wrongly changes the section
of code that handles the Connect to Server item, with various
side effects depending on the environment setup.

Fix that by adding the Connect to Server at the right section
of code.
2015-07-16 09:37:56 -03:00
Georges Basile Stavracas Neto
7db399d975 placessidebar: add Other Locations item
Places sidebar is a widget that enabled the user to select
XDG directories, bookmarks and mounted network locations,
as well as manages permanent and removable devices.

The new design that aims to look less clutered makes the
sidebar display only removable devices, as well as mounted
networks, bookmarks and XDG directories, and delegates the
management of permanent devices such as hard drive partitions
to GtkPlacesView, a newly introduced widget for this specific
purpose.

To delegate it, add an "Other Locations..." item to notify
when the permanent devices manager is required. Besides that,
don't show these fixes devices on the sidebar itself, as they
are not supposed to be handled by the sidebar anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=752034
2015-07-15 23:11:52 -03:00
Matthias Clasen
24e1323eb3 places sidebar: Handle menu key
It is good practice to handle the menu key and Shift-F10 to
allow keyboard-driven use of context menus.
2015-07-15 12:46:06 -04:00
Matthias Clasen
8e53a01188 places sidebar: Fix rows getting 'lost' when dnd fails
There was some code that lead to the places sidebar loosing track
of the row being dragged if a motion event came in between letting
go of the button and the drag snap-back animation ending. This would
cause us to not show the row again, giving the appearance that it
was 'lost'.

https://bugzilla.gnome.org/show_bug.cgi?id=751448
2015-07-08 06:10:00 -04:00
Matthias Clasen
fb316156e2 place sidebar: Make removing bookmarks work again
This was accidentally broken in ae8c07c67c when I
forgot to switch the sense of a condition.
2015-07-06 23:21:51 -04:00
Matthias Clasen
3cbe6d86af place sidebar: minor change
We generally prefer for loops to iterate over lists.
2015-07-06 21:59:10 -04:00
Matthias Clasen
8b90c79037 places sidebar: Fix memory handling of rename popover
We were freeing the same string twice here, leading to
badness.
2015-07-04 22:38:29 -04:00
Matthias Clasen
78db92df7e GtkPlacesSidebar: Allow hiding Trash
We will use this in the filechooser in save mode.
2015-07-04 00:29:26 -04:00
Matthias Clasen
715aba650e places sidebar: Add private api to get title
The places sidebar already does all the work to determine the
right label to use for the current location of the filechooser.
We want to use the same label in the headerbar subtitle, so
add some private API to get it.
2015-07-04 00:29:24 -04:00
Carlos Garnacho
8c9e426dc5 placessidebar: Do not set as a "track motion" DnD site
It has the unintended effect of picking the suggested action from the
context, which conflicts with the (possibly 0) status we set on our
::drag-motion handler.

Given this widget is not interested in listening to DnD from every
possible target, it is safe to just disable it.
2015-07-01 19:37:42 +02:00
Matthias Clasen
ae8c07c67c GktPlacesSidebar: Plug a ton of leaks
If you don't keep in mind that g_object_get() returns references to
objects and copies fo strings, things leak all over the place.
2015-06-23 16:35:17 -04:00
Matthias Clasen
f2a8ddfecf sidebarrow: Avoid object-valued properties
They tend to leak...as these do.
2015-06-23 16:35:17 -04:00
Carlos Soriano
569e59b2c5 gtkplacessidebar: improve variable name 2015-06-16 16:54:24 +02:00
Carlos Soriano
0bb82bf1de gtkplacessidebar: Remove some old comments
We didn't made up our minds until now from some of them, and for
the others no progress has been made or bugs reported, so probably
they are fine.
2015-06-16 16:25:33 +02:00
Carlos Soriano
fbbad5deec gtkplacesidebar: use GtkListBox
We were using GTkTreeView in a simple list. Also, as we know,
GtkCellRenderers are not the best way to theme and manipulate
widgets.

So instead use a GtkListBox to modernize the GtkPlacesSidebar,
and in the way clean up some parts of the code (like headings)
which were not used anymore.
Also we don't use a model anymore, since the data is simple
enough to manage it in a subclass of the row itself.
2015-06-16 16:19:37 +02:00
Carlos Soriano
4499174e32 gtkplacessidebar: make insensitive invalid drop targets
https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:37 +02:00
Carlos Soriano
fb034f38b3 gtkplacessidebar: add new bookmark icon
Following design mockups

https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:37 +02:00
Carlos Soriano
a9b698b265 gtkplacesidebar: remove obsolete drop state
We didn't use those for some time now.
2015-06-16 16:19:37 +02:00
Carlos Soriano
91e1e80862 gtkplacessidebar: add API for show drop hints
It is convenient to allow applications to show all the drop
targets at once. This improves the user experience with drag
an drop.

The new API allows the application to set the gtkplacessidebar
in a mode where invalid drop targets are insensitive and it
adds a "new bookmark" row. This mode is intended to be set
when the application is aware of a dnd operation and needs to
be stopped kwhen the application is aware that dnd operation
was cancelled or ended in a different part than gtkplacesisdebar.

The context parameter is unused in this patch, but will be
used in next patches when the sidebar will use a GtkListBox.
The reason of being unused now is just convenience.

https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:37 +02:00
Carlos Soriano
4371cc8f01 gtkplacessidebar: new bookmark row only at first position
Following the new mockups, put the new bookmark row always
in the first position, so it's easier to drop an item.

https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:36 +02:00
Matthias Clasen
1bba3b0a38 Avoid uninitialized variables
clang complains that these may be used uninitialized.
2015-06-13 21:10:26 -04:00
Matthias Clasen
a8191e7113 places sidebar: Make 'recent' work on other platforms
Since nautilus merge, we were not showing 'Recent' in the sidebar
if GIO did not support the recent: scheme. But the file chooser
can show recent files independent of gvfs - it loads the recent
files manually. This is relevant on Windows and OS X, where gvfs
is typically not used.

This commit adds a show-recent property which can be used to override
the recent: scheme check. We use it in the file chooser.

https://bugzilla.gnome.org/show_bug.cgi?id=750068
2015-06-06 17:13:22 -04:00
Matthias Clasen
4de444ca61 placessidebar: Simplify some code
Use existing functions, instead of open-coding manipulation
of string arrays.
2015-05-30 09:20:27 -04:00
Cosimo Cecchi
e0b1ea11cc placessidebar: escape tooltip text before setting it
gtk_tree_view_set_tooltip_column() specifies that markup in the text
should be escaped.
This fixes critical warnings when hovering over items in the sidebar for
bookmarks that have markup characters in their names.

https://bugzilla.gnome.org/show_bug.cgi?id=719683
2015-05-24 12:04:22 -07:00
Matthias Clasen
adb58b2c84 file chooser: Set default widget in create folder popover
This is using the new default widget functionality for
popovers to make Enter in the entry activate the Create
button.

https://bugzilla.gnome.org/show_bug.cgi?id=747664
2015-05-02 20:34:28 -04:00
Matthias Clasen
3fbaf3231e GtkPlacesSidebar: Use a popover for renaming bookmarks
This is following the example in gnome-builder.
2015-05-02 02:48:46 -04:00
Matthias Clasen
59a901e285 places sidebar: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Georges Basile Stavracas Neto
ce9a5a3fec places sidebar: compare bookmarks by index
GtkPlacesSidebar applies a sorting function on
the tree model that does not consider the case
of bookmarks, which are sorted by their indexes.

By adding the bookmarks corner case and comparing
then by their indexes, GtkPlacesSidebar can sort
the bookmarks properly in the order they're saved.

https://bugzilla.gnome.org/show_bug.cgi?id=744589
2015-03-04 17:20:40 -03:00
Matthias Clasen
f211031a9f places sidebar: Make a function NULL-safe
gtk_places_sidebar_set_location's location argument is documented
as allow-none, but if one actually passes NULL, a warning results.
Fix that.
2015-01-28 18:25:32 -05:00