summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserentry.c
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate widget flag: GTK_WIDGET_HAS_FOCUSJavier Jardón2010-03-011-1/+1
| | | | | | Use gtk_widget_has_focus() instead https://bugzilla.gnome.org/show_bug.cgi?id=69872
* Fix compilation warning: initialize variable to NO_MATCHJavier Jardón2009-11-091-1/+1
|
* Use gtk_entry_xxx functions rather than using GtkEntry structure directly.Stefan Walter2009-03-271-6/+6
| | | | | | See bug #576801 svn path=/trunk/; revision=22589
* GtkFileChooserEntry: handle slow folders by not autocompleting when the ↵Federico Mena Quintero2009-01-231-3/+4
| | | | | | | | | | | | | | | cursor is not at the end of the text 2009-01-22 Federico Mena Quintero <federico@novell.com> * gtk/gtkfilechooserentry.c (autocomplete): Relax the assertion; just do nothing if the folder is not loaded or if the cursor position is not at the end of the text. A very slow-to-load folder can get us into the latter state if the user starts typing first. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22186
* GtkFileChooserEntry: fix the computation of 'complete but not unique' and ↵Federico Mena Quintero2009-01-231-17/+26
| | | | | | | | | | | | | | | | | | | | | | | appending a '/' to unique directory names 2009-01-22 Federico Mena Quintero <federico@novell.com> Fix the computation of "complete but unique" in GtkFileChooserEntry. Fix the case where "/" was not appended to a unique directory name during explicit Tab completion. * gtk/gtkfilechooserentry.c (maybe_append_separator_to_file): Return whether anything was appended as well as the new string itself. (find_common_prefix): Oops, only turn on is_complete_not_unique_ret if we had a unique match! (append_common_prefix): If we appended a directory separator, we *did* expand the common prefix, so we are not in the "nothing inserted" case. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22184
* Comments for translators on the file chooser entry's completion feedbackFederico Mena Quintero2009-01-231-9/+22
| | | | | | | | | | (start_explicit_completion): Add comments for translators, to explain the purpose of the various feedback messages used during completion. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22183
* Pass refresh errors from the very bottom of the loading sequence up to the topFederico Mena Quintero2009-01-231-15/+38
| | | | | | | | | | | | | | | | (start_loading_current_folder): Check if the folder to be loaded is non-native for the local_only=TRUE case; if so, return an error as we are configured to load only local folders. (reload_current_folder): Pass on errors from start_loading_current_folder(). Tighten the preconditions, as we are sure that we can only receive non-NULL folder-files to load. (refresh_current_folder_and_file_part): Pass on errors from reload_current_folder(). At the very end, assert the invariant described above. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22182
* Factor out function to discard the loading process and the current folder fileFederico Mena Quintero2009-01-231-18/+29
| | | | | | | | | | | | | | | (discard_loading_and_current_folder_file): Factor out function to cancel the cancellable and discard the current_folder_file, i.e. to reset the invariant to the "nothing valid is loaded" case. (gtk_file_chooser_entry_dispose): Use discard_loading_and_current_folder_file(). (reload_current_folder): Likewise. (refresh_current_folder_and_file_part): Likewise, and ensure that the error cases result in the invariant being held. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22181
* Process the result of refreshing the folder during autocompletionFederico Mena Quintero2009-01-231-9/+22
| | | | | | | | | | | (start_autocompletion): Process the result from refresh...(). We only do completion in the REFRESH_OK case. For the error cases, we don't do anything, as this is autocompletion and must not result in non-asked-for errors popping up. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22180
* Don't handle errors when committing the completionFederico Mena Quintero2009-01-231-5/+4
| | | | | | | | | | (commit_completion_and_refresh): Don't do anything with the result of refresh...(), since this function doesn't get called during completion-related interaction. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22179
* Process the result of refreshing the folder during explicit completionFederico Mena Quintero2009-01-231-26/+59
| | | | | | | | | | (start_explicit_completion): Process the result from refresh...(). Here we present the actual feedback about only being able to display local folders for local_only=TRUE. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22178
* Return an error code when refreshing the entry from the user's inputFederico Mena Quintero2009-01-231-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-01-22 Federico Mena Quintero <federico@novell.com> Return an error code when refreshing the entry from the user's input. We use this in the completion code to know when completion can't happen due to (for example) having a non-local URI in a file chooser that is local_only=TRUE. Also, we start maintaining an invariant that chooser_entry->current_folder_file != NULL implies that: * what the user entered is valid * we are loading that folder (chooser_entry->load_folder_cancellable != NULL) * or we are done loading that folder, or we have a handle to it at least (chooser_entry->current_folder != NULL) The invariant also says that all of the above are NULL (and chooser_entry->current_folder_file == NULL) implies that the user typed something invalid. This makes _gtk_file_chooser_entry_get_current_folder() not able to return an invalid folder. * gtk/gtkfilechooserentry.c (RefreshStatus): New enum. (refresh_current_folder_and_file_part): Return a RefreshStatus. We filter out incomplete hostnames here (typing "sftp://incompl[tab]" will error out), as well as completely unparsable input. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22177
* Don't do completion in the middle of an incomplete hostnameFederico Mena Quintero2009-01-211-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix completion so it doesn't pop up for every character in a URI hostname: * gtk/gtkfilechooser.h (GtkFileChooserError): Add a GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME. * gtk/gtkfilesystem.c (_gtk_file_system_parse): Return an "incomplete hostname" error if the user has not typed a full hostname yet in an URI. * gtk/gtkfilechooserentry.c (append_common_prefix): If we get an incomplete hostname, just don't pop up an error, since that is a transient state and the user doesn't need to be notified about it. (refresh_current_folder_and_file_part): Don't revert to showing the base folder if we have an incomplete hostname. (reload_current_folder): Handle the passed folder being NULL, even if we must force a reload. Also, reload the folder if we didn't have a cancellable for it (i.e. we hadn't started to load it before). Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22157
* Add a local_only property to GtkFileChooserEntryFederico Mena Quintero2009-01-211-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | Patch by Carlos Garnacho <carlos@imendio.com> - add a local_only property to GtkFileChooserEntry: * gtk/gtkfilechooserentry.c (struct _GtkFileChooserEntry): Add a local_only field. (_gtk_file_chooser_entry_init): Default to local_only being true. (start_explicit_completion): Don't allow completion of non-native files if local_only is turned on. (start_loading_current_folder): Don't start loading non-native folders if local_only is turned on. (_gtk_file_chooser_entry_set_local_only): New function. (_gtk_file_chooser_entry_get_local_only): New function. * gtk/gtkfilechooserentry.h (_gtk_file_chooser_entry_set_local_only, _gtk_file_chooser_entry_get_local_only): New prototypes. * gtk/gtkfilechooserdefault.c (set_local_only): Set the local_only property on the entry. Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22156
* Factor out code to discard the current_folderFederico Mena Quintero2009-01-211-28/+25
| | | | | | | | | | | | | | | | | | | Patch by Carlos Garnacho <carlos@imendio.com>: * gtk/gtkfilechooserentry.c (discard_current_folder): New function, factored out for when we need to get rid of the current_folder. (gtk_file_chooser_entry_dispose): Use discard_current_folder(). (finished_loading_cb): Fix prototype. (load_directory_get_folder_callback): Discard the completion store, as well as clearing the completion feedback, if we find an error while loading the folder. Also, use discard_current_folder(). (reload_current_folder): Use discard_current_folder(). Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=22155
* Replace several implementation of blank cursor setting byMatthias Clasen2009-01-201-19/+3
| | | | | | | | | | * gtk/gtkentry.c: * gtk/gtkfilechooserentry.c: * gtk/gtktextview.c: Replace several implementation of blank cursor setting by GDK_BLANK_CURSOR. svn path=/trunk/; revision=22148
* Privately export this method. It classifies directories and mountables theMatthias Clasen2008-12-141-2/+2
| | | | | | | | | | | | | | | | | | | * gtk/gtkfilesystem.[hc] (_gtk_file_info_consider_as_directory): Privately export this method. It classifies directories and mountables the same. * gtk/gtkfilesystem.c (enclosing_volume_mount_cb): Silently drop G_IO_ERROR_ALREADY_MOUNTED error for gvfs backends without visible mounts. * gtk/gtkfilesystemmodel.c: * gtk/gtkfilechooserbutton.c: * gtk/gtkfilechooserentry.c: * gtk/gtkfilechooserdefault.c: Use the new function instead of direct checks for G_FILE_TYPE_DIRECTORY throughout. svn path=/trunk/; revision=21898
* use gdk_threads_add_idle so that the handler acquires the lock since itPaolo Borelli2008-09-081-1/+1
| | | | | | | | | | | 2008-09-08 Paolo Borelli <pborelli@katamail.com> * gtk/gtkfilechooserentry.c (install_start_autocompletion_idle): use gdk_threads_add_idle so that the handler acquires the lock since it calls gtk functions. svn path=/trunk/; revision=21321
* gtk/gtkaboutdialog.c gtk/gtkcellrendereraccel.c gtk/gtkcellrenderercombo.cSven Neumann2008-08-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-08-11 Sven Neumann <sven@gimp.org> * gtk/gtkaboutdialog.c * gtk/gtkcellrendereraccel.c * gtk/gtkcellrenderercombo.c * gtk/gtkcellrendererspin.c * gtk/gtkcellrenderertext.c * gtk/gtkclipboard.c * gtk/gtkcolorsel.c * gtk/gtkcombo.c * gtk/gtkcombobox.c * gtk/gtkdnd-quartz.c * gtk/gtkdnd.c * gtk/gtkentry.c * gtk/gtkentrycompletion.c * gtk/gtkfilechooserbutton.c * gtk/gtkfilechooserdefault.c * gtk/gtkfilechooserentry.c * gtk/gtkfontsel.c * gtk/gtkinputdialog.c * gtk/gtkmenutoolbutton.c * gtk/gtkpathbar.c * gtk/gtktooltip.c: use canonical signal names in g_signal_connect(). svn path=/trunk/; revision=21060
* Add translator hintsMatthias Clasen2008-07-241-0/+13
| | | | svn path=/trunk/; revision=20902
* Revert name changeCody Russell2008-07-011-1/+1
| | | | svn path=/trunk/; revision=20724
* Practically everything changed.Cody Russell2008-06-301-1/+1
| | | | | | | | | | | | | 2008-06-30 Cody Russell <bratsche@gnome.org> * Practically everything changed. Change all references of GIMP Toolkit (and variations of it) to GTK+ Toolkit, showing no mercy at all to our beloved ancestry. (#540529) svn path=/trunk/; revision=20709
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Mitch and Tim svn path=/trunk/; revision=20669
* Really make GtkFileSystem private by _-prefixing all functions.Matthias Clasen2008-06-131-23/+23
| | | | | | | | | | | | | | * gtk/gtkfilechooserbutton.c: * gtk/gtkfilechooserdefault.c: * gtk/gtkfilechooserentry.c: * gtk/gtkfilesystem.c: * gtk/gtkfilesystem.h: * gtk/gtkfilesystemmodel.c: * gtk/gtkpathbar.c: Really make GtkFileSystem private by _-prefixing all functions. svn path=/trunk/; revision=20378
* Bug 520874 - Should use gio directly.Carlos Garnacho2008-06-101-119/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-06-10 Carlos Garnacho <carlos@imendio.com> Bug 520874 - Should use gio directly. * gtk/gtkfilesystem.[ch]: Turn into a private object, which mostly provides helper functions for asynchronous calls, folder abstraction and uniform handling of volumes/drives/mounts. * gtk/gtkfilesystemwin32.[ch]: * gtk/gtkfilesystemunix.[ch]: Removed, these are no longer required. * gtk/gtkfilechooser.c: * gtk/gtkfilechooserbutton.c: * gtk/gtkfilechooserdefault.c: * gtk/gtkfilechooserentry.[ch]: * gtk/gtkfilechooserprivate.h: * gtk/gtkfilechooserutils.c: * gtk/gtkfilesystemmodel.[ch]: * gtk/gtkpathbar.[ch]: Use GIO internally. Adapt to GtkFileSystem API. Do not load filesystem implementation modules. * gtk/Makefile.am: * gtk/gtk.symbols: the gtkfilesystem.h private header isn't installed anymore, nor the unix/win32 implementations. * README.in: Add blurb about these changes. svn path=/trunk/; revision=20342
* bnc355225 - File chooser crash in Tab completionFederico Mena Quintero2008-06-031-1/+2
| | | | | | | | | | | | | 2008-06-03 Federico Mena Quintero <federico@novell.com> * gtk/gtkfilechooserentry.c (install_completion_feedback_timer): If the user presses Tab while the completion feedback window is active, then we'll assert. Remove the assertion and just re-set the timer. Fixes https://bugzilla.novell.com/show_bug.cgi?id=355225 Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=20305
* Ahem, fix compilationFederico Mena Quintero2008-03-261-2/+2
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19938
* Make 'Ok' work for the file chooser entryFederico Mena Quintero2008-03-261-16/+10
| | | | | | | | | | | | | | | | | | 2008-03-26 Federico Mena Quintero <federico@novell.com> * gtk/gtkfilechooserentry.c (commit_completion_and_refresh): New helper function; factored out from the functions that commit the current suggested autocompletion and that refresh the entry's paths. (gtk_file_chooser_entry_activate): Use commit_completion_and_refresh(). (_gtk_file_chooser_entry_get_file_part): Likewise. (_gtk_file_chooser_entry_get_current_folder): Likewise. This makes the entry have the correct paths when *not* using any form of completion (and makes the file chooser work when clicking the OK button). Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19937
* Hide the mouse cursor in the completion feedback windowFederico Mena Quintero2008-03-141-0/+44
| | | | | | | | | | | | 2008-03-13 Federico Mena Quintero <federico@novell.com> * gtk/gtkfilechooserentry.c (create_completion_feedback_window): Set the mouse cursor of the feedback window to invisible, so that we respect GtkEntry's invisible cursor while typing. Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19870
* Use rough font-based spacing for the completion entry's suggestion windowFederico Mena Quintero2008-03-141-1/+2
| | | | | | | | | | | | 2008-03-13 Federico Mena Quintero <federico@novell.com> * gtk/gtkfilechooserentry.c (show_completion_feedback_window): Put the feedback window at entry_height/2 pixels to the right of the cursor, for a cheap "M-width / 2" spacing. Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19869
* Beep with gtk_widget_error_bell()Federico Mena Quintero2008-03-131-1/+1
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19859
* Better feedback for sole completionsFederico Mena Quintero2008-03-131-4/+13
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19858
* Don't complete the directory separator if it would result in double separatorsFederico Mena Quintero2008-03-131-4/+41
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19857
* Remove obsolete FIXMEsFederico Mena Quintero2008-03-131-12/+3
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19856
* Remove debug printfsFederico Mena Quintero2008-03-131-80/+10
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19855
* Add some FIXMEsFederico Mena Quintero2008-03-131-1/+3
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19854
* On error when loading a folder, use the raw error message instead of ↵Federico Mena Quintero2008-03-131-5/+1
| | | | | | | | commenting it up Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19853
* Clear the current_folder_path if loading yields an errorFederico Mena Quintero2008-03-131-0/+3
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19852
* Present an error if we can't load the folder during explicit completionFederico Mena Quintero2008-03-131-4/+19
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19851
* Detect when Tab would generate no new completionsFederico Mena Quintero2008-03-131-25/+48
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19850
* Debug printfs for deleting/inserting the completionFederico Mena Quintero2008-03-131-2/+7
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19849
* If explicitly completing and we have a completion, just unselect itFederico Mena Quintero2008-03-131-7/+1
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19848
* Another FIXMEFederico Mena Quintero2008-03-131-0/+1
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19847
* Add completion feedback in other placesFederico Mena Quintero2008-03-131-3/+5
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19846
* Find the cursor position from GtkEntry for the completion feedbackFederico Mena Quintero2008-03-131-3/+30
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19845
* Use a timer for the completion feedback windowFederico Mena Quintero2008-03-131-2/+30
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19844
* Destroy the completion feedback windowFederico Mena Quintero2008-03-131-1/+19
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19843
* Use an alignment for the label like in GtkTooltipFederico Mena Quintero2008-03-131-4/+15
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19842
* Show the label as well as the feedback windowFederico Mena Quintero2008-03-131-2/+4
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19841
* Debug printfs for the completion feedback positionFederico Mena Quintero2008-03-131-3/+8
| | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> svn path=/trunk/; revision=19840