Commit Graph

99 Commits

Author SHA1 Message Date
Matthias Clasen
4bf4f04d1f Adapt to new popover lifecycle
We need to unparent popovers in dispose.
2019-05-28 20:25:13 +00:00
Matthias Clasen
2bf1561b48 Port widgets to the root focus API 2019-03-16 21:24:44 -04:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Emmanuele Bassi
cb0d8d6d90 Remove gtk_widget_show_all() call
Extraneous chunk from 7601bca758.

Cherry picked from gtk-3-24, which has a gtk_widget_show_all() function.
2018-12-14 20:38:03 +00:00
António Fernandes
7601bca758 placesview: List only available protocols as available
We display a list of supported protocols in the server_addresses_popover.

However, this curated list contains protocols which may or may not be
available, depending on the respective gvfs backend being installed.

So, populate the list only with protocols which are available.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-12-14 12:30:52 -05:00
António Fernandes
3bbfff9280 placesview: Set .error style if unsupported protocol
When the user types an address with a schema that is not supported,
the Connect button doesn't become sensitive, but there is no visible
feedback at all.

This feels unresponsive and leaves the user clueless.

While it doesn't help explain why the address doesn't work, this will
provide a hint that the input was acknowledged but doesn't work.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-12-14 12:28:47 -05:00
Carlos Garnacho
e08e15ba51 gtkentry: Use gestures for entry icons
Instead of doing all handling manually in the ::event vfunc,
set up drag/multipress gestures on icon images, and implement
emission of ::icon-press/release and DnD there.

As a side effect, the GdkEvent field in ::icon-press/release
signals has been dropped. Callers that might be interested on it
may still use gtk_get_current_event*().
2018-06-21 12:50:57 +02:00
Carlos Garnacho
15e00759c7 eventcontrollerkey: Port to new API model 2018-04-26 17:59:42 +02:00
Marco Trevisan (Treviño)
4900c3eb3b gtkplacesview: disconnect from server list monitor changes on destroy
It might happen otherwise that a change is recorded in between the
widget dispose and finalization, causing a crash when setting
the visible name for the GtkStack (as that will be NULL at that point)
2018-04-19 02:59:52 -05:00
Marco Trevisan (Treviño)
f9452957cd gtkplacesview: unset entry_pulse_timeout_id before removing it
Fixes a warning on widget finalize, when trying to remove an invalid
source.
2018-04-19 02:59:43 -05:00
Matthias Clasen
6d1b21a028 places view: Stop using ::key-press-event 2018-04-05 19:26:53 +02:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Matthias Clasen
1818e7bed2 places view: Stop using ::button-press-event
Instead, use a multi-press gesture in the row widget,
and emit ::popup-menu from there.
2018-01-16 14:14:10 -05:00
Matthias Clasen
33fdcca2cf placesview: Make middle click work
This does not cost us much, and improves consistency.
2017-12-12 13:56:15 -05:00
Colin Leroy
0156c52a2c placesview: Present FUSE-reachable network shares in Other Locations
The documentation about gtk_file_chooser_set_local_only() states
that "non-native files may still be available using the native
filesystem via a userspace filesystem (FUSE)."
The code that made this possible in GTK+2 was missing from GTK+3 and
that represented a regression for Linux users in numerous applications
(Firefox, Thunderbird, Chromium, ...)

https://bugzilla.gnome.org/show_bug.cgi?id=787128
2017-12-07 21:31:46 -05:00
Matthias Clasen
1c59db9bff placesview: Drop the word stock from the docs
It does not really add anything here, and makes it harder
to grep for occurrences of stock ids.
2017-12-01 10:30:21 -05: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
Matthias Clasen
dbfaa99107 image: Remove icon-size argument from icon setters
Instead, add a function gtk_image_set_icon_size() for the cases where
overriding the icon size is necessary.

Treat icon sizes the same way as pixel sizes, too. So gtk_image_clear()
no longer unsets the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
a409320cda gtk: Use gtk_widget_set_cursor()
... and gtk_widget_set_cursor_from_name() instead of setting cursors on
GdkWindows.
2017-11-04 01:37:03 +01:00
Benjamin Otte
9323d098a6 gdk: Cursors no longer have a display
Change constructors to reflect that.

While doing so, also add a fallback argument to the cursor constructors,
so it is now possible to create cursors with fallback.
2017-11-04 00:07:13 +01:00
Matthias Clasen
7793e8f071 places view: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Carlos Garnacho
8803886319 placesview: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Benjamin Otte
464ffad23e placesview: Remove event box usage 2017-08-02 14:05:02 +01:00
Timm Bäder
9c347c3012 placesview: Remove duplicate GtkMountOperation assignment
we assign a new mount operation a few lines later again.
2017-04-30 20:22:34 +02:00
Carlos Soriano
73d13fbdac gtkplacesview: Fix unmounted open in tab/window
We were send the "open-location" signal without mounting first the
location if necessary, making the open in tab/window context menu not
work for those.

This patch makes sure we mount the location before emitting the signal.

https://bugzilla.gnome.org/show_bug.cgi?id=771269
2017-04-22 11:54:23 +02:00
Georges Basile Stavracas Neto
400db31ad3 placesview: fix testsuite
Because the network monitor can perfectly be NULL,
the tests were failing on that for GtkPlacesView
always tries to disconnect this handler.

Fix that by only disconnecting the handler when
the network monitor exists.

https://bugzilla.gnome.org/show_bug.cgi?id=781195
2017-04-11 16:50:33 -03:00
Georges Basile Stavracas Neto
767927aef3 places-view: monitor network
GtkPlacesView exposes local access points and network
shares transparently by using the 'network:///' URI,
which is handled by GIO.

Currently, however, it doesn't monitor the network
for new available points, such as computers that just
join the network. It may happen too that the backend
won't find all the networks before the network enumeration
finishes.

Fix that by keeping a file monitor inspecting the network
uri, and update the places list when that happens.

https://bugzilla.gnome.org/show_bug.cgi?id=781162
2017-04-10 19:36:02 -03:00
Timm Bäder
dc511a38d0 placesview: Simplify button construction 2017-03-02 15:16:08 +01:00
Timm Bäder
56a58655fe Remove unnecessary gtk_widget_show calls 2017-01-22 14:38:21 +01:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00
Matthias Clasen
9bacbb489b Don't confuse gtk-doc
It doesn't like doc comments for non-api.
2016-11-19 13:44:36 -05:00
Matthias Clasen
214eb5860d placeview: Don't leak the file enumerator
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774634
2016-11-17 13:50:25 -05:00
Matthias Clasen
2f197ac0c2 Revert "GtkFileChooser: Make local-only default to FALSE"
This reverts commit 0bc79910e0.
2016-11-17 09:05:47 -05:00
Matthias Clasen
0bc79910e0 GtkFileChooser: Make local-only default to FALSE
There is no good reason anymore to default to TRUE, and this
default only makes applications miss out on useful functionality.
2016-11-17 09:02:29 -05:00
Rico Tzschichholz
8abf05e194 gtk: Update path references from gtk-3.0 to gtk-4.0 2016-10-23 20:22:38 +02:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Christian Kellner
d4bf215611 placesview: keep reference during network fetching
Analogous to (un)mount operation, we now keep a reference around
during the ongoing operation and make use of the destroyed flag
to check if we are still alive or if we have been cancelled as
a result of the widget being destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=764979
2016-09-09 16:55:47 -04:00
Christian Kellner
7cdc04c8d2 placesview: override destory to cancel ongoing ops
Since we hold on to a reference during (un)mount operations, we
don't trigger the cancellation of operations in finalize anymore.
Instead we now override the GtkWidget's destroy() and cancel any
ongoing operations there.

https://bugzilla.gnome.org/show_bug.cgi?id=764979
2016-09-09 16:55:47 -04:00
Christian Kellner
0e5b0b75c5 placesview: properly recover from cancellation
The current code wrongly assumes that cancellation can only happen
as a result widget finalization, and consequentially does not
properly recover from it. Therefore if the operation is cancelled
as a result of user interaction, the entry is will stay disabled
and the spinner will keep spinning. This is fixed by removal of
the early bail out in case of cancellation.

https://bugzilla.gnome.org/show_bug.cgi?id=764979
2016-09-09 16:55:47 -04:00
Christian Kellner
3ed25941ac placesview: hold onto ref during (un)mount ops
During mount and unmount opertions we keep a reference to the
GtkPlacesView around, so we have a valid view for the callback
code, even in the case that othe external references have been
dropped (i.e. the containing window gets destroyed).

https://bugzilla.gnome.org/show_bug.cgi?id=764979
2016-09-09 16:55:47 -04:00
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