Commit Graph

95 Commits

Author SHA1 Message Date
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
Jonathan Blandford
d40eda7e87 Add two more folder modes to the enum.
Thu Feb 26 18:25:57 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooser.h (GtkFileChooserAction): Add two more folder
        modes to the enum.

        * gtk/gtkfilechooser.c (gtk_file_chooser_set_folder_mode): Remove.
        (gtk_file_chooser_get_folder_mode): Remove
2004-02-26 23:35:05 +00:00
Jonathan Blandford
4d5baf9f63 move the expander code.
Wed Feb 25 16:00:40 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (update_appearance): move the
        expander code.
2004-02-25 21:05:30 +00:00
Jonathan Blandford
2ef8bbc976 use gtk_widget_push/pop_composite_child around internal buttons.
Wed Feb 25 03:52:58 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkpathbar.c: use gtk_widget_push/pop_composite_child around
        internal buttons.

        * gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
        rename some widgets to make it clear where they are packed.
        (update_appearance): New function to handle all the 'logic' of
        layout in one place.  We aren't trying to keep all our properties
        in sync.
        (gtk_file_chooser_default_set_property): use update_appearance()
2004-02-25 08:55:48 +00:00
Federico Mena Quintero
903e2de0c3 Renamed from create_shortcuts_model(). (struct _GtkFileChooserDefault):
2004-02-24  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_model_create): Renamed
	from create_shortcuts_model().
	(struct _GtkFileChooserDefault): Renamed the shortcuts_tree field
	to shortcuts_list.
	(shortcuts_list_create): Renamed from shortcuts_tree_create().
	(create_file_list): Enable the tree view as a model drag source.
	(create_folder_tree): Likewise.

	* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_get_type):
	Register the drag source interface.
	(drag_source_iface_init): New function.
	(drag_source_row_draggable): New function.
	(drag_source_drag_data_get): New function.
2004-02-25 03:03:11 +00:00
Federico Mena Quintero
359748bd27 Use a plain GtkEntry for the filename, not a GtkFileChooserEntry.
2004-02-24  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (save_widgets_create): Use a plain
	GtkEntry for the filename, not a GtkFileChooserEntry.
	(update_chooser_entry): Use gtk_entry_set_text() rather than
	_gtk_file_chooser_entry_set_file_part().
	(gtk_file_chooser_default_set_current_name): Likewise.
	(gtk_file_chooser_default_set_current_folder): Don't set the base
	folder of the entry, and don't call update_chooser_entry().
	(gtk_file_chooser_default_get_paths): Use the plain entry.
	(save_widgets_create): Store the "Save in Folder" label in the
	impl structure.
	(expander_activate_cb): Set the sensitivity of the label and
	combo.
	(save_widgets_create): Connect to "notify::expanded" rather than
	"activate" on the expander.
	(expander_changed_cb): Renamed from expander_activate_cb().  Flip
	the conditions again...
2004-02-24 20:30:54 +00:00
Anders Carlsson
0cc7bb4f20 Fix compilation (#135278, Padraig O'Briain).
2004-02-24  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtkfilechooserdefault.c: (shortcuts_insert_separator):
	Fix compilation (#135278, Padraig O'Briain).
2004-02-24 11:48:13 +00:00
Anders Carlsson
4ce7278ecf Translate the desktop label.
2004-02-24  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
	Translate the desktop label.

	(shortcuts_get_index), (shortcuts_add_bookmarks),
	(shortcuts_insert_separator), (create_shortcuts_model):
	Don't show the bookmark separator if there are no bookmarks.
2004-02-24 10:11:47 +00:00
Jonathan Blandford
6f75d838e8 Make the dialog look like the nautilus dialog. (expander_activate_cb): get
Tue Feb 24 01:41:30 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (location_popup_handler): Make the
        dialog look like the nautilus dialog.
        (expander_activate_cb): get the order correct.
2004-02-24 06:47:51 +00:00
Federico Mena Quintero
e4e9e08caf Call bookmarks_check_add_sensitivity(). (shortcut_exists): New helper
2004-02-23  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (list_selection_changed): Call
	bookmarks_check_add_sensitivity().
	(shortcut_exists): New helper function; moved the testing code
	over from bookmarks_check_add_sensitivity().
	(bookmarks_check_add_sensitivity): Check the contents of the
	selection in the file/folder list.  Use shortcut_exists().
	(shortcuts_add_bookmark_from_path): Don't insert the bookmark if
	the path is already in the shortcuts list.
	(add_bookmark_button_clicked_cb): Add the bookmarks from the list
	selection or from the current folder, as appropriate.
2004-02-24 03:37:32 +00:00
Jonathan Blandford
93732fb225 Add mnemonics. Sorry translators.
Mon Feb 23 21:09:06 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (shortcuts_pane_create): Add
        mnemonics.  Sorry translators.
2004-02-24 02:09:20 +00:00
Anders Carlsson
d6286bc3c4 Improve bookmark list rendering by controlling the visibility of the
2004-02-24  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtkfilechooserdefault.c: (shortcuts_insert_path),
	(shortcuts_remove_rows), (shortcuts_append_bookmarks),
	(create_shortcuts_model), (shortcuts_tree_create),
	(gtk_file_chooser_default_remove_shortcut_folder):
	Improve bookmark list rendering by controlling the visibility
	of the pixbuf cell so that it will be invisible for the separator
	row, also use a list store instead of a tree store for the model
	so we won't get unnecessary space for an expander.
2004-02-24 00:15:23 +00:00
Jonathan Blandford
95e7d61e6b use a size group when allocating space for the buttons at the bottom just
Mon Feb 23 17:52:43 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (main_paned_create): use a size
        group when allocating space for the buttons at the bottom just in
        case.  Also, move the filter to below the file list.
2004-02-23 22:56:55 +00:00
Jonathan Blandford
6b5ba8d25d Seth was confused by keybindings. They should be Alt, not Ctl. Also,
Mon Feb 23 16:52:12 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_class_init): Seth was confused by
        keybindings.  They should be Alt, not Ctl.  Also, A-Home should go
        home, not up.
2004-02-23 22:07:55 +00:00
Jonathan Blandford
4b041f8241 Display the root a bit more cleanly.
Mon Feb 23 15:23:23 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkpathbar.c (gtk_path_bar_set_path): Display the root a bit
        more cleanly.

        * gtk/gtkpathbar.h (struct _GtkPathBarClass): fix the signal.
2004-02-23 20:24:01 +00:00
Federico Mena Quintero
fa72f157ac Rework the user interface of the file chooser, as per Seth Nickell's
2004-02-23  Federico Mena Quintero  <federico@ximian.com>

	Rework the user interface of the file chooser, as per
	Seth Nickell's design.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_class_init): Add binding signals and bindings:
		"location-popup" - C-l
		"up-folder"      - C-Up
		"home-folder"    - C-Home
	(up_folder_handler): New function; moved the code from up_button_clicked().
	(up_button_clicked_cb): Call up_folder_handler().
	(home_folder_handler): New function.
	(location_popup_handler): New function.
	(struct _GtkFileChooserDefault): Add an hpaned field.
	(gtk_file_chooser_default_set_current_name): Check that we are in
	Save mode.
	(save_widgets_create): New function, create the widgets specific
	to Save mode.
	(main_paned_create): New function, create the hpaned's widgets here.
	(gtk_file_chooser_default_constructor): Create the open and save
	widgets, and show only one set.
	(gtk_file_chooser_default_set_property): Show/hide the save widgets.
	(gtk_file_chooser_default_get_paths): Only pay attention to the
	entry in Save mode.
	(update_chooser_entry): Update the entry only in Save mode.
	(entry_activate): Removed.
2004-02-23 19:55:49 +00:00
Jonathan Blandford
decffc9d95 Use the GtkPathBar by default now.
Mon Feb 23 02:08:42 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (file_pane_create): Use the
        GtkPathBar by default now.

        * gtk/gtkpathbar.c (gtk_path_bar_set_path): Correctly set the
        current path from the path.
        (gtk_path_bar_class_init): new signal
        (button_clicked_cb): emit the signal when we're selected.
        (gtk_path_bar_clear_buttons): Fix a crasher when we weren't
        clearing thr first_scrolled_button.
2004-02-23 07:11:31 +00:00
Jonathan Blandford
b379bc580e conditional compile for GtkPathBar
Fri Feb 20 18:20:22 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c: conditional compile for GtkPathBar

        * gtk/gtkpathbar.c (gtk_path_bar_size_allocate): Clean up
        allocation code.  Works fully in RTL languages, I think.
        (gtk_path_bar_scroll_up): Scroll up.
        (gtk_path_bar_scroll_down): Scroll down.
2004-02-20 23:21:01 +00:00
Alexander Larsson
0300bfdc32 Desktop directory is not translated. (set_tree_model): There might not be
2004-02-20  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
	Desktop directory is not translated.
	(set_tree_model):
	There might not be volumes for all paths.
	* gtk/gtkfilechooserwidget.c:
	(gtk_file_chooser_widget_constructor):
	Use gtk_file_chooser_set_current_folder to set cwd.
2004-02-20 07:52:56 +00:00
Alexander Larsson
824548f1e4 Remove old file-system property. Add new file-system-backend string
2004-02-19  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkfilechooser.c: (gtk_file_chooser_class_init):
	* gtk/gtkfilechooserutils.c:
	* gtk/gtkfilechooserutils.h:
	* gtk/gtkfilechooserwidget.c:
	Remove old file-system property.
	Add new file-system-backend string property

	* gtk/gtkfilechooserdefault.[ch]:
	Handle the file-system-backend property

	* gtk/gtkfilechooserdialog.[ch]:
	(gtk_file_chooser_dialog_new_with_backend):
	Remove old file-system property.
	Add new file-system-backend string property
	Add new function gtk_file_chooser_dialog_new_with_backend

	* gtk/gtkfilesystem.c:
	* gtk/gtkfilesystem.h:
	Add filesystem module support.
2004-02-19 07:43:39 +00:00
Federico Mena Quintero
4c35b74301 Renamed from create_shortcuts_tree(). (shortcuts_pane_create): New
2004-02-18  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_tree_create): Renamed
	from create_shortcuts_tree().
	(shortcuts_pane_create): New function.
	(button_new): Renamed from toolbar_button_new().
	(shortcuts_pane_create): New function, create the whole shortcuts
	pane here.
	(current_folder_create): Renamed from toolbar_create().  Don't
	create the bookmarks buttons here.
	(file_pane_create): New function.
	(gtk_file_chooser_default_constructor): Use the new helper
	functions, and don't use an extra vbox as GtkFileChooserDefault is
	already a vbox.
2004-02-19 03:22:22 +00:00
Federico Mena Quintero
e27a88458f Free the filters. Fixes #133547, patch by Morten Welinder
2004-02-10  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
	Free the filters.  Fixes #133547, patch by Morten Welinder
	<mortenw@gnome.org>.
2004-02-10 19:48:38 +00:00
Federico Mena Quintero
87c45c73b1 Fixes the entry-related part of #133852.
2004-02-10  Federico Mena Quintero  <federico@ximian.com>

	Fixes the entry-related part of #133852.

	* gtk/gtkfilechooserdefault.c (update_chooser_entry): Don't change
	the file part of the entry if the selected item is a folder.
2004-02-10 18:29:11 +00:00
Federico Mena Quintero
76108bc3da Request GTK_FILE_INFO_ALL from the file system model, so that arbitrary
2004-02-09  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (set_list_model): Request
	GTK_FILE_INFO_ALL from the file system model, so that arbitrary
	filtering will work.  Perhaps we should have a way of aggregating
	info types to the model as filters get installed.
2004-02-09 21:58:26 +00:00
Federico Mena Quintero
11ad0f9d65 Fix #132256.
2004-02-09  Federico Mena Quintero  <federico@ximian.com>

	Fix #132256.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_get_paths): Read the contents of the
	filename entry in both OPEN and SAVE mode.  In multiple-selection
	mode, add this to the selection from the file/folder list.
	(struct get_paths_closure): Add a path_from_entry field.
	(get_paths_foreach): Only add the iterated path if it is not the
	same as the path from the entry.
2004-02-09 20:31:38 +00:00
Jonathan Blandford
0180cce7f9 clean up the packing of the file selector.
Fri Feb  6 23:40:24 2004  Jonathan Blandford  <jrb@gnome.org>

        * gtk/gtkfilechooserdefault.c (create_file_list): clean up the
        packing of the file selector.
2004-02-07 17:28:36 +00:00
Federico Mena Quintero
fd05813a0f Free the list. Fixes #133546.
2004-02-06  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_add_volumes): Free the
	list.  Fixes #133546.
2004-02-06 16:21:39 +00:00
Federico Mena Quintero
07de591757 Fix #132247.
2004-01-23  Federico Mena Quintero  <federico@ximian.com>

	Fix #132247.

	* gtk/gtkfilechooserdefault.c (set_select_multiple): Handle folder
	mode.
	(set_select_multiple): Optionally notify about changes to the
	select-multiple property.
	(list_selection_changed): Change the condition for the editable row to
	test for save mode; this is more clear than testing for not being
	in multiple selection mode.
	(gtk_file_chooser_default_get_paths): Get impl->action directly
	rather than calling gtk_file_chooser_get_action().
	(entry_activate): Likewise.
	(set_select_multiple): Annotate about #133255.
	(update_chooser_entry): Likewise.
	(check_preview_change): Likewise.
	(tree_selection_changed): Likewise.
2004-01-23 20:15:05 +00:00
Federico Mena Quintero
56913b4b3b Free the path fields.
2004-01-21  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
	Free the path fields.

	* gtk/gtkfilesystemmodel.c (gtk_file_system_model_finalize): Free
	the root_path, reported by <scott@asofyet.org>
	(gtk_file_system_model_finalize): Unref the file system.

	* gtk/gtkfilefilter.c (filter_rule_free): default:
	g_assert_not_reached().
	(gtk_file_filter_finalize): Free the filter->name, reported by
	<scott@asofyet.org>
	(gtk_file_filter_finalize): Free the rules list.
2004-01-22 02:39:31 +00:00
Federico Mena Quintero
45e6ab2d84 Fix #131418.
2004-01-19  Federico Mena Quintero  <federico@ximian.com>

	Fix #131418.

	* gtk/gtkfilechooserdefault.c (set_select_multiple): New helper
	function.
	(gtk_file_chooser_default_set_property): Use
	set_select_multiple().  Also, re-set this mode to single if the
	file chooser is set to Save mode.
	(entry_activate): Handle the case where the entry is completely
	empty *and* its current folder does exist.  Also, there is need to
	test for select_multiple here now that we ensure that it won't
	happen during Save mode.
2004-01-20 02:44:58 +00:00
Federico Mena Quintero
02cb455471 Added a has_editable field. (_gtk_file_system_model_add_editable): New
2004-01-16  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystemmodel.c (struct _GtkFileSystemModel): Added a
	has_editable field.
	(_gtk_file_system_model_add_editable): New function.
	(_gtk_file_system_model_remove_editable): New function.
	(gtk_file_system_model_get_value): Return appropriate values for
	the temporary editable row.
	(_gtk_file_system_model_get_info): Handle the editable row.
	(_gtk_file_system_model_get_path): Likewise.

	* gtk/gtkfilechooserdefault.c (shortcuts_append_bookmarks):
	Removed an unused variable.
	(toolbar_button_new): Optionally show the button.
	(up_button_clicked_cb): Renamed from up_button_cb(), fixed prototype.
	(toolbar_create): Add a "New Folder" button for Save mode.
	(error_building_filename_dialog): New helper function.
	(gtk_file_chooser_default_get_paths): Use error_building_filename_dialog().
	(create_file_list): Connect to the "edited" signal of the text
	cell renderer.  Store the name column and text renderer in the
	impl structure.
	(renderer_edited_cb): New callback.
	(gtk_file_chooser_default_set_property): Show/hide the "New
	folder" button when the save action changes.
	(COMPARE_DIRECTORIES): Allow the info values to be NULL.
	(COMPARE_DIRECTORIES): Duh, use the list_model, not the
	tree_model.
	(get_list_file_info): Likewise!
	(list_icon_data_func): Handle the path being NULL.
	(new_folder_button_clicked): New callback.
	(list_name_data_func): If we are on the editable row, set the text
	to "Type name of new folder".
	(list_selection_changed): Handle the editable row.
	(list_mtime_data_func): Likewise.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_make_path): Return
	NULL, not FALSE.
	(gtk_file_system_unix_create_folder): Test the result of mkdir() correctly.
2004-01-17 04:34:49 +00:00
Federico Mena Quintero
c6860c111b Do not allow setting select_multiple when in Save mode. (set_list_model):
2004-01-16  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_set_property): Do not allow setting
	select_multiple when in Save mode.
	(set_list_model): No need to nullify the list_model and
	sort_model.
	(gtk_file_chooser_default_get_paths): Handle folder mode as well.
	(get_paths_foreach): Likewise.

	* gtk/gtkfilechooser.c (gtk_file_chooser_get_filename): Clarify
	documentation about folder mode.
	(gtk_file_chooser_get_uri): Likewise.
2004-01-16 05:12:21 +00:00
Federico Mena Quintero
f2f12b9aae New get_volume_for_path() method. (struct _GtkFileSystemIface): Finally
2004-01-16  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystem.h (struct _GtkFileSystemIface): New
	get_volume_for_path() method.
	(struct _GtkFileSystemIface): Finally removed the list_roots() and
	get_root_info() methods, and the "roots-changed" signal.

	* gtk/gtkfilesystem.c (gtk_file_system_get_volume_for_path): New
	function.
	(gtk_file_system_list_roots): Removed.
	(gtk_file_system_get_root_info): Removed.

	* gtk/gtkfilesystemunix.c
	(gtk_file_system_unix_get_volume_for_path): Implement.
	(get_root_volume): New helper function.
	(gtk_file_system_unix_list_volumes): Use get_root_volume().
	(gtk_file_system_unix_list_roots): Removed.
	(gtk_file_system_unix_get_root_info): Removed.

	* gtk/gtkfilesystemmodel.c (_gtk_file_system_model_new): Don't
	accept a NULL root_path.
	(struct _GtkFileSystemModel): Add a field to remember the
	root_path.
	(_gtk_file_system_model_new): Store the root_path in the model
	structure.
	(find_and_ref_path): Stop going up the hierarchy at the root_path
	of the model.  Also, don't return prematurely when walking up the
	hierarchy.

	* gtk/gtkfilechooserdefault.c (create_file_list): Sigh, restore
	the rules_hint.
	(struct _GtkFileChooserDefault): Added a current_volume_path field.
	(set_tree_model): New function; create the folder tree model here.
	(create_folder_tree): Don't create the model here.
	(set_list_model): Set the show_hidden flag on the list model.
2004-01-16 03:35:33 +00:00
Jan Arne Petersen
77cbf47adf add REMOVABLE column to the shortcuts_model.
2004-01-07  Jan Arne Petersen  <jpetersen@uni-bonn.de>

        * gtk/gtkfilechooserdefault.c: (shortcuts_insert_path),
        (shortcuts_append_home), (shortcuts_append_desktop),
        (shortcuts_append_paths), (shortcuts_add_volumes),
        (shortcuts_append_bookmarks), (create_shortcuts_model),
        (gtk_file_chooser_default_add_shortcut_folder): add REMOVABLE column
        to the shortcuts_model.

        (remove_bookmark_button_clicked_cb),
        (bookmarks_check_remove_sensitivity): use REMOVABLE column to check if
        bookmarks can be removed. Fixes #129873
2004-01-07 17:07:18 +00:00
Federico Mena Quintero
96b8f1c176 Oops, call shortcuts_add_bookmarks() here.
2004-01-05  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (shortcuts_append_bookmarks): Oops,
	call shortcuts_add_bookmarks() here.
	(remove_bookmark_button_clicked_cb): Ahem, fetch the selected
	iter.
	(shortcuts_append_paths): Don't display error dialogs here.
	(create_file_list): Remove the @#$% rules hint.
2004-01-06 05:13:31 +00:00
Federico Mena Quintero
50e38e513a New helper function. (toolbar_create): Do not use a toolbar widget, just
2004-01-05  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (toolbar_button_new): New helper
	function.
	(toolbar_create): Do not use a toolbar widget, just an hbox
	instead.  Add the bookmarks buttons and the current folder label
	here.
	(create_filename_entry_and_filter_combo): Create the filter combo
	here.
	(filter_create): Don't show the filter combo initially.
	(up_button_cb): Renamed from toolbar_up_cb().
	(create_shortcuts_buttons): Removed.
2004-01-06 04:18:42 +00:00
Christian Neumair
0e08ebc7d4 Use ngettext for plurals (#123847). 2003-12-31 16:02:22 +00:00
Federico Mena Quintero
700335123a Make show_all() work for the extra and preview widgets; reported by Paolo
2003-12-29  Federico Mena Quintero  <federico@ximian.com>

	Make show_all() work for the extra and preview widgets; reported
	by Paolo Maggi.

	* gtk/gtkfilechooserdefault.c (set_preview_widget): show_all() the
	preview widget.
	(set_extra_widget): show_all() the extra widget.
2003-12-29 20:55:01 +00:00
Federico Mena Quintero
f615072cde Use g_date_strftime() for UTF-8 correctness; use Julian dates to simplify
2003-12-19  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func): Use
	g_date_strftime() for UTF-8 correctness; use Julian dates to
	simplify the function.
2003-12-19 17:38:54 +00:00
Federico Mena Quintero
8baf8571b5 Added a "volumes-changed" signal. Added the following methods:
2003-12-16  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilesystem.h (struct _GtkFileSystemIface): Added a
	"volumes-changed" signal.  Added the following methods:
		list_volumes
		volume_free
		volume_get_base_path
		volume_get_is_mounted
		volume_mount
		volume_get_display_name
		volume_render_icon

	* gtk/gtkfilesystem.c (gtk_file_system_base_init): Create the
	"volumes-changed" signal.
	(gtk_file_system_list_volumes): New function.
	(gtk_file_system_volume_free): New function.
	(gtk_file_system_volume_get_base_path): New function.
	(gtk_file_system_volume_get_is_mounted): New function.
	(gtk_file_system_volume_mount): New function.
	(gtk_file_system_volume_get_display_name): New function.
	(gtk_file_system_volume_render_icon): New function.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_volume_free): Implement.
	(gtk_file_system_unix_volume_get_base_path): Implement.
	(gtk_file_system_unix_volume_get_is_mounted): Implement.
	(gtk_file_system_unix_volume_mount): Implement.
	(gtk_file_system_unix_volume_get_display_name): Implement.
	(gtk_file_system_unix_volume_render_icon): Implement.

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
	Added a field for the "volumes-changed" signal connection.
	(gtk_file_chooser_default_set_property): Connect to
	"volumes-changed" on the file system.
	(gtk_file_chooser_default_finalize): Disconnect from
	"volumes-changed".

	* gtk/gtkfilechooserdefault.c (shortcuts_remove_rows): New helper
	function.
	(shortcuts_get_index): New helper function.
	(shortcuts_insert_path): Can now insert volumes as well as paths.
	(shortcuts_append_paths): Don't take is_file_system_root.
	(shortcuts_add_volumes): New function.
	(shortcuts_append_file_system_roots): Removed.
	(create_shortcuts_model): Use shortcuts_add_volumes().
	(remove_bookmark_button_clicked_cb): Check that the index is
	within range.
	(bookmarks_check_add_sensitivity): Take volumes into account.
	(shortcuts_get_selected_index): New helper function.
	(remove_bookmark_button_clicked_cb): Use
	shortcuts_get_selected_index().
	(bookmarks_check_remove_sensitivity): Likewise.
	(shortcuts_select_func): Likewise.
	(shortcuts_row_activated_cb): Handle volumes as well as normal
	paths.
	(shortcuts_activate_volume): New function.
	(struct _GtkFileChooserDefault): Removed the bookmarks_set and
	bookmarks_iter fields.
	(shortcuts_append_bookmarks): Use shortcuts_remove_rows().
	(bookmarks_changed_cb): Use shortcuts_add_bookmarks().
	(remove_bookmark_rows): Removed.
	(shortcuts_add_bookmarks): New function; moved most of the code
	over from shortcuts_append_bookmarks().
	(shortcuts_append_bookmarks): Add the separator node here, and
	then call shortcuts_add_bookmarks().
2003-12-17 05:55:16 +00:00
Federico Mena Quintero
c9c99b3f1b Added toolbar items for the filter separator and the filter item.
2003-12-10  Federico Mena Quintero  <federico@ximian.com>

	* gtk/gtkfilechooserdefault.c (struct _GtkFileChooserDefault):
	Added toolbar items for the filter separator and the filter item.
	(toolbar_create): Add the filter widgets here.
	(filter_create): Renamed from create_filter().  Don't store the
	alignment in the impl structure, just return it.
	(toolbar_show_filters): New function.
	(gtk_file_chooser_default_add_filter): Use toolbar_show_filters().
	(gtk_file_chooser_default_remove_filter): Likewise.
	(gtk_file_chooser_default_constructor): Don't create the filter
	widget here.
	(struct _GtkFileChooserDefault): Added a field for a current
	folder label.
	(gtk_file_chooser_default_constructor): Create the folder label.
	(gtk_file_chooser_default_set_current_folder): Set the current
	folder label.

	* tests/testfilechooser.c (main): Dramatically improved the
	usability of the extra widget through careful word choice.
2003-12-10 20:49:44 +00:00