Commit Graph

373 Commits

Author SHA1 Message Date
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
Matthias Clasen
00e08a0159 places sidebar: Drop the top margin
This looks odd in combination with the top underflow.
2015-01-19 09:37:04 -05:00
Nelson Benítez León
f26986a50a gtkplacessidebar: insert bookmark by dnd in correct position
Add needed COLUMN INDEX to "new bookmark" row based on previous
bookmark index plus one.

Fixes bug 742727
2015-01-13 19:01:46 -05:00
Matthias Clasen
a3e37abb38 GtkPlacesSidebar: Don't return FALSE as a pointer
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741250
2014-12-08 09:15:07 -05:00
Matthias Clasen
39c0ba59bc places sidebar: Fix the sort function
When returning 1 for a pair (a,b), a sort function must
return -1 for the pair (b,a), otherwise things can go
badly.

https://bugzilla.gnome.org/show_bug.cgi?id=739729
2014-12-04 22:26:14 -05:00
Matias De Lellis
bd71849e26 GtkPlacesSidebar: Fix Home and Desktop on Windows.
We were concatenating "file://" to the result of g_get_user_special_dir() to build
a URI, but this is not enough on Windows.  Use g_filename_to_uri() instead.

See https://bugzilla.gnome.org/show_bug.cgi?id=739453
2014-12-01 14:57:32 -06:00
Cosimo Cecchi
94f412622e GtkPlacesSidebar: add support for unmount notifications
Now that we can use GNotification from here, send a notification when
umounting from GtkPlacesSidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=740896
2014-11-30 09:59:54 -08:00
Matthias Clasen
041ccd7f87 GtkPlacesSidebar: Don't crash on dnd
gtk_get_current_event() can return NULL. Don't crash if it does.

https://bugzilla.gnome.org/show_bug.cgi?id=739150
2014-10-25 16:00:00 -04:00
Matthias Clasen
c26b2c9209 GtkPlacesSidebar: Don't leak an icon
Found in valgrind.
2014-10-14 23:59:51 -04:00
Carlos Soriano
975d9d4314 gtkplacessidebar: Fix commit f6870e5b79
Commit f6870e5b79 introduced a some memory leaks and could be
improved in some areas.

Fix the memory leaks and apply the improvements.

https://bugzilla.gnome.org/show_bug.cgi?id=737983
2014-10-12 04:16:44 +02:00
Carlos Soriano
f6870e5b79 gtkplacessidebar: Open $HOME after unmounting or ejecting
When a drive is ejected or a volume unmounted the current directory
doesn't change most of the times being empty or being a directory that
user shouldn't take care about, like /run/media

Seems more useful to change to $HOME directory in that case so the user
can see something useful and familiar just after unmounting.

https://bugzilla.gnome.org/show_bug.cgi?id=737983
2014-10-10 18:17:41 +02:00
Carlos Soriano
3c29212ce3 gtkplacessidebar: Don't change location if clicked on eject button
Currently we change the current location if we click the eject button of
a mount.

Check whether the user actually clicked the eject button and don't
change location in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=737983
2014-10-10 18:17:41 +02:00
Matthias Clasen
d1fd8267ef Cosmetic formatting fix 2014-10-05 13:39:37 -04:00
Matthias Clasen
b858d45e3c GtkPlacesSidebar: Don't pile up duplicate bookmarks
We get multiple notifications from the bookmark manager when
something changes. Every time, we reconstruct the sidebar contents
completely, by clearing the store. The bookmarks are added with
async calls though, and the code was forgetting to cancel outstanding
async requests, leading to multiple instances of the same bookmark
getting added. Use the cancellable we already have to prevent that.

This could be made much more efficient by not recreating the entire
sidebar quite so often (3-5 times for a single bookmark rename).

https://bugzilla.gnome.org/show_bug.cgi?id=737679
2014-10-05 13:39:37 -04:00
Matthias Clasen
4866f0cec4 GtkPlacesSidebar: Be consistent in messages
Always quote drive/volume names.

https://bugzilla.gnome.org/show_bug.cgi?id=735192
2014-09-29 23:05:22 -04:00
Ross Lagerwall
08e1c8e30a GtkPlacesSidebar: Fix a memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=736512
2014-09-12 08:08:09 +01:00
Ross Lagerwall
0c12d3afcc GtkPlacesSidebar: Don't update bookmark if cancelled
If the query fails because it has been cancelled, it means that
dispose() has been called, so don't try and update anything.

This fixes a segfault with Nautilus in certain situations.

https://bugzilla.gnome.org/show_bug.cgi?id=736512
2014-09-12 08:08:09 +01:00
Ross Lagerwall
94ed54f8ad GtkPlacesSidebar: Only add shortcut if query succeeds
https://bugzilla.gnome.org/show_bug.cgi?id=736512
2014-09-12 08:08:09 +01:00
Matthias Clasen
768c0c21b5 GtkPlacesSidebar: Cancel async ops when finalized
This is the common practice for objects that start async operations.
https://bugzilla.gnome.org/show_bug.cgi?id=735953
2014-09-03 23:30:43 -04:00
Emmanuele Bassi
c68fc27719 places-sidebar: Use asynchronous API for querying bookmarks
Removes two FIXMEs, and ensures that the places sidebar does not block
while enumerating bookmarks or application shortcuts to remote volumes.

https://bugzilla.gnome.org/show_bug.cgi?id=735953
2014-09-03 23:30:43 -04:00
Yosef Or Boczko
40b50083ee places-sidebar: Refine the spacing
Based on a patch by Yosef Or Boczko,
https://bugzilla.gnome.org/show_bug.cgi?id=731443
2014-08-13 14:34:57 -04:00
Matthias Clasen
155c45eba5 GtkPlacesSidebar: Fix editing of bookmarks
This was silently broken - the code was just assuming that the
text cell renderer is item no. 6 on the list of all cells. That
doesn't work so well if the cell renderers are set up elsewhere
and get rearranged.

Fix this by keeping an explicit pointer to the the text cell.
2014-07-23 14:11:22 -04:00
Bastien Nocera
9d69ff697c placessidebar: Use symbolic name for symbolic icon
https://bugzilla.gnome.org/show_bug.cgi?id=731908
2014-06-22 12:23:52 -04:00
Evan Nemerson
07d825574f gtk: add missing type annotations ported from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:33 -07:00
Cosimo Cecchi
6ecc431c23 placessidebar: use proper canonicalization when checking if home
Instead of just checking the string. This catches things like double
slashes, relative paths and so on.

https://bugzilla.gnome.org/show_bug.cgi?id=730142
2014-05-14 16:05:44 -07:00
William Jon McCann
1e925a85ca places-sidebar: add optional enter location place
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:58 -04:00
William Jon McCann
5a73757cdb places-sidebar: use separators instead of heading labels
https://bugzilla.gnome.org/show_bug.cgi?id=722211
2014-04-22 22:34:55 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
285d216d3e docs: use apostrophe in *'ll 2014-02-07 13:35:54 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
Matthias Clasen
3d17e3f88c GtkPlacesSidebar: Stop drives that can be stopped
Removable USB drives or memory sticks should be powered down
when the eject button is pressed. For this, we need to call
g_drive_stop() instead of g_drive_eject(), provided the drive
can be stopped.

https://bugzilla.gnome.org/show_bug.cgi?id=723121
2014-01-27 21:53:49 -05:00
Matthias Clasen
04e8d9fa5e GtkPlacesSidebar: Fix two copy-paste errors
Sadly, this means the code can have never been tested :-(
2014-01-27 21:53:49 -05:00
Matthias Clasen
2783395eae GtkPlacesSidebar: Remove to FIXMEs
It doesn't hurt to just add the ref here, as the FIXME suggests.
2014-01-27 21:53:49 -05:00
William Jon McCann
ce941736da docs: use correct signal name in docs 2014-01-21 18:57:38 -05:00
Matthias Clasen
0de1173600 Fix a memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=722029
2014-01-13 22:22:29 -05:00
Matthias Clasen
465d4be3cf GtkPlacesSidebar: Don't show desktop if its home
We go to extra length to set the desktop_uri to NULL when
desktop == home, but then we were adding the (non-functional)
place item anyway. Don't do that.
2013-12-19 11:22:02 -05:00
Matthias Clasen
98bdc9321e GtkPlacesSidebar: avoid a crash
Be more careful when comparing uris during DND - they may
be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=720264
2013-12-19 11:01:39 -05:00
Matthias Clasen
8eeebda1e5 places sidebar: Use a symbolic desktop icon
This was pointed out in

https://bugzilla.gnome.org/show_bug.cgi?id=719505
2013-12-01 13:58:39 -05:00
Matthias Clasen
21114071ec Change the default for "show-desktop" back to TRUE
Change the GtkSettings default for "shell-shows-desktop" back to TRUE
and also change the default value of the "show-desktop" property on
GtkPlacesSidebar so that the defaultvalue test passes.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-26 14:21:01 -05:00
Cosimo Cecchi
f4f82e736c GtkPlacesSidebar: don't unref an object we don't own
gtk_settings_get_default() doesn't return a reference, so don't unref it
during dispose.
2013-11-14 18:30:47 -08:00
Ryan Lortie
c4141a2115 GtkPlacesSidebar: use shell-shows-desktop setting
Use the just-added shell-shows-desktop GtkSetting to determine if we
should also show the "Desktop" folder in the places sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-14 15:03:04 -05:00
Bastien Nocera
3f5af532f7 GtkPlacesSidebar: Show unmounted bookmarks
The GtkFileInfo is only used if there's no bookmark name,
or to get the icon for the remote share or local folder.

https://bugzilla.gnome.org/show_bug.cgi?id=711548
2013-11-13 23:23:50 -05:00
Matthias Clasen
8b7940c0b1 Silence a compiler warning 2013-11-09 19:26:22 -05:00
Matthias Clasen
2a6039e47f Filter out duplicate application shortcuts
The file chooser used to do this, the places sidebar
still needs to learn it.

https://bugzilla.gnome.org/show_bug.cgi?id=711636
2013-11-09 19:01:27 -05:00
Matthias Clasen
9e5a8b7ae1 GtkPlacesSidebar: Add local-only
This is necessary to implement the filechooser property
of the same name.

https://bugzilla.gnome.org/show_bug.cgi?id=711574
2013-11-09 18:32:51 -05:00
Matthias Clasen
bce6185494 Update coding style
gtkplacessidebar.c was looking foreign.
2013-11-09 18:32:51 -05:00
Matthias Clasen
3abae96740 Properly set drop targets
Pointed out in by Nelson Benitez in bug 707679.
2013-11-09 15:20:02 -05:00
Matthias Clasen
cf00c43154 Revert "GtkPlacesSidebar: support switching locations for XDS drag types"
This reverts commit 588ffa8c32.
2013-10-23 15:55:14 -04:00
Matthias Clasen
c9f8d22094 Revert "GtkPlacesSidebar: support open locations when dragging text"
This reverts commit 1b839d4b72.
2013-10-23 15:54:52 -04:00
Matthias Clasen
aa7bb22685 Revert "GtkPlacesSidebar: use gtk api to add dnd uri targets"
This reverts commit 7fa27dff25.
2013-10-23 15:54:44 -04:00
Nelson Benítez León
7fa27dff25 GtkPlacesSidebar: use gtk api to add dnd uri targets
Instead of hardcoding it in the dnd drop targets list.

Part of bug 707679
2013-10-23 20:20:33 +02:00
Nelson Benítez León
1b839d4b72 GtkPlacesSidebar: support open locations when dragging text
Make GtkPlacesSidebar also open locations when hovered by
text dnd targets.

Part of bug 707679
2013-10-23 20:20:33 +02:00
Nelson Benítez León
588ffa8c32 GtkPlacesSidebar: support switching locations for XDS drag types
Make GtkPlacesSidebar also change locations when hovered
by XDS dnd targets (eg. dragging a file from file-roller).

Part of bug 707679
2013-10-23 20:20:33 +02:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
John Lindgren
17a1f4abad Populate GtkPlacesSidebar at initialization
Previously, the "Places" sidebar was populated by the update_places()
call from within gtk_places_sidebar_style_set(). After
742a2f11a9, update_places() is never called
and the sidebar is never populated unless gtk_places_sidebar_add_shortcut()
happens to be called. This commit fixes this by calling update_places()
at the end of gtk_places_sidebar_init().

https://bugzilla.gnome.org/show_bug.cgi?id=709522
2013-10-06 16:06:14 -04:00
Debarshi Ray
35be1c8b56 places sidebar: Small cleanup 2013-10-03 18:30:39 +02:00
Matthias Clasen
e5317f0f9a Improve struct packing in various places 2013-09-21 23:50:55 -04:00
Federico Mena Quintero
1e5dde7eab places sidebar: Don't activate the bookmark if Eject was clicked
This should really fix https://bugzilla.gnome.org/show_bug.cgi?id=704087 ...

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-09-20 21:14:00 -05:00
Joshua Lock
24751cba8e places sidebar: don't open a bookmark when clicking eject
Trying to open a bookmark which is being ejected is at best confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=704087
2013-09-19 18:05:49 -05:00
Matthias Clasen
6aa56979dc More documentation fixes 2013-09-17 01:28:39 -04:00
Matthias Clasen
624ec0fb7d Add a style class for context menus
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.

To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.

https://bugzilla.gnome.org/show_bug.cgi?id=697127
2013-08-18 13:46:48 -04:00
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
William Jon McCann
a4332e7f69 Set reasonable minimum size for the file chooser
At small sizes it just looks broken.
2013-07-17 20:48:59 -04:00
William Jon McCann
dae6afc847 Deprecate and ignore timeout-expand setting 2013-07-11 17:08:15 -04:00
Matthias Clasen
d0a2e06c7d places sidedbar: deal with lack of symbolics
Use g_themed_icon_new_with_default_fallbacks, so we don't end up
without icons when the theme doesn't have symbolic icons.

https://bugzilla.gnome.org/show_bug.cgi?id=703606
2013-07-09 07:12:18 -04:00
William Jon McCann
aef9dca9d5 Deprecate GtkIconFactory, GtkIconSet, GtkIconSource
We want to use GtkIconTheme instead. It is worth noting that
the parts that remain undeprecated are GtkIconSize and gtk_icon_size_lookup.
2013-06-26 20:02:27 -04:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
Alban Browaeys
b08fe39cd8 GtkPlacesSidebar: do not unref mount
Do not unref mount has we grabbed its pointer without taking
a reference.
Otherwise the following call to g_list_free_full on network_mounts
frees it a second time. Segfault in nautilus ensue.

https://bugzilla.gnome.org/show_bug.cgi?id=700979
2013-05-26 00:03:13 -04:00
Federico Mena Quintero
dc2f399dd0 GtkPlacesSidebar: Only create bookmarks for folders, not files
https://bugzilla.gnome.org/show_bug.cgi?id=561221
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-05-22 17:22:28 -05:00
Joe Pea
67c8ebc5d5 GtkPlacesSidebar: Fixed tooltip capitalization
Use sentence capitalization for the tooltip on the file system disk under Devices.
https://bugzilla.gnome.org/show_bug.cgi?id=698933
2013-05-13 05:47:05 -04:00
Kalev Lember
34c0deb006 GtkPlacesSidebar: Fix an uninitialized variable in the error code path
Initialize it to NULL early so that we won't try to free an
uninitialized variable when handling an error.
2013-05-07 14:01:54 +02:00
Matthias Clasen
c6894cd606 Try this again
When the hostnamed call is cancelled, we get a G_IO_ERROR_CANCELLED
error back. Handle it properly.
2013-05-02 09:29:35 -04:00
Matthias Clasen
f7f63ae3ee Revert "Remove a superfluous ref"
This reverts commit f326c0eac8.

Grr, turns out that cancelling is not that reliable :-(
2013-05-02 08:23:58 -04:00
Matthias Clasen
f326c0eac8 Remove a superfluous ref
If we cancel the call in dispose, no need to ref the object
we pass as userdata. Avoids the risk of leaking the ref if
the call is actually canceled.
2013-05-02 05:53:40 -04:00
Matthias Clasen
2f0a5dd541 GtkPlacesSidebar: Correct all since tags 2013-05-01 21:19:37 -04:00
Federico Mena Quintero
5322420145 Use friendlier property names for Glade 2013-04-22 15:46:59 -04:00
Federico Mena Quintero
9b91e06513 Oops, only show 'Connect to server' if the caller enabled it 2013-04-21 18:20:46 -04:00
Federico Mena Quintero
9d8e3be6d7 Add a selected_volume argument to ::populate-popup
Nautilus needs this in order to implement a Format command for a volume's popup menu.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-21 12:41:33 -04:00
Federico Mena Quintero
9ded1c0c99 Sync from nautilus commit 500770e8de18b07392ffa4435372525d5d03c688
Add a Connect to Server menu item, a show-connect-to-server property, and a show-connect-to-server signal.
2013-04-20 19:14:59 -04:00
Federico Mena Quintero
2d84ebeeb8 Remove the switch location timer during drag_leave
So that hovering in and out of the sidebar quickly doesn't cause a location change in the caller.
2013-04-20 16:21:33 -04:00
Cosimo Cecchi
e9c4dcd3f8 Sync from nautilus commit d2bfffc574c1e6305d862c041b35c9c45ba67674
Coding style fix.
2013-04-20 15:59:04 -04:00
Cosimo Cecchi
755e37ffdf Sync from nautilus commit 277a6a45bee8186b2493ad1b286234ac52f1aed8
Use gtk_tree_view_set_activate_on_single_click().
2013-04-20 15:58:55 -04:00
William Jon McCann
fa1f7d3f97 Sync nautilus commit 95400548176688f3d2f5e8888f48410756bd96b8
Switch location on hovering the places sidebar during a DnD operation -
kind of for spring-loaded folders.
2013-04-20 15:56:59 -04:00
Federico Mena Quintero
3b34e70f13 Remove the drop feedback row a little time after drag_leave
Since ::drag-leave gets emitted before ::drag-drop, we can't just remove the drop feedback row
in drag-leave, as we *need* it during drag-drop.  So, we use the same trick as in testdnd.c - we
install a timeout handler in our drag-leave callback, and remove the feedback in the timeout callback.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-20 14:53:03 -04:00
Federico Mena Quintero
9c38ff7dfb Drop in the right place when the feedback row is active
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-20 14:53:03 -04:00
Federico Mena Quintero
3083308d1c Actually use the drop_state, instead of encoding things in new_bookmark_index
This lets us keep the new_bookmark_index untouched even when the drop state goes from armed to unarmed.
That will in turn let us drop in the right place...

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-20 11:42:04 -04:00
Federico Mena Quintero
a1b9bf7fbc Adjust the drag destination row when it is above the currently highlighted row
This makes the feedback accurate and without hysteresis.  Haven't I written this code ten times before?

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 17:24:03 -05:00
Federico Mena Quintero
3815f5d956 Dropping on the feedback row is always possible
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 17:24:03 -05:00
Federico Mena Quintero
bc0a9a33b0 Add a temporary row for feedback when inserting a bookmark is possible
We'll prettify this gradually.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 17:23:55 -05:00
Federico Mena Quintero
624b352d77 Move the drop feedback code to stub functions
For now it is the old, simple call to gtk_tree_view_set_drag_dest_row().  We'll do something
fancier in the following commits.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 11:30:23 -05:00
Federico Mena Quintero
7d52dff5ec Add a DropState enum to the internal state of the sidebar
We want to show a little animation when a DnD operation is happening and the user hovers
between existing bookmarks.  The animation should indicate the user that he's about to
create a new bookmark from the file right there.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-19 11:20:13 -05:00
Federico Mena Quintero
456c318f6e Remove unused #define 2013-04-11 20:42:43 -05:00
Federico Mena Quintero
d3985dec1d GtkPlacesSidebar: Hold a reference to the sidebar while a D-Bus proxy is being created
The creation is async, and the sidebar could be destroyed while the D-Bus proxy is being created.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-04-11 20:04:53 -05:00
Federico Mena Quintero
0ae26b94f2 Remove a NULL-GError that is no longer useful
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 18:12:20 -06:00
Federico Mena Quintero
63b9598b51 Don't use inout ints in the drag-action-requested signal
It's not friendly to bindings, and we didn't need an inout parameter anyway.
We use a simple return value from the signal handler now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 14:39:39 -06:00
Federico Mena Quintero
bc38811645 Remove a couple of FIXMEs 2013-02-27 14:17:10 -06:00
Federico Mena Quintero
a7213e3ccf Disallow drops on the recent:/// item
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 14:04:33 -06:00
Federico Mena Quintero
3363974c09 Remove temporary debugging code
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 14:04:23 -06:00
Federico Mena Quintero
6d94f8a56c Don't allow drops in unmounted volumes
Unmounted volumes don't have a URI yet, so we can use that to distinguish them
from within the DnD code.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 12:16:31 -06:00
Federico Mena Quintero
dbf98bcfeb Properly indicate when new bookmarks are being dropped between other bookmarks
We weren't handling the drag-URIs-as-bookmarks case in drag_motion_callback().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 12:08:16 -06:00
Federico Mena Quintero
936045e82b Merge branch 'master' into places-sidebar
Conflicts:
	docs/reference/gtk/gtk-docs.sgml
	gtk/gtkfilechooserdefault.c
	gtk/org.gtk.Settings.FileChooser.gschema.xml
2013-02-13 20:37:36 -06:00
Federico Mena Quintero
04dbec4191 Allow dropping URIs as bookmarks between existing bookmarks
The before-drop machinery was already in place; here we implement the actual
dropping.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-05 14:44:58 -06:00
Federico Mena Quintero
46acb933cd Remove the accept-uri-drops property
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-29 01:16:09 -06:00
Federico Mena Quintero
fafec940b3 Redo the logic for computing drop positions
Instead of having an accept_uri_drops flag, we'll always advertise as accepting URI drops.
However, we'll see if the caller actually handles the drag-action-requested signal.  If it
does, we'll indeed allow performing file operations when URIs are dropped.  Otherwise,
we'll only allow creating bookmarks from dragged URIs.

Dragging URIs directly into a places item will cause the sidebar to check if the caller
allows file operations.  Dragging URIs between places items will cause the sidebar
to create bookmarks for those URIs instead.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-29 01:14:10 -06:00
Federico Mena Quintero
2a35574067 Whitespace cleanups 2013-01-29 01:02:57 -06:00
Federico Mena Quintero
4bff4b025b Reset the treeview drag dest row if the drop is not possible
This keeps the drop indicator line from 'sticking' if you drag a bookmark above
the Bookmarks heading.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-25 18:01:42 -06:00
Federico Mena Quintero
f3fb51e96b Remove TODO items that are done 2013-01-24 18:46:07 -06:00
Federico Mena Quintero
fc9489f381 Use GFile in the DnD signals instead of URIs
The rest of the public API works in terms of GFile, so remove this last remnant
of passing URIs around.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-21 17:59:44 -06:00
Cosimo Cecchi
a8f3465181 Add some missing annotations 2013-01-21 18:23:25 -05:00
Cosimo Cecchi
21a07a5760 Add GObject properties and C getters 2013-01-21 18:21:00 -05:00
Cosimo Cecchi
742a2f11a9 Remove useless style_set override 2013-01-21 18:04:14 -05:00
Cosimo Cecchi
f5b91b9176 Update TODO 2013-01-21 17:49:58 -05:00
Cosimo Cecchi
f59a618db9 Apply custom names to XDG dirs if possible
And make it possible to rename them
2013-01-21 17:49:01 -05:00
Cosimo Cecchi
03f220e4c2 Don't add built-in bookmarks twice 2013-01-21 17:49:01 -05:00