Commit Graph

269 Commits

Author SHA1 Message Date
Timm Bäder
806c4f7d2f filechooserwidget: Inherit from GtkWidget 2017-03-31 09:50:38 +02:00
Timm Bäder
a65fbf2d49 filechooserwidget: Remvoe useless gtk_widget_show call
And a comment above. Even if it is not correct, it doesn't matter since
we call gtk_widget_show on it again later in that function.
2017-03-13 12:45:38 +01:00
Timm Bäder
4d3b15e37c filechooserwidget: Avoid a gtk_widget_destroy 2017-03-13 12:08:58 +01:00
Timm Bäder
fa5c39942c filechooserwidget: Remove unnecessary gtk_widget_show calls 2017-03-13 12:08:58 +01:00
Timm Bäder
aebea7d644 filechooserwidget: Fix profiling code compilation 2017-02-17 18:23:01 +01:00
Timm Bäder
d637b0eeed filechooserwidget: Fix rename popover position calculation
Since the browse_file_popover is positioned correctly, just convert the
coordinates in the same way we do there.

https://bugzilla.gnome.org/show_bug.cgi?id=778746
2017-02-17 18:22:15 +01:00
Bastien Nocera
76dfef6257 gtk: Ignore gtk_show_uri() deprecation warnings
https://bugzilla.gnome.org/show_bug.cgi?id=778726
2017-02-16 16:37:55 +01:00
Piotr Drąg
bfaed659f1 Fix translator comments
They need to be exactly one line above a string to show up in .po files.
2017-01-28 01:13:12 +01:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00
Timm Bäder
13b001b77c widget: Remove show_all vfunc 2017-01-20 21:33:38 +01:00
Timm Bäder
55fda57c44 filechooserwidget: Forward file filter to entry
And in the entry, apply the currently used filter as a second step to
the completion items.

https://bugzilla.gnome.org/show_bug.cgi?id=773007
2016-11-17 15:42:25 +01:00
Matthias Clasen
5b3b111260 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:06:57 -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
Emmanuele Bassi
590e7e68d8 filechooserwidget: Rename error variable
Avoid shadowing an existing error.
2016-10-17 11:44:10 +01:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Benjamin Otte
1518fe0a8f API: stylecontext: Remove state argument from getters
The argument must always be the current state.
2016-10-16 18:18:58 +02:00
Timm Bäder
3b336dda73 dialog: Remove alternative button order API 2016-10-16 18:17:21 +02:00
Timm Bäder
f45dadadd0 box: Remove 'padding' child property 2016-10-16 18:17:21 +02:00
Benjamin Otte
ad64402a55 filechooserwidget: Query dpi from CssStyle 2016-10-16 18:17:21 +02: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
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
Matthias Clasen
4e418ed71d file chooser: align date formatting with nautilus
We were treating 'yesterday' not quite the same way.

https://bugzilla.gnome.org/show_bug.cgi?id=769568
2016-08-11 12:22:01 -04:00
Timm Bäder
6032e7b216 filechooserwidget: Remove unused enum 2016-08-04 13:09:01 +02:00
Matthias Clasen
5839c13843 Implement combobox apis in GtkFileChooserWidget
https://bugzilla.gnome.org/show_bug.cgi?id=768499
2016-07-08 00:08:28 -04:00
Руслан Ижбулатов
fcd3321fa7 GtkFileChooser: don't override already opened folder
When filechooer is re-used (instead of being created and destroyed
every time it's needed), it might happen that the directory the
application wishes to initially show is the same directory that
was shown last time the filechooser was used. In that case, make sure
filechooser knows that it does not need to do its default "select $pwd
or $home" routine.

https://bugzilla.gnome.org/show_bug.cgi?id=766122
2016-05-26 11:44:13 +00:00
Bastien Nocera
6a5224ffcb file-chooser-widget: Fix "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-05 12:58:58 +02: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
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
Matthias Clasen
bbd94b5a9f gtk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05: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
Matthias Clasen
8f71060ef9 file chooser: Reload current dir when switching from search mode
The need for this was pointed out by Evangelos Foutras in
https://bugzilla.gnome.org/show_bug.cgi?id=761757
2016-02-15 22:06:17 -05:00
Matthias Clasen
71559c603e file chooser: Avoid nonworking search+save combinations
With the location entry up in the header bar in save mode, we can
end up with the search model being in use when the user types in
the location entry. In this case, we don't make the Save button
sensitive as we should.

Having two entries in the dialog is somewhat confusing anyway,
so just stop the search when the user starts typing in the location
entry.

https://bugzilla.gnome.org/show_bug.cgi?id=761757
2016-02-12 22:05:40 -05:00
Matthias Clasen
811a9b21c1 file chooser: Use the right model when getting the selection
We don't need to make assumptions about which model is currently
used since gtk_tree_selection_get_selection hands us the model.

https://bugzilla.gnome.org/show_bug.cgi?id=761757
2016-02-12 20:35:26 -05:00
Руслан Ижбулатов
4a49d8d14f Don't do remote checks on NULL files
Calling _gtk_file_consider_as_remote() with a NULL argument
results in warnings being thrown.

Note that query->priv->location being NULL is a state that does
not seem to be invalid by itself.

This could happen if you do search-as-you-type in a filechooser,
which has a filter that does not match anything *and* the current
"place" selected is "Recent".

https://bugzilla.gnome.org/show_bug.cgi?id=761552
2016-02-04 15:57:35 +00:00
Matthias Clasen
f793da54a9 file chooser: Avoid a crash
Since 39c2d12330,
priv->operation_mode == OPERATION_MODE_BROWSE no longer
guarantees that priv->browse_files_model is the current
model of the list - we are only switching the models after
loading the new directory. Avoid triggering the assertion
in show_and_select_files by checking if we have right model
before calling it.

https://bugzilla.gnome.org/show_bug.cgi?id=761209
2016-01-30 23:07:56 -05:00
Matthias Clasen
176e85ffe5 file chooser: Make Escape close the dialog
In some situations (no header bar, save mode), hitting Escape
would not do anything because the entry ate the key event.
Fix this by telling the entry to only handle Escape when there
is something to do, such as switching back to the path bar.

https://bugzilla.gnome.org/show_bug.cgi?id=761026
2016-01-29 19:12:51 -05:00
Ondrej Holy
b2eaed62f6 file chooser: Allow saving even if executable attribute is not set
Commit 8e975b2 (Bug 753969) introduced check of parent accessibility.
Consequently it is not possible to save file if executable attribute
is not set, which might happen for some gvfs backends. Let's assume
that the folder is accessible even if the attribute is not set.

https://bugzilla.gnome.org/show_bug.cgi?id=760881
2016-01-20 14:09:46 +01:00
Matthias Clasen
704b41b504 file chooser: Set a CSS name
The CSS name for GtkFileChooserWidget is ... filechooser.
2016-01-13 23:41:38 -05:00
Benjamin Otte
415030d25f dnd: Split GtkDragSourceSite into its own file 2015-11-25 20:31:27 +01:00
Timm Bäder
2182fe7d9d Don't pass widget state flags to GtkStyleContext API 2015-11-22 17:11:35 +01:00
Paolo Borelli
c619c86250 filechooser: ignore double clicks on the selected item
Since we are now interpreting button press events and
make our own double-click determination, we should not
handle double-click events that are generated by GDK.

https://bugzilla.gnome.org/show_bug.cgi?id=757950
2015-11-13 07:07:53 -05:00
Matthias Clasen
3c217e6954 file chooser: Avoid search interruption
When the search entry is shown, the 'special' nature of
., ~ and / should not trigger the location entry, because
that interrupts the search and is likely not what the
user intended.

https://bugzilla.gnome.org/show_bug.cgi?id=756505
2015-10-15 20:53:43 -04:00
Matthias Clasen
eabdaf17dc file chooser: Clear busy cursor before showing error
It looks odd to still have a busy cursor while the error
dialog is presented.
2015-10-02 06:57:05 -04:00
Matthias Clasen
7d4ed3692e file chooser: Improve search focus handling
Move focus to list when search results appear to make it
possible to select the first search result by just hitting
Enter. To keep this from interfering with keynav, we need
to make sure that we still handle Escape to search. And when
search comes up empty, we need to move the focus back to the
entry.

https://bugzilla.gnome.org/show_bug.cgi?id=755926
2015-10-01 23:32:30 -04:00
Matthias Clasen
134c2ea799 file chooser: Don't select in the search entry
The stack calls gtk_widget_grab_focus on the last focus widget,
which selects the text in the entry, so we need to make sure to
move the focus there first to keep that from happening.

https://bugzilla.gnome.org/show_bug.cgi?id=755931
2015-10-01 22:59:57 -04:00
Matthias Clasen
450056cdfe file chooser: Avoid a crash
When right-clicking in an empty folder, you should get a context
menu, not a crash. The code for positioning the popover was not
handling the eventuality of no row under the pointer. Just position
the popover right at the click location in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=755021
2015-09-16 07:41:02 -07:00
Matthias Clasen
b3a3e91f02 file chooser: Make sure places view type is known
Similar to how we handle GtkPathBar, make sure that the
type for GtkPlacesView is registered before we load the
template.

https://bugzilla.gnome.org//show_bug.cgi?id=754133
2015-09-01 01:00:46 -04:00
Paolo Borelli
8e975b28ff filechooser: check if we can access the parent folder
If we manually enter an unaccessible path in the entry, e.g
"/root/foo.txt", we should receive an error saying that the
folder is not accessible instead of showing the replace
confirmation dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=753969
2015-08-23 15:44:09 +02:00