Carlos Garnacho [Sun, 18 Dec 2011 17:56:51 +0000 (18:56 +0100)]
gdk,xi2: Make more resilient about not yet known devices
Dealing with disabled devices may turn into hierarchy/device
changed events on device IDs with no backing GdkDevice yet,
so protect against that. The device attachment will be handled
correctly when the device is enabled later.
Rui Matos [Fri, 16 Dec 2011 23:46:19 +0000 (23:46 +0000)]
widget: Flip the sensitive flag even if the state doesn't change
Even if we can't change our sensitivity because the parent is insensitive we
should still flip the sensitive flag. Otherwise, with and insensitive parent,
Benjamin Otte [Fri, 16 Dec 2011 18:52:46 +0000 (19:52 +0100)]
filechooserentry: Catch tab key earlier
Instead of in the key_press handler, use a signal handler. The signal
handler runs before the default handler, and before other signal
handlers. In particular it runs before the signal handler installed via
gtk_entry_set_completion() which pops down the entry completion, and we
don't want that to happen.
The code does not change the code of the handler in any significant way,
it just refacotrs it to not call the parent anymore.
Benjamin Otte [Fri, 16 Dec 2011 17:24:24 +0000 (18:24 +0100)]
filechooserentry: Allow NULL as base folder again
This was removed previously, but is necessary to support the case where
no base folder is in use, which should cause an error. This can be
experienced in save mode in the recent files list.
Benjamin Otte [Mon, 7 Nov 2011 04:08:46 +0000 (05:08 +0100)]
filechooserentry: Use a GtkFileFilter for filtering
That way, we can use the regular filtering features of the
filesystemmodel instead of having our own filtering function that
duplicates much of the matching code.
This also removes the broken-on-windows feature where files strting with
a dot were not autocompleted.
This returns the text that should be completed on. As this is somewhat
tricky to compute (and in fact one place did it wrong), let's make it a
function.
Benjamin Otte [Mon, 7 Nov 2011 01:30:06 +0000 (02:30 +0100)]
filechooserentry: Remove completion feedback
Too much special code for no gain.
I did a totally unscientific questionnaire on GNOME IRC (assuming
autocompletion is for advanced users) and nobody even knew what this is.
So I suspect it's useless. Also, it's positioned completely wrong anyway
and nobody noticed so far. Last but not least, I'm trying to imitate
bash here and bash doesn't show feedback.
Benjamin Otte [Mon, 7 Nov 2011 01:16:43 +0000 (02:16 +0100)]
filechooserentry: Redo completion popup trigger
Use dispatch_properties_changed() instead of GtkEditable to watch for
changes to the to-be-completed text. This is necessary because various
functions in GtkEntry don't use the interface vfuncs and one only
becomes aware of them via notifications. I'm not sure this is intended
behavior, but it's how it works today.
Also, use the same code for triggering in all situations.
What the code does is this: It looks at the part of the text in front of
the cursor (or selection) and completes for it. Once the directory has
been enumerated, inline completion is activated. Note that popping up of
the completion popup is completely handled by GtkEntry.
Benjamin Otte [Sun, 6 Nov 2011 02:52:41 +0000 (03:52 +0100)]
filechooserentry: Get rid of RefreshMode
Instead, pass the text to use to refresh_current_folder_and_file_part().
This also gets rid of the problem introduced earlier that the position
is not properly updated in do_insert_text() and therefor the completion
is wrong.
Benjamin Otte [Sun, 6 Nov 2011 02:00:47 +0000 (03:00 +0100)]
filechooserentry: Use inline completion
... from GtkEntryCompletion instead of implementing a poor copy
ourselves. This also makes the file chooser entry behave a lot closer to
normal entries.
Benjamin Otte [Sat, 5 Nov 2011 21:31:40 +0000 (22:31 +0100)]
filechooserentry: Keep an extra column for the full path
This is identical to the display name when not having a path that
changes the folder. Otherwise it will have the full path that was
entered in the entry. Say when from your home dir, you type
"../../usr/li", the full path for "lib" and "lib64" will be
"../../usr/lib" and "../../usr/lib64" respectively. This value isn't
used yet, but will be soon.
The new version does not need to muck with the entry, it just extracts
the required information. It returns a reference to the folder though,
as we extract the information now instead of returning something stored.
Benjamin Otte [Fri, 28 Oct 2011 12:38:11 +0000 (05:38 -0700)]
filechooserentry: Reorganize function
Setter functions the way I code it look like this (in order):
1) Figure out if the value changed. If not, exit early.
2) Clear the old value (ie unref stuff, disconnect signals
3) Copy the new value
4) Set up things about the new value
This reorganization does that.
And by doing that, it even reduces the amount of code and the amount of
branches (and with it, nesting) needed.
Benjamin Otte [Thu, 3 Nov 2011 21:03:22 +0000 (22:03 +0100)]
entry: Don't try to handle Tab in entry completions
Instead, fall through to the default handler after closing the
completion. This has the advantage of letting the file chooser entry
capture the tab key properly, so one can't accidentally move out of the
entry by pressing tab while the completion is popped up.
I also suspect it fixes bugs with weird tab keys and shift/ctrl
oddities. But who knows...
Benjamin Otte [Thu, 15 Dec 2011 22:51:57 +0000 (23:51 +0100)]
a11y: Redo cell update function
1) always emit signals
Previously, newly constructed cells would be told to not emit events.
However, we can ensure that nothing is connected to the signals, so
they will not actually emit anything.
2) don't return anything
The return value is unused anyway.
Benjamin Otte [Wed, 14 Dec 2011 17:14:47 +0000 (18:14 +0100)]
treeview: Send changed signal directly to a11y code
No more signal handler is needed, therefore the code can also get rid of
tracking the treemodel. And we use a faster approach for iterating the
changed cellrenderers: We just iterate all columns instead of over all
cell accessibles, as that number is likely quite a bit smaller.