Commit Graph

21349 Commits

Author SHA1 Message Date
Federico Mena Quintero
82a5a0240c filechooserbutton: When the combo box changes, set the *file*, not the current folder
The currently-selected file *is* the selection even in SELECT_FOLDER mode.  Do not confuse this
with the current folder.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:28:13 -06:00
Aleksander Morgado
b994bcd4f2 combobox: popdown the combobox when on 'grab-broken-event'
And also explicitly remove pointer/keyboard grabs from the display.

Whenever the grab is reported lost, we should popdown the combobox, so that the
GDK_WINDOW_TEMP window is hidden and removed from the toplevel, as done with
the menu for example.

Leaving the GDK_WINDOW_TEMP window open when re-activating the application
triggers several issues in the win32 backend, due to restacking windows of the
non-toplevel group into the toplevel group:

https://bugzilla.gnome.org/show_bug.cgi?id=695200
2013-03-12 12:42:21 +01:00
Federico Mena Quintero
979e8bd9ec filechooserbutton: Update the combo box even after the dialog is cancelled
We assumed that we didn't have to update the combo box if the dialog got cancelled,
as it should simply retain its previous contents.  But this assumption doesn't work
as the dialog is brought up with the 'Other...' item - we don't want the
combo box to keep showing 'Other...' if the dialog is cancelled.

The test from the previous commit now passes.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:58:02 -06:00
Federico Mena Quintero
e16591780d filechooserbutton: New test for opening the Other item in the combo box and then canceling the dialog
There is this bug:

1. Start with a file chooser button in SELECT_FOLDER mode, and select a folder from the combo box.

2. Click on the button's combo box, select 'Other...'

3. You get the file chooser dialog. Cancel the dialog.

4. The file chooser button's combo box still shows 'Other...' instead of
   showing the selection from (1).

This is a test to ensure that the original selection is restored.
The test fails right now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:57:58 -06:00
Federico Mena Quintero
dc5c12b437 filechooserbutton: Sync the tests a bit with the master branch
The tests fail right now in gtk-2-24 because accessibility is not available out of the box.
2013-03-08 11:13:12 -06:00
Federico Mena Quintero
6dc11c26a8 filechooserbutton: Don't show the (None) item when the combo box is popped up
This is surprisingly tricky, since the (None) item *has* to be a visible item while
the combo box is *not* popped up, so that it can show its contents.  But the item
has to be *not* visible when the combo box is popped up.

Also, update the whole button's selection, not just the underlying dialog's, when
the combo box changes its selection - based on a patch by Paul Davis in
https://bugzilla.gnome.org/show_bug.cgi?id=691040#c20

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:56:49 -06:00
Federico Mena Quintero
b714446fd8 filechooserbutton: In SELECT_FOLDER, when the selection is empty, show (None) in the combo box
We do this by adding a new row type, ROW_TYPE_EMPTY_SELECTION.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:54:43 -06:00
Federico Mena Quintero
a72b31bac1 filechooserbutton: Update the button/combo at construction time
This way the internal labels will show the correct selection even if nothing
has been selected programmatically.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:54:39 -06:00
Federico Mena Quintero
6fb7087758 filechooserbutton: Update the button/combo whenever the selection is changed programmatically
We didn't change it when the file chooser button's dialog was inactive, and so
the actual file chooser button would not visually reflect the current selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:54:32 -06:00
Federico Mena Quintero
c4b47464a2 filechooserbutton: Test that the expected filename is shown
We do some gymnastics to pull the string out of the GtkButton or the GtkComboBox that is
being used in GtkFileChooserButton to show the current selection when the dialog
is inactive - namely, we look for the subwidget with the correct ATK role, and pull its
accessible name.

Currently the test fails; this is https://bugzilla.gnome.org/show_bug.cgi?id=691040#c18

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:54:08 -06:00
Aleksander Morgado
b2a65ebfb6 spinbutton: don't override initial text in non-numeric-only spin buttons
https://bugzilla.gnome.org/show_bug.cgi?id=695312
2013-03-08 11:23:58 +01:00
Federico Mena Quintero
461c1a547e Remove some unused variables 2013-03-06 12:42:24 -06:00
Federico Mena Quintero
3c993547a4 filechooser: Use _gtk_file_has_native_path() throughout when testing for local_only
In the case of checking for local_only, g_file_is_native() is not useful, since it
will return FALSE for something in a FUSE mount.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-06 12:25:43 -06:00
Federico Mena Quintero
7a93355977 filechooser: Also convert get_uris() to returning native paths
It was only being done in gtk_file_chooser_get_uri().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-06 12:08:03 -06:00
Federico Mena Quintero
f907d16329 filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
Negatives in names of boolean functions are confusing.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-06 12:07:12 -06:00
Timothy Arceri
5d32c05578 filechooser: Show FUSE mounted locations in shortcuts
Since FUSE locations can be handled safely by applications show these mounted locations regardless of whether gtk_file_chooser_set_local_only()
is set to TRUE

https://bugzilla.gnome.org/show_bug.cgi?id=586367
2013-03-06 12:05:37 -06:00
Alan McGovern
776fc82bd5 quartz: Null check title before setting it
This avoids a crash in objective-c.

https://bugzilla.gnome.org/show_bug.cgi?id=695278
2013-03-06 12:40:23 +01:00
Cosimo Cecchi
3087e8b74e Revert "entry: never use GTK_STATE_ACTIVE to paint the background"
This reverts commit 87115e00a8.

https://bugzilla.gnome.org/show_bug.cgi?id=695003
2013-03-05 17:50:01 -05:00
Matthias Clasen
eb89bf1729 Bump version 2013-03-04 11:10:33 -05:00
Matthias Clasen
ed543bdccf 2.24.17 2013-03-04 08:50:35 -05:00
Changwoo Ryu
b01f90b8d1 immodule: Fix context ID lookup on module with multiple contexts
https://bugzilla.gnome.org/show_bug.cgi?id=690247
2013-03-04 13:07:10 +09:00
Aleksander Morgado
461c3835aa win32: fix possible memleak if GlobalAlloc() fails
Also remove the unused 'buf' variable.

https://bugzilla.gnome.org/show_bug.cgi?id=694742
2013-02-26 15:14:35 +01:00
Federico Mena Quintero
8eb2278f6a filechooserbutton: Don't ever use gtk_file_chooser_get_files()
The file chooser button only supports single-selection modes, so
switch the code to a simpler gtk_file_chooser_get_file() to avoid
dealing with GSLists of a single file.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-21 18:44:38 -06:00
Руслан Ижбулатов
d9f87ff098 Make sure icon cache has /-separated subdirs only (v2 - use g_build_path)
https://bugzilla.gnome.org/show_bug.cgi?id=692955
(cherry picked from commit 8e80fd1ab9)

Conflicts:
	gtk/updateiconcache.c
2013-02-21 19:44:47 +01:00
Federico Mena Quintero
2cc67fc109 filechooserbutton: In tests, sleep after opening the dialog
This may ensure that the dialog is actually done initializing.  We need to kill this
sleeping business and really use signals, sigh...

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 18:52:23 -06:00
Federico Mena Quintero
f8de7b1757 filechooserbutton: Don't emit file-set signal when the change is not the result of a user action
We only emit that signal when the user confirms the button's internal GtkFileChooserDialog,
or when he drags-and-drops stuff into the button.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 18:30:30 -06:00
Federico Mena Quintero
a05d51e7ab filechooserbutton: In the tests, run through the dialog more than one time
This ensures that data maintained by the button while the dialog opens/closes remains consistent.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 18:29:04 -06:00
Federico Mena Quintero
2f396a74f3 filechooserbutton: Add tests for cancelling the dialog via closing it (delete-event), instead of by simulating the Cancel button (response cancel)
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 18:14:15 -06:00
Federico Mena Quintero
65cf6295f7 filechooser: When stopping/clearing BROWSE model, really ensure that we end up in LOAD_EMPTY state
Previously we could end up in a situation where browse_list_model==NULL, and yet load_state==LOAD_FINISHED.
This is not a valid state.  So, when we get rid of the list model, really ensure that we end up
in LOAD_EMPTY so nothing assumes that there is a valid list model around.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 18:02:24 -06:00
Federico Mena Quintero
a070d75a2f filechooser: Tighten up some assertions when actually selecting files in the treeview
The model must be fully loaded, and it must be inserted in the treeview.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 17:29:05 -06:00
Cosimo Cecchi
c56f508993 release: post-release version bump 2013-02-18 14:36:04 -05:00
Cosimo Cecchi
67771adfd0 release: doc updates for 2.24.16 2013-02-18 14:31:23 -05:00
Cosimo Cecchi
e99827cb19 release: update NEWS for 2.24.16 2013-02-18 13:58:50 -05:00
Cosimo Cecchi
c25c2f0a41 Comment out a file chooser test that doesn't pass 2013-02-18 13:58:50 -05:00
William Hua
950084ae18 Make GtkItemFactory produce GtkSeparatorMenuItems.
https://bugzilla.gnome.org/show_bug.cgi?id=694077
2013-02-18 13:40:00 -05:00
Federico Mena Quintero
0004fe6cd4 filechooser: Remove test directory from testfilechooserbutton 2013-02-13 17:44:38 -06:00
Federico Mena Quintero
81df0059cb filechooserbutton: Add tests for SELECT_FOLDER mode with the dialog active
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 15:21:12 -06:00
Federico Mena Quintero
747a514cfb filechooser: Oops, cancel a file operation that was missing
In addition, remove a list of pending_cancellables that was no longer being used.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 15:10:08 -06:00
Federico Mena Quintero
670fcf2c41 filechooserbutton: Add a battery of tests for GtkFileChooserButton
These are generic tests that can test the button in all of its modes,
instead of hand-written tests for each combination.

Some tests fail currently.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 13:50:57 -06:00
Federico Mena Quintero
27eea79537 filechooserbutton: In SELECT_FOLDER mode, consider an empty selection to mean current_folder
If the user didn't explicitly select anything, BUT the file chooser button has
a current_folder set, do the same as what GtkFileChooserDefault would do:
return the current folder as the selection.

This makes the tests in tests/filechooser pass!

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 12:12:53 -06:00
Federico Mena Quintero
ea3a1ecbd1 filechooserbutton: Keep track of the current_folder while the dialog is inactive
This is analogous to keeping the selection while the dialog is inactive.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 11:47:35 -06:00
Federico Mena Quintero
c7cae86568 filechooser: Fix cast 2013-02-13 11:14:36 -06:00
Federico Mena Quintero
97aaba8343 filechooserbutton: Remove unused function prototypes 2013-02-13 11:14:17 -06:00
Federico Mena Quintero
bfcaa4228c filechooserbutton: Restore to an empty previous selection properly
If no file was originally selected in the GtkFileChooserButton, then its
internal dialog is brought up and cancelled, then we need to restore the
selection back to none.  GtkFileChooser, though, doesn't like to
select a NULL file, so call _unselect_all() in that condition.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 11:01:50 -06:00
Michael Natterer
5de08612dc gtk: reliably stop spinning when a GtkSpinButton is hidden
Call stop_spinning() also in unrealize() because unmap() is not
reliably called in GTK+ 2.x. This is not an issue in GTK+ 3.x.
2013-02-13 14:37:11 +01:00
Federico Mena Quintero
30a2f8edcc filechooserbutton: Add test for setting/getting the current folder; currently fails
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 23:12:20 -06:00
Federico Mena Quintero
1cfd1f372a filechooserbutton: Fix preserving the selection after cancelling the dialog
The button's underlying file chooser dialog should not be used to store the file selection
while the dialog is unmapped.  Instead, the file chooser button now stores the
selection itself.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 23:11:10 -06:00
Federico Mena Quintero
e6f629f2bb filechooser: Remove some unused code
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 20:12:32 -06:00
Federico Mena Quintero
69bf331c98 filechooserbutton: Simplify the code to preserve the selection while the dialog is running
It used to fetch a possibly multiple selection from the GtkFileChooserDialog, and then
pick just the first item from the selection list.  But since GtkFileChooserButton
operates in single-selection mode only, it can simply use gtk_file_chooser_get_file()
instead.

Also, the right way to reset the selection for GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
is with gtk_file_chooser_select_file(), not with _set_current_folder_file().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 19:33:17 -06:00
Federico Mena Quintero
0e79a04b66 filechooserbutton: Don't set a starting folder in the underlying dialog
Let the dialog decide by itself.
2013-02-11 19:13:38 -06:00