Commit Graph

366 Commits

Author SHA1 Message Date
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
Matthias Clasen
a560c6ba97 Handle double queuing, rather than asserting that it does not happen.
2006-03-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (queue_edited_idle): Handle
	double queuing, rather than asserting that it does not
	happen.  (#330617)
2006-03-29 05:35:00 +00:00
Federico Mena Quintero
712dc6b8da Cancel drags when the grabs get broken. Fixes bug #333056:
2006-03-07  Federico Mena Quintero  <federico@novell.com>

	Cancel drags when the grabs get broken.  Fixes bug #333056:

	* gtk/gtkdnd.c (gtk_drag_selection_received): The time argument is
	a guint, not guint32.
	(gtk_drag_source_event_cb): Return gboolean, not gint.
	(gtk_drag_anim_timeout): Likewise.
	(gtk_drag_motion_cb): Likewise.
	(gtk_drag_key_cb): Likewise.
	(gtk_drag_button_release_cb): Likewise.
	(gtk_drag_abort_timeout): Likewise.
	(gtk_drag_begin_internal): Connect to "grab-broken-event" on the
	ipc_widget.
	(gtk_drag_source_info_destroy): Disconnect from the
	"grab-broken-event" callback.
	(gtk_drag_end): Likewise.
	(gtk_drag_grab_broken_event_cb): New callback.  We cancel the drag
	if the grab was broken and not regrabbed by the DnD code.

2006-03-07  Federico Mena Quintero  <federico@novell.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_button_press_event_cb):
	Hack to let the treeview's button-press-event handler run before
	ours.  This lets the selection be updated before we pop up a
	context menu.
2006-03-07 17:48:07 +00:00
Federico Mena Quintero
50d9a067bb Make the column header visible, and make it be "_Places". Changed the
2006-02-24  Federico Mena Quintero  <federico@novell.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_list_create): Make the
	column header visible, and make it be "_Places".  Changed the
	accessible object name to Places as well.  Fixes bug #331306.
	(file_pane_create): Do not create the path bar and "create folder"
	button here...
	(browse_widgets_create): ... but create them here instead.  This
	moves the path bar to be above both the hpaned, giving it the full
	width of the dialog.  Fixes bug #327733.
2006-02-25 02:45:57 +00:00
Federico Mena Quintero
bd51b09f77 Fixes bug #328820:
2006-01-27  Federico Mena Quintero  <federico@ximian.com>

	Fixes bug #328820:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_class_init): Make GDK_KP_Divide pop up
	the location dialog populated to "/".
	(tree_view_keybinding_cb): Likewise.
	(trap_activate_cb): Likewise.
2006-01-27 17:22:17 +00:00
Dan Winship
967aeb882b On "unix", pop up the "Open Location" window on "~" as well as "/".
* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_class_init,
	tree_view_keybinding_cb, trap_activate_cb): On "unix", pop up the
	"Open Location" window on "~" as well as "/". #153213
	(location_entry_create): Fix this so autocompletion still works
	correctly in that case.
(ok'ed by federico)
2006-01-20 19:11:08 +00:00
Federico Mena Quintero
446d1edbdb "event->state & modifiers", not "event->state && modifiers". Patch by
2005-12-05  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (trap_activate_cb): "event->state &
	modifiers", not "event->state && modifiers".  Patch by Sadrul
	Habib Chowdhury <imadil@gmail.com>.  Fixes bug #323073.
2005-12-06 03:11:43 +00:00
Federico Mena Quintero
62ed8cb115 Fixes the critical warnings from bug #317999, thus fixing the bug
2005-11-28  Federico Mena Quintero  <federico@ximian.com>

	Fixes the critical warnings from bug #317999, thus fixing the bug
	completely:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_get_paths): In SELECT_FOLDER mode,
	use _gtk_file_chooser_get_current_folder_path() instead of fetching the
	impl->current_folder directly.  The latter may be null if we are
	in RELOAD_NONE state.
2005-11-29 01:15:13 +00:00
Federico Mena Quintero
4ac1632f10 Fix bug #321560, based on a patch by Bogdan Nicula (bogdanni@hotmail.com):
2005-11-28  Federico Mena Quintero  <federico@ximian.com>

	Fix bug #321560, based on a patch by Bogdan Nicula (bogdanni@hotmail.com):

	* gtk/gtkfilechooserdefault.c (up_folder_handler): Don't add the
	current_folder to the pending select paths here; the path bar will
	give it to us now.
	(path_bar_clicked): Add the child_path to the pending select paths
	here.
	(show_and_select_paths): Don't filter out folders.
	(show_and_select_paths): Don't take separate arguments for
	only_one_path and multiple paths.

	* tests/autotestfilechooser.c (test_folder_switch_and_filters):
	New test about preserving the filters when we change folders.
2005-11-28 22:25:03 +00:00
Matthias Clasen
9228dcee29 Make F2 work for renaming bookmarks. (#320822, Jaap A. Haitsma, patch by
2005-11-28  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_key_press_event_cb): Make
	F2 work for renaming bookmarks.  (#320822, Jaap A. Haitsma, patch
	by Paolo Borelli)
2005-11-28 14:03:20 +00:00
Tim Janik
fbb2e3f4f5 deprecated floating/sink API and implemented it in terms of the GObject
Wed Nov 23 18:55:47 2005  Tim Janik  <timj@imendio.com>

        * gtk/gtkobject.[hc]: deprecated floating/sink API and implemented it
        in terms of the GObject floating/sink API.

        * gtk/gtkaboutdialog.c:
        * gtk/gtkaction.c:
        * gtk/gtkcellview.c:
        * gtk/gtkclist.c:
        * gtk/gtkcolorsel.c:
        * gtk/gtkcombobox.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkiconview.c:
        * gtk/gtkinvisible.c:
        * gtk/gtkitemfactory.c:
        * gtk/gtklayout.c:
        * gtk/gtkmenu.c:
        * gtk/gtkmenutoolbutton.c:
        * gtk/gtknotebook.c:
        * gtk/gtkprogress.c:
        * gtk/gtkrange.c:
        * gtk/gtkspinbutton.c:
        * gtk/gtkstatusicon.c:
        * gtk/gtktext.c:
        * gtk/gtktextview.c:
        * gtk/gtktoolbar.c:
        * gtk/gtktoolbutton.c:
        * gtk/gtktoolitem.c:
        * gtk/gtktreeitem.c:
        * gtk/gtktreeview.c:
        * gtk/gtktreeviewcolumn.c:
        * gtk/gtkuimanager.c:
        * gtk/gtkviewport.c:
        * gtk/gtkwidget.c:
        * gtk/gtkwindow.c:
        ported to use GObject's g_object_ref_sink().

        * gtk/gtkcolorsel.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkaboutdialog.c:
        fixed compiler warnings.
2005-11-23 18:06:58 +00:00
Federico Mena Quintero
c100ebd2da Do not check whether the path is a folder. It is useful to bookmark files
2005-11-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not
	check whether the path is a folder.  It is useful to bookmark
	files as well (e.g. todo.txt), and this will also help
	performance.
	(shortcuts_add_bookmark_from_path): Likewise.
	(shortcuts_activate_iter): Change folders or select files, as
	appropriate.
2005-11-11 22:29:09 +00:00
Federico Mena Quintero
287dee48be Only get the base path of the volume if it is mounted.
2005-11-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_add_volumes): Only get
	the base path of the volume if it is mounted.
2005-11-11 19:29:44 +00:00
Matthias Clasen
938d34c059 Improve navigation to parent folders. (#318444, Andrei Yurkevich)
2005-11-10  Matthias Clasen  <mclasen@redhat.com>

	Improve navigation to parent folders.  (#318444, Andrei Yurkevich)

	* gtk/gtkpathbar.[hc]: Add a child_path argument to
	the path_clicked signal.
	* gtk/gtkfilechooserdefault.c (path_bar_clicked): Select the
	child_path, if it is provided.
	* gtk/marshalers.list (path_bar_clicked): Add the necessary
	glue.
2005-11-10 15:17:40 +00:00
Matthias Clasen
0c7e1c1624 Don't looks the bookmark label when reordering. (#320720, Jeremy Cook)
2005-11-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_reorder): Don't
	looks the bookmark label when reordering.  (#320720, Jeremy Cook)
2005-11-07 20:31:10 +00:00
Federico Mena Quintero
647ba5b40d Fixes bug #317999:
2005-10-18  Federico Mena Quintero  <federico@ximian.com>

	Fixes bug #317999:

	* tests/autotestfilechooser.c
	(test_button_folder_states_for_action): Test that we have either
	$cwd or the explicitly-set folder.
	(test_reload_sequence): Likewise.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_get_current_folder): If our reload_state
	is RELOAD_EMPTY, return a GtkFilePath corresponding to $cwd.
2005-10-19 16:25:42 +00:00
Tommi Komulainen
8ad0abb867 Add ALREADY_EXISTS error code. Return an error code when the shortcut
2005-10-10  Tommi Komulainen  <tommi.komulainen@iki.fi>

	* gtk/gtkfilechooser.h (GtkFileChooserError): Add ALREADY_EXISTS error
	code.
	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_add_shortcut_folder): Return an error code
	when the shortcut already exists in the sidebar.  (#147521)
2005-10-10 14:29:03 +00:00
Matthias Clasen
6592f00a6d fix includes 2005-10-07 20:03:36 +00:00
Michael Natterer
cab26ded6f remove some explicit #defines of PROFILE_FILE_CHOOSER because they break
2005-10-07  Michael Natterer  <mitch@gimp.org>

	* gtk/gtkfilechooserdefault.c: remove some explicit #defines of
	PROFILE_FILE_CHOOSER because they break compilation after the
	removal of <unistd.h>.
2005-10-07 18:51:30 +00:00
Matthias Clasen
5b2d546e9f Remove a redundant (and unconditional) include of unistd.h (#318211,
2005-10-07   Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c: Remove a redundant (and
        unconditional) include of unistd.h  (#318211, Kazuki Iwamoto)
2005-10-07 16:20:37 +00:00
Federico Mena Quintero
1155f0b3e5 Take a shortcut position, not a ShortcutsIndex, to make the function more
2005-10-04  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (switch_to_shortcut): Take a
	shortcut position, not a ShortcutsIndex, to make the function more
	generic.
	(home_folder_handler): Pass the resolved index to
	switch_to_shortcut(), rather than just SHORTCUTS_HOME.
	(desktop_folder_handler): Likewise for SHORTCUTS_DESKTOP.
	(gtk_file_chooser_default_class_init): Add a "quick-bookmark"
	binding signal, and bind it to Alt-1, Alt-2. ..., Alt-0.  These
	make the respective key switch to the first, second, ..., tenth
	bookmark.
	(quick_bookmark_handler): Implement.
2005-10-05 05:05:42 +00:00
Federico Mena Quintero
5a65996333 Don't special-case Home and Desktop; just use their real names on the file
2005-10-04  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkpathbar.c (get_dir_name): Don't special-case Home and
	Desktop; just use their real names on the file system for the
	user-visible names.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_class_init): Add a "desktop-folder"
	binding signal, and bind it to M-d by default.
	(desktop_folder_handler): Implement the default handler.
	(home_folder_handler): Use a helper function.
	(switch_to_shortcut): New helper function.
	(shortcuts_append_home): Don't special-case the name of "Home";
	just use the folder name.
2005-10-04 20:08:32 +00:00
Federico Mena Quintero
3e9f549d3b New file with a set of tests for GtkCellRendererText. The idea is to run a
2005-09-28  Federico Mena Quintero  <federico@ximian.com>

	* tests/testcellrenderertext.c: New file with a set of tests for
	GtkCellRendererText.  The idea is to run a text renderer through
	most of its interesting property values to see that it works
	correctly.

	* tests/Makefile.am: Added testcellrenderertext.

	* gtk/gtkfilechooserdefault.c (load_set_model): Mark the
	entry/exit of this function for profiling.
	(gtk_file_chooser_default_style_set): Mark the start/end of the
	calls to the parent class and the the signal emission for profiling.
2005-09-29 00:19:32 +00:00
Federico Mena Quintero
72851a22cd Don't reload the current folder unnecessarily on ::map().
2005-09-27  Federico Mena Quintero  <federico@ximian.com>

	Don't reload the current folder unnecessarily on ::map().

	* gtk/gtkfilechooserprivate.h (ReloadState): New enum to represent
	the reloading state.
	(struct _GtkFileChooserDefault): Added a "reload_state" field.

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
	Initialize impl->reload_state.
	(gtk_file_chooser_default_map): Check the impl->reload_state; load
	a default folder if no folder has been set, or reload the current
	one only if we had been unmapped first.
	(gtk_file_chooser_default_update_current_folder): Set the
	reload_state to RELOAD_HAS_FOLDER.
	(gtk_file_chooser_default_unmap): Implement, and set the
	reload_state to RELOAD_WAS_UNMAPPED.
	(shortcuts_model_create): Don't call shortcuts_add_bookmarks()
	here; they'll get (re)loaded on ::map() anyway.

	* gtk/gtkfilechooserwidget.c
	(gtk_file_chooser_widget_constructor): Don't set a default folder here.

	* tests/autotestfilechooser.c (test_action_widgets): Don't take in
	a dialog; build it ourselves.
	(test_reload): New test to ensure that we don't load the default
	folder more than once, and that we reload it when
	unmapping/remapping.
	(get_impl_from_dialog): New utility function.
	(test_widgets_for_current_action): Use get_impl_from_dialog().
2005-09-27 23:57:09 +00:00
Federico Mena Quintero
58a2a79682 Mark the entry/exit of this function for profiling. (check_icon_theme):
2005-09-27  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_constructor): Mark the entry/exit of
	this function for profiling.
	(check_icon_theme): Likewise.
	(change_icon_theme): Likewise.
	(settings_notify_cb): Likewise.
	(gtk_file_chooser_default_screen_changed): Likewise.
	(update_chooser_entry): If the selection is empty, clear the file
	name entry only if we are in CREATE_FOLDER mode.  In SAVE mode,
	nothing will be selected when the user starts typeahead in the
	treeview, and we don't want to clear the file name entry in that
	case --- the user could be typing-ahead to look for a folder name.
	Fixes bug #308332, patch by Jürg Billeter.
2005-09-27 21:33:24 +00:00
Federico Mena Quintero
e9465843db Do not create the save mode-specific widgets in the open modes, so that we
2005-09-26  Federico Mena Quintero  <federico@ximian.com>

	Do not create the save mode-specific widgets in the open modes, so
	that we don't carry their baggage around.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_constructor): Don't create the
	save_widgets here.
	(save_widgets_create): Set the impl->save_widgets directly here,
	instead of passing the widgets back to the caller.  Also, pack
	them into the impl's box.
	(update_appearance): Create or destroy the save widgets as
	appropriate.  Set the action of the save_file_name_entry here.
	(shortcuts_add_current_folder): Set the active item in the
	save_folder_combo only if it exists.
	(gtk_file_chooser_default_set_property): Don't set the action of
	the save_file_name_entry here.
	(gtk_file_chooser_default_update_current_folder): Set the base
	folder of the save_file_name_entry only if the entry exists.
	(shortcuts_drag_data_received_cb): Cast the selection_data->data
	to (const char *) since that's what shortcuts_drop_uris() expects.
	(file_list_drag_data_received_cb): Likewise, for
	g_uri_list_extract_uris().
2005-09-27 01:34:24 +00:00
Federico Mena Quintero
329bc4e221 Start a set of automated tests for the file chooser. The only test in
2005-09-15  Federico Mena Quintero  <federico@ximian.com>

	* tests/autotestfilechooser.c: Start a set of automated tests for
	the file chooser.  The only test in there right now doesn't pass
	yet.  It specifies the intended behavior of the first optimization
	of a series which I'll do on the file chooser (see
	http://primates.ximian.com/~federico/news-2005-09.html#14 for the
	details of this optimization).

	* tests/Makefile.am: Added autotestfilechooser.c.

	* gtk/gtkfilechooserprivate.h (struct
	_GtkFileChooserDialogPrivate): Move all the file chooser's private
	structures to here, so that they can be accessed by
	tests/autotestfilechooser.c:  _GtkFileChooserDialogPrivate,
	_GtkFileChooserWidgetPrivate, LoadState, _GtkFileChooserDefault.

	* gtk/gtkfilechooserdialog.c: See above.

	* gtk/gtkfilechooserwidget.c: See above.

	* gtk/gtkfilechooserdefault.c: See above.
2005-09-15 21:51:31 +00:00
Federico Mena Quintero
14bcc53ec5 Add an easy-to-find profiling marker when starting to create a file
2005-09-14  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init): Add
	an easy-to-find profiling marker when starting to create a file
	chooser.
	(browse_files_model_finished_loading_cb): Likewise, for when the
	chooser is finished loading.
2005-09-15 00:59:16 +00:00
Matthias Clasen
463aab93dd Various cleanups. (#315360, Kjartan Maraas)
2005-09-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.c: Various cleanups.  (#315360, Kjartan Maraas)
2005-09-13 19:57:42 +00:00
Matthias Clasen
af89d145f7 Use gdk_atom_intern_static_string() where appropriate.
* gtk/*.c:  Use gdk_atom_intern_static_string() where
	appropriate.
2005-09-11 05:48:27 +00:00
Alexander Larsson
fa0b788dde Handle base_path being null in the rest of the cases (#310270)
2005-09-02  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkfilechooserdefault.c: (shortcuts_add_volumes),
	(shortcuts_activate_volume):
	Handle base_path being null in the rest of the cases (#310270)
2005-09-02 13:33:06 +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
f4bbe8f0de Also intern static strings passed to g_object_set_data() 2005-08-31 17:58:55 +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
Matthias Clasen
d0ef4dec81 Fix a C99ism. (#314262, Robert Jeff Mitchell)
2005-08-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_append_desktop): Fix a
	C99ism.  (#314262, Robert Jeff Mitchell)
2005-08-23 12:48:05 +00:00
Matthias Clasen
cbd1435c88 When using gtk_dialog_run() for modal dialogs, make sure to inherit the
2005-08-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: When using gtk_dialog_run() for
	modal dialogs, make sure to inherit the window group from
	the parent, since we don't inherit window groups across
	transient parents currently.  (#312918, Christian Persch)

	* gtk/gtkmessagedialog.c (gtk_message_dialog_new):
	* gtk/gtkdialog.c (gtk_dialog_run): Slight update to the docs.
2005-08-15 18:17:01 +00:00
Matthias Clasen
2b40fb4fd9 Work around some problems with the gnome-vfs backends which could lead to
2005-08-11  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Work around some problems
	with the gnome-vfs backends which could lead to crashes
	in the bookmark handling.  (#310270, Diego Gonzalez, patch
	by Michael Meeks)
2005-08-12 03:03:44 +00:00
Matthias Clasen
98a1367afe Fix up includes on Win32. (#311630, Kazuki Iwamoto)
2005-07-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Fix up includes on Win32.
	(#311630, Kazuki Iwamoto)
2005-07-26 18:43:27 +00:00
Federico Mena Quintero
d06ef3be88 Clarify the usage of this function. (gtk_file_chooser_set_uri): Likewise.
2005-07-21  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooser.c (gtk_file_chooser_set_filename): Clarify
	the usage of this function.
	(gtk_file_chooser_set_uri): Likewise.
	(gtk_file_chooser_set_current_name): Likewise.

	* gtk/gtkfilechooserdefault.c (set_file_system_backend):
	Instrument this function for profiling as well.
	(gtk_file_chooser_default_init): Likewise; just to have a marker
	of where instance initialization begins.
2005-07-22 02:54:24 +00:00
Federico Mena Quintero
78d3db9fad Added a few utility functions for profiling; instrument the code, make it
2005-07-19  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c: Added a few utility functions for
	profiling; instrument the code, make it conditional.
2005-07-20 02:11:37 +00:00
Federico Mena Quintero
55fe917aad Take the parent folder path instead of the display name, to avoid doing
2005-07-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(should_respond_after_confirm_overwrite): Take the parent folder
	path instead of the display name, to avoid doing duplicated work
	in gtk_file_chooser_default_should_respond().
2005-07-15 15:06:52 +00:00
Federico Mena Quintero
0f18ef8887 Take the display name of the folder as well so that we can present a
2005-07-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(confirm_dialog_should_accept_filename): Take the display name of
	the folder as well so that we can present a better message.  Use a
	stock cancel button, "_Replace", and GTK_STOCK_SAVE_AS.
	(gtk_file_chooser_default_should_respond): Pass the file part and
	folder display name directly to the function above.  Oops, only do
	the confirmation dialog if the file exists.
2005-07-15 13:50:54 +00:00
Federico Mena Quintero
dfda674070 Use header capitalization for the buttons, per the HIG.
2005-07-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(confirm_dialog_should_accept_filename): Use header capitalization
	for the buttons, per the HIG.
2005-07-15 06:16:20 +00:00
Federico Mena Quintero
fb7d6ac4fd Add overwrite confirmation for SAVE mode. Fixes bug #152850:
2005-07-14  Federico Mena Quintero  <federico@ximian.com>

	Add overwrite confirmation for SAVE mode.  Fixes bug #152850:

	* gtk/gtkfilechooser.h: Add prototypes for
	gtk_file_chooser_set/get_do_overwrite_confirmation().
	(GtkFileChooserConfirmation): New enum for the result of the
	"confirm-overwrite" signal.

	* gtk/gtkmarshalers.list: Add ENUM:VOID.

	* gtk/gtkfilechooser.c (gtk_file_chooser_class_init): Add a
	"do-overwrite-confirmation" boolean property.
	(gtk_file_chooser_set_do_overwrite_confirmation): Implement.
	(gtk_file_chooser_get_do_overwrite_confirmation): Implement.
	(confirm_overwrite_accumulator): New accumulator for the signal.

	* gtk/gtkfilechooserutils.h (GtkFileChooserProp): Add
	GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION.

	* gtk/gtkfilechooserutils.c
	(_gtk_file_chooser_install_properties): Override the
	do-overwrite-confirmation property.

	* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserIface): Add a
	confirm_overwrite signal to the vtable.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_set_property): Handle the new property.
	(gtk_file_chooser_default_get_property): Likewise.
	(get_selected_file_info_from_file_list): New helper function; code
	taken from list_selection_changed().
	(list_selection_changed): Use get_selected_file_info_from_file_list().
	(should_respond_after_confirm_overwrite): New function.
	(gtk_file_chooser_default_should_respond): Confirm when necessary.
2005-07-15 04:55:56 +00:00
Matthias Clasen
1df38871e1 Implement Drag-and-Drop to the file list. (#145121, Sven Neumann)
2005-07-07  Matthias Clasen  <mclasen@redhat.com>

	Implement Drag-and-Drop to the file list.  (#145121, Sven Neumann)

	* gtk/gtkfilechooserdefault.c (file_list_drag_data_received_cb)
	(file_list_drag_drop_cb, file_list_drag_motion_cb): New functions
	to handle drag-and-drop on the file list.
	(create_file_list): Set up drag-and-drop handlers on the file list.
2005-07-07 17:11:26 +00:00
Matthias Clasen
8cc4fe41ff Fix #157787, reported by Jonathan Blandford:
2005-07-07  Matthias Clasen  <mclasen@redhat.com>

	Fix #157787, reported by Jonathan Blandford:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_set_current_folder): Don't leave a
	"trail" behind when set_current_folder is called explicitly.
	(gtk_file_chooser_default_update_current_folder): New function
	that is called to update the current folder in response to
	user actions.

	* gtk/gtkpathbar.c (_gtk_path_bar_set_path): Add a boolean
	keep_trail argument, and don't leave a "trail" behind unless
	it is set.
2005-07-07 12:40:50 +00:00
Manish Singh
be53636ec1 remove unused variable.
Thu Jun 16 15:33:42 2005  Manish Singh  <yosh@gimp.org>

        * gdk/x11/gdkcursor-x11.c (update_cursor): remove unused variable.

        * gdk/x11/gdkwindow-x11.c (_gdk_x11_window_get_cursor): use
        g_return_val_if_fail.

        * gtk/gtkdnd.c (gtk_drag_get_cursor): initialize hot_x and hot_y
        for all cases.

        * gtk/gtkfilechooserdefault.c (button_new): gtk_button_set_image
        takes a GtkWidget, not a GtkImage.
2005-06-16 22:35:45 +00:00
Matthias Clasen
2ee17f4875 Simplify the code and respect the show-button-images setting. (#307941,
2005-06-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (button_new): Simplify
	the code and respect the show-button-images setting.
	(#307941, Vincent Noel)
2005-06-16 16:44:08 +00:00
Federico Mena Quintero
cd3c641ce4 Merged from gtk-2-6:
2005-06-14  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fix #302087:

	* gtk/gtkfilechooserdefault.c (list_selection_changed): Emit
	"selection-changed" and do the normal housekeeping even if we are
	in SAVE mode and there is nothing selected.  We didn't emit that
	signal if we were in SAVE mode and unselect_all() got called.
	(gtk_file_chooser_default_unselect_all): Call
	pending_select_paths_free() so that we cancel any asynchronous
	selections.
	(gtk_file_chooser_default_set_current_name): Likewise.
2005-06-15 01:03:21 +00:00
Federico Mena Quintero
fb323cfb0c Merged from gtk-2-6:
2005-06-14  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fixes #307640:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_should_respond): Oops, I broke SAVE
	mode.  If the parent path is a folder, only create a subfolder if
	we are in CREATE_FOLDER mode; if we are in SAVE mode, just return
	and respond.  Also, pick up the case where the user types
	"dirname/" instead of "dirname".
	(check_save_entry): Make the return type void.  Add some return
	parameters so that we can do more thorough checking.
	(gtk_file_chooser_default_get_paths): If the file part is empty
	and we are in SAVE mode, return an empty selection.
2005-06-14 23:30:12 +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
39d710eabe Don't grab the focus away from the file list when operating the filter
2005-05-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (filter_create): Don't grab
	the focus away from the file list when operating the filter
	combo with the pointer.  (#304844, Sven Neumann)
2005-05-23 16:45:57 +00:00
Matthias Clasen
b1f056a802 Remove the no longer needed workaround.
2005-05-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
	Remove the no longer needed workaround.
2005-05-18 16:22:20 +00:00
Matthias Clasen
2763b81fe3 Add a bug reference 2005-05-18 15:24:01 +00:00
Federico Mena Quintero
093b389f6a Merged from gtk-2-6:
2005-05-02  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fixes #301068:

	* gtk/gtkfilesystemunix.c (struct _GtkFileSystemUnix): Add fields
	to store struct stat for /afs and /net, and boolean fields to say
	whether these are valid.
	(struct _GtkFileFolderUnix): Added a boolean is_network_dir field.
	(gtk_file_system_unix_get_folder): Fill in the is_network_dir
	field of the folder structure.
	(fill_in_names): If the folder is a network directory, create a
	fake struct stat for its entries.
	(fill_in_stats): Don't stat() the children of network directories.

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func): If the mtime
	is 0, use "Unknown" for the cell's displayed text.
2005-05-03 01:55:33 +00:00
Federico Mena Quintero
d22aa7c0f5 Merged from gtk-2-6:
2005-04-18  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	* gtk/gtkfilechooserdefault.c (remove_selected_bookmarks): Remove
	obsolete assertion that the selected row can't be a volume; this
	is handled by the "removable" column now.  Fixes #301017.
2005-04-18 17:56:57 +00:00
Federico Mena Quintero
9bd53c8683 Merged from gtk-2-6:
2005-04-15  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	* gtk/gtkfilechooserdefault.c (pending_select_paths_process):
	Patch from Christian Neumair <chris@gnome-de.org>; only select the
	first row if we are in OPEN mode.  The only other case we were
	letting pass through was SELECT_FOLDER, but selecting the first
	row when changing folders confuses people when folders are
	actually being selected.  Fixes #171885.
2005-04-15 21:27:27 +00:00
Matthias Clasen
af8b86b8a1 Avoid unaligned access. (#172947)
2005-04-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/updateiconcache.c (write_card16, write_card32): Avoid
	unaligned access.  (#172947)

	* gtk/gtkfilechooserdefault.c (file_list_build_popup_menu):
	Consistently use the term "Bookmarks" in the UI.  (#166906,
	Sebastian Bacher)
2005-04-07 19:10:11 +00:00
Jeroen Zwartepoorte
2b874b2438 Make the preview label ellipsize so the dialog layout stays constant.
2005-03-28  Jeroen Zwartepoorte  <jeroen.zwartepoorte@gmail.com>

	* gtk/gtkfilechooserdefault.c: (update_preview_widget_visibility): Make
	the preview label ellipsize so the dialog layout stays constant.
	(#171398)
2005-03-28 17:18:00 +00:00
Matthias Clasen
4c28ce0877 Use canonical names for g_object_notify() as well.
2005-03-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.c:
	* gdk/gdkdisplaymanager.c:
	Use canonical names for g_object_notify() as well.
2005-03-26 05:49:15 +00:00
Matthias Clasen
dce8bffc7d Implement bookmark renaming (#136216, Sean Middleditch)
2005-03-22  Matthias Clasen  <mclasen@redhat.com>

	Implement bookmark renaming  (#136216, Sean Middleditch)

	* gtk/gtkfilesystem.h (struct _GtkFileSystemIface): Add
	get_bookmark_label and set_bookmark_label vfuncs.

	* gtk/gtkfilesystem.h:
	* gtk/gtkfilesystem.c (gtk_file_system_set_bookmark_label):
	(gtk_file_system_get_bookmark_label): Wrappers for the
	vfuncs.

	* gtk/gtk.symbols: Add new exported symbols.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_set_bookmark_label):
	(gtk_file_system_unix_get_bookmark_label): Implementations
	for the Unix backend.

	* gtk/gtkfilechooserdefault.c: Add a context menu to
	the bookmarks pane, and allow to rename bookmarks.
2005-03-22 20:23:19 +00:00
Matthias Clasen
269d89c79c Define macros GTK_PARAM_READABLE, GTK_PARAM_WRITABLE, GTK_PARAM_READWRITE
2005-03-21  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkprivate.h: Define macros GTK_PARAM_READABLE,
	GTK_PARAM_WRITABLE, GTK_PARAM_READWRITE which are like
	their G_ counterparts, but also mark the name, nick
	and blurb as static.

	* gtk/*.c: Mark param spec strings as static, using
	the new macros.
2005-03-22 02:14:55 +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
6da29b43a6 gdk/gdkkeyuni.c gdk/gdkpixbuf-drawable.c gdk/gdkrgb.c gdk/x11/gdkdnd-x11.c
2005-03-01  Matthias Clasen  <mclasen@redhat.com>

	* gdk/gdkkeyuni.c
	* gdk/gdkpixbuf-drawable.c
	* gdk/gdkrgb.c
	* gdk/x11/gdkdnd-x11.c
	* gdk/x11/gdkevents-x11.c
	* gdk/x11/gdkproperty-x11.c
	* gdk/x11/gdkvisual-x11.c
	* gdk-pixbuf/gdk-pixbuf.c
	* gtk/gtkaction.c
	* gtk/gtkbindings.c
	* gtk/gtkcolorbutton.c
	* gtk/gtkcombo.c
	* gtk/gtkcontainer.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilesel.c
	* gtk/gtkgamma.c
	* gtk/gtkiconview.c
	* gtk/gtkinputdialog.c
	* gtk/gtkitemfactory.c
	* gtk/gtkmenu.c
	* gtk/gtktextview.c
	* gtk/gtktooltips.c
	* gtk/gtktreedatalist.c
	* gtk/gtkuimanager.c
	* gtk/tree_minus.xpm
	* gtk/tree_plus.xpm
	* gtk/xdgmime/xdgmime.c
	* gtk/xdgmime/xdgmime.h:
	Move constant data to .rodata.
2005-03-01 06:25:55 +00:00
Matthias Clasen
c78b24e7d3 Unset "focus-on-click" for the save folder combo. (#168688, Sven Neumann)
2005-02-27  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (save_folder_combo_create):
	Unset "focus-on-click" for the save folder combo.  (#168688,
	Sven Neumann)
2005-02-28 04:25:20 +00:00
Matthias Clasen
59d658187c Don't leak parent_path. (#168435, Morten Welinder)
2005-02-24  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_select_path):
	Don't leak parent_path.  (#168435, Morten Welinder)
2005-02-24 20:28:26 +00:00
Federico Mena Quintero
1707e510a8 Merged from gtk-2-6:
2005-02-02  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	* gtk/gtkfilechooserdefault.c (pending_select_paths_process):
	Don't select the first row if the chooser is not mapped.  This
	happens when it's acting on behalf of GtkFileChooserButton.  Also,
	don't select the first row if we are in SAVE or CREATE_FOLDER
	modes --- I had missed that (see the ChangeLog entry from
	2005-01-18).  Fixes #165264.
2005-02-02 18:25:27 +00:00
Federico Mena Quintero
4200bed6be Merged from gtk-2-6:
2005-02-01  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	* gtk/gtkfilechooserdefault.c
	(browse_files_model_finished_loading_cb): Don't
	g_assert_not_reached() if we are in any other state.  Another code
	path may have triggered a folder reload.  Fixes #165556.
2005-02-02 00:53:10 +00:00
Federico Mena Quintero
224c47a9b8 Merged from gtk-2-6:
2005-02-01  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fix #165770:

	* gtk/gtkfilechooserdefault.c (FALLBACK_ICON_SIZE): Make the
	fallback size be 16, to be equal to the default for
	GTK_ICON_SIZE_MENU (in gtkiconfactory.c:init_icon_sizes()).
	(change_icon_theme): Use GTK_ICON_SIZE_MENU instead of
	GTK_ICON_SIZE_SMALL_TOOLBAR.
2005-02-01 23:55:44 +00:00
Federico Mena Quintero
9032abed7c Merged from gtk-2-6:
2005-01-27  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_select_path): Oops, don't assert that we
	can't reach the end of the function; this happens if we are still
	loading but don't need a path change.  Fixes #165213.
2005-01-27 20:08:56 +00:00
Federico Mena Quintero
570ad468e0 Removed leftover comments.
2005-01-24  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c: Removed leftover comments.
2005-01-25 01:39:23 +00:00
Federico Mena Quintero
ed30bc0c76 Merged from gtk-2-6:
2005-01-24  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fix #147785 and clean up the loading code:

	* gtk/gtkfilechooserdefault.c (LoadState): Make the set of states
	be EMPTY, PRELOAD, LOADING, FINISHED.
	(gtk_file_chooser_default_init): Start in the LOAD_EMPTY state.
	(struct _GtkFileChooserDefault): Added a pending_select_paths
	field.
	(load_remove_timer): Add the new states.
	(load_setup_timer): Likewise.
	(load_timeout_cb): Likewise.  Switch to the LOAD_LOADING state.
	(browse_files_model_finished_loading_cb): Switch to the
	LOAD_FINISHED state.
	(enum PendingOp): Removed.
	(struct _GtkFileChooserDefault): Removed the pending_op and
	pending_select_path fields.
	(pending_select_paths_free): New utility function.
	(pending_select_paths_add): New utility function.
	(gtk_file_chooser_default_finalize): Call
	pending_select_paths_free().
	(pending_op_queue): Removed.
	(pending_op_process): Removed.
	(pending_select_paths_process): New function.
	(browse_files_model_finished_loading_cb): Call
	pending_select_paths_process().
	(center_selected_row_foreach_cb): Handle multiple selection by
	only centering the first row.
	(get_is_file_filtered): Constify.
	(gtk_file_chooser_default_select_path): Queue into a list of paths
	to select if we are not finished loading.
	(show_and_select_paths): New utility function.
	(up_folder_handler): Use pending_select_paths_add().
	(gtk_file_chooser_default_should_respond): Do not call
	pending_op_queue(); free the pending_selected_paths instead.
	(gtk_file_chooser_default_initial_focus): Don't queue a pending
	operation, and don't select the first row unconditionally --- this
	will happen when the folder is done loading.
	(shortcuts_row_activated_cb): Free the pending_select_paths.
	(pending_select_paths_store_selection): New utility function.
	(gtk_file_chooser_default_map): Call
	pending_select_paths_store_selection() to save the selection
	before reloading the folder.
	(select_func): Umm?  Call gtk_tree_selection_select_iter().  Don't
	move the cursor here; it will be done when processing the pending paths.

	* tests/testfilechooser.c (main): Add a button to the command
	window to unmap and remap the file chooser.
2005-01-25 01:35:09 +00:00
Matthias Clasen
895e943360 In save mode, don't return paths containing nonexisting directories.
2005-01-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_should_respond):
	In save mode, don't return paths containing nonexisting
	directories.  (#162443, Jean Marie Favreau)
2005-01-19 21:05:15 +00:00
Manish Singh
fad37a600e Actually assign PENDING_OP_NONE.
Tue Jan 18 13:56:09 2005  Manish Singh  <yosh@gimp.org>

        * gtk/gtkfilechooserdefault.c (pending_op_queue): Actually assign
        PENDING_OP_NONE.
2005-01-18 21:57:40 +00:00
Federico Mena Quintero
19c564ba25 Merged from gtk-2-6:
2005-01-18  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	* gtk/gtkfilechooserdefault.c (pending_op_queue): Don't queue an
	operation to select the first file if we are in SAVE or
	CREATE_FOLDER modes.  Executing that operation would overwrite the
	contents of the save-name entry.
2005-01-18 21:45:01 +00:00
Matthias Clasen
a1f0b89d92 Save and restore the selected row in the bookmark list and the save folder
2005-01-17  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_add_bookmarks): Save
	and restore the selected row in the bookmark list and the
	save folder combo.  (#164290)
2005-01-17 07:05:17 +00:00
Federico Mena Quintero
74f4872211 Add an "Open _Location" item. Fixes #148839.
2005-01-06  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (file_list_build_popup_menu): Add an
	"Open _Location" item.  Fixes #148839.
2005-01-06 20:27:58 +00:00
Federico Mena Quintero
bbea189a4f Fix #161409:
2005-01-05  Federico Mena Quintero  <federico@ximian.com>

	Fix #161409:

	* gtk/gtkfilechooserdefault.c (shortcuts_row_activated_cb): Queue
	a pending operation to select the first row.
2005-01-06 01:53:50 +00:00
Federico Mena Quintero
faaee051d1 Don't call button_data_free() explicitly; the button is weak-reffed and
2005-01-05  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkpathbar.c (_gtk_path_bar_set_path): Don't call
	button_data_free() explicitly; the button is weak-reffed and the
	callback will free the button data.  Fixes #163010.
	(_gtk_path_bar_set_path): Don't ref/sink the button.  And for the
	failure case, call gtk_widget_destroy() on it.

	* gtk/gtkfilechooserdefault.c (check_is_folder): Use
	gtk_file_system_get_folder() again (see the ChangeLog entry from
	2004-08-25).  We can't first get the parent folder and then
	request the info for the path in question, as the parent folder
	may not be readable.  See bug #162617.
	(gtk_file_chooser_default_set_current_folder): Assert that the
	passed-in path is not null.
	(shortcuts_find_current_folder): Likewise.
	(shortcuts_add_current_folder): Likewise.
	(set_list_model): Likewise.
	(gtk_file_chooser_default_map): Only reload the current folder if
	it exists.
	(bookmarks_check_add_sensitivity): Check for the current folder
	being NULL.
	(browse_files_select_first_row): Don't set the cursor if there is
	no model loaded.
2005-01-06 01:46:39 +00:00
Matthias Clasen
9359ede29b Don't construct errors from the GTK_FILE_SYSTEM_ERROR domain. Partial fix
2005-01-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Don't construct errors from
	the GTK_FILE_SYSTEM_ERROR domain. Partial fix for #162911.
	(get_file_info, check_is_folder): Translate errors from
	the filesystem into the GTK_FILE_CHOOSER_ERROR domain. Rest
	of the fix for #162911, noticed by Murray Cumming.
2005-01-05 17:18:01 +00:00
Matthias Clasen
7794fa7f57 Don't construct errors from the GTK_FILE_SYSTEM_ERROR domain. Partial fix
2005-01-05  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Don't construct errors from
	the GTK_FILE_SYSTEM_ERROR domain. Partial fix for #162911.
2005-01-05 16:57:49 +00:00
Tor Lillqvist
c668f46d9e Add -lole32, needed for CoTaskMemFree in get_special_folder() below.
2005-01-02  Tor Lillqvist  <tml@iki.fi>

	* gtk/Makefile.am (libgtk_target_ldflags): Add -lole32, needed for
	CoTaskMemFree in get_special_folder() below.

	* gtk/gtkfilesystem.h: Implement case-insensitive path compare on
	Win32 using _gtk_file_system_win32_path_compare().

	* gtk/gtk.symbols: Add _gtk_file_system_win32_path_compare.

	* gtk/gtkfilechooserbutton.c (model_add_special)
	* gtk/gtkfilechooserdefault.c (shortcuts_append_desktop): Use
	_gtk_file_system_win32_get_desktop() to get correct Desktop folder
	on Win32. (#144003)

	* gtk/gtkfilesystemwin32.c: Remove unnecessary includes. Do
	consider all drives "mounted", including floppies. Trying to
	inspect the contents of a nonexistent floppy will cause errors
	later that are handled normally, no need to avoid them
	completely. Keep the drive type in the GtkFileSystemVolume.
	Support UNC paths. (#161797) Fix error message capitalizations
	as in gtkfilesystemunix.c.

	(gtk_file_system_win32_init): Start one timeout per
	GtkFileSystemWin32.

	(gtk_file_system_win32_finalize): Remove the timeout.

	(get_special_folder): Copied from GLib.

	(_gtk_file_system_win32_get_desktop): New function, uses
	get_special_folder().

	(gtk_file_system_win32_list_volumes): Don't start a timeout at
	each call to this function. Don't assume A: and B: are floppies.

	(gtk_file_system_win32_get_volume_for_path): Don't assume all
	volumes are drive roots, i.e. support share roots of UNC paths
	(\\server\share).

	(gtk_file_system_win32_get_folder): Don't assume errno is set
	after g_file_test() returns FALSE. It isn't on Win32 (and even on
	Unix I don't think one should assume anything about errno after
	g_file_test()).

	(gtk_file_system_win32_volume_get_is_mounted): Always return TRUE.

	(gtk_file_system_win32_volume_get_display_name): Don't call
	GetVolumeInformation() on drives A: or B: if they are removable,
	as they might then be floppies, causing an unnecessary
	delay. (#157820)

	(gtk_file_system_win32_volume_render_icon): Use network icon for
	unrecognized drive types.

	(canonicalize_filename, gtk_file_system_win32_parse): Don't get
	confused by UNC paths.

	(bookmarks_serialize): Use _gtk_file_system_win32_path_compare()
	for case-insensitive UTF-8 path comparison.

	(extract_icon): Use SHGetFileInfo() which is faster than
	ExtractAssociatedIcon(). Icon extraction is still slow, though,
	needs work.

	(win32_pseudo_mime_lookup): Don't use the same icon for all
	shortcuts or executables. Cache only other file type icons.

	(gtk_file_system_win32_render_icon): Use network stock icon for
	remote drives and UNC server share roots. Compare home directory
	case-insensitively. Do lookup icons also for executable files,
	after all, it's these files that can have individual icons in the
	first place. Yes, it can be slow. Needs work.

	(filename_is_drive_root): Require also the slash after the colon.

	(filename_is_server_share): New function.

	(_gtk_file_system_win32_path_compare): New function, does
	case-folded UTF-8 comparison.

	* gtk/gtkfilesystemwin32.h: Declare
	_gtk_file_system_win32_path_compare().
2005-01-02 23:15:21 +00:00
Matthias Clasen
db4665b45e Use secondary text for error dialogs.
2004-12-30  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Use secondary text for error
	dialogs.
2004-12-30 07:42:07 +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
Matthias Clasen
43f8526198 Don't try to filter if impl->current_filter is NULL. (#161329, R.
2004-12-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (get_is_file_filtered): Don't
	try to filter if impl->current_filter is NULL.  (#161329,
	R. McFarland)
2004-12-15 14:30:53 +00:00
Federico Mena Quintero
9f558a1540 Merged from gtk-2-4:
2004-12-14  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	Fix #145470:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_initial_focus): Queue a pending
	operation to select the first row if we are not finished loading
	yet.
	(gtk_file_chooser_default_class_init): Override GtkWidget::map().
	(gtk_file_chooser_default_map): New ::map() handler; refresh the
	file and bookmark lists.

	* gtk/gtkfilechooserdialog.c (gtk_file_chooser_dialog_class_init):
	Override GtkWidget::map() and GtkWidget::unmap().
	(gtk_file_chooser_dialog_constructor): Don't call initial_focus()
	here.
	(gtk_file_chooser_dialog_map): Map the file chooser widget if
	needed.  Call initial_focus() here.
	(gtk_file_chooser_dialog_unmap): Unmap the file chooser widget.
	When we are re-mapped, the widget will get mapped as well and it
	will have a chance to refresh.
2004-12-15 01:37:41 +00:00
Matthias Clasen
e83213d06d Apply a patch to reset the filter if an otherwise invisible file is
2004-12-09  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Apply a patch to reset the
	filter if an otherwise invisible file is selected via the
	location popup.  (#159896, Carlos Garnacho Parro)
2004-12-09 22:06:55 +00:00
Federico Mena Quintero
787ee3e77d Merged from gtk-2-4:
2004-12-08  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	* gtk/gtkfilechooserdefault.c (pending_op_process): Center the
	selected row so that it's easily visible.
2004-12-09 02:12:47 +00:00
Matthias Clasen
be60805ef6 Reinstate the previous behavior for clicking Ok after activating a
2004-12-02  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_should_respond): 	Reinstate the previous behavior for clicking Ok after
	activating a bookmark or path bar button in folder
	modes.  (#160044, Dennis Cranston)
2004-12-03 03:42:48 +00:00
Federico Mena Quintero
bc63304b92 Merged from gtk-2-4:
2004-12-02  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	Fix #159656:

	* gtk/gtkfilechooserdefault.c (PendingOp): New enumeration for the
	pending operation to perform when finishing loading a folder.
	(struct _GtkFileChooserDefault): New fields 'pending_op' and
	'pending_select_path'.
	(pending_op_queue): New utility function.
	(pending_op_process): New utility function.
	(gtk_file_chooser_default_select_path): Don't select the path
	immediately; delay it until the folder is finished loading.
	(browse_files_model_finished_loading_cb): Process the pending
	operation.
	(browse_files_select_first_row): New utility function.
	(gtk_file_chooser_default_initial_focus): Use
	browse_files_select_first_row().
	(gtk_file_chooser_default_should_respond): Queue an operation to
	select the first row once we load the child folder.
	(up_folder_handler): Queue an operation to select the current
	folder once we load the parent folder.
	(gtk_file_chooser_default_finalize): Free the pending_select_path.
2004-12-02 21:36:14 +00:00
Federico Mena Quintero
d5323addf5 Merged from gtk-2-4:
2004-11-29  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	* gtk/gtkfilechooserdefault.c (trap_activate_cb): Don't handle
	Enter if we are in SELECT_FOLDER or CREATE_FOLDER actions.  This
	lets us navigate thei file system more easily.
	(gtk_file_chooser_default_should_respond): If we are in
	SELECT_FOLDER or CREATE_FOLDER modes, return TRUE if something is
	selected.
2004-11-30 00:00:07 +00:00
Federico Mena Quintero
dc478e8647 Merged from gtk-2-4:
2004-11-20  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	* gtk/gtkfilechooserdefault.c (list_icon_data_func): Set an empty
	icon if we are on the editable row:  if we don't set the cell
	renderer at all, it will reuse the last thing it painted.
2004-11-20 06:21:30 +00:00
Federico Mena Quintero
e44612e7da Merged from gtk-2-4:
2004-11-19  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	Fix #141077.  Based on a patch by Christian Neumair <chris@gnome-de.org>:

	* gtk/gtkfilechooserdefault.c (new_folder_button_clicked):
	Desensitize the "new folder" button.
	(edited_idle_cb): Sensitize the button back.
2004-11-20 02:00:45 +00:00
Federico Mena Quintero
a006f66238 Merged from gtk-2-4:
2004-11-19  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	Fix #158477:

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
	Remove the "save_extra_align" and "browse_extra_align" fields; use
	a single "extra_align" field.
	(save_widgets_create): Don't create the save_extra_align.
	(browse_widgets_create): Don't create the browse_extra_align.
	(gtk_file_chooser_default_constructor): Create the extra_align
	here.
	(set_extra_widget): Add the extra widget to the alignment here,
	and remove the old one if necessary.
	(update_appearance): No need to frob the extra widget's alignments
	anymore.
	(gtk_file_chooser_default_set_property): No need to call
	update_appearance() anymore when we set the extra widget.

2004-11-19  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_initial_focus): Don't set the cursor if
	we are still loading.
2004-11-20 01:39:26 +00:00
Federico Mena Quintero
74c146301c Merged from gtk-2-4:
2004-11-18  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	Fixes #155744:

	Try to load the whole file system model within a specified time.

	* gtk/gtkfilechooserdefault.c (set_list_model): Don't create and
	set the sort model here.  Instead, set up a timer in which we'll
	try to load the file system model.
	(load_set_model): Create and set the sort model here.
	(load_setup_timer): New function to set up a timer and switch to
	the LOAD_LOADING state.
	(load_remove_timer): New function to unset the timer and switch to
	the LOAD_FINISHED state.
	(browse_files_model_finished_loading_cb): Remove the timer if
	needed and set the file system and sort model; switch to the
	LOAD_FINISHED state.
	(gtk_file_chooser_default_finalize): Remove the load timer.
	(gtk_file_chooser_default_init): Start in the LOAD_FINISHED state.
2004-11-20 00:17:30 +00:00
Manish Singh
60b30ff513 gdk/linux-fb/gdkgc-fb.c gdk/win32/gdkgc-win32.c
Fri Nov 19 14:54:09 2004  Manish Singh  <yosh@gimp.org>

        * gdk/linux-fb/gdkgc-fb.c
        * gdk/win32/gdkgc-win32.c
        * gdk/win32/gdkwindow-win32.c
        * gtk/gtkaboutdialog.c
        * gtk/gtkaction.c
        * gtk/gtkactiongroup.c
        * gtk/gtkcellrendererprogress.c
        * gtk/gtkcellview.c
        * gtk/gtkcolorbutton.c
        * gtk/gtkcombobox.c
        * gtk/gtkcomboboxentry.c
        * gtk/gtkentrycompletion.c
        * gtk/gtkfilechooserbutton.c
        * gtk/gtkmenutoolbutton.c
        * gtk/gtkrc.c
        * gtk/gtksettings.c
        * gtk/gtkstyle.c
        * gtk/gtktoggletoolbutton.c
        * gtk/gtktoolbutton.c
        * gtk/gtktoolitem.c
        * gtk/gtktreemodelfilter.c
        * gtk/gtktreeselection.c
        * gtk/gtktreeviewcolumn.c
        * gtk/gtkuimanager.c: get rid of unnecessary casts.

        * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_set_property):
        cast away the const for g_value_set_enum. This is after the g_warning,
        so this is a hack to begin with.

        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_set_property):
        add a cast to GTK_FILE_CHOOSER for impl here.
2004-11-19 23:18:38 +00:00
Davyd Madeley
b23e4c2349 Allow backspace to move up the FileChooser tree to make it consistent with
2004-11-17  Davyd Madeley  <davyd@madeley.id.au>

        * gtk/gtkfilechooserdefault.c: Allow backspace to move up the
        FileChooser tree to make it consistent with Nautilus and others.
2004-11-16 16:52:17 +00:00
Matthias Clasen
297a55d018 Show files in folder modes. (#157013, Nickolay V. Shmyrev)
2004-11-07  Matthias Clasen  <mclasen@redhat.com>

	Show files in folder modes. (#157013, Nickolay V. Shmyrev)

	* gtk/gtkfilechooserdefault.c (create_file_list): Use a selection
	function to determine which rows can be selected.
	(update_appearance): Always show files. Also queue a redraw.
	(set_list_model): Always show files.
	(list_select_func): The selection function used for the file list.
	Don't allow to select files when in select/create folder mode.
	(list_row_activated): Don't activate files in folder modes.
	(list_icon_data_func, list_mtime_data_func, list_size_data_func):
	Render files insensitive in folder modes.
2004-11-07 05:15:25 +00:00
Matthias Clasen
14ed2beff5 Jump through a few hoops to make the tooltip on the filter combo box work
2004-11-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
	a few hoops to make the tooltip on the filter combo box work
	a bit better. This fixes #157273 and #157074.
2004-11-07 04:10:01 +00:00
Matthias Clasen
ff56295f76 Don't leak the path. (#157301, Carlos Garnacho Parro)
2004-11-03  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (new_folder_button_clicked):
	Don't leak the path.  (#157301, Carlos Garnacho Parro)
2004-11-04 03:28:23 +00:00