summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserentry.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoid a critical in the file chooserMatthias Clasen2014-05-211-10/+14
| | | | | | | Hiding the location entry was causing criticals, because the completion was updated after the widget has already been disposed. https://bugzilla.gnome.org/show_bug.cgi?id=720330
* docs: use Returns: consistentlyWilliam Jon McCann2014-02-191-3/+3
| | | | Instead of Return value:
* GtkFileChooserEntry: don't inline-complete if the entry doesn't have the focusFederico Mena Quintero2013-06-211-2/+6
| | | | | | | | | | | | | | | When the file chooser changes directories, it tells the GtkFileChooserEntry to change its base folder (i.e. the folder from which relative pathnames are resolved). GtkFileChooserEntry then starts loading a GtkFileSystemModel asynchronously. In the finished_loading_cb(), however, it would always ask the GtkEntryCompletion to insert the completion prefix, since that finished_loading_cb() is what is also used while the user is typing *in the entry*. But when the entry doesn't have the focus (e.g. the user changed directories by double-clicking on the file list in the file chooser), there's no reason to insert completions at all. https://bugzilla.gnome.org/show_bug.cgi?id=672271 Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()Federico Mena Quintero2013-03-051-1/+1
| | | | | | Negatives in names of boolean functions are confusing. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* filechooser: Show FUSE mounted locations in shortcutsTimothy Arceri2013-03-051-1/+1
| | | | | | | 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
* filechooser: Fix entry completionMatthias Clasen2012-03-291-9/+11
| | | | | | Inserting the selected completion did not actually work. Oops. https://bugzilla.gnome.org/show_bug.cgi?id=673090
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* filechooserentry: Catch tab key earlierBenjamin Otte2011-12-161-27/+21
| | | | | | | | | | | | | 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. https://bugzilla.gnome.org/show_bug.cgi?id=663573
* filechooserentry: Do inline completion only when opening filesBenjamin Otte2011-12-161-2/+28
| | | | | | | When saving files, using <tab> is required. We don't want the UI randomly changing filenames from below us. https://bugzilla.gnome.org/show_bug.cgi?id=663573
* filechooserentry: Remove unused enumBenjamin Otte2011-12-161-6/+0
|
* filechooserentry: Allow NULL as base folder againBenjamin Otte2011-12-161-11/+16
| | | | | | | | 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. https://bugzilla.gnome.org/show_bug.cgi?id=663573
* filechooserentry: Don't show files when selecting directoryBenjamin Otte2011-12-161-0/+8
| | | | | We don't want to complete on files when they're not supposed to be selectable.
* filechooserentry: Remove beep functionBenjamin Otte2011-12-161-8/+2
| | | | | There's only 2 places left where we potentially beep. We can call gtk_widget_error_bell() directly there.
* filechooserentry: Simplify load completionBenjamin Otte2011-12-161-49/+22
| | | | | Most importantly, consistently trigger a beep when we abort a pending completion.
* filechooserentry: Use a GtkFileFilter for filteringBenjamin Otte2011-12-161-79/+25
| | | | | | | | | 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.
* filechooserentry: Remove the file columnBenjamin Otte2011-12-161-6/+1
| | | | It is not needed anymore.
* filechooserentry: Simplify codeBenjamin Otte2011-12-161-122/+10
| | | | | | | | Use all the clever functions we invented in recent refactorings to compute the file and dir part and the current folder. This also fixes the bug where "./" was not taken as the current directory but interpreted as a file named "./".
* filechooserentry: Refactor functionBenjamin Otte2011-12-161-36/+25
| | | | | Name the function set_completion_folder() and make it accept NULL, so it behaves like a regular setter function.
* filechooserentry: Set minimum key length to 0Benjamin Otte2011-12-161-0/+1
| | | | We want the empty chooser to show possible completions, too.
* filechooserentry: Simplify refresh_current_folder_and_file_part()Benjamin Otte2011-12-161-19/+9
| | | | | The function can get the text it's refreshing from itself, as there is only one possible value. And it doesn't need to return a value anymore.
* filechooserentry: Get rid of unused member variableBenjamin Otte2011-12-161-6/+0
| | | | in_change isn't set anymore.
* filechooserentry: Remove _gtk_file_chooser_entry_set_file_part()Benjamin Otte2011-12-161-20/+0
| | | | gtk_entry_set_text() is fine.
* filechooserentry: Use completion for completionBenjamin Otte2011-12-161-153/+22
| | | | | Reduce the amount of code even more by using the entry completion to query the prefix.
* filechooserentry: Add gtk_file_chooser_entry_get_completion_text()Benjamin Otte2011-12-161-8/+12
| | | | | | 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.
* filechooserentry: Don't update the folder when completingBenjamin Otte2011-12-161-53/+4
| | | | | | The folder is always up to date, there's no need to update it. (If the folder is not up to date, that is a bug and needs to be fixed elsewhere.)
* filechooserentry: Don't override activateBenjamin Otte2011-12-161-20/+0
| | | | | The code is no longer necessary, because the relevant parts for inline completion are now handled by GtkEntry.
* filechooserentry: Simplify append_common_prefix()Benjamin Otte2011-12-161-133/+20
| | | | | | | Now that we don't need to know anymore why insertion failed, we can simplify the append function quite a lot. A simple rule now: If we did not insert anything, beep.
* filechooserentry: Remove completion feedbackBenjamin Otte2011-12-161-269/+1
| | | | | | | | | | 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.
* filechooserentry: Redo completion popup triggerBenjamin Otte2011-12-161-94/+40
| | | | | | | | | | | | | | 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.
* filechooserentry: Get rid of RefreshModeBenjamin Otte2011-12-161-35/+12
| | | | | | | 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.
* filechooserentry: Use inline completionBenjamin Otte2011-12-161-87/+19
| | | | | | ... from GtkEntryCompletion instead of implementing a poor copy ourselves. This also makes the file chooser entry behave a lot closer to normal entries.
* filechooserentry: Merge functionBenjamin Otte2011-12-161-9/+3
|
* filechooserentry: Set the text column of the entry completionBenjamin Otte2011-12-161-0/+2
| | | | | I want to use it in the next commits, but am doing this in a separate commit so we can find side effects causing bugs easier when bisecting.
* filechooserentry: Simplify match_selected functionBenjamin Otte2011-12-161-23/+9
|
* filechooserentry: Keep an extra column for the full pathBenjamin Otte2011-12-161-5/+23
| | | | | | | | | 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.
* filechooserentry: Redo _gtk_file_chooser_entry_get_file_part()Benjamin Otte2011-12-161-2/+10
| | | | | The new version does not need to update any text, it just strips the last part of the existing entry.
* filechooserentry: Modify _gtk_file_chooser_entry_get_current_folder()Benjamin Otte2011-12-161-4/+23
| | | | | | 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.
* filechooserentry: Split out functionBenjamin Otte2011-12-161-4/+15
| | | | I want to use that function elsewhere, so split it out.
* filechooserentry: Simplify codeBenjamin Otte2011-12-161-18/+4
| | | | | Now that the base folder is always != NULL, we can remove the parts of the code that check for NULL.
* filechooserentry: Ensure the base folder is always validBenjamin Otte2011-12-161-3/+12
| | | | | If the base folder is set to NULL, then we just assume the home dir. FIXME: Should we disallow a NULL folder?
* filechooserentry: Don't complain about incomplete hostnamesBenjamin Otte2011-12-161-56/+6
| | | | | First of all, those hostnames may very well be complete, second of all, smb:// is a valid uri to enter.
* filechooserentry: Start autocomplete immediatelyBenjamin Otte2011-12-161-31/+2
| | | | Don't do idle handlers for this.
* filechooserentry: Remove file_system argumentBenjamin Otte2011-12-161-13/+1
| | | | It's not needed anymore.
* filechooserentry: Simplify codeBenjamin Otte2011-12-161-18/+15
| | | | | Now that we've imported the function in the last commit, rename it and omit useless arguments by instead passing in the entry directly.
* filechooserentry: Move _gtk_file_system_parse()Benjamin Otte2011-12-161-0/+138
| | | | | It's very specific to the file chooser entry, so it's better kept there. It's also not used anywhere else in the code.
* filechooserentry: Use a GtkFileSystemModelBenjamin Otte2011-12-161-136/+65
| | | | | Replace the usage of a list store and a GtkFolder with a GtkFileSystemModel. This improves performance and reduces code size.
* filechooserentry: Store the liststore as a treemodelBenjamin Otte2011-12-161-14/+14
| | | | | Just changes the type of the member variable. This way we can avoid a lot of casts.
* filechooserentry: Make appending / to directories simplerBenjamin Otte2011-12-161-47/+4
|
* filechooserentry: Only append / to directory names onceBenjamin Otte2011-12-161-38/+0
| | | | | | Since 069d78ed31fc1c0a9cb7621d27fe10d7b974315b the / is appended to directories upon constructing the display name, so there is no need to do it later.
* filechooserentry: Don't trim away the slash after directoriesBenjamin Otte2011-12-161-13/+1
| | | | | It's not necessary as the code appending the slashes checks for a slash these days.