Commit Graph

236 Commits

Author SHA1 Message Date
Javier Jardón
4232115e22 Deprecate widget flag: GTK_WIDGET_HAS_FOCUS
Use gtk_widget_has_focus() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 06:11:01 +01:00
Javier Jardón
1919f55647 Fix compilation warning: initialize variable to NO_MATCH 2009-11-09 09:41:51 +01:00
Stefan Walter
de60fd8cfd Use gtk_entry_xxx functions rather than using GtkEntry structure directly.
See bug #576801

svn path=/trunk/; revision=22589
2009-03-27 05:22:23 +00:00
Federico Mena Quintero
ba54644c38 GtkFileChooserEntry: handle slow folders by not autocompleting when the 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
2009-01-23 01:52:36 +00:00
Federico Mena Quintero
7fde4a8542 GtkFileChooserEntry: fix the computation of 'complete but not unique' and 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
2009-01-23 00:55:07 +00:00
Federico Mena Quintero
a8b06ad561 Comments for translators on the file chooser entry's completion feedback
(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
2009-01-23 00:54:52 +00:00
Federico Mena Quintero
cabc9f7f5c Pass refresh errors from the very bottom of the loading sequence up to the top
(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
2009-01-23 00:54:37 +00:00
Federico Mena Quintero
7ba4268d6b Factor out function to discard the loading process and the current folder file
(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
2009-01-23 00:54:22 +00:00
Federico Mena Quintero
fe636e4be2 Process the result of refreshing the folder during autocompletion
(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
2009-01-23 00:54:08 +00:00
Federico Mena Quintero
c1205bbbb9 Don't handle errors when committing the completion
(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
2009-01-23 00:53:53 +00:00
Federico Mena Quintero
65cd4f8df4 Process the result of refreshing the folder during explicit completion
(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
2009-01-23 00:53:38 +00:00
Federico Mena Quintero
2dd7cf4926 Return an error code when refreshing the entry from the user's input
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
2009-01-23 00:53:23 +00:00
Federico Mena Quintero
e4bc68ba04 Don't do completion in the middle of an incomplete hostname
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
2009-01-21 03:17:01 +00:00
Federico Mena Quintero
2c07a59e54 Add a local_only property to GtkFileChooserEntry
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
2009-01-21 03:16:46 +00:00
Federico Mena Quintero
92ec0276fc Factor out code to discard the current_folder
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
2009-01-21 03:16:28 +00:00
Matthias Clasen
b6b5237663 Replace several implementation of blank cursor setting by
* 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
2009-01-20 02:45:19 +00:00
Matthias Clasen
50329fa7c0 Privately export this method. It classifies directories and mountables the
* 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
2008-12-14 02:14:19 +00:00
Paolo Borelli
5e667ea561 use gdk_threads_add_idle so that the handler acquires the lock since it
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
2008-09-08 14:29:26 +00:00
Sven Neumann
2a95978506 gtk/gtkaboutdialog.c gtk/gtkcellrendereraccel.c gtk/gtkcellrenderercombo.c
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
2008-08-11 09:17:49 +00:00
Matthias Clasen
7e39f9285a Add translator hints
svn path=/trunk/; revision=20902
2008-07-24 04:02:37 +00:00
Cody Russell
57223c9a05 Revert name change
svn path=/trunk/; revision=20724
2008-07-01 22:57:50 +00:00
Cody Russell
fce9c8b7d4 Practically everything changed.
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
2008-06-30 23:01:56 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
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
2008-06-22 14:28:52 +00:00
Matthias Clasen
f9c7a4bbd0 Really make GtkFileSystem private by _-prefixing all functions.
* 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
2008-06-13 16:47:41 +00:00
Carlos Garnacho
640d68778a Bug 520874 - Should use gio directly.
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
2008-06-10 00:39:35 +00:00
Federico Mena Quintero
cf62c83b0e bnc355225 - File chooser crash in Tab completion
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
2008-06-03 18:08:48 +00:00
Federico Mena Quintero
dec88cb285 Ahem, fix compilation
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19938
2008-03-26 20:34:22 +00:00
Federico Mena Quintero
00b34c0b3d Make 'Ok' work for the file chooser entry
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
2008-03-26 20:22:50 +00:00
Federico Mena Quintero
5ed9d8099c Hide the mouse cursor in the completion feedback window
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
2008-03-14 02:45:44 +00:00
Federico Mena Quintero
d31b7a0dd8 Use rough font-based spacing for the completion entry's suggestion window
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
2008-03-14 02:13:54 +00:00
Federico Mena Quintero
c2d5bcb7f7 Beep with gtk_widget_error_bell()
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19859
2008-03-13 00:48:10 +00:00
Federico Mena Quintero
cec81cbfdf Better feedback for sole completions
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19858
2008-03-13 00:47:54 +00:00
Federico Mena Quintero
1e60639143 Don't complete the directory separator if it would result in double separators
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19857
2008-03-13 00:47:38 +00:00
Federico Mena Quintero
b7e32c8dcb Remove obsolete FIXMEs
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19856
2008-03-13 00:47:21 +00:00
Federico Mena Quintero
74f3d16c26 Remove debug printfs
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19855
2008-03-13 00:47:05 +00:00
Federico Mena Quintero
bb4c73e81b Add some FIXMEs
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19854
2008-03-13 00:46:48 +00:00
Federico Mena Quintero
b0e2c417cb On error when loading a folder, use the raw error message instead of commenting it up
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19853
2008-03-13 00:46:31 +00:00
Federico Mena Quintero
c406ebcc44 Clear the current_folder_path if loading yields an error
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19852
2008-03-13 00:46:14 +00:00
Federico Mena Quintero
7efced5687 Present an error if we can't load the folder during explicit completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19851
2008-03-13 00:45:58 +00:00
Federico Mena Quintero
d5df63cc1c Detect when Tab would generate no new completions
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19850
2008-03-13 00:45:41 +00:00
Federico Mena Quintero
801553bee6 Debug printfs for deleting/inserting the completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19849
2008-03-13 00:45:23 +00:00
Federico Mena Quintero
857c561ffe If explicitly completing and we have a completion, just unselect it
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19848
2008-03-13 00:45:05 +00:00
Federico Mena Quintero
bcb36780ed Another FIXME
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19847
2008-03-13 00:44:48 +00:00
Federico Mena Quintero
e33260acf3 Add completion feedback in other places
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19846
2008-03-13 00:44:30 +00:00
Federico Mena Quintero
932e20e9df Find the cursor position from GtkEntry for the completion feedback
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19845
2008-03-13 00:44:12 +00:00
Federico Mena Quintero
197ab5dee8 Use a timer for the completion feedback window
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19844
2008-03-13 00:43:54 +00:00
Federico Mena Quintero
2465beb901 Destroy the completion feedback window
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19843
2008-03-13 00:43:36 +00:00
Federico Mena Quintero
53b09108df Use an alignment for the label like in GtkTooltip
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19842
2008-03-13 00:43:18 +00:00
Federico Mena Quintero
547069a38e Show the label as well as the feedback window
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19841
2008-03-13 00:42:58 +00:00
Federico Mena Quintero
b17ffff0ff Debug printfs for the completion feedback position
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19840
2008-03-13 00:42:38 +00:00
Federico Mena Quintero
3b5ddd8b55 Create a tooltip-like window to present completion feedback
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19839
2008-03-13 00:42:19 +00:00
Federico Mena Quintero
f47227adde Beep if there are no matches for explicit completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19838
2008-03-13 00:41:58 +00:00
Federico Mena Quintero
a83799a32a Scan the completion store again to look for complete-but-not-unique matches
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19837
2008-03-13 00:41:38 +00:00
Federico Mena Quintero
e5f8a4693e Stubs for all cases of completion feedback
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19836
2008-03-13 00:41:17 +00:00
Federico Mena Quintero
806cca3c9c Update comments on explicit completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19835
2008-03-13 00:40:57 +00:00
Federico Mena Quintero
47ddc0c86f Stubs to give feedback when doing explicit completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19834
2008-03-13 00:40:37 +00:00
Federico Mena Quintero
1510b02c75 Refresh the file part when it gets requested and when activating the entry
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19833
2008-03-13 00:40:16 +00:00
Federico Mena Quintero
8482f9a7de Clear the completion flags before appending the common prefix
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19832
2008-03-13 00:39:56 +00:00
Federico Mena Quintero
6a06c6daee Add FIXMEs for beeping later
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19831
2008-03-13 00:39:35 +00:00
Federico Mena Quintero
d2293cc4f8 Factor out some code
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19830
2008-03-13 00:39:15 +00:00
Federico Mena Quintero
989637296b Implement the basic code path for explicit completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19829
2008-03-13 00:38:53 +00:00
Federico Mena Quintero
11a9457ee1 Clear pending completions thoroughly
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19828
2008-03-13 00:38:31 +00:00
Federico Mena Quintero
e7009432b2 Remove debug printfs from populate_completion_store()
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19827
2008-03-13 00:38:11 +00:00
Federico Mena Quintero
a531c03baf Debug printfs for finishing the folder load
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19826
2008-03-13 00:37:50 +00:00
Federico Mena Quintero
deec573420 More debug printfs for populating the completion store
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19825
2008-03-13 00:37:27 +00:00
Federico Mena Quintero
b2fe9f70d3 Debug printfs for populating the completion store
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19824
2008-03-13 00:37:05 +00:00
Federico Mena Quintero
baeaea3ca8 Turn on in_change while changing the filename in the entry
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19823
2008-03-13 00:36:42 +00:00
Federico Mena Quintero
b25ec8e40e Update some FIXMEs
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19822
2008-03-13 00:36:18 +00:00
Federico Mena Quintero
a6bdc59213 When finding the common prefix, assert that we have the correct folder loaded
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19821
2008-03-13 00:35:54 +00:00
Federico Mena Quintero
073093bde0 Discard the completion store when we change the folder
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19820
2008-03-13 00:35:31 +00:00
Federico Mena Quintero
f5343b9037 Add some more FIXMEs
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19819
2008-03-13 00:35:08 +00:00
Federico Mena Quintero
bdebb1c7fb Remove obsolete comments
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19818
2008-03-13 00:34:44 +00:00
Federico Mena Quintero
69f62828f4 Cancel all forms of completion at the appropriate times, not just in ::changed
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19817
2008-03-13 00:34:21 +00:00
Federico Mena Quintero
9c9b5e6034 Put some more FIXMEs
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19816
2008-03-13 00:33:55 +00:00
Federico Mena Quintero
f96770eb2f Re-create the completion store right before populating it
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19815
2008-03-13 00:33:31 +00:00
Federico Mena Quintero
af7a4e2ecf Populate the completion store when the folder is done loading
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19814
2008-03-13 00:32:58 +00:00
Federico Mena Quintero
756497d142 Remove files_added handler
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19813
2008-03-13 00:32:32 +00:00
Federico Mena Quintero
d254972b7a Remove files_deleted handler
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19812
2008-03-13 00:32:05 +00:00
Federico Mena Quintero
340e9ac350 Handle the folder being completely loaded
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19811
2008-03-13 00:31:38 +00:00
Federico Mena Quintero
f1101e1169 Debug printfs for finding the common prefix
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19810
2008-03-13 00:31:13 +00:00
Federico Mena Quintero
4158110fe8 Debug printfs for the common prefix
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19809
2008-03-13 00:30:47 +00:00
Federico Mena Quintero
f027017d8b Autocomplete by inserting/selecting the common prefix
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19808
2008-03-13 00:30:20 +00:00
Federico Mena Quintero
e7afb62172 Debugging printfs
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19807
2008-03-13 00:29:55 +00:00
Federico Mena Quintero
25b98dca7b Start autocompletion in an idle so GtkEntry updates its cursor position
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19806
2008-03-13 00:29:30 +00:00
Federico Mena Quintero
5f32bf06e0 Rework the way autocompletion is initiated
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19805
2008-03-13 00:29:04 +00:00
Federico Mena Quintero
d64fa89eec For autocompletion, consider only the text up to the cursor
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19804
2008-03-13 00:28:38 +00:00
Federico Mena Quintero
1394858329 Don't overwrite the suffix after the cursor when inserting the completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19803
2008-03-13 00:28:12 +00:00
Federico Mena Quintero
bbb847aef7 Skip the cursor past the autocompleted part when requesting explicit completion
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19802
2008-03-13 00:27:46 +00:00
Federico Mena Quintero
45c87ed009 Move the cursor to the end only if we highlight the completed match
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19801
2008-03-13 00:27:16 +00:00
Federico Mena Quintero
46d0480711 Complete even if not at the end of the text
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19800
2008-03-13 00:26:49 +00:00
Federico Mena Quintero
833e32fa08 Only auto-insert the prefix if we are at the end of the text
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19799
2008-03-13 00:26:20 +00:00
Federico Mena Quintero
795727aad4 Find the common prefix based on the cursor position
Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19798
2008-03-13 00:25:50 +00:00
Tor Lillqvist
c8b617382d Bug 469868 - Filenames with colon ":" are not saved correctly
2008-03-11  Tor Lillqvist  <tml@novell.com>

	Bug 469868 - Filenames with colon ":" are not saved correctly

	* gtk/gtkfilechooserentry.c (insert_text_callback)
	(delete_text_callback) [Win32]: New functions to make sure that
	colons used otherwise than as a separator after a drive letter, or
	characters that are always illegal in file names, are rejected on
	input. This means that the GTK+ file chooser can't be used to
	input full names of alternate data streams, but oh well. There are
	still more checks that could be done on the file names, see the
	bug report. But this will do for now.
	(_gtk_file_chooser_entry_init) [Win32]: Connect above functions.


svn path=/trunk/; revision=19753
2008-03-11 18:43:49 +00:00
Matthias Clasen
4118dd893f Skip exensions when selecting filenames in the save-as dialog. (#362516,
2008-02-12  Matthias Clasen  <mclasen@redhat.com>

        Skip exensions when selecting filenames in the save-as dialog.
        (#362516, Carlos Garnacho)

        * gtk/gtkfilechooserentry.h:
        * gtk/gtkfilechooserentry.c (_gtk_file_chooser_entry_select_filename):
        New function to skip the extension part when selecting a filename.
        (_gtk_file_chooser_entry_set_base_folder): Use it here.

        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_entry_grab_focus):
        ...and here.


svn path=/trunk/; revision=19540
2008-02-12 17:34:43 +00:00
Matthias Clasen
069d78ed31 Append a '/' to directory names in the completion popup. (#431323, Maarten
2007-04-26  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserentry.c: Append a '/' to directory names
        in the completion popup.  (#431323, Maarten Maathuis)



svn path=/trunk/; revision=17658
2007-04-26 17:04:33 +00:00
Matthias Clasen
82ce59cd0f Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,
2007-03-09  Matthias Clasen <mclasen@redhat.com>

        * Everywhere: Remove unnecessary NULL checks before
        g_free().  (#369666, Morten Welinder, Djihed Afifi)

        * configure.in: Check for ftw.h



svn path=/trunk/; revision=17444
2007-03-09 21:57:37 +00:00
Matthias Clasen
07e7719441 Apply a cleanup patch by Kjartan Maraas (#341812)
2006-10-08  Matthias Clasen  <mclasen@redhat.com>

	* Apply a cleanup patch by Kjartan Maraas  (#341812)
2006-10-08 05:07:55 +00:00
Matthias Clasen
f45a35921a Commit a patch by Behdad to fix typos, omissions and other errors in the
2006-09-10  Matthias Clasen  <mclasen@redhat.com>

        * Commit a patch by Behdad to fix typos, omissions and other
        errors in the symbol aliasing, and add checks for local PLT
        entries.  (#354687, Behdad Esfahbod)
2006-09-10 06:39:16 +00:00
Matthias Clasen
ce94b03def Don't store GSource pointers, but ids. (gtk_file_chooser_entry_dispose):
2006-08-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserentry.c (struct _GtkFileChooserEntry): Don't
	store GSource pointers, but ids.
	(gtk_file_chooser_entry_dispose): Remove idles.
	(idle_add, idle_add): Factor this out.
	(gtk_file_chooser_entry_maybe_update_directory):
	(add_completion_idle): And use it here. (#350039, Chris Wilson)
2006-08-15 18:11:13 +00:00
Matthias Clasen
f8794cccca Improve consistency of signal and property names 2006-07-06 05:14:03 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Matthias Clasen
f26aad1916 Boilerplate reduction 2006-05-02 23:56:43 +00:00
Kristian Rietveld
2c97a8f6e8 Merge of the GTK+ asynchronous file chooser branch. Please see the
2006-05-01  Kristian Rietveld  <kris@imendio.com>

	Merge of the GTK+ asynchronous file chooser branch.  Please see
	the kris-asynch-branch for more detailed ChangeLog entries.

	* configure.in: increase binary version to 2.9.0.

	* gtk.symbols:
	* gtkfilechooser.c:
	* gtkfilechooserbutton.c:
	* gtkfilechooserdefault.c:
	* gtkfilechooserdialog.c:
	* gtkfilechooserembed.c:
	* gtkfilechooserembed.h:
	* gtkfilechooserentry.c:
	* gtkfilechooserentry.h:
	* gtkfilechooserprivate.h:
	* gtkfilesystem.c:
	* gtkfilesystem.h:
	* gtkfilesystemmodel.c:
	* gtkfilesystemmodel.h:
	* gtkfilesystemunix.c:
	* gtkpathbar.c:
	* gtkpathbar.h:
	Merge from kris-async-branch.
2006-05-01 21:41:12 +00:00
Michael Natterer
f41db86239 implement boolean property "truncate-multiline" which, when enabled,
2005-12-19  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkentry.c: implement boolean property "truncate-multiline"
	which, when enabled, truncates multi-line pastes or drops to their
	first line. Fixes bug #322252.

	* gtk/gtkfilechooserentry.c (gtk_file_chooser_entry_init): enable
	truncate-multiline here.
2005-12-19 19:03:51 +00:00
Matthias Clasen
94eec04267 Intern some more strings.
2005-09-01  Matthias Clasen  <mclasen@redhat.com>

        * gdk/*.c: Intern some more strings.
        * gtk/gtkintl.h:
        * gtk/*.c: Define an I_() macro and use it instead of the
        bulky g_intern_static_string().
2005-09-01 05:11:46 +00:00
Matthias Clasen
c09cc89317 Intern type names in code generated by glib-mkenums, too.
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

	* gdk/Makefile.am:
	* gtk/Makefile.am: Intern type names in code generated by
	glib-mkenums, too.

	* gtk/*.c:
	* gdk/x11/*.c:
	* gdk/*.c: Intern type names before registering the type to avoid
	unnecessary copies.
2005-08-31 16:53:43 +00:00
Federico Mena Quintero
ab44ea2b8c Merged from gtk-2-6:
2005-06-10  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fixes #162358:

	* gtk/gtkfilechooserdefault.c (update_chooser_entry): Don't return
	immediately if we are in CREATE_FOLDER mode, so that we can fill
	the entry with the newly-selected folder.
	(gtk_file_chooser_default_set_property): Warn against turning on
	multiple selection for CREATE_FOLDER mode, or about setting that
	action while multiple selection is on.
	(update_chooser_entry): Change the entry's contents as well if we
	are in CREATE_FOLDER mode.  If nothing is selected, clear the
	chooser entry.
	(trap_activate_cb): Don't trap enter/space if modifiers are
	pressed.  This lets one use Ctrl-space to toggle rows in multiple
	selection mode.
	(gtk_file_chooser_default_should_respond): Clean up the if-chain
	mess of special cases by using an array to determine what to do.
	Also, for the save-entry case in CREATE_FOLDER mode, actually fix
	the bug where the file chooser would switch to an existing folder
	rather than confirming with it, and create the folder ourselves.
	(error_creating_folder_over_existing_file_dialog): New function.

	* gtk/gtkfilechooserentry.c (check_completion_callback): Only
	insert the common prefix if we are in an "open" mode.  Use a
	helper function.
	(append_common_prefix): New helper function; code moved over from
	check_completion_callback().
	(find_common_prefix): New helper function.
	(gtk_file_chooser_entry_focus): Append the common prefix if the
	user requests it explicitly.
2005-06-10 05:54:28 +00:00
Matthias Clasen
6bd2df1ad5 Add a property to suppress the popup for single matches. (#154711)
2005-05-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtk.symbols:
	* gtk/gtkentrycompletion.c: Add a property to suppress the
	popup for single matches.  (#154711)

	* gtk/gtkentry.c (gtk_entry_completion_timeout): Respect it here.

	* gtk/gtkfilechooserentry.c (_gtk_file_chooser_entry_set_action):
	Use it here.
2005-05-26 20:36:36 +00:00
Matthias Clasen
cca8dd6347 Make PLT-reduction work with gcc4, and don't include everything in
2005-03-20  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in gdkalias.h:

	* gtk/grk.symbols: Group symbols by header and source file.
	* gtk/makegtkalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegtkalias.pl -def
	* gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate
	this file.
	* gtk/*.c: Include gtkalias.h after the other headers,
	include gtkaliasdef.c at the bottom.
	* gtk/*.h: Small cleanups.
2005-03-20 07:01:23 +00:00
Matthias Clasen
947fcbbd9f Add missing GDK_THREADS_ENTER/LEAVE.
2004-12-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserentry.c (check_completion_callback)
	(load_directory_callback): Add missing GDK_THREADS_ENTER/LEAVE.

	* gtk/gtkfilechooserdefault.c (edited_idle_cb)
	(shortcuts_drag_outside_idle_cb): Add missing
	GDK_THREADS_ENTER/LEAVE.  (#161604)

	* gtk/gtkfilechooserdefault.c (selection_check_foreach_cb):
	(list_select_func): Don't call gtk_file_info_get_is_folder()
	on NULL.
2004-12-19 04:45:09 +00:00
Anders Carlsson
21ad6be6ad Really handle a NULL model, fixes #137211 for real.
2004-10-25  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtkentry.c: (gtk_entry_completion_timeout):
	* gtk/gtkentrycompletion.c: (gtk_entry_completion_set_model),
	(gtk_entry_completion_get_model), (gtk_entry_completion_complete):
	Really handle a NULL model, fixes #137211 for real.

	* gtk/gtkfilechooserentry.c:
	(gtk_file_chooser_entry_maybe_update_directory):
	Remove _clear, #137211 is fixed.

	* tests/testentrycompletion.c: (main):
	Add completion with an empty model.
2004-10-26 15:53:32 +00:00
Matthias Clasen
5fde6ffa0b Pop up the completions again after tab. (#147700, Jens Bech Madsen)
2004-10-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserentry.c (gtk_file_chooser_entry_focus): Pop up
	the completions again after tab.  (#147700, Jens Bech Madsen)
2004-10-06 18:20:03 +00:00
Matthias Clasen
350559dea8 Remove leftover debug code.
2004-09-17  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): Remove
	leftover debug code.

	Improve the behaviour of the file chooser in save mode. Fixes bugs
	#151031, #151608, #151994 reported by Owen Taylor and Alexander
	Larsson.

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_set_property):
	(location_entry_create): Propagate the action to the file
	chooser entries.
	(gtk_file_chooser_default_should_respond): Switch folders if
	the user enters a directory name in the entry and clear the entry
	after switching folders.
	(gtk_file_chooser_default_should_respond, shortcuts_row_activated_cb):
	Move focus to the file list when activating a shortcut.
	(gtk_file_chooser_default_should_respond): Handle the case where the
	user clicks on "Save" after selecting a folder in the file list.

	* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
	Propagate the action to the file chooser entries.

	* gtk/gtkfilechooserentry.h:
	* gtk/gtkfilechooserentry.c (_gtk_file_chooser_entry_set_action):
	(_gtk_file_chooser_entry_get_action): New functions to propagate
	the GtkFileChooserAction of the file chooser to the file chooser
	entry.
	(check_completion_callback): If we are in save mode, only do
	inline completion for directories.
2004-09-17 18:13:26 +00:00
Matthias Clasen
a3aa10e5a6 New widget to go along with GtkFontButton and GtkColorButton for use in
2004-08-17  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.[hc]: New widget to go along with
	GtkFontButton and GtkColorButton for use in preference dialogs.
	Replaces GnomeFileEntry.  (#148108, James M. Cape)

	* gtk/gtk.h: Include gtkfilechooserbutton.h

	* gtk/Makefile.am (gtk_public_h_sources): Add gtkfilechooserbutton.h
	(gtk_c_sources): Add gtkfilechooserbutton.c

	* gtk/gtk.symbols: Add the GtkFileChooserButton symbols.

	* gtk/gtkfilechooserutils.[hc]: Make the delegate quark available.

	* gtk/gtkfilechooserentry.[hc] (_gtk_file_chooser_entry_new): Allow
	to suppress tab-eating using the new eat_tabs argument. Adjust all
	callers.

	* tests/testfilechooserbutton.c: Test for GtkFileChooserButton.

	* tests/Makefile.am (noinst_PROGRAMS): Add testfilechooserbutton
2004-08-17 16:06:39 +00:00
Matthias Clasen
3612aee585 Add hidden aliases for exported symbols which are used internally in order
Mon Aug  9 12:48:04 2004  Matthias Clasen  <maclas@gmx.de>

	Add hidden aliases for exported symbols which are
	used internally in order to get rid of many PLT
	entries.  (#145519, Arjan van de Ven)

	* gtk/Makefile.am: Add rules to generate gtk.def and
	from gtk.symbols, and make make check check the abi
	with abicheck.sh.
	(gtk_private_h_sources): Add gtkinternals.h
	(gtk_built_private_headers): Add gtkalias.h
	(gtk_extra_sources): Add gtk.symbols
	(EXTRA_DIST): Add makegtkalias.pl and abicheck.sh

	* gtk/gtk.symbols: New file. Definition of the GTK+ ABI.
	The file can be processed by cpp to filter out certain
	subsets of symbols.

	* gtk/abicheck.sh: New file. Script to check the actually
	symbols exported from libgtk-x11.2.0.so against the symbols
	found in gtk.symbols.

	* gtk/makegtkalias.pl: New file. Perl script to generate the
	header containing the alias definitions for internally used
	exported symbols from a list of symbols.

	* gtk/gtkinternals.h: New file. An uninstalled header listing
	symbols which must be exported for some reason and do not appear
	in any other header.

	* gtk/*.c: Include gtkalias.h
2004-08-09 16:59:53 +00:00
Federico Mena Quintero
bbd78cd9a0 Fix #144232:
2004-08-06  Federico Mena Quintero  <federico@ximian.com>

	Fix #144232:

	* gtk/gtkfilechooserdefault.c (save_widgets_create): Use a
	GtkFileChooserEntry for the file name, rather than a GtkEntry.
	(update_chooser_entry): Set the contents of the file chooser entry
	rather than the plain entry's.
	(gtk_file_chooser_default_set_current_folder): Set the new folder
	on the save entry.
	(gtk_file_chooser_default_set_current_name): Set the name on the
	file chooser entry.
	(check_save_entry): Use the file chooser entry rather than the
	plain entry.

	* gtk/gtkfilechooserentry.c
	(_gtk_file_chooser_entry_set_base_folder): Call
	gtk_file_chooser_entry_changed() so that we recompute the current
	folder based on the new base folder.
2004-08-06 19:25:25 +00:00
Tor Lillqvist
215cabd938 Fix the file chooser on Windows. I can't make it misbehave or crash any
2004-04-22  Tor Lillqvist  <tml@iki.fi>

	Fix the file chooser on Windows. I can't make it misbehave or
	crash any more now. But presumably there are still corner cases
	not handled. I haven't really checked behaviour of UNC paths, for
	instance.

	* gtk/gtkfilesystemwin32.c: Accept both backslash and slash in
	several places. Use G_IS_DIR_SEPARATOR macro (which could be added
	to GLib in 2.6).

	(gtk_file_system_win32_get_parent): Like the Unix version, assert
	filename is absolute, and avoid one unnecessary string allocation
	and freeing.

	(canonicalize_filename,gtk_file_system_win32_parse): Handle drive
	letters more correctly.

	(gtk_file_system_win32_render_icon): Assure correct syntax is used
	for root folder of a drive. (#137962, Morten Welinder)

	(filename_is_some_root): New function that accepts also root
	without any drive specified.

	(filename_is_drive_root): Rename from filename_is_root.

	* gtk/gtkfilechooserentry.c (completion_match_func): Casefold on
	Windows.
2004-04-22 05:08:19 +00:00
Federico Mena Quintero
d903e89ece Fix #132500.
2004-04-07  Federico Mena Quintero  <federico@ximian.com>

	Fix #132500.

	* gtk/gtkfilesystem.c (gtk_file_system_parse): Ensure that the
	passed-in 'str' is not NULL.

	* gtk/gtkfilesystemunix.c (expand_tilde): New helper function;
	expands "~/" or "~foo/" at the beginning of a filename.
	(gtk_file_system_unix_parse): Use expand_tilde() before doing
	anything else.

	* gtk/gtkfilechooserentry.c
	(gtk_file_chooser_entry_maybe_update_directory): Take in a
	force_reload argument.
	(gtk_file_chooser_entry_changed): If gtk_file_system_parse()
	returns an error, set the file_part_pos to -1.
	(load_directory_callback): Only populate the model if the
	file_part_pos is not -1.
2004-04-07 17:52:03 +00:00
Matthias Clasen
bf86da9df0 Block the ::changed handler during the emission of ::match-selected.
Tue Mar 16 00:56:11 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkentrycompletion.c (gtk_entry_completion_list_button_press):
	Block the ::changed handler during the emission of ::match-selected.
	Partial fix for #137226.

	* gtk/gtkfilechooserentry.c: Remove the no longer needed
	no_pop_down flag.
2004-03-15 23:56:44 +00:00
Federico Mena Quintero
3e3ca55535 In the Save modes, set the Name entry of the file chooser if we get a
2004-03-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (update_from_entry): In the Save
	modes, set the Name entry of the file chooser if we get a
	nonexistent filename from the file entry.  Fixes #135911.
	(gtk_file_chooser_default_set_current_name): Oops, this should
	also work if we are in CREATE_FOLDER mode.

	* gtk/gtkfilesystem.c (gtk_file_path_real_copy): Use
	gtk_file_path_copy().

	* gtk/gtkfilechooserentry.c (check_completion_callback): Free the
	path that we got from the model.
	(completion_match_func): Use DISPLAY_NAME_COLUMN rather than a
	hard-coded constant.
2004-03-15 19:23:54 +00:00
Owen Taylor
84fecde88b Store the position of the file part and use that in
Mon Mar 15 11:40:43 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkfilechooserentry.c: Store the position of the
        file part and use that in check_completion_callback()
        and match_selected_callback() to figure out where
        to operate on the text, rather than recomputing the
        information.
2004-03-15 17:11:28 +00:00
Owen Taylor
2ede6713a7 s/seperator/separator/.
Mon Mar 15 10:47:18 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkfilechooserentry.c: s/seperator/separator/.
2004-03-15 15:50:13 +00:00
Jonathan Blandford
486fc4fe45 implement correctly. (completion_match_func): Allow surpressing popdowns.
Mon Mar 15 08:48:48 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserentry.c (match_selected_callback): implement
        correctly.
        (completion_match_func): Allow surpressing popdowns.
        (maybe_append_seperator_to_path): New function to add a separator
        item to a display_name.  Bad hack.
        (check_completion_callback): Implement select-ahead as an idle.
        (add_completion_idle): new function to handle select-ahead
        (gtk_file_chooser_entry_do_insert_text): starf the select-ahead
        idle.
        (gtk_file_chooser_entry_focus): Override tab for completion.
        (gtk_file_chooser_entry_activate): commit select_ahead when
        activated.

        * gtk/gtkfilechooserdefault.c (location_popup_handler): grab the
        appropriate widget for the mode.
2004-03-15 14:10:45 +00:00
Jonathan Blandford
20808790d2 Rewritten to use the GtkEntryCompletion API more correctly. Now pops down
Mon Mar 15 01:50:28 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtkfilechooserentry.c: Rewritten to use the GtkEntryCompletion
        API more correctly.  Now pops down the dropdown well.

        * gtkfilesystem.c (gtk_file_path_get_type): New boxed type for the
        FilePath.

        * test/testfilechooser.c: disable preview widget temporarily.
        It's not representative of a good preview widget.
2004-03-15 06:54:34 +00:00
Jonathan Blandford
976647fdd4 up the width of the entry a tad.
Thu Mar 11 01:08:25 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (location_entry_create): up the
        width of the entry a tad.

        * gtk/gtkfilechooserentry.c (gtk_file_chooser_entry_init): use
        gtk_entry_completion_selection_changed.  Also, unref the
        completion as we were leaking a reference to it.
2004-03-11 06:08:28 +00:00
Anders Carlsson
c47ca5975f Set the base folder path in the entry.
2004-03-08  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtkfilechooserentry.c:
	(_gtk_file_chooser_entry_set_base_folder):
	Set the base folder path in the entry.
2004-03-08 01:55:43 +00:00
Federico Mena Quintero
80581c3011 Fixes #136082 and #135265, patch by Morten Welinder.
2004-03-05  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136082 and #135265, patch by Morten Welinder.

	* configure.in: Use AC_SYS_LARGEFILE.

	* */*.c: #include <config.h>
2004-03-06 03:38:59 +00:00
Federico Mena Quintero
ec3cf84bc1 Removed the in_change flag. (completion_idle_callback): Use a temporary
2003-12-03  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserentry.c (struct _GtkFileChooserEntry): Removed
	the in_change flag.
	(completion_idle_callback): Use a temporary list store and re-set
	it on the completion rather than modifying the old one.  We are
	re-reading the folder anyway, and this gets rid of non-atomicity
	problems.
2003-12-04 02:13:27 +00:00
Matthias Clasen
a2ea36c055 Remove debug g_print()s.
Fri Nov 28 00:09:10 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfilechooserentry.c: Remove debug g_print()s.
2003-11-27 23:08:51 +00:00
Federico Mena Quintero
56fb0d4856 Changing GtkFileChooserEntry to use GtkEntryCompletion.
2003-11-07  Federico Mena Quintero  <federico@ximian.com>

	Changing GtkFileChooserEntry to use GtkEntryCompletion.

	* gtk/gtkfilechooserentry.c (gtk_file_chooser_entry_init): Create
	a GtkListStore for the completion list.  Create a
	GtkEntryCompletion and attach it to the chooser entry.
	(gtk_file_chooser_entry_finalize): Unref the completion store.
	(completion_match_func): New callback for the GtkEntryCompletion.
	(completion_idle_callback): Fill the completion store with filenames.
2003-11-07 23:10:19 +00:00
Owen Taylor
b3bae3b40a gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]: Basic framework
Wed Oct 22 23:20:04 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkfilechooser.[ch] gtk/gtkfilefilter.[ch]
        gtk/gtkfilechooserwidget.[ch] gtk/gtkfilechooserdialog.[ch]:
        gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]:
        Basic framework for the new file selector widget.

        * gtk/gtkfilechooserdefault.[ch] gtk/gtkcellrenderersep.[ch]
        gtk/gtkfilechooserentry.[ch] gtk/gtkfilesystemmodel.[ch]:
        Initial implementation of the GtkFileChooser user interface.

        * gtk/gtkfilesystemunix.[ch]: GtkFileSystem implementation
        for Unix files.

        * configure.in gtk/Makefile.am gtk/xdgmime: Build code
        for freedesktop.org MIME system on Unix.

        * tests/testfilechooser.c: Test program for GtkFileChooser

        * tests/prop-editor.c: Add support for properties on interfaces.
2003-10-23 04:22:32 +00:00
Owen Taylor
7e54248bc3 auto-ize.
Wed Jul 16 16:50:31 2003  Owen Taylor  <otaylor@redhat.com>

        * configure.ac Makefile.am: auto-ize.

        * xdgmime/: Add freedesktop.org MIME spec implementatin
        by Jonathan Blandford.

        * gtkfilesystem.[ch]: Add gtk_file_info_render_icon()
        gtk_file_info_set/get_icon_type to do icon handling
        based on MIME type. Add a simple icon caching system.

        * gtkfilesystemgnomevfs.c: Implement ensure_types()
        so that extending the set of types for a loaded
        directory works. Set the MIME type to get the default
        icon handling.

        * gtkfilesystemunix.c: Look up the MIME type using
        xdgmime.

        * gtkfilechooserimpldefault.c: Display icons in the list.
2003-07-16 21:07:38 +00:00
Owen Taylor
af6bc44d86 - Disconnect signal connections when appropriate. - Listen to
Wed Apr  9 12:28:04 2003  Owen Taylor  <otaylor@redhat.com>

        * gtkfilesystemmodel.c:
        - Disconnect signal connections when appropriate.
        - Listen to ::roots-changed on the file system
        - When the last reference count on a child is
          removed, queue an idle to unload the parent.

        * gtkfilesystemgnomevfs.c
        - When URI's outside of file:/// are acessed,
          add toplevel URI's to the list of roots.
        - Improve display name computations

        * gtkfilechooserentry.c: Don't complete on empty
        file parts; free stored folder when base directory
        changes.

        * gtkfilechooser.c: Fill in some docs.
2003-04-09 16:52:13 +00:00
Owen Taylor
7388eeaa2b Fix double free.
Fri Apr  4 18:29:27 2003  Owen Taylor  <otaylor@redhat.com>

        * gtkfilechooserentry.c: Fix double free.
2003-04-04 23:36:37 +00:00
Owen Taylor
bc3fb55c1b Move interface definition into a private header so it can refer to
Fri Apr  4 17:30:27 2003  Owen Taylor  <otaylor@redhat.com>

        * gtkfilechooserprivate.h gtkfilechooser.h: Move
        interface definition into a private header so it
        can refer to GtkFileSystem.

        * *.[ch]: Switch over from using gchar *uri internally
        to using GtkFilePath * internally, and add
        conversion routines to GtkFileSystem.

        * TODO README: Updates.
2003-04-04 22:43:12 +00:00
Owen Taylor
bb320fcb5b Add GtkFileSystem::parse, and a chooser entry with completion 2003-03-25 00:11:06 +00:00