Commit Graph

202 Commits

Author SHA1 Message Date
Matthias Clasen
a642c62c57 Don't use bitops on booleans.
2004-09-22  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (selection_check_foreach_cb): Don't use
	bitops on booleans.
2004-09-22 19:32:13 +00:00
Matthias Clasen
34059cf293 Don't assert that current_focus != NULL, just return FALSE.
2004-09-21  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_should_respond):
	Don't assert that current_focus != NULL, just return FALSE.
2004-09-21 20:36:31 +00:00
Matthias Clasen
4531b37582 Don't return FALSE from a void function. (#153185, Joel Fredrikson)
Mon Sep 20 19:27:48 2004  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_activate_iter): Don't
	return FALSE from a void function.  (#153185, Joel Fredrikson)
2004-09-20 23:47:38 +00:00
Matthias Clasen
627dc11c98 Scroll to the selected row. (#143868, Christian Persch)
2004-09-17  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (select_func): Scroll to the selected
	row.  (#143868, Christian Persch)
2004-09-17 19:05:45 +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
Manish Singh
95674320d9 initialize path so we don't potentially use an undefined pointer.
Wed Aug 25 17:14:58 2004  Manish Singh  <yosh@gimp.org>

        * gtk/gtktreeview.c (gtk_tree_view_search_activate): initialize
        path so we don't potentially use an undefined pointer.

        * gtk/gtkfilechooserdefault.c (shortcuts_list_create): add G_CALLBACK
        cast for tree_view_keybinding_cb.

        * gtk/gtkfilechooserdefault.c (location_entry_create): cast to
        GTK_FILE_CHOOSER_ENTRY for _gtk_file_chooser_entry_set_file_part()
        calls.

        * gtk/gtkcellrenderercombo.c (gtk_cell_renderer_combo_start_editing):
        cast to GTK_COMBO_BOX for gtk_combo_box_set_active_iter() call.

        * gtk/gtkselection.c (selection_get_text_plain): make len a gsize,
        since that's what g_convert_with_fallback() expects.
2004-08-26 00:20:25 +00:00
Jonathan Blandford
8bc41273f6 Don't handle the event if we have no children.
Tue Aug 24 02:06:37 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtktreeview.c
        (gtk_tree_view_real_expand_collapse_cursor_row): Don't handle the
        event if we have no children.

        * gtk/gtkfilechooserdefault.c (trap_activate_cb):
        (tree_view_keybinding_cb):Since GtkTreeView has a keybinding
         attached to '/', we need to catch keypresses before the TreeView
         gets them.
        (gtk_file_chooser_default_class_init): add '/' to be a keybinding
        to the C-l dialog.
        (location_entry_create): Clear the text to "" when loading a file.
        This has a much better feel than putting the currently selected
        in.
        * #include <errno.h>
2004-08-25 19:10:38 +00:00
Matthias Clasen
e4ef01a7b4 Use get_file_info() rather than trying get_folder() and checking for an
2004-08-25  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (check_is_folder): Use get_file_info() rather
	than trying get_folder() and checking for an error directly because older
	versions of the gnome-vfs backend don't return an error
	immediately.  (#150852, Zack Cerza )
2004-08-25 16:59:57 +00:00
Manish Singh
ba6fc3ccd8 Initialize height from fixed_height before we do anything, so it always
Wed Aug 18 16:18:00 2004  Manish Singh  <yosh@gimp.org>

        * gtk/gtktreeview.c (gtk_tree_view_row_inserted): Initialize height
        from fixed_height before we do anything, so it always has a valid
        value.

        * gtk/gtkfilechooserdefault.c (shortcuts_reload_icons): Fix call
        to gtk_tree_model_get (missing "," in param list).
2004-08-18 23:18:15 +00:00
Federico Mena Quintero
65ddedd1ae Merged from 2.4:
2004-08-18  Federico Mena Quintero  <federico@ximian.com>

	Merged from 2.4:

	Fixes #149251:

	* gtk/gtkfilechooserdefault.c: Renamed SHORTCUTS_COL_PATH to
	SHORTCUTS_COL_DATA.  Add SHORTCUTS_COL_IS_VOLUME, to determine
	easily whether the SHORTCUTS_COL_DATA points to a GtkFilePath or a
	GtkFileSystemVolume.
	(shortcuts_model_create): Create a boolean column for
	SHORTCUTS_COL_IS_VOLUME.
	(shortcuts_reload_icons): Simplify with the use of the
	SHORTCUTS_COL_IS_VOLUME column.  Don't leak the pixbuf.
	(shortcuts_insert_path): Add the SHORTCUTS_COL_IS_VOLUME data.
	(shortcuts_free_row_data): New helper function; frees the data
	columns for an iter.
	(shortcuts_remove_rows): Don't take a callback for freeing the
	data; free everything here instead.  Use
	shortcuts_free_row_data().
	(volume_remove_cb): Removed.
	(remove_bookmark_cb): Removed.
	(remove_row_cb): Make this a single generic function to delete
	rows.
	(shortcuts_add_volumes): Use remove_row_cb().
	(shortcuts_add_bookmarks): Likewise.
	(struct _GtkFileChooserDefault): Removed the
	shortcuts_current_folder_is_volume field.
	(shortcuts_add_current_folder): Oops, don't free the volume.
	(remove_current_folder_cb): Removed.
	(shortcut_find_position): Simplify through the use of the
	SHORTCUTS_COL_IS_VOLUME column.
	(remove_selected_bookmarks): Assert that we don't get a volume.
	(shortcuts_reorder): Likewise; also, plug a leak.
	(gtk_file_chooser_default_remove_shortcut_folder): Simplify
	through the use of shortcuts_remove_rows().
	(gtk_file_chooser_default_list_shortcut_folders): Assert that we
	don't get a volume.
	(shortcuts_activate_iter): Simplify.
	(home_folder_handler): Simplify by using
	shortcuts_activate_iter().
	(shortcuts_free): New function; frees all the data columns.
	(gtk_file_chooser_default_finalize): Unref the
	shortcuts_filter_model and the shortcuts model data first.
2004-08-18 16:30:58 +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
Tor Lillqvist
ae6d3a2214 gtk/gtkfilechooserdefault.c (shortcuts_append_home,
2004-08-14  Tor Lillqvist  <tml@iki.fi>

	* gtk/gtkfilechooserdefault.c (shortcuts_append_home,
	shortcuts_append_desktop, set_local_only)
	* gtk/gtkfilesystemwin32.c (gtk_file_system_win32_render_icon)
	* gtk/gtkpathbar.c (find_button_type, _gtk_path_bar_set_file_system):
	Guard against g_get_home_dir() returning NULL. (#150007)
2004-08-14 16:47:48 +00:00
Matthias Clasen
766d78659c Don't install the settings_notify_cb from here, since it may be called
* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_style_set):
	Don't install the settings_notify_cb from here, since it
	may be called before the first screen_changed signal,
	confusing the logic in gtk_file_chooser_screen_changed().
	(#148803, Abel Daniel)
2004-08-13 18:09:29 +00:00
Matthias Clasen
e4ec4f3710 Underscore-prefix gtk_file_system_module_get_type(). Underscore-prefix
2004-08-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilesystem.c: Underscore-prefix gtk_file_system_module_get_type().
	* gtk/gtkfilechooserdefault.c: Underscore-prefix shortcuts_model_filter_get_type().

	* gtk/gtkimmodule.c: Make gtk_im_module_get_type() static.
	* gtk/gtk.symbols:
	* gtk/gtkinternals.h: Remove the no longer exported get_type functions.
2004-08-12 21:09:03 +00:00
Federico Mena Quintero
c710d479f1 Fix #149422, #143457:
2004-08-11  Federico Mena Quintero  <federico@ximian.com>

	Fix #149422, #143457:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_should_respond): Rewrite to take the
	current focus into account, the contents of the save entry, and
	the last focus for the shortcuts list.
	(switch_to_selected_folder): We don't need an assertion on the
	action here.
2004-08-12 03:07:01 +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
Matthias Clasen
fbc0b76739 Don't leak a reference to the pixbufs.
Sun Aug  8 23:46:20 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfilechooserdefault.c (shortcuts_reload_icons): Don't
	leak a reference to the pixbufs.
2004-08-09 03:55:00 +00:00
Matthias Clasen
f82ca65b81 Use GtkTreeViewRowSeparatorFunc instead of GtkCellRendererSepText.
Sat Aug  7 18:19:03 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfilechooserdefault.c (save_folder_combo_create):
	(shortcuts_list_create): Use GtkTreeViewRowSeparatorFunc
	instead of GtkCellRendererSepText.  (#147864)

	* gtk/gtkcellrendererseptext.[hc]: Removed.

	* gtk/Makefile.am: Remove gtkcellrendererseptext.[hc]

Sat Aug  7 18:15:15 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcombobox.c (gtk_combo_box_menu_row_deleted):
	(gtk_combo_box_menu_row_inserted):
	(gtk_combo_box_menu_row_changed): Correctly handle
	insertion and deletion of separators in menu mode.
2004-08-07 22:21:25 +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
Federico Mena Quintero
15f23d383c Add a field for an "add to shortcuts" menu item. (popup_menu_detach_cb):
2004-07-29  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault): Add
	a field for an "add to shortcuts" menu item.
	(popup_menu_detach_cb): Clear out the field.
	(file_list_build_popup_menu): Only build the menu here.
	(file_list_update_popup_menu): Build the menu, then update the
	sensitivity of its items.
	(file_list_popup_menu): Use file_list_update_popup_menu().
	(bookmarks_check_add_sensitivity): Also set the sensitivity of the
	popup menu item.  Correctly handle the case for a *single* file.
	Simplify a bit.
	(bookmarks_add_selected_folder): New helper function; code moved
	over from add_bookmark_button_clicked_cb().
	(add_bookmark_button_clicked_cb): Use the function above.
	(selection_check): Rather than returning a boolean value for
	emptiness, actually return the number of selected rows.  Also,
	simplify a bit.
	(get_selected_path): New helper function.
2004-07-29 20:53:52 +00:00
Federico Mena Quintero
db87e3fa90 Store signal IDs in gulongs, not guints!
2004-07-28  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
	Store signal IDs in gulongs, not guints!
	(gtk_file_chooser_default_hierarchy_changed): We now monitor the
	focus widget on our toplevel to know which widget was last focused
	at the time our "should_respond" method gets called.
	(shortcuts_activate_selected): New helper function.
	(shortcuts_get_selected): New helper function.
	(remove_selected_bookmarks): Use shortcuts_get_selected().
	(bookmarks_check_remove_sensitivity): Likewise.
	(shortcuts_reorder): Likewise.
	(shortcuts_activate_iter): Renamed from shortcuts_activate_item().
	Activate by iter, not by item number.
	(save_folder_combo_changed_cb): Use shortcuts_activate_iter().
	(shortcuts_row_activated_cb): Likewise.
	(gtk_file_chooser_default_should_respond): If the last focused
	widget on the toplevel was the shortcuts list, activate the
	selected shortcut.
2004-07-29 01:26:51 +00:00
Matthias Clasen
f0d8fe3a7d Add a new :ellipsize property which controls ellipsization of the rendered
Thu Jul 22 01:42:16 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init):
	Add a new :ellipsize property which controls ellipsization of the
	rendered text.  (#144835, Vincent Untz, patch by Jonathan Blandford
	and Anders Carlsson

	* gtk/gtkfilechooserdefault.c (create_file_list): Use ellipsization
	for the name column.
2004-07-22 05:45:19 +00:00
Federico Mena Quintero
d319b8f926 Fix #144405, patch by Padraig O'Briain <padraig.obriain@sun.com>:
2004-07-14  Federico Mena Quintero  <federico@ximian.com>

	Fix #144405, patch by Padraig O'Briain <padraig.obriain@sun.com>:

	* gtk/gtkfilechooserdefault.c (shortcuts_list_create): Set the
	accessible object name for the tree view.
	(create_file_list): Likewise.
2004-07-14 17:08:40 +00:00
Federico Mena Quintero
f9d9cc9aac Set a busy cursor while mounting the volume. Also, ref the chooser while
2004-07-13  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a
	busy cursor while mounting the volume.  Also, ref the chooser
	while mounting, as we may re-enter.  Fixes #139376.
2004-07-13 18:25:48 +00:00
Federico Mena Quintero
b3fbcef831 Fix #139290:
2004-07-08  Federico Mena Quintero  <federico@ximian.com>

	Fix #139290:

	* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_new): Add a
	GError argument.  Do check for errors when getting the
	GtkFileFolder:  get the folder and read the children before
	actually creating the model.  Removed obsolete code that handled
	roots-changed on the file system.
	(file_model_node_get_info): Assert that we don't reach the old
	case to display file system roots.
	(roots_changed_callback): Removed.

	* gtk/gtkfilechooserdefault.c (set_list_model): Add a GError
	argument, and a boolean return value.  Return an error if we
	cannot create the file system model.  On error, set a NULL model
	on the tree.
	(gtk_file_chooser_default_set_current_folder): Use the error value
	from set_list_model().
	(gtk_file_chooser_default_set_property): Set the show_hidden
	property only if the browse_files_model exists.
	(gtk_file_chooser_default_unselect_path): Only operate if the
	browse_files_model exists.
	(check_preview_change): Check whether we have the sort_model.
	(change_folder_and_display_error): Copy the path we get passed
	before using it.  There's a comment in there that explains why we
	need to copy it; basically, if the passed path belongs to the
	model, the model may go away in the middle of this function and
	we'll be left with a dangling pointer.
	(install_list_model_filter): Assert that the model is not NULL.
	(set_current_filter): Check whether the model exists.

	* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Don't
	g_return_if_fail if the model is NULL.
	(gtk_tree_selection_get_selected_rows): Likewise.
	(gtk_tree_selection_count_selected_rows): Likewise.
	(gtk_tree_selection_selected_foreach): Likewise.
	(gtk_tree_selection_path_is_selected): Likewise; rather just
	return FALSE.
	(gtk_tree_selection_select_all): Likewise.
	(gtk_tree_selection_unselect_all): Likewise.
	(gtk_tree_selection_select_range): Do g_return_if_fail() if the
	model is NULL.
	(gtk_tree_selection_unselect_range): Likewise.

	* gtk/gtkfilesystemunix.c (fill_in_names): Return immediately if
	g_dir_open() fails:  there is no need to set the error ourselves,
	as g_dir_open() already does it.
2004-07-09 00:53:48 +00:00
Matthias Clasen
ed4707d505 Improve positioning of keyboard-activated menus with Xinerama.
Tue Jul  6 02:00:28 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkfilechooserdefault.c (popup_position_func):
	* gtk/gtkentry.c (popup_position_func):
	* gtk/gtktextview.c (popup_position_func): Improve positioning
	of keyboard-activated menus with Xinerama.
2004-07-06 06:02:57 +00:00
Federico Mena Quintero
765d7d0517 Use a Save or an Open stock button for the C-l dialog depending on the
2004-06-22  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (location_popup_handler): Use a Save
	or an Open stock button for the C-l dialog depending on the action
	in which the file chooser operates.  Fixes #141753.
2004-06-23 00:28:47 +00:00
Matthias Clasen
9bff92fbcd Don't use contractions like "don't" or "isn't" in error messages. It isn't
Fri Jun 11 22:02:56 2004  Matthias Clasen  <maclas@gmx.de>

	* io-gif.c, io-pnm.c, io-tga.c, io-xpm.c: Don't use
	contractions like "don't" or "isn't" in error messages.
	It isn't nice to use them in log entries either...
	(#137774, Morten Welinder, patch by Alexander Winston)
2004-06-12 02:08:45 +00:00
Federico Mena Quintero
2ec910595c Fixes #143578:
2004-06-11  Federico Mena Quintero  <federico@ximian.com>

	Fixes #143578:

	* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_add_editable):
	Don't ref the editable node.
	(_gtk_file_system_model_remove_editable): Don't unref the editable node.
	(_gtk_file_system_model_remove_editable): Ahem, free the node.

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
	Added fields for edited_idle and edited_new_text.
	(renderer_edited_cb): Queue the
	creation of the folder in an idle handler.
	(renderer_editing_canceled_cb): Likewise for the cancellation.
	(gtk_file_chooser_default_finalize): Free the impl->edited_new_text.
2004-06-12 00:49:02 +00:00
Federico Mena Quintero
53684f70cf Change to the newly-created folder. Fixes #138932. (trap_activate_cb):
2004-05-31  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (renderer_edited_cb): Change to the
	newly-created folder.  Fixes #138932.
	(trap_activate_cb): Only return TRUE if we did handle the event.
	Fixes #143359; patch by jylefort@brutele.be.
2004-05-31 18:29:02 +00:00
Anders Carlsson
12b566cec4 Make separator rows insensitive.
2004-05-27  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtkfilechooserdefault.c (save_folder_combo_create):
	Make separator rows insensitive.
2004-05-27 13:40:36 +00:00
Federico Mena Quintero
8e6a2b4f6e Fixes #139562, based on a patch by Christian Neumair.
2004-05-04  Federico Mena Quintero  <federico@ximian.com>

	Fixes #139562, based on a patch by Christian Neumair.

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault): Add
	a filter_combo_hbox field to contain the filter combo.
	(show_filters): Show/hide the filter_combo_hbox.
	(create_filename_entry_and_filter_combo): Removed.
	(file_pane_create): Create the filter_combo_hbox here.
2004-05-04 17:53:13 +00:00
Federico Mena Quintero
6631943388 Fixes #140412.
2004-04-29  Federico Mena Quintero  <federico@ximian.com>

	Fixes #140412.

	* gtk/gtkfilechooserdefault.c (remove_selected_bookmarks): New
	function; moved the code over from
	remove_bookmark_button_clicked_cb().
	(remove_selected_bookmarks): Now, getting a non-removable bookmark
	is not an error, as we may be called as a result of hitting the
	Delete key.
	(shortcuts_key_press_event_cb): New handler; delete the bookmark
	if the user presses Backspace, Delete, or KP_Delete.
2004-04-29 23:13:50 +00:00
Federico Mena Quintero
6cb9668e69 Use a variant of the code from gtkfilesel.c to parse a "text/uri-list"
2004-04-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (split_uris): Use a variant of the
	code from gtkfilesel.c to parse a "text/uri-list" blob.  Fixes
	#140126.
2004-04-15 19:17:50 +00:00
Federico Mena Quintero
f37b0a1d97 Use a title for SAVE and CREATE_FOLDER modes. Fixes #137272.
2004-04-05  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (location_popup_handler): Use a
	title for SAVE and CREATE_FOLDER modes.  Fixes #137272.
2004-04-06 03:15:21 +00:00
Federico Mena Quintero
a0f3ee5660 Make the new-folder button say "Create Fo_lder" rather than "Create
2004-04-05  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (file_pane_create): Make the
	new-folder button say "Create Fo_lder" rather than "Create
	_Folder", so that the mnemonic doesn't conflict with the "Save in
	_folder" label.  Fixes #136975.
2004-04-06 02:52:08 +00:00
Federico Mena Quintero
8e661364c6 Fix #136077.
2004-04-01  Federico Mena Quintero  <federico@ximian.com>

	Fix #136077.

	* gtk/gtkpathbar.h (struct _GtkPathBarClass): Add a
	"child_is_hidden" boolean argument to the "path-clicked" signal.

	* gtk/gtkpathbar.c (struct _ButtonData): Added a file_is_hidden
	field.
	(make_directory_button): Take a file_is_hidden argument; put it in
	the ButtonData.
	(_gtk_path_bar_set_path): See whether each path component path is
	a hidden file.
	(gtk_path_bar_class_init): Add the file_is_hidden argument to the
	"path-clicked" signal.
	(button_clicked_cb): See if the downwards button represents a
	hidden file for the file_is_hidden argument in the signal
	emission.

	* gtk/gtkmarshalers.list: Added a signal type VOID:POINTER,BOOLEAN.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_select_path): If we fail to switch
	folders, don't try to select the path in the file system model.
	Also, return the result from _gtk_file_system_model_path_do().
	(gtk_file_chooser_default_select_path): Turn on show_hidden in the
	file system model if we are asked to select a hidden file.
	(path_bar_clicked): Show hidden files based on whether the
	immediate downwards folder in the path bar is a hidden file
	itself.
	(struct _GtkFileChooserDefault): Added fields
	browse_files_popup_menu and browse_files_popup_menu_hidden_files_item.
	(create_file_list): Set an object data key of
	"GtkFileChooserDefault" on the tree view so that we can find the
	impl from the popup menu callbacks.  Also, hook up to the
	"button-press-event" and "popup-menu" signals in the file list to
	bring up a popup menu.
	(list_popup_menu_cb): New callback.
	(list_button_press_event_cb): New callback.

	Fix #138763:

	* gtk/gtkfilesystemmodel.c
	(_gtk_file_system_model_new): Oops, connect_object to
	"finished-loading".
2004-04-02 00:35:07 +00:00
Federico Mena Quintero
7f62edf379 Fix #137520.
2004-03-29  Federico Mena Quintero  <federico@ximian.com>

	Fix #137520.

	* gtk/gtkfilesystem.h (struct _GtkFileFolderIface): Added slots
	for an ::is_finished_loading() method and a ::finished_loading()
	signal at the end of the struct.

	* gtk/gtkfilesystem.c (gtk_file_folder_base_init): Create the
	"finished-loading" signal.
	(gtk_file_folder_is_finished_loading): New function.

	* gtk/gtkfilesystemunix.c
	(gtk_file_folder_unix_is_finished_loading): Implement.

	* gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModelClass): New
	slot for a "finished-loading" signal.
	(gtk_file_system_model_class_init): Create the "finished-loading"
	signal.
	(struct _GtkFileSystemModel): New field
	idle_finished_loading_source.  We emit the "finished-loading"
	signal in an idle if the root folder was done loading right in
	_gtk_file_system_model_new(), so that the caller has a chance to
	connect to the signal.
	(_gtk_file_system_model_new): Connect to the normal signals of the
	folder even if the initial _list_children() fails.  Also, see if
	the folder is finished loading; connect to the "finished-loading"
	signal otherwise.
	(gtk_file_system_model_finalize): Remove the idle handler.

	* gtk/gtkfilechooserdefault.c (set_list_model): Set a busy cursor
	and connect to the model's "finished-loading" signal.
	(get_toplevel): New helper function.
	(error_message): Use get_toplevel().
	(trap_activate_cb): Likewise.
	(location_popup_handler): Likewise.
	(set_busy_cursor): New function.
	(browse_files_model_finished_loading_cb): New callback.
2004-03-29 19:52:16 +00:00
Federico Mena Quintero
e38ade9299 Just use the file under the cursor; we don't need the logic from
2004-03-25  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (check_preview_change): Just use the
	file under the cursor; we don't need the logic from
	GtkFileSelection after all.  Fixes #132255.
2004-03-25 21:52:04 +00:00
Federico Mena Quintero
cd486d396f Fill the location entry with the display name of the file under the cursor
2004-03-25  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (location_entry_create): Fill the
	location entry with the display name of the file under the cursor
	for Open mode, or the typed filename in Save mode.
2004-03-25 21:36:02 +00:00
Federico Mena Quintero
da83c1cbf3 Revert the patch to #137520, as 2.4.1 is for conservative bug fixes only.
2004-03-19  Federico Mena Quintero  <federico@ximian.com>

	* Revert the patch to #137520, as 2.4.1 is for conservative bug
	fixes only.  The patch is attached to the bug report, for
	reference.

2004-03-19  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilechooserdefault.c
2004-03-19 21:16:24 +00:00
Morten Welinder
f1c18d57d6 Test existance of the path after checking for locality, if needed.
2004-03-19  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_set_current_folder): Test existance of
	the path after checking for locality, if needed.
2004-03-19 20:18:09 +00:00
Federico Mena Quintero
68030a7ee7 Fix #137520.
2004-03-19  Federico Mena Quintero  <federico@ximian.com>

	Fix #137520.

	* gtk/gtkfilesystem.h (struct _GtkFileFolderIface): Added slots
	for an ::is_finished_loading() method and a ::finished_loading()
	signal at the end of the struct.

	* gtk/gtkfilesystem.c (gtk_file_folder_base_init): Create the
	"finished-loading" signal.
	(gtk_file_folder_is_finished_loading): New function.

	* gtk/gtkfilesystemunix.c
	(gtk_file_folder_unix_is_finished_loading): Implement.

	* gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModelClass): New
	slot for a "finished-loading" signal.
	(gtk_file_system_model_class_init): Create the "finished-loading"
	signal.
	(struct _GtkFileSystemModel): New field
	idle_finished_loading_source.  We emit the "finished-loading"
	signal in an idle if the root folder was done loading right in
	_gtk_file_system_model_new(), so that the caller has a chance to
	connect to the signal.
	(_gtk_file_system_model_new): Connect to the normal signals of the
	folder even if the initial _list_children() fails.  Also, see if
	the folder is finished loading; connect to the "finished-loading"
	signal otherwise.
	(gtk_file_system_model_finalize): Remove the idle handler.

	* gtk/gtkfilechooserdefault.c (set_list_model): Set a busy cursor
	and connect to the model's "finished-loading" signal.
	(get_toplevel): New helper function.
	(error_message): Use get_toplevel().
	(trap_activate_cb): Likewise.
	(location_popup_handler): Likewise.
	(set_busy_cursor): New function.
	(browse_files_model_finished_loading_cb): New callback.
2004-03-19 19:41:06 +00:00
Morten Welinder
72d48463da Free volumes not actually put into the shortcut list.
2004-03-17  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilechooserdefault.c (shortcuts_add_volumes): Free
	volumes not actually put into the shortcut list.
2004-03-17 21:52:29 +00:00
Morten Welinder
8d3344036c Do nothing if we have no screen. Fixes #137260.
2004-03-17  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilechooserdefault.c (check_icon_theme): Do nothing if we
	have no screen.  Fixes #137260.
	(shortcuts_add_bookmark_from_path): Simplify using check_is_folder
	thereby fixing leak.  Fixes #137259.
2004-03-17 15:34:21 +00:00
Federico Mena Quintero
7cd0c2686d Only hide the "create folder" button in OPEN mode; all the others should
2004-03-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (update_appearance): Only hide the
	"create folder" button in OPEN mode; all the others should show it
	it.
	(get_paths_foreach): Handle the editable row.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder):
	Force a re-get of the folder so that the new directory gets added
	to its hash table of file info.
2004-03-15 23:15:31 +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
Federico Mena Quintero
77c7092489 Only show the title string in OPEN/SELECT_FOLDER mode as it's
Mon Mar 15 12:51:17 2004  Jonathan Blandford  <jrb@gnome.org>

	* gtk/gtkfilechooserdefault.c (location_popup_handler): Only show
	the title string in OPEN/SELECT_FOLDER mode as it's open-specific.
	Put a blank title for SAVE/CREATE_FOLDER; we are in string freeze,
	so we'll fix it for 2.4.1 as #137272.

	* gtk/gtkpathbar.c (gtk_path_bar_scroll_down): calculate
	space_available correctly for RTL mode.  w/o this, you can't
	scroll down again.  Fixes #137021.

2004-03-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkpathbar.c (gtk_path_bar_scroll_up): Queue a resize.
	(gtk_path_bar_scroll_down): Likewise.
2004-03-15 18:12:51 +00:00
Jonathan Blandford
e8095cc81b set changing_folders to be true so we don't trigger a callback when we
Mon Mar 15 10:35:19 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (shortcuts_add_volumes): set
        changing_folders to be true so we don't trigger a callback when we
        remove the selection
        (shortcuts_add_bookmarks): ditto
2004-03-15 16:27:45 +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