Commit Graph

58 Commits

Author SHA1 Message Date
William Hua
8701e34f74 port to new gtk_menu_popup_at_* () functions
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
Razvan Chitu
9747312e6c placesview: fix open action for locations without a mount or volume
In the "Other Locations" view, locations can be opened from the context menu
based on their mount or volume. However, some locations, like "Computer", do not
have either of those so they cannot be opened from the context menu. In order to
fix this, the file associated with the location can be used as well.

https://bugzilla.gnome.org/show_bug.cgi?id=768657
2016-07-12 12:56:04 +03: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
Руслан Ижбулатов
b579fa82fe Use default VFS, not a local one (it has no network) 2016-05-02 14:45:44 +00:00
Руслан Ижбулатов
bab628beb2 GtkPlacesView: check for network:// URI support before using it
Specifically, this URI is not supported on Windows, but GFile will
do its "best" and turn it into GLocalFile("$pwd/network"), with
spectacularly bad results.

https://bugzilla.gnome.org/show_bug.cgi?id=765858
2016-05-01 19:04:18 +00:00
Georges Basile Stavracas Neto
605e205584 placesview: update a leftover function name
This should've been part of the previous commit.
2016-04-27 09:06:46 -03:00
Georges Basile Stavracas Neto
bb8b459407 placesview: follow up fixes
This patch unmarks the addresses' prefixes as translatable,
and updates the callback name to reflect what it really does
now.

This is a follow up fix from commit 7449add82.

https://bugzilla.gnome.org/show_bug.cgi?id=756570
2016-04-27 08:40:19 -03:00
Georges Basile Stavracas Neto
7449add82b placesview: provide guidance on server addresses
GtkPlacesView currently provides no example of
server addresses, which may confuse users.

To fix that, add a helper popover with some
guidance on server addresses.

https://bugzilla.gnome.org/show_bug.cgi?id=756570
2016-04-26 20:50:45 -04:00
Benjamin Otte
3308122c32 placesview: Simplify
http://www.viva64.com/en/b/0383/
2016-03-20 05:18:38 +01:00
Carlos Soriano
1977994128 gtkplacesview: clean up mount server callback
And fix a warning of unused variable.

Reviewed by Nacho on IRC
2016-02-25 13:45:20 +01:00
Carlos Soriano
17a4bd51bb gtkplacesview: use location instead of the enclosing one
We were using the enclosing location when connecting to a server, so
for instance if  we were connecting to ftp://test/test it would actually
open ftp://test/ instead of the full path.

To fix it, use the full location when emitting the open location signal.

https://bugzilla.gnome.org/show_bug.cgi?id=756659
2016-02-23 20:42:01 -05:00
Georges Basile Stavracas Neto
67125ae4e0 placesview: implement available space
GtkPlacesView is a widget to display locations
in the computer, such as root ("/") and volumes,
separating the persistent devices from removable
ones.

From the latest mockups[1], GtkPlacesView would
display the available space of local drives like
partitions. This, however, is not implemented in
the current codebase.

Fix that by implementing the measurement of disk
space, and adding a new property GtkPlacesView::show-disk-usage
which controls the visibility of measured disks.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/nautilus/nautilus-next/other-locations.png

https://bugzilla.gnome.org/show_bug.cgi?id=759225
2015-12-09 20:30:10 -02:00
Matthias Clasen
2188fe0e54 places view: Use names for cursors
Use the standard name for the busy+interactive cursor.
2015-12-05 19:18:27 -05:00
Matthias Clasen
3532cd5365 places view: Fix up docs 2015-11-23 17:01:22 -05:00
Emmanuele Bassi
e2d9051f23 Do not use the GPL v3 blurb for LGPL v2.1 files
GTK+ is licensed under the terms of the GNU LGPL v2.1+.
2015-11-19 12:54:48 +00:00
Matthias Clasen
efc7dfd7a7 places view: Add an element name
Use placesview as the element name.
2015-11-05 23:41:42 -05:00
Georges Basile Stavracas Neto
50c6a11b05 placesview: vertically align path labels
The current situation is somewhat sad, with the path
label totally misaligned throughout the rows.

This is fixed by using a size group for the path labels,
so they all have the same allocated size (with the max
of 15 chars). Also, instead of hiding the eject button,
set it child-invisible, so it is hidden and yet it's size
is allocated by GtkBox.

https://bugzilla.gnome.org/show_bug.cgi?id=757303
2015-10-30 11:35:43 -02:00
Carlos Soriano
c3686838ea gtkplacesview: align spinner with header label
Use the box margin top instead of the label margin top,
so the spinner remains aligned with the header label.

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:22:40 +02:00
Carlos Soriano
9cc3e63045 gtkplacesview: plug leak
https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:22:40 +02:00
Carlos Soriano
9341f64c19 gtkplacesview: add a clear button to address entry
So it allows a quick way to clear the entry.

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:18:54 +02:00
Carlos Soriano
831509f6aa gtkplacesview: tweak ui to allow more server rows
Following design guidance, reduce row height and increase
popover height so the user is allowed to see more than 3
rows.

https://bugzilla.gnome.org/show_bug.cgi?id=756568
2015-10-15 19:18:54 +02:00
Carlos Soriano
1dbcce785e gtkplacesview: improve heuristics for external drives
Following the sidebar on commit b0989b190df, improve the way
we check when a drive is external or not.

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Carlos Soriano
569be9f111 gtkplacesview: remove dead code
This is checked on add_volume inside the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Carlos Soriano
983c61826b gtkplacesview: remove dead code
This is checked on is_removable_volume

https://bugzilla.gnome.org/show_bug.cgi?id=756589
2015-10-15 19:16:56 +02:00
Matthias Clasen
c1ad0f595c places view: fix a crash in finalize
Fix a GtkPlacesView crash in the test suite, _again_.
2015-09-21 19:42:28 -04:00
Matthias Clasen
6064ed5181 places view: Avoid a crash in finalize
When the places view is finalized before the network loading
is finished, the async operation is cancelled, and the callback
accesses the places view while it is already in a state of
disrepair. Avoid that access.
2015-09-02 07:15:57 -04:00
Matthias Clasen
6a4e4a9fe8 places view: Spew less warnings
When running the testsuite with a local gvfs, we get a 'not supported'
error here, and the g_warning makes the test fail. Avoid that.
2015-09-02 07:15:57 -04:00
Carlos Soriano
3cdf8fda37 gtkplacesview: don't warn for cancelled operations
This was intended to filter out cancelled operations, not
the other way around.

https://bugzilla.gnome.org/show_bug.cgi?id=754150
2015-08-30 09:47:29 +02:00
Carlos Soriano
0d93db7e68 gtkplacesview: make consistent loading state
Until now the code was not very clear about why the loading property is
needed, since we didn't forced all the async operations to mark the
view as loading. This cause that clients are not aware when the view
is busy on those situations.

For instance Nautilus uses the property for a few things, one of it
is to show a busy spinner on the tab title.

To improve the situation, mark as loading when a volume operation,
a mount operation or a connect to server operation is being performed.

https://bugzilla.gnome.org/show_bug.cgi?id=754150
2015-08-30 09:47:28 +02:00
Carlos Soriano
150bb6245c gtkplacesview: don't fetch networks if local only
We were fetching networks even on local only mode.
Avoid to do extra work if not necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=754150
2015-08-30 09:47:28 +02:00
Carlos Soriano
9fe9b78497 gtkplacesview: dont invalidate headers if not necessary
We were invalidating the headers after adding the placeholder
row, but GtkListBox already update the header of that row in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=754150
2015-08-30 09:47:28 +02:00
Carlos Soriano
03cd8e9558 gtkplacesview: don't rely on widgets on headers
We are showing a GtkSpinner on the networks header to provide feedback
to the user if we are fetching networks, therefore we have to modify
the spinner state when doing it.
However GtkListBox doesn't give guarantees about the widgets
set by gtk_list_box_set_header, and we could access an invalid
widget.

To avoid to access invalid widgets, bind the fetching networks
view property to the networks header spinner active property instead
of modifying directly the spinner in the private structure.

Not having the spinner in the private structure also makes the code
cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=754150
2015-08-30 09:47:28 +02:00
Carlos Soriano
bdb17a0890 gtkplacesview: create placeholder before fetching networks
If not we don't show the header at all.
This was an accidental removal before commiting.

https://bugzilla.gnome.org/show_bug.cgi?id=754150
2015-08-30 09:47:28 +02:00
Carlos Soriano
a427f1e82e gtkplacesview: only filter out placeholder if searching
We were filtering out placeholders if the list box filters
while not searching, which is not what we want, since placeholders
should only be hidden if the view is searching.

https://bugzilla.gnome.org/show_bug.cgi?id=754150
2015-08-30 09:47:28 +02:00
Matthias Clasen
919f9b24d2 places view: Don't spew needlessly
The check here was obviously meant to filter out cancellations,
not warn for them.
2015-08-28 12:15:39 -04:00
Matthias Clasen
2d83dd6217 places view: Use proper gettext macros
P_() is meant only for property nicks and blurbs. Everything
else should use _().

http://bugzilla.gnome.org/show_bug.cgi?id=754086
2015-08-25 23:28:56 -04:00
Piotr Drąg
826ac52e43 Fix grammar in "No networks locations found" 2015-08-25 17:47:12 +02:00
Carlos Soriano
00b17651b1 gtkplacesview: bail out if operation cancelled
When an operation is cancelled it's never safe to access
the object itself or the private struct, since it could be
called (and probably is) during finalize.

In case the operation is cancelled, just bail out to fix
the crashes.
2015-08-21 19:58:52 +02:00
Carlos Soriano
d0c45f19b8 gtkplacesview: use g_utf8_collate for sorting
Also rename the variable, since we usually use location
for GFiles variables.
2015-08-21 14:49:11 +02:00
Carlos Soriano
036ba25eb1 gtkplacesview: add a loading property
So clients of the view can know if the view is busy.

https://bugzilla.gnome.org/show_bug.cgi?id=753786
2015-08-21 13:29:21 +02:00
Carlos Soriano
89a34210cb gtkplacesview: improve networks feedback
Add a spinner when networks are being fetched and make
the network section permanent and show a placeholder with
a message that no networks were found in case there are no
networks. In this way users from previous versions won't be
confused with the fact that no networks are shown.

https://bugzilla.gnome.org/show_bug.cgi?id=753786
2015-08-21 13:29:20 +02:00
Carlos Soriano
7347a69328 gtkplacesview: add networks in network:///
Previously we had a network item in the sidebar, which now
is replaced by the network section on other-locations view.
However we were not exposing the networks in network:///.

Fetch them and add them in the network section of other-locations
view.

https://bugzilla.gnome.org/show_bug.cgi?id=753786
2015-08-21 13:28:12 +02:00
Carlos Soriano
16bea59b78 gtkplacesview: style fix
https://bugzilla.gnome.org/show_bug.cgi?id=753786
2015-08-21 12:04:05 +02:00
Carlos Soriano
af78792720 gtkplacesview: allow to cancel connection to server
We were not allowing to cancel the operation at all, and at
most the operation was cancelled only when clicked connect again.

Also due to gvfs bug 753735 we actually weren't cancelling
at all, and therefore creating multiple dialogs.
2015-08-18 01:05:20 +02:00
Georges Basile Stavracas Neto
e548c71394 placesview: show Disconnect instead of Eject
Since we're dealing with networks, terms like "Eject" or
the eject button are misleading, since we're not actually
ejecting but disconnecting.

Fix that by showing the appropriate icon and tooltip.
2015-08-10 15:35:56 -03:00
Georges Basile Stavracas Neto
0dff248516 placesview: sort by path
As pointed out by Cosimo, we should sort the
items according to their path.
2015-08-10 15:33:34 -03:00
Georges Basile Stavracas Neto
025f74161d placesview: plug a leak 2015-08-10 15:24:43 -03:00
Georges Basile Stavracas Neto
1219b67cdb placesview: no url for networks
We are not showing the URL of network locations
anymore, since they are distracting and not
necessary.

The code, however, forgot to cleanup the URL,
so we are still showing the URL for network
locations.

Fix that by properly cleanup the URL for network
locations.
2015-08-10 14:59:50 -03:00
Georges Basile Stavracas Neto
5e3d0b19b0 placesview: jumps to the default location
When we connect to a server, the default and expected
behavior is going to the default location, which usually
is the home directory or a writable directory.

GtkPlacesSidebar behaves properly, while GtkPlacesView
doesn't.

Fix that by jumping to the default locations instead of
the root location.
2015-08-10 10:42:43 -03:00
Ting-Wei Lan
68e00e9e5d placesview: Fix wrong property type when creating a GtkLabel
The type of xalign property of GtkLabel is float, not int. Using wrong type
crashes GtkFileChooser on x86_64 when compiling with clang.

https://bugzilla.gnome.org/show_bug.cgi?id=753284
2015-08-05 23:31:13 +08:00