Commit Graph

235 Commits

Author SHA1 Message Date
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
Mark McLoughlin
2d23e05a46 remove the unused "lowest_folder" GtkFileChooserDefault member. Leftover
2004-03-15  Mark McLoughlin  <mark@skynet.ie>

        * gtk/gtkfilechooserdefault.c: remove the unused "lowest_folder"
        GtkFileChooserDefault member. Leftover from my original patch
        for bug #136987.
2004-03-15 09:07:59 +00:00
Federico Mena Quintero
f956e3ae0a Renamed from shortcuts_unselect_all(); now selects the row that
2004-03-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_find_current_folder):
	Renamed from shortcuts_unselect_all(); now selects the row that
	corresponds to the current folder, if any.  Fixes #135916.

	* gtk/gtkpathbar.h: Added prototypes for _gtk_path_bar_up() and
	_gtk_path_bar_down().
2004-03-15 06:51:58 +00:00
Federico Mena Quintero
0abde22904 Surround the drag-outside-to-remove-bookmarks code with "#if 0" blocks;
2004-03-15  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c: Surround the
	drag-outside-to-remove-bookmarks code with "#if 0" blocks; it's
	too unstable right now.
2004-03-15 06:29:33 +00:00
Owen Taylor
2c9d190c09 Implement local_only by filtering the shortcuts and bookmarks list by
Sun Mar 14 23:36:15 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkfilechooserdefault.c: Implement local_only by
        filtering the shortcuts and bookmarks list by
        gtk_file_system_path_to_filename (file_system, path) != NULL.
        (#132894)

        * gtk/gtkfilesystem.c (gtk_file_system_path_is_local): Add
        a convenience function, may by interesting to push to the
        file system vtable later for performance.
2004-03-15 06:09:40 +00:00
Federico Mena Quintero
084bb2fe39 Allow the path to be NULL, so that people can ask for information about a
2004-03-14  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystem.c (gtk_file_folder_get_info): Allow the path
	to be NULL, so that people can ask for information about a
	parent-less file system root (e.g. get_info (get_folder ("/"), NULL)).

	* gtk/gtkfilesystemunix.c (gtk_file_folder_unix_get_info): Allow
	the condition describe above.

	* gtk/gtkfilechooserdefault.c (get_file_info): Allow getting
	information of root paths.

	* gtk/gtkpathbar.c (_gtk_path_bar_set_path): Handle root paths correctly.
2004-03-15 05:42:51 +00:00
Owen Taylor
f8b3e6fe42 Add _gtk_path_bar_up()/ _gtk_path_bar_down().
Sun Mar 14 21:03:15 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkpathbar.[ch]: Add _gtk_path_bar_up()/
        _gtk_path_bar_down().

        * gtk/gtkfilechooserdefault.c: Use _gtk_path_bar_up()/
        _gtk_path_bar_down() as bindings for Alt-Up
        and new Alt-Down. (Partly based on a patch by
        Mark McLoughlin, #136987)
2004-03-15 02:12:08 +00:00
Federico Mena Quintero
dfa36bb4e4 Fixes #136185, patch by Morten Welinder, with some changes.
2004-03-14  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136185, patch by Morten Welinder, with some changes.

	* gtk/gtkfilechooserdefault.c (check_is_folder): New helper function.
	(shortcuts_insert_path): Check the path first with check_is_folder().
	(gtk_file_chooser_default_set_current_folder): Likewise.
	(gtk_file_chooser_default_add_shortcut_folder): Likewise.
	(browse_widgets_create): Unref the size group.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_get_folder):
	Handle the case where the file exists but it is not a directory.
	(IconType): Add value for ICON_UNDECIDED.
	(struct stat_info_entry): New structure to hold a file's struct
	stat, its MIME type and its icon type.
	(struct _GtkFileFolderUnix): Added a hash of struct
	stat_info_entry, and flags to remember which info types we've read
	so far.
	(get_icon_type): Use a helper function for the icons-from-stat
	types.
	(gtk_file_system_unix_render_icon): Use the cached file info.
	(gtk_file_folder_unix_get_info): Put the info in the cache.
	(gtk_file_system_unix_get_folder): Create the cache of file info
	structures.

	* gtk/gtkfilesystem.c (gtk_file_info_set_display_name): Handle the
	case where display_name is the same as the existing
	info->display_name.
2004-03-15 02:09:22 +00:00
Morten Welinder
79d73b1349 Damn cvs. 2004-03-14 19:50:11 +00:00
Morten Welinder
df8b419ecf Don't crash on NULL path; don't crash on NULL error.
2004-03-14  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilechooserdefault.c (error_dialog): Don't crash on NULL
	path; don't crash on NULL error.
2004-03-14 19:47:20 +00:00
Federico Mena Quintero
2de434104e Put the trash icon on the right for LTR locales, or on the left for RTL.
2004-03-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
	Put the trash icon on the right for LTR locales, or on the left
	for RTL.
	(shortcuts_drag_motion_cb): Cancel the idle handler here as well.
	(shortcuts_drag_leave_cb): Test whether the idle is present.
	(shortcuts_drag_data_received_cb): Ahem, don't assert here.
2004-03-12 00:13:16 +00:00
Federico Mena Quintero
b4a6705a8c Put the trash icon on the right for LTR locales, or on the left for RTL.
2004-03-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_drag_set_delete_cursor):
	Put the trash icon on the right for LTR locales, or on the left
	for RTL.
	(shortcuts_drag_motion_cb): Cancel the idle handler here as well.
	(shortcuts_drag_leave_cb): Test whether the idle is present.
2004-03-12 00:03:48 +00:00
Jonathan Blandford
865d3dd267 revert earlier change to insert_path so that we test that the directory
Thu Mar 11 16:18:51 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): revert
        earlier change to insert_path so that we test that the directory
        exists.

        * gtk/gtkfilechooserdialog.c
        (gtk_file_chooser_dialog_constructor): move focus.
2004-03-11 21:23:16 +00:00
Federico Mena Quintero
df0510a89f New function, copied from gtkpathbar.c.
2004-03-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (remove_settings_signal): New
	function, copied from gtkpathbar.c.
	(gtk_file_chooser_default_dispose): Use remove_settings_signal()
	rather than our own code.
	(gtk_file_chooser_default_screen_changed): Use
	remove_settings_signal(); this should handle per-screen settings
	correctly.
2004-03-11 20:03:38 +00:00
Federico Mena Quintero
b35220fda0 Use a single OK button, not a Close button, as per the HIG.
2004-03-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (error_message_with_parent): Use a
	single OK button, not a Close button, as per the HIG.

	* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Likewise.
2004-03-11 18:48:46 +00:00
Federico Mena Quintero
4cfd0030b6 Oops, initialize "action" before jumping. Fixes #136900.
2004-03-11  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_drag_motion_cb): Oops,
	initialize "action" before jumping.  Fixes #136900.
2004-03-11 18:13:51 +00:00
Federico Mena Quintero
1135bef0da Fix #135912 and #135913.
2004-03-11  Federico Mena Quintero  <federico@ximian.com>

	Fix #135912 and #135913.

	* gtk/gtkfilechooserdefault.c
	(shortcuts_filter_model_row_draggable): Implement.
	(shortcuts_model_filter_new): New function, create a
	ShortcutsModelFilterClass derived from GtkTreeModelFilter, so that
	we can implement our own DnD interface methods.
	(shortcuts_model_create): Use shortcuts_model_filter_new().
	(shortcuts_list_create): Enable the shortcuts list as a drag
	source.
	(file_list_source_targets): Renamed from shortcuts_targets.
	(shortcuts_list_create): Change the options for
	gtk_drag_dest_set().  Connect to more drag signals so that we can
	implement drops by hand.
	(shortcuts_drag_data_delete_cb): New handler; just stop the emission.
	(shortcuts_drag_motion_cb): New handler; validate the drop.
	(shortcuts_drag_leave_cb): New handler; unset the drag_dest_row.
	(shortcuts_drag_drop_cb): New handler; just stop the emission and
	remove the idle handler for the drag cursor.
	(shortcuts_add_bookmark_from_path): Add a position argument,
	return a boolean success code.
	(shortcuts_drag_data_received_cb): Handle two cases:  1) Insert
	the bookmarks at the proper position, rather than always appending
	them to the list; 2) alternatively, reorder the bookmarks.
	(struct _GtkFileChooserDefault): New field shortcuts_drag_outside.
	(shortcuts_drag_motion_cb): Turn off impl->shortcuts_drag_outside.
	(shortcuts_drag_leave_cb): Turn on impl->shortcuts_drag_outside in
	an idle handler.
	(shortcuts_drag_end_cb): New handler; remove the selected bookmark.
2004-03-11 06:24:15 +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
Federico Mena Quintero
6e30693cd9 Use an untranslatable "%x" for dates, rather than a custom format. Fixes
2004-03-10  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func): Use an
	untranslatable "%x" for dates, rather than a custom format.  Fixes
	#136357.
2004-03-10 18:35:07 +00:00
Morten Welinder
5babb8607f Add comment. 2004-03-10 17:58:56 +00:00
Morten Welinder
3f5ec9fe02 Test validity of path here. (shortcuts_insert_path): Don't check here.
2004-03-10  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_add_shortcut_folder): Test validity of
	path here.
	(shortcuts_insert_path): Don't check here.
	(get_file_info): Barf if name-only fails.
2004-03-10 17:55:16 +00:00
Jonathan Blandford
5d8863bbac use uri instead of the pathname for UTF-8 safety.
Wed Mar 10 00:24:24 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (error_dialog): use uri instead of
        the pathname for UTF-8 safety.
2004-03-10 05:24:23 +00:00
Jonathan Blandford
382bf3a113 Always check to see if the shortcuts exists. We don't want to put invalid
Wed Mar 10 00:10:47 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Always
        check to see if the shortcuts exists.  We don't want to put
        invalid dirs in the shortcuts pane.
2004-03-10 05:19:29 +00:00
Jonathan Blandford
e76bb1c3c7 remove unneeded shortuts_swin;
Tue Mar  9 16:40:34 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
        remove unneeded shortuts_swin;
2004-03-10 03:43:58 +00:00
Federico Mena Quintero
b82008a037 Fix #136533.
2004-03-09  Federico Mena Quintero  <federico@ximian.com>

	Fix #136533.

	* gtk/gtkfilechooserdefault.c (shortcuts_reload_icons): New
	function.
	(check_icon_theme): New helper function, installs a handler for
	changes in the icon theme.
	(gtk_file_chooser_default_style_set): Use check_icon_theme().
	(gtk_file_chooser_default_screen_changed): Use check_icon_theme().
	(gtk_file_chooser_default_dispose): Disconnect from GtkSettings.
	(change_icon_theme): New function, updates impl->icon_size and
	reloads the icons.
	(struct _GtkFileChooserDefault): New field settings_signal_id.
	(struct _GtkFileChooserDefault): New field icon_size.
	(shortcuts_insert_path): Use impl->icon_size.
	(list_icon_data_func): Likewise.
2004-03-09 21:22:42 +00:00
Federico Mena Quintero
22bc71a667 Handle the returned parent_path being NULL. Fixes #136662.
2004-03-09  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (get_file_info): Handle the returned
	parent_path being NULL.  Fixes #136662.
2004-03-09 19:47:09 +00:00
Federico Mena Quintero
ace5e30238 Stop the emission so that GtkTreeView's handler won't try to poke the
2004-03-09  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_drag_data_received_cb):
	Stop the emission so that GtkTreeView's handler won't try to poke
	the filter model.  Fixes #136127.
2004-03-09 19:10:20 +00:00
Federico Mena Quintero
caf66b3ddd Use gtk_tree_view_set_cursor().
2004-03-08  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_initial_focus): Use
	gtk_tree_view_set_cursor().
2004-03-08 23:16:03 +00:00
Federico Mena Quintero
8383c8f7fe Patch "1a" from #136185, by Morten Welinder.
2004-03-08  Federico Mena Quintero  <federico@ximian.com>

	Patch "1a" from #136185, by Morten Welinder.

	* gtk/gtkfilechooserdefault.c (get_file_info): Take in an argument
	that says whether the caller just wants the display name.
	(shortcuts_insert_path): We only want the name in the call to
	get_file_info().

	* gtk/gtkpathbar.c (_gtk_path_bar_set_path): Don't request more
	info than needed from the file_folder.
2004-03-08 22:53:35 +00:00
Federico Mena Quintero
2247fc6659 Fixes #136105.
2004-03-08  Federico Mena Quintero  <federico@ximian.com>

	Fixes #136105.

	* gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
	Added an ::initial_focus() method.

	* gtk/gtkfilechooserembed.c
	(_gtk_file_chooser_embed_delegate_iface_init): Set the
	initial_focus method.
	(delegate_initial_focus): Implement.
	(_gtk_file_chooser_embed_initial_focus): New function.

	* gtk/gtkfilechooserdialog.c
	(gtk_file_chooser_dialog_constructor): Call
	_gtk_file_chooser_embed_initial_focus().

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
	Install the ::initial_focus() handler.
	(gtk_file_chooser_default_initial_focus): Implement.
2004-03-08 22:21:47 +00:00
Federico Mena Quintero
4bab88cda4 Return a boolean success code. (location_popup_handler): Refocus the file
2004-03-08  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (update_from_entry): Return a
	boolean success code.
	(location_popup_handler): Refocus the file chooser if appropriate.
	Fixes #135905.
	(save_widgets_create): Don't set the text of the save_folder_label
	here.
	(update_appearance): Set the text here as appropriate for the save
	mode.  Also fixes #136387.
	(update_appearance): Don't show the Create Folder button in
	SELECT_FOLDER mode.
	(update_appearance): Show the extra widget in all Save modes
	correctly.
2004-03-08 20:06:50 +00:00
Jonathan Blandford
59938d927c new function to consolidate creating the path_bar.
Mon Mar  8 04:50:12 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (create_path_bar): new function to
        consolidate creating the path_bar.
        (gtk_file_chooser_default_set_current_folder): no longer need to
        pass in the filesystem.

        * gtk/gtkpathbar.h: Removed unused set_pixbuf functions in favor
        of just setting the filesystem.

        * gtk/gtkpathbar.c (gtk_path_bar_finalize): Free root path and
        home_dir.
        (get_button_image): Add images to path_bar.
        (update_button_appearance): use images
        (make_directory_button): Clasify buttons based upon location.
        (_gtk_path_bar_set_path): no longer need a file-system.  Also, add
        rerooting, #135845, #135914

        * tests/testfilechooser.c: Fix reused error handling.
2004-03-08 09:56:34 +00:00
Jonathan Blandford
afec1da061 actually use gtk_button_add.
Sun Mar  7 17:38:03 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkbutton.c (gtk_button_class_init): actually use
        gtk_button_add.

        * gtk/gtkfilechooserdefault.c (error_building_filename_dialog):
        use the uri, not the path, #136317
        (renderer_edited_cb): ditto
        (shortcuts_add_bookmark_from_path): ditto
        (remove_bookmark_button_clicked_cb): ditto
        (gtk_file_chooser_default_remove_shortcut): ditto
        (update_from_entry): ditto
        (up_folder_handler): ditto
2004-03-07 22:49:44 +00:00
Jonathan Blandford
9e379cfd40 set redraw_on_allocate, #135902.
Sun Mar  7 16:07:08 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init): set
        redraw_on_allocate, #135902.

        * gtk/gtkfilesystemmodel.c (model_refilter_recurse): Patch from
        Damon Chaplin to set a node to be visible before emitting the
        inserted signal, #135555.
2004-03-07 21:26:32 +00:00
Jonathan Blandford
58db7b1f62 stop activate from unselecting rows when pressed in multiple-selection
Sun Mar  7 14:34:04 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (trap_activate_cb): stop activate
        from unselecting rows when pressed in multiple-selection mode.
2004-03-07 19:38:49 +00:00
Jonathan Blandford
eb258fe24c if action is SELECT_FOLDER, then return the currentd folder if none is
Sun Mar  7 03:03:57 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_get_paths): if action is
        SELECT_FOLDER, then return the currentd folder if none is
        selected.
        (gtk_file_chooser_default_should_respond): Allow 'Ok' to be hit if
        no directory is selected in SELECT_FOLDER mode.
2004-03-07 08:15:09 +00:00
Jonathan Blandford
0b231feb1c remove unneeded elements. (tree_selection_changed): removed
Sat Mar  6 23:31:18 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
        remove unneeded elements.
        (tree_selection_changed): removed
        (tree_name_data_func): removed
        (gtk_file_chooser_default_finalize): don't unref dir model
        (create_folder_tree): removed
        (get_selection): no longer need to abstract away the selection
        function.
        (create_file_list): We now create a tree for all actions.
        (file_pane_create): Make one tree.
        (update_appearance) We really change the mode only, now.
2004-03-07 04:41:36 +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
Jonathan Blandford
48bfdd5174 scroll to the new path.
Fri Mar  5 18:00:36 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserdefault.c (new_folder_button_clicked): scroll
        to the new path.

        * gtk/gtktreeview.c (gtk_tree_view_adjustment_changed): Update the
        allocation when scrolling instead of cancelling editing.
2004-03-05 23:02:01 +00:00
Federico Mena Quintero
385bd6a54e Add gboolean return values and GError arguments to ::set_current_folder()
2004-03-05  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserIface): Add
	gboolean return values and GError arguments to
	::set_current_folder() and ::select_path().

	* gtk/gtkfilechooser.c (gtk_file_chooser_set_current_folder):
	Return a boolean value for success/failure.
	(gtk_file_chooser_set_current_folder_uri): Likewise.
	(gtk_file_chooser_select_filename): Likewise.
	(gtk_file_chooser_select_uri): Likewise.
	(gtk_file_chooser_set_filename): Likewise.
	(gtk_file_chooser_set_uri): Likewise.
	(_gtk_file_chooser_set_current_folder_path): Likewise, plus take
	in a GError.
	(_gtk_file_chooser_select_path): Likewise.

	* gtk/gtkfilechooserutils.c (delegate_set_current_folder):
	Likewise.
	(delegate_select_path): Likewise.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_select_path): Likewise.
	(gtk_file_chooser_default_set_current_folder): Likewise.
	(error_changing_folder_dialog): New helper function.
	(change_folder_and_display_error): New helper function.
	(switch_to_selected_folder): Use change_folder_and_display_error().
	(tree_selection_changed): Likewise.
	(shortcuts_activate_volume): Likewise.
	(shortcuts_activate_item): Likewise.
	(list_row_activated): Likewise.
	(path_bar_clicked): Likewise.
	(update_from_entry): Likewise.
	(up_folder_handler): Likewise.
	(home_folder_handler): Get the home path from the shortcuts model,
	and use change_folder_and_display_error().

	* tests/testfilechooser.c (set_current_folder): New helper
	function; pops up a simple error dialog if necessary.
	(set_filename): Likewise.
	(set_folder_nonexistent_cb): Use set_current_folder().
	(set_folder_existing_nonexistent_cb): Likewise.
	(set_filename_nonexistent_cb): Use set_filename().
	(set_filename_existing_nonexistent_cb): Likewise.
2004-03-05 20:47:05 +00:00
Michael Natterer
800f0e6197 s/object/widget/. Makes it compile again.
2004-03-05  Michael Natterer  <mitch@gimp.org>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_show_all):
	s/object/widget/. Makes it compile again.
2004-03-05 09:49:00 +00:00
Jonathan Blandford
5d50d3d16f chain to the extra_widget.
Fri Mar  5 03:37:14 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_show_all):
        chain to the extra_widget.
2004-03-05 08:37:11 +00:00
Jonathan Blandford
233b7b8be6 Patch from Damon Chaplin to free models when we're finalized, #134053
Fri Mar  5 02:53:41 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
        Patch from Damon Chaplin to free models when we're finalized,
        #134053
2004-03-05 07:58:36 +00:00
Alexander Larsson
8a8798bdbc Document the fact that there might not be a volume for all paths.
2004-03-05  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkfilesystem.c (gtk_file_system_get_volume_for_path):
	Document the fact that there might not be a volume for all
	paths.

	* gtk/gtkfilechooserdefault.c (shortcuts_add_current_folder):
	Don't assume there is a volume for all paths.
2004-03-05 07:46:06 +00:00
Jonathan Blandford
8bb74888d6 insert in the correct place instead of naïvely appending.
Fri Mar  5 01:45:04 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (shortcuts_append_paths): insert in
        the correct place instead of naïvely appending.
        (shortcuts_add_volumes): refilter the model
        (shortcuts_add_bookmarks): refilter the model
        (gtk_file_chooser_default_add_shortcut_folder): refilter the model
2004-03-05 06:51:22 +00:00
Federico Mena Quintero
d64c7c08a8 New handler. Ask the GtkFileChooser widget if it wants to do something
2004-03-04  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdialog.c (response_cb):  New handler.  Ask the
	GtkFileChooser widget if it wants to do something special rather
	than letting us terminate the dialog.
	(gtk_file_chooser_dialog_init): Connect to "response"; see the
	comment in the sources to see why we don't override the method in
	class_init.

	* gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
	Added a ::should_respond() method.

	* gtk/gtkfilechooserembed.c
	(_gtk_file_chooser_embed_delegate_iface_init): Add a delegate for ::should_respond().
	(delegate_should_respond): New delegate.
	(_gtk_file_chooser_embed_should_respond): New function.

	* gtk/gtkfilechooserdefault.c (set_list_model, create_file_list):
	Use dashes in signal names rather than underscores.
	(gtk_file_chooser_default_init): Hook up our ::should_respond() implementation.
	(gtk_file_chooser_default_should_respond): Implement.  go into a
	folder rather than responding if we are in File mode and the
	selected file is a folder.
	(get_selection): New helper function.
	(add_bookmark_button_clicked_cb): Use get_selection().
	(bookmarks_check_add_sensitivity): Likewise.
	(gtk_file_chooser_default_get_paths): Likewise.
	(check_save_entry): New helper function.
	(gtk_file_chooser_default_get_paths): Use check_save_entry().
	(selection_check): Renamed from selection_is_folders().  Now
	checks whether the selection is empty, all files, all folders.
	(bookmarks_check_add_sensitivity): Use selection_check().
2004-03-05 00:10:59 +00:00
Jonathan Blandford
b1ac4367f5 show the 'New Folder' button in SAVE mode again.
Thu Mar  4 15:20:55 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (update_appearance): show the 'New
        Folder' button in SAVE mode again.
2004-03-04 21:29:51 +00:00
Jonathan Blandford
778d6904c4 Modified patch from muppet <scott@asofyet.org> to keep child directories
Thu Mar  4 01:32:19 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkpathbar.c (gtk_path_bar_set_path): Modified patch from
        muppet <scott@asofyet.org> to keep child directories around if we
        change to a child.

        * gtk/gtkpathbar.c (_gtk_path_bar_set_home_icon): Start of
        icon-setting functions.  Not used yet.
        (_gtk_path_bar_set_root_icon): Ditto.
2004-03-04 06:47:54 +00:00
Jonathan Blandford
e47f7d5827 Don't activate the combo if we're in the midst of changing folders.
Wed Mar  3 16:06:03 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (save_folder_combo_changed_cb):
        Don't activate the combo if we're in the midst of changing
        folders.
2004-03-03 21:09:46 +00:00
Jonathan Blandford
bb5a499944 Split function into realized and unrealized variants, and consolidate the
Tue Mar  2 23:39:55 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdialog.c
        (file_chooser_widget_default_realized_size_changed): Split
        function into realized and unrealized variants, and consolidate
        the handling fo size-changing and default changing.

        * gtk/gtkfilechooserembed.[ch] (gtk_file_chooser_embed_class_init):
        remove resizable-hints-changed, as it just complicated things.

        * gtk/gtkfilechooserdefault.c (update_appearance): Don't emit
        resizable-hints-changed.
2004-03-03 04:52:01 +00:00
Federico Mena Quintero
e50fb68763 Handle errors in setting the path bar's path. Fixes #136000, based on a
2004-03-02  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_set_current_folder): Handle errors in
	setting the path bar's path.  Fixes #136000, based on a patch by
	Morten Welinder.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_insert_bookmark):
	Don't free our own propagated error.

	* gtk/gtkpathbar.c (gtk_path_bar_set_path): Likewise, and free the
	parent_path upon error.  Fixes #136006, patch by Morten Welinder.
	(gtk_path_bar_set_path): Unref the file_folder upon error.
	(gtk_path_bar_set_path): Return a boolean success code.
2004-03-03 00:38:19 +00:00
Jonathan Blandford
e8c5b64836 set the default value, spotted by Morten Welinder.
Tue Mar  2 15:19:52 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_get_resizable_hints): set the default
        value, spotted by Morten Welinder.
2004-03-02 20:24:27 +00:00
Jonathan Blandford
87a6680f33 get the logic correct. This will fix sizing on save dialogs.
Tue Mar  2 15:03:15 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_get_resizable_hints): get the logic
        correct.  This will fix sizing on save dialogs.

        (save_widgets_create): set_mnemonic_widget.
2004-03-02 20:09:20 +00:00
Federico Mena Quintero
9133c58b8d Don't update the save folder combo if we are already switching folders;
2004-03-02  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_set_current_folder): Don't update the
	save folder combo if we are already switching folders; based on a
	patch by Jonathan Blandford.

	* gtk/gtkfilechooserdefault.c (shortcuts_add_current_folder):
	Handle failure to insert the path.  Based on a patch by Morten
	Welinder attached to bug #135380.

	* tests/testfilechooser.c (extra_widget_create): Add a bunch of
	buttons to test various things.
2004-03-02 20:05:08 +00:00
Morten Welinder
c0b55fe0d8 Major thinko, trivial patch. /me chances a commit.
2004-03-02  Morten Welinder  <terra@gnome.org>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_get_resizable_hints): Test the
	resize_horizontally pointer, not the deferenced pointer.
2004-03-02 16:14:53 +00:00
Federico Mena Quintero
af409998b8 New flag shortcuts_current_folder_is_volume.
2004-03-01  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault): New
	flag shortcuts_current_folder_is_volume.
	(shortcuts_add_current_folder): Set
	impl->shortcuts_current_folder_is_volume as appropriate.
	(remove_current_folder_cb): Handle the flag.
	(shortcuts_activate_item): Likewise.
	(shortcuts_update_current_folder): Handle the
	impl->shortcuts_current_folder_active flag; only add the folder if
	it doesn't already exist in the list.
	(shortcuts_model_create): Don't insert the current folder
	separator here.
	(shortcuts_add_current_folder): Insert the separator here.
	(shortcut_find_position): Renamed from shortcut_exists(); now
	returns an index.
	(shortcuts_add_current_folder): Set the active item in the combo.
2004-03-02 05:27:51 +00:00
Federico Mena Quintero
4e08da819d Eep, use gtk_tree_model_filter_convert_iter_to_child_iter(), not the
2004-03-01  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_row_activated_cb): Eep,
	use gtk_tree_model_filter_convert_iter_to_child_iter(), not the reverse.
2004-03-02 03:06:07 +00:00
Federico Mena Quintero
7233e912e2 Don't unref an old model; there isn't one. This was a leftover from when
2004-03-01  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_model_create): Don't
	unref an old model; there isn't one.  This was a leftover from
	when we recreated the model on every change.
	(save_widgets_create): Create the save folder combo.
	(shortcuts_model_create): Don't set the model on the tree view
	here.
	(gtk_file_chooser_default_constructor): Create the shortcuts model
	here, before the rest of the widgets.
	(shortcuts_list_create): Don't call shortcuts_model_create() here;
	just set the model on the tree.
	(save_folder_combo_create): New function, provided by Jonathan
	Blandford.
	(update_appearance): Set the sensitivity of the folder combo.
	(shortcuts_activate_iter): New helper function; code moved from
	shortcuts_row_activated_cb().
	(shortcuts_activate_item): New helper function.
	(shortcuts_row_activated_cb): Use shortcuts_activate_iter().
	(ShortcutsIndex): Renamed SHORTCUTS_SEPARATOR to
	SHORTCUTS_BOOKMARKS_SEPARATOR.
	(struct _GtkFileChooserDefault): New field shortcuts_current_folder_active.
	(shortcuts_insert_separator): Add a position argument.
	(shortcuts_get_index): Handle the SHORTCUTS_CURRENT_FOLDER_SEPARATOR
	and SHORTCUTS_CURRENT_FOLDER positions.
	(shortcut_exists): Ignore the current folder row.
	(struct _GtkFileChooserDefault): New field shortcuts_filter_model.
	(shortcuts_model_create): Create a filter model for the shortcuts list.
	(shortcuts_list_create): Set the model to the shortcuts_filter_model.
	(remove_bookmark_button_clicked_cb): Use the shortcuts_filter_model.
	(bookmarks_check_remove_sensitivity): Likewise.
	(shortcuts_row_activated_cb): Likewise.
	(gtk_file_chooser_default_set_current_folder): New function.
	(gtk_file_chooser_default_set_current_folder): Update the current
	folder row in the shortcuts list.

	* gtk/gtkfilechooserwidget.c
	(gtk_file_chooser_widget_constructor): Cast correctly for
	_gtk_file_chooser_embed_set_delegate().
2004-03-02 02:59:02 +00:00
Jonathan Blandford
a11c1bd6f3 only store the size if we can resize in that direction.
Mon Mar  1 16:51:21 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserdialog.c
        (file_chooser_widget_default_size_changed): only store the size if
        we can resize in that direction.
2004-03-01 21:52:04 +00:00
Owen Taylor
945e6c4ecb Based on patch by Alex Larsson
Mon Mar  1 14:16:52 2004  Owen Taylor  <otaylor@redhat.com>

        Based on patch by Alex Larsson

        * gtk/gtkfilechooserdefault.c: Use gtk-file-chooser-backend
        GtkSetting to set the backend if the app doesn't specify one.

        * gdk/x11/gdkevents-x11.c gtk/gtksettings.c:
        Add Gtk/FileChooserBackend.
2004-03-01 19:40:47 +00:00
Federico Mena Quintero
0775cd28a3 Test for filter_info.uri correctly. Fixes #135379, pointed out by Damon
2004-03-01  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (list_model_filter_func): Test for
	filter_info.uri correctly.  Fixes #135379, pointed out by Damon
	Chaplin.
	(shortcuts_get_index): Compute the bookmarks index correctly.
	Fixes #135714, pointed out by Damon Chaplin.
	(gtk_file_chooser_default_list_shortcut_folders): Handle the case
	with no shortcuts, and don't run off the end of the list if there
	are no bookmarks and their separator.  Fixes #135572, patch by
	Damon Chaplin.
2004-03-01 18:24:06 +00:00
Jonathan Blandford
8f190fbf2f Handle shrinking/growing.
Mon Mar  1 12:05:54 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserdialog.c
        (file_chooser_widget_resizable_hints_changed): Handle
        shrinking/growing.
2004-03-01 17:08:19 +00:00
Jonathan Blandford
7359903ef0 Add g_return_if_fail() (_gtk_file_chooser_embed_get_resizable_hints): Add
Sun Feb 29 01:51:27 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserembed.c
        (_gtk_file_chooser_embed_get_default_size):  Add g_return_if_fail()
        (_gtk_file_chooser_embed_get_resizable_hints): Add g_return_if_fail()

        * gtk/gtkfilechooserdialog.c
        (file_chooser_widget_default_size_changed): Get the correct
        initial size for the dialog.  Also, don't bother with
        gtk_window_set_default_size().  It's not really meaningful.

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_get_default_size): Get the correct
        spacing for the preview_widget
        (update_preview_widget_visibility): Clear widget field after we
        destroy it.
2004-02-29 07:55:24 +00:00
Federico Mena Quintero
17e840f79c Handle GTK_FILE_CHOOSER_PROP_USE_PREVIEW_LABEL.
2004-02-29  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_set_property): Handle
	GTK_FILE_CHOOSER_PROP_USE_PREVIEW_LABEL.
	(gtk_file_chooser_default_get_property): Likewise.
	(struct _GtkFileChooserDefault): Added fields for preview_label,
	use_preview_label, preview_display_name, preview_box.  Removed
	preview_frame.
	(set_preview_widget): Reorder the widget in relation to the label.
	(update_preview_widget_visibility): Create or destroy the preview
	label.
	(check_preview_change): Update impl->preview_display_name and the
	label.
	(find_good_size_from_style): Use the preview_box.
	(gtk_file_chooser_default_finalize): Free
	impl->preview_display_name.
	(gtk_file_chooser_default_init): Initialize
	impl->use_preview_label.

	* gtk/gtkfilechooser.c (gtk_file_chooser_class_init): Add a
	"use-preview-label" property.
	(gtk_file_chooser_set_use_preview_label): New function.  This sets
	whether one wants the file chooser to display a stock label with
	the previewed filename.  Apps that do really fancy previews can
	turn this off and draw the name themselves.
	(gtk_file_chooser_get_use_preview_label): New function.
	(gtk_file_chooser_get_preview_widget_active): Documentation fix.

	* gtk/gtkfilechooserutils.h (GtkFileChooserProp): Add a
	GTK_FILE_CHOOSER_PROP_USE_PREVIEW_LABEL value.

	* gtk/gtkfilechooserutils.c
	(_gtk_file_chooser_install_properties): Override the
	"use-preview-label" property.
2004-02-29 06:35:15 +00:00
Federico Mena Quintero
e403f769d5 Use "Name" for the title of the filename column. (create_file_list):
2004-02-28  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (create_folder_tree): Use "Name" for
	the title of the filename column.
	(create_file_list): Likewise.
2004-02-29 02:59:05 +00:00
Federico Mena Quintero
8a7f716aa4 Removed. (list_name_data_func): Don't call the function above.
2004-02-28  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (set_cell_text_bold_if_folder):
	Removed.
	(list_name_data_func): Don't call the function above.
	(list_mtime_data_func): Likewise.
2004-02-29 02:16:58 +00:00
Jonathan Blandford
0cfdc7fb2b New private interface to help negotiate the default size of the widget.
Fri Feb 27 18:46:27 2004  Jonathan Blandford  <jrb@redhat.com>

        * gtk/gtkfilechooserembed.h: New private interface to help
        negotiate the default size of the widget.  Still a bit buggy, but
        better than the old behavior.

        * gtk/gtkfilechooserdefault.c: Implement the embed interface.

        * gtk/gtkfilechooserwidget.c: Proxy the embed interface.

        * gtk/gtkfilechooserdialog.c: Use the embed interface.
2004-02-27 23:51:16 +00:00
Federico Mena Quintero
c9e88e4e67 Added a "position" argument.
2004-02-27  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystem.c (gtk_file_system_insert_bookmark): Added a
	"position" argument.

	* gtk/gtkfilesystem.h (GtkFileSystemError): Added value for
	GTK_FILE_SYSTEM_ERROR_ALREADY_EXISTS.
	(struct _GtkFileSystemIface): Added a "position" argument to the
	::insert_bookmark() method.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_insert_bookmark):
	Updated; renamed from gtk_file_system_unix_add_bookmark().  Return
	an error if the path already exists in the bookmarks list.
	(gtk_file_system_unix_remove_bookmark): Return an error if the
	path does not exist in the bookmarks list.

	* gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path):
	For now, use gtk_file_system_insert_bookmark() with -1 for the
	position.  DnD will come next.
2004-02-27 20:48:22 +00:00