Commit Graph

513 Commits

Author SHA1 Message Date
Cody Russell
57223c9a05 Revert name change
svn path=/trunk/; revision=20724
2008-07-01 22:57:50 +00:00
Cody Russell
fce9c8b7d4 Practically everything changed.
2008-06-30  Cody Russell  <bratsche@gnome.org>

        * Practically everything changed.

        Change	all references	of GIMP	Toolkit	(and variations	of it)
        to GTK+	Toolkit, showing no mercy at all to our	beloved
	ancestry. (#540529)


svn path=/trunk/; revision=20709
2008-06-30 23:01:56 +00:00
Carlos Garnacho
1732652e71 current_folder can be NULL here, do not try to reference it (Bug #540235)
2008-06-26  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_get_current_folder): current_folder can be
        NULL here, do not try to reference it (Bug #540235)
        (gtk_file_chooser_default_get_files): Deal better with
        gtk_file_chooser_default_get_current_folder() being able to return
        NULL.

svn path=/trunk/; revision=20687
2008-06-26 09:41:13 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Christian Persch
a58a173b48 Use gtk_drag_[dest|source]_add_[text|uri]_targets(), and simplify code. Bug #516092.
svn path=/trunk/; revision=20464
2008-06-19 12:52:40 +00:00
Christian Persch
446f41757b Use g_set_error_literal where appropriate. Bug #538640.
svn path=/trunk/; revision=20463
2008-06-19 12:47:48 +00:00
Olle Bergkvist
ad54e22fc7 bgo538784 - Don't change the filename entry in CREATE_FOLDER mode
2008-06-18  Olle Bergkvist <olle.bergkvist@yahoo.se>

	http://bugzilla.gnome.org/show_bug.cgi?id=538784 - Don't change
	the filename in the name entry in CREATE_FOLDER mode when changing
	folders, so that you can enter a new subfolder name, double-click on a
	folder to change to it, and close the dialog.

	* gtk/gtkfilechooserdefault.c (update_chooser_entry): Don't change
	the filename in the entry in CREATE_FOLDER mode, either.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=20457
2008-06-18 22:35:32 +00:00
Olle Bergkvist
666b544ddd bgo419737 - Don't clear filename entry in SAVE/CREATE_FOLDER modes
2008-06-18  Olle Bergkvist <olle.bergkvist@yahoo.se>

	http://bugzilla.gnome.org/show_bug.cgi?id=419737#c59 - The file
	chooser clears the filename entry in SAVE/CREATE_FOLDER modes when
	it shouldn't.

	* gtk/gtkfilechooserdefault.c (shortcuts_activate_iter): Don't
	clear the entry for CREATE_FOLDER either; this needs the same
	behavior as SAVE mode.
	(update_chooser_entry): Only clear the entry in OPEN/SELECT_FOLDER
	modes.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=20455
2008-06-18 22:23:39 +00:00
Matthias Clasen
d217ec4f90 Use standard icon names.
2008-06-18  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilesystem.c (_gtk_file_system_volume_render_icon):
        * gtk/gtkfilechooserbutton.c (change_icon_theme):
        (model_add_bookmarks):
        (model_update_current_folder):
        * gtk/gtkfilechooserdefault.c (shortcuts_insert_file):
        (shortcuts_reload_icons): Use standard icon names.


svn path=/trunk/; revision=20454
2008-06-18 16:22:42 +00:00
Michael Natterer
40b6173aa3 remove static integer variables which hold the number of members in
2008-06-17  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserdefault.c: remove static integer variables
	which hold the number of members in GtkTargetEntry arrays and use
	G_N_ELEMENTS() directly instead.


svn path=/trunk/; revision=20421
2008-06-17 12:54:16 +00:00
Emmanuele Bassi
ea51ac13f8 Remove the GtkRecentManager screen dance, as it has been deprecated since
2008-06-17  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c:
	(gtk_file_chooser_default_init),
	(gtk_file_chooser_default_constructor),
	(gtk_file_chooser_default_screen_changed),
	(recent_start_loading): Remove the GtkRecentManager screen
	dance, as it has been deprecated since 2.12. Now we get the
	GtkRecentManager singleton whewn we create the FileChooserDefault
	instance. (Michael Natterer)

svn path=/trunk/; revision=20419
2008-06-17 12:46:12 +00:00
Michael Natterer
5337cdbb10 remove GtkTooltips member from the GtkFileChooserDefault struct.
2008-06-16  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserprivate.h: remove GtkTooltips member from the
	GtkFileChooserDefault struct.

	* gtk/gtkfilechooserdefault.c: don't allocate and free the
	GtkTooltips.


svn path=/trunk/; revision=20396
2008-06-16 11:49:23 +00:00
Carlos Garnacho
bfe00f9b9b Return full path here as expected, not just the basename.
2008-06-15  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkfilechooser.c (gtk_file_chooser_get_filename): Return full
        path here as expected, not just the basename.

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_update_current_folder): Ensure that we keep
        a reference to file, since it can be destroyed when switching back to
        browse mode.

        * gtk/gtkfilesystem.c (get_icon_for_special_directory): Removed, home
        and desktop directories are dealt by the filechooser as normal files,
        not volumes, so the icon for these is handled directly by GIO.
        (_gtk_file_system_volume_render_icon): Update caller.

svn path=/trunk/; revision=20393
2008-06-15 23:32:11 +00:00
Matthias Clasen
f9c7a4bbd0 Really make GtkFileSystem private by _-prefixing all functions.
* gtk/gtkfilechooserbutton.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkfilechooserentry.c:
        * gtk/gtkfilesystem.c:
        * gtk/gtkfilesystem.h:
        * gtk/gtkfilesystemmodel.c:
        * gtk/gtkpathbar.c: Really make GtkFileSystem private
        by _-prefixing all functions.


svn path=/trunk/; revision=20378
2008-06-13 16:47:41 +00:00
Behdad Esfahbod
d76e3d552e Bug 503071 – Application direction changes to right to left even if
2008-06-11  Behdad Esfahbod  <behdad@gnome.org>

        Bug 503071 – Application direction changes to right to left even if
        theres no translation

        * configure.in: Bump glib requirement.

        * gtk/gtkaccellabel.c
        (_gtk_accel_label_class_get_accelerator_label):
        * gtk/gtkactiongroup.c (dgettext_swapped):
        * gtk/gtkbuilder.c (gtk_builder_class_init):
        * gtk/gtkbuilderparser.c (_dpgettext),
        (_gtk_builder_parser_translate):
        * gtk/gtkfilechooserdefault.c (list_size_data_func):
        * gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):
        * gtk/gtkintl.h:
        * gtk/gtkmain.c (setlocale_initialization),
        (do_pre_parse_initialization), (gettext_initialization):
        * gtk/gtkstock.c (gtk_stock_lookup), (sgettext_swapped):
        Use g_dgettext() and g_dngettext().


svn path=/trunk/; revision=20358
2008-06-11 23:40:35 +00:00
Carlos Garnacho
640d68778a Bug 520874 - Should use gio directly.
2008-06-10  Carlos Garnacho  <carlos@imendio.com>

        Bug 520874 - Should use gio directly.

        * gtk/gtkfilesystem.[ch]: Turn into a private object, which mostly
        provides helper functions for asynchronous calls, folder abstraction
        and uniform handling of volumes/drives/mounts.

        * gtk/gtkfilesystemwin32.[ch]:
        * gtk/gtkfilesystemunix.[ch]: Removed, these are no longer required.

        * gtk/gtkfilechooser.c:
        * gtk/gtkfilechooserbutton.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkfilechooserentry.[ch]:
        * gtk/gtkfilechooserprivate.h:
        * gtk/gtkfilechooserutils.c:
        * gtk/gtkfilesystemmodel.[ch]:
        * gtk/gtkpathbar.[ch]: Use GIO internally. Adapt to GtkFileSystem API.
        Do not load filesystem implementation modules.

        * gtk/Makefile.am:
        * gtk/gtk.symbols: the gtkfilesystem.h private header isn't installed
        anymore, nor the unix/win32 implementations.

        * README.in: Add blurb about these changes.

svn path=/trunk/; revision=20342
2008-06-10 00:39:35 +00:00
Federico Mena Quintero
4b1bba8af1 bgo533891 - disallow DnD from the file list into itself
2008-05-27  Federico Mena Quintero  <federico@novell.com>

	http://bugzilla.gnome.org/show_bug.cgi?id=533891 - Don't allow
	drag and drop from the file list into itself, as it doesn't make
	sense (it would just change the current folder).

	* gtk/gtkfilechooserdefault.c (file_list_dest_targets): Use
	GTK_TARGET_OTHER_WIDGET so we don't DnD from the file list into
	itself.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=20194
2008-05-27 20:33:23 +00:00
Carlos Garnacho
cdaca42be3 Enable rubberbanding when "select-multiple" is TRUE. Bug #446068.
2008-05-27  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkfilechooserdefault.c (set_select_multiple): Enable
        rubberbanding when "select-multiple" is TRUE. Bug #446068.

svn path=/trunk/; revision=20184
2008-05-27 00:20:18 +00:00
Jan Arne Petersen
1d946af2f3 Add GDK_ACTION_MOVE to the drag actions to allow trash (#137717).
2008-05-25  Jan Arne Petersen  <jpetersen@jpetersen.org>

	* gtk/gtkfilechooserdefault.c: (create_file_list): Add GDK_ACTION_MOVE
	to the drag actions to allow trash (#137717).


svn path=/trunk/; revision=20150
2008-05-25 14:24:42 +00:00
Jan Arne Petersen
242f330920 Ignore G_IO_ERROR_FAILED_HANDLED errors (#532262).
2008-05-25  Jan Arne Petersen  <jpetersen@jpetersen.org>

	* gtk/gtkfilechooserdefault.c:
	(shortcuts_activate_volume_mount_cb): Ignore G_IO_ERROR_FAILED_HANDLED
	errors (#532262).


svn path=/trunk/; revision=20145
2008-05-25 12:22:30 +00:00
Jan Arne Petersen
adcf2fd3f3 Don't try to toggle the visibility of the location entry field in search
2008-05-24  Jan Arne Petersen  <jpetersen@jpetersen.org>

	* gtk/gtkfilechooserdefault.c: (location_toggle_popup_handler): Don't
	try to toggle the visibility of the location entry field in search and
	recent mode (#526422)


svn path=/trunk/; revision=20138
2008-05-24 18:59:56 +00:00
Jan Arne Petersen
d6c80f57b6 Show parse name as tooltip for path shortcuts (#137503).
2008-05-24  Jan Arne Petersen  <jpetersen@jpetersen.org>

	* gtk/gtkfilechooserdefault.c: (shortcuts_query_tooltip_cb),
	(shortcuts_list_create): Show parse name as tooltip for path
	shortcuts (#137503).


svn path=/trunk/; revision=20137
2008-05-24 18:56:22 +00:00
Hans Breuer
0b57c6b98f updated fix c99ism (variable at start of block export functions for window
2008-05-23  Hans Breuer  <hans@breuer.org>

	* **/makefile.msc gtk/makefile.msc.in : updated
	* gtk/gtkwidget.c : fix c99ism (variable at start of block
	* gdk/gdk.symbols gtk/gtk.symbols : export functions for window 
	redirection
	* gtk/gtkfilechooserdefault.c : #include <locale.h> for 
	setlocale(LC_ALL, ...)

svn path=/trunk/; revision=20131
2008-05-23 20:29:27 +00:00
Federico Mena Quintero
20ee3a022e bgo322298 - Make the file chooser dialog always resizable
2008-05-19  Federico Mena Quintero  <federico@novell.com>

	http://bugzilla.gnome.org/show_bug.cgi?id=322298 - Save dialog
	can't be resized until you expand the "Browse for other folders"
	section.

	* gtk/gtkfilechooserembed.h (struct _GtkFileChooserEmbedIface):
	Removed the "get_resizable" method.
	(_gtk_file_chooser_embed_get_resizable): Removed.

	* gtk/gtkfilechooserembed.c: Removed the _get_resizable() machinery.

	* gtk/gtkfilechooserdefault.c: Likewise.

	* gtk/gtkfilechooserdialog.c
	(file_chooser_widget_default_size_changed): Act as if the dialog
	were always resizable.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=20113
2008-05-19 17:25:19 +00:00
Sven Neumann
04466bac87 gtk/gtkfilechooserdefault.c set alternative button order for overwrite
2008-03-13  Sven Neumann  <sven@gimp.org>

	* gtk/gtkfilechooserdefault.c
	* gtk/gtkprintunixdialog.c: set alternative button order for
	overwrite confirmation dialogs (bug #522191).

svn path=/trunk/; revision=19866
2008-03-13 14:09:02 +00:00
William Rikard Lachance
b68d7cc100 Oops, forgot to make the raw "%H:%M" string localizable (as it should be).
svn path=/trunk/; revision=19724
2008-03-06 19:57:55 +00:00
William Rikard Lachance
69cef720a4 Don't print "Today at" in front of the time for today's date. It's
redudant. (see bug #410517).

svn path=/trunk/; revision=19723
2008-03-06 19:43:22 +00:00
Tor Lillqvist
f07ad74afc Small further change to make it more robust.
svn path=/trunk/; revision=19626
2008-02-21 16:23:01 +00:00
Tor Lillqvist
7a9bbf551f Must pass the format string to strftime in the C library's locale's
2008-02-21  Tor Lillqvist  <tml@novell.com>

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func) [Win32]: Must
	pass the format string to strftime in the C library's locale's
	charset, not the system's. Correspondingly, the return value from
	strftime() is in the C library's locale's charset. (#509885)


svn path=/trunk/; revision=19625
2008-02-21 12:47:45 +00:00
Federico Mena Quintero
1cda35d32c Fix 419737 - don't focus the file list when activating a shortcut in the file chooser
2008-02-12  Federico Mena Quintero  <federico@novell.com>

	Merged from gtk-2-12:

	Don't focus the file list when shortcuts get activated.  This
	removes a lot of ambiguity in when the file selection should
	change, and makes the overall code flow simpler.

	This fixes http://bugzilla.gnome.org/show_bug.cgi?id=419737 -
	file/save dialog clears the filename entry when changing
	directories.

	Also fixes http://bugzilla.gnome.org/show_bug.cgi?id=499940 -
	focus should not go to the file list when a shortcut is activated.

	* gtk/gtkfilechooserdefault.c
	(shortcuts_activate_volume_mount_cb): Don't focus the file list
	(shortcuts_activate_get_info_cb): Likewise.

	* gtk/gtkfilechooserdefault.c (switch_to_shortcut): Don't focus
	the file list (this was the last place where we would focus the
	file list explicitly).  If you are in the location entry, for
	example, you don't want Alt-Home to take you to the file list; you
	just want the current folder to change.  Thanks to Olle Bergkvist
	<olle.bergkvist@yahoo.se> for pointing this out in
	http://bugzilla.gnome.org/show_bug.cgi?id=419737#c51.
	(focus_browse_tree_view_if_possible): Removed.

Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19543
2008-02-12 19:32:17 +00:00
Matthias Clasen
4118dd893f Skip exensions when selecting filenames in the save-as dialog. (#362516,
2008-02-12  Matthias Clasen  <mclasen@redhat.com>

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

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

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


svn path=/trunk/; revision=19540
2008-02-12 17:34:43 +00:00
Matthias Clasen
0509519d35 Unify the handling of various "Enter" keysyms all over the place.
2008-02-12  Matthias Clasen  <mclasen@redhat.com>

        * gtk/*.c: Unify the handling of various "Enter" keysyms
        all over the place.  (#515047, Christian Persch)



svn path=/trunk/; revision=19528
2008-02-12 15:51:09 +00:00
Matthias Clasen
6a80b177a0 Use gtk_selection_data_set_uris() instead of doing it by hand. (#514890,
2008-02-12  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (recent_model_sort_drag_data_get):
        (recent_model_sort_drag_data_get):
        (search_model_sort_drag_data_get):
        * gtk/gtkfilesystemmodel.c (drag_source_drag_data_get):
        * gtk/gtkpathbar.c (button_drag_data_get_cb):
        Use gtk_selection_data_set_uris() instead of doing it
        by hand.  (#514890, Christian Persch)


svn path=/trunk/; revision=19524
2008-02-12 15:07:38 +00:00
Emmanuele Bassi
6f1d571c04 Use the correct comparison function (kudos to Christian Persch and Claudio
2008-01-03  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c (recent_sort_mru): Use the
	correct comparison function (kudos to Christian Persch and
	Claudio Saavedra for spotting this)

	* gtk/gtkrecentchooserutils.c:
	(sort_recent_items_mru),
	(sort_recent_items_lru): Ditto as above.

svn path=/trunk/; revision=19302
2008-01-03 12:29:16 +00:00
Matthias Clasen
dcc86ce57c Don't leak pixbufs. (#502250, Yevgen Muntyan)
2007-12-07  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (shortcuts_reload_icons): Don't
        leak pixbufs.  (#502250, Yevgen Muntyan)


svn path=/trunk/; revision=19128
2007-12-07 18:51:25 +00:00
Josselin Mouette
21a30978dc reviewed by: Federico Mena Quintero
2007-11-26  Josselin Mouette <joss@malsain.org>

        reviewed by: Federico Mena Quintero

        * gtk/gtkfilechooserdefault.c: (shortcuts_append_paths),
        (shortcuts_add_bookmarks), (shortcuts_selection_changed_cb),
        (shortcuts_list_create), (gtk_file_chooser_default_should_respond):
        Make the shortcuts activate with a single click. (#148828)
        Fix a few things affected by the change:
          - Set selection mode to GTK_SELECTION_SINGLE to allow a case 
            where no shortcut is selected.
          - Don't activate a shortcut in the response callback.
          - Filter out duplicate entries in volumes and bookmarks to 
            avoid the selection to change when reordering them with DnD.


svn path=/trunk/; revision=19072
2007-11-26 23:16:19 +00:00
Emmanuele Bassi
2ad0ef4632 Convert the format to the current locale before passing it to strtime().
2007-10-10  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func): Convert
	the format to the current locale before passing it to
	strtime(). Fixes corrupt dates with non-UTF8 encodings on
	OpenSolaris. (#465380, Takao Fujiwara)

svn path=/trunk/; revision=18903
2007-10-10 08:09:13 +00:00
Emmanuele Bassi
928db3a71b Fix the time_t typecasting on OpenSolaris. (#465380, Takao Fujiwara)
2007-10-10  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func): Fix the
	time_t typecasting on OpenSolaris. (#465380, Takao Fujiwara)

svn path=/trunk/; revision=18902
2007-10-10 08:02:16 +00:00
Loïc Minier
618c8de221 Fix warnings and display of modified date / time in filechooser for some
2007-10-04  Loïc Minier  <lool@dooz.org>

       * gtk/gtkfilechooserdefault.c: (list_mtime_data_func): Fix warnings
       and display of modified date / time in filechooser for some locales as
       it was missing a locale to UTF-8 conversion. Fixes #482504.

svn path=/trunk/; revision=18880
2007-10-04 07:40:55 +00:00
Federico Mena Quintero
721eb57a22 455284 - Focus or toggle location entry
2007-10-02  Federico Mena Quintero  <federico@novell.com>

	Fix http://bugzilla.gnome.org/show_bug.cgi?id=455284 - In the file
	chooser, Ctrl-L should switch to the location entry.  If we are
	already on the location entry, turn it off.  Based on a patch by
	Jaap A. Haitsma <jaap@haitsma.org> and an idea by Wouter
	Bolsterlee.

	* gtk/gtkfilechooserdefault.c (location_button_toggled_cb): Call
	location_mode_set() directly instead of using toggle_location_mode().
	(toggle_location_mode): Removed.
	(location_toggle_popup_handler): If the file entry is not visible,
	show it.  If it is visible, turn it off only if it is focused.
	Otherwise, switch to the entry.

Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=18874
2007-10-02 15:50:27 +00:00
Emmanuele Bassi
7421a81f67 Fixes for bug #480123.
2007-09-25  Emmanuele Bassi  <ebassi@gnome.org>

	Fixes for bug #480123.

	* gtk/gtksearchenginesimple.c:
	(gtk_search_engine_simple_dispose), (search_thread_done_idle): Cancel
	the file tree walking thread when disposing the search engine
	implementation.

	* gtk/gtkfilechooserdefault.c (search_stop_searching): Forcibly
	stop the search engine implementation when stopping the search,
	instead of just unreffing the object.

svn path=/trunk/; revision=18865
2007-09-25 20:59:15 +00:00
Emmanuele Bassi
e299a72a49 Use the "document-open-recent" icon for the the Recently Used shortcut in
2007-09-12  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c (render_recent_icon): Use the
	"document-open-recent" icon for the the Recently Used shortcut
	in the file chooser. (#306445)

	* gtk/Makefile.am:
	* gtk/stock-icons/16/document-open-recent.png:
	* gtk/stock-icons/16/document-open-recent.svg:
	* gtk/stock-icons/24/document-open-recent.png:
	* gtk/stock-icons/24/document-open-recent.svg: Add the
	"document-open-recent" icon to the builtin theme we provide
	as a fallback.

svn path=/trunk/; revision=18803
2007-09-12 18:00:30 +00:00
Matthias Clasen
b0c57a4b8f Initialize error to NULL before calling g_set_error(). Should fix #473954,
2007-09-06 Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (shortcuts_drop_uris): Initialize
        error to NULL before calling g_set_error(). Should fix #473954,
        reported by Sebastien Bacher.

svn path=/trunk/; revision=18738
2007-09-06 19:15:37 +00:00
Emmanuele Bassi
a35bd52a96 Check if we are still holding the model before updating it; removes a set
2007-08-23  Emmanuele Bassi  <ebassi@gnome.org>

	* gtkfilechooserdefault.c:
	(search_hit_get_info_cb), (recent_item_get_info_cb): Check if
	we are still holding the model before updating it; removes a
	set of critical warnings when switching to the browse mode from
	a loading search or recent files list.

	(recent_clear_model), (recent_sort_model),
	(recent_idle_cleanup): When in recent files mode, set the
	model for the files list view when we have completed the loading
	of the recently used files list. This makes switching between
	modes fast again and reduces the amount of redraws needed
	to display the list. (#469214)

svn path=/trunk/; revision=18677
2007-08-23 10:48:28 +00:00
Matthias Clasen
57c44b18e7 Port to use new tooltips API. (#451397, Jan Arne Petersen)
2007-07-24  Matthias Clasen  <mclasen@redhat.com>

        * gtkcolorsel.c:
        * gtkfilechooserdefault.c:
        * gtkpagesetupunixdialog.c:
        * gtkprintunixdialog.c: Port to use new tooltips API.
        (#451397, Jan Arne Petersen)


svn path=/trunk/; revision=18539
2007-07-24 15:18:42 +00:00
Matthias Clasen
13277b42e2 Apply a patch by Emmanuele Bassi to limit the number of shown recent
2007-07-20  Matthias Clasen  <mclasen@redhat.com>

        Apply a patch by Emmanuele Bassi to limit the number
        of shown recent files.  (#439715)

        * gtk/gtksettings.c: Add a setting for the number
        of recent files to display by default.

        * gtk/gtkrecentchooserdefault.c:
        * gtk/gtkfilechooserdefault.c: Respect the limit.

        * gtk/gtkrecentmanager.c: Remove the poll timeout in
        dispose, and do not stat more often than every 5 seconds.

        * gtk/gtkrecentchooserutils.c:
        * gtk/gtkrecentchoosermenu.c: Cleanups

        * tests/testrecentchoosermenu.c: Test limits.


svn path=/trunk/; revision=18510
2007-07-20 10:39:03 +00:00
Matthias Clasen
2b5eeba065 Apply a patch by Emmanuele Bassi to add tooltips to the file lists in
2007-07-20  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c: Apply a patch by Emmanuele
        Bassi to add tooltips to the file lists in recent files and
        search modes.



svn path=/trunk/; revision=18508
2007-07-20 09:53:20 +00:00
Emmanuele Bassi
b38d9cec6b Fix a typo in the previous commit.
2007-06-26  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func): Fix
	a typo in the previous commit.

	(shortcuts_append_desktop): Remove unused variable and
	hush the compiler warning.

svn path=/trunk/; revision=18249
2007-06-26 22:26:29 +00:00
Emmanuele Bassi
1bf057fa95 Show the time of last change in the file chooser, for files modified today
2007-06-26  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c (list_mtime_data_func): Show
	the time of last change in the file chooser, for files
	modified today or yesterday. (#324543)

	* configure.in: Check for localtime_r().

svn path=/trunk/; revision=18248
2007-06-26 20:37:44 +00:00
Xan Lopez
ee0411ae72 Update changelog
svn path=/trunk/; revision=18173
2007-06-17 12:02:42 +00:00
Kristian Rietveld
87ae968f9e gtk/gtk.symbols rename _gtk_file_system_create to gtk_file_system_create
2007-06-13  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtk.symbols
	* gtk/gtkfilesystem.[ch]: rename _gtk_file_system_create to
	gtk_file_system_create to make it public and bring trunk back
	in sync with gtk-2-10.

	* gtk/gtkfilechooserdefault.c (set_file_system_backend): updated.


svn path=/trunk/; revision=18121
2007-06-13 13:51:07 +00:00
Matthias Clasen
232f30f1ba Use g_get_user_special_dir() to obtain the path for the DESKTOP directory.
2007-06-06  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c (model_add_special):
        * gtk/gtkfilechooserdefault.c (shortcuts_append_desktop):
        * gtk/gtkfilesystemunix.c (get_icon_name_for_directory):
        * gtk/gtkpathbar.c (_gtk_path_bar_set_file_system):
        Use g_get_user_special_dir() to obtain the path for the
        DESKTOP directory.

svn path=/trunk/; revision=18070
2007-06-07 04:23:10 +00:00
Emmanuele Bassi
f74c473299 Factor out the search shortcut, the recently used shortcut and the
2007-06-06  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c:
	(get_file_info_finished), (shortcuts_insert_path),
	(shortcuts_add_bookmarks), (shortcuts_add_current_folder): Factor
	out the search shortcut, the recently used shortcut and the separator
	from the shortcut selection combo. (#444734)

	(recent_idle_load): Remove the idle source that lazily loads the
	recently used files, if the GtkRecentManager returns an empty
	list. (#443913)

svn path=/trunk/; revision=18063
2007-06-06 16:07:03 +00:00
Emmanuele Bassi
7ec6f9375c Fix to update the file chooser entry
Return after setting the file chooser entry instead of falling through. Also
remove the handling for the search and recent files operation modes, since
they don't have a location entry to update.

svn path=/trunk/; revision=17983
2007-05-30 12:27:47 +00:00
Carlos Garnacho
7bb7cfb293 Refactor GtkFileChooserDialog sizing.
2007-05-18  Carlos Garnacho  <carlos@imendio.com>

        Refactor GtkFileChooserDialog sizing.

        * gtkfilechooserembed.[ch] (delegate_get_resizable_hints)
        (_gtk_file_chooser_embed_get_resizable_hints):
        s/resizable_hints/resizable/, return just one boolean value to
        determine whether the filechooser should be resizable or not.

        * gtkfilechooserprivate.h (struct GtkFileChooserDialogPrivate): remove
        variables related to the GtkFileChooserEmbed get_default_size() and
        get_resizable() implementations.
        (struct GtkFileChooserDefault): Move default size management here.

        * gtkfilechooserdefault.c (gtk_file_chooser_default_size_allocate):
        Added, store currently allocated size to calculate default size later.
        (gtk_file_chooser_default_get_resizable_hints):
        s/resizable_hints/resizable/.
        (gtk_file_chooser_default_set_property): Reload settings if the file
        chooser action changes, this way the save expander state will be known
        before mapping the window, avoiding wrong window positioning and
        flickering. (#424299, #424309)
        (find_good_size_from_style): Only get size from style if it wasn't set
        previously.
        (gtk_file_chooser_default_get_default_size): return default size based
        on stored default size and preview/extra widget sizes.

        * gtkfilechooserdialog.c (file_chooser_widget_update_hints)
        (file_chooser_widget_realized_size_changed)
        (file_chooser_widget_unrealized_size_changed): simplified to
        (file_chooser_widget_size_changed): set window size and resizability
        based on the GtkFileChooserEmbed interface implementation. (Bug
        #420285, Tomeu Vizoso)
        (gtk_file_chooser_dialog_map): force a dialog size change, so it's
        clamped for sure to the 75% of the screen size.


svn path=/trunk/; revision=17859
2007-05-18 10:38:42 +00:00
Kristian Rietveld
a09b7359f5 remove dangling semicolon, fixes the segfault ebassi was seeing earlier
2007-05-14  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtkfilechooserdefault.c (recent_column_path_sort_func): remove
	dangling semicolon, fixes the segfault ebassi was seeing earlier today
	;)


svn path=/trunk/; revision=17848
2007-05-14 21:36:24 +00:00
Emmanuele Bassi
59120d8bfd Convert the GtkTreeIter inside the sorting functions for the search and
2007-05-14  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c:
	Convert the GtkTreeIter inside the sorting functions for the
	search and recent modes. This doesn't yet fix the segfault when
	clicking the 'Name' column in recent mode, though.

svn path=/trunk/; revision=17843
2007-05-14 10:16:07 +00:00
Emmanuele Bassi
32f42f446a GtkFileChooser search fixes and recent files support. (#435342)
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>

	GtkFileChooser search fixes and recent files support.  (#435342)
	
	* gtk/gtkfilechooserdefault.c: Support drag and drop for
	adding shortcuts of folders when in search or recent files
	mode.

svn path=/trunk/; revision=17829
2007-05-11 19:44:32 +00:00
Emmanuele Bassi
dfff0c0a14 GtkFileChooser search fixes and recent files support. (#435342)
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>

	GtkFileChooser search fixes and recent files support.  (#435342)

	* gtk/gtkfilechooserprivate.h:
	* gtk/gtkfilechooserdefault.c: Follow the sorting order of
	the GtkTreeView displaying the files list.

	(shortcuts_get_index), (shortcuts_insert_separator),
	(shortcuts_model_create), (shortcuts_combo_filter_func): Remove
	the separator between the Search and the Recently Used shortcuts.

	(list_select_func), (list_icon_data_func), (list_name_data_func),
	(list_mtime_data_func): Update the sensitivity of the row
	depending on the GtkFileChooserAction used.

svn path=/trunk/; revision=17828
2007-05-11 19:42:40 +00:00
Emmanuele Bassi
9f2d195367 GtkFileChooser search fixes and recent files support. (#435342)
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>

	GtkFileChooser search fixes and recent files support.  (#435342)

	* gtk/gtkfilechooserprivate.h:
	* gtk/gtkfilechooserdefault.c: Update the contents of the
	files list when changing the filter of the GtkFileChooserDefault
	widget.

svn path=/trunk/; revision=17827
2007-05-11 19:37:26 +00:00
Emmanuele Bassi
2957c052b8 GtkFileChooser search fixes and recent files support. (#435342)
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>

	GtkFileChooser search fixes and recent files support.  (#435342)

	* gtk/gtkfilechooserdefault.c: Update the add bookmark button
	sensitivity when in search or recent files mode, and allow
	adding a bookmark for a folder.

svn path=/trunk/; revision=17826
2007-05-11 19:33:38 +00:00
Emmanuele Bassi
588d09cfc0 GtkFileChooser search fixes and recent files support. (#435342)
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>

	GtkFileChooser search fixes and recent files support.  (#435342)

	* gtk/gtkfilechooserdefault.c: UI fixes in the Search mode: add
	a mnemonic to the label, de-boldify the label's text and assign
	focus to the search entry when switching to the search mode.

	(list_name_data_func): Split the text in both search and recent
	files mode: on the first line use the short name and on the
	second line use the full path.

svn path=/trunk/; revision=17825
2007-05-11 19:30:38 +00:00
Emmanuele Bassi
4078ef567b GtkFileChooser search fixes and recent files support. (#435342)
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>

	GtkFileChooser search fixes and recent files support.  (#435342)

	* gtk/gtkfilechooserprivate.h:
	* gtk/gtkfilechooserdefault.c: Add support for showing the
	recently used files list as a special shortcut item.

svn path=/trunk/; revision=17824
2007-05-11 19:26:32 +00:00
Emmanuele Bassi
b5d60d48e8 GtkFileChooser search fixes and recent files support. (#435342)
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>
	
	GtkFileChooser search fixes and recent files support.  (#435342)

	* gtk/gtkfilechooserdefault.c: Overall whitespace fixes and
	indentation style consistency.

	(list_row_activated): If the search hit is a folder, follow it
	when activating the row, and switch back to browse mode.

	(search_clear_model), (search_start_query),
	(search_entry_activate_cb), (search_setup_widgets): Remember
	the last query when switching between modes.

svn path=/trunk/; revision=17823
2007-05-11 19:22:38 +00:00
Emmanuele Bassi
ccc3c58ac7 Add key binding for the Search shortcut; default to MOD1+S.
2007-05-11  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c:
	(_gtk_file_chooser_default_class_init): Add key binding for
	the Search shortcut; default to MOD1+S.

	(search_shortcut_handler): Handle the key binding.

	(search_hit_get_info_cb), (search_add_hit), (search_clear_model),
	(search_setup_model): Retrieve informations on the search hits
	when adding them to the model.

	(list_icon_data_func): Show the search hit icon.

svn path=/trunk/; revision=17822
2007-05-11 19:16:59 +00:00
Emmanuele Bassi
d3aeccf774 Add search file support in the GtkFileChooser. Original patch by Federico
2007-05-02  Emmanuele Bassi  <ebassi@gnome.org>

	Add search file support in the GtkFileChooser. Original patch
	by Federico Mena Quintero; patch updated by Matthias Clasen.
	See bug #344785.

	* gtk/gtksearchengine.[ch]: Private search engine abstraction
	object.

	* gtk/gtksearchenginebeagle.[ch]: Private search engine
	implementation using libbeagle (via g_module_open()).

	* gtk/gtksearchenginesimple.[ch]: Private search engine
	implementation using file tree walking.

	* gtk/gtksearchenginetracker.[ch]: Private earch engine
	implementation using libtracker (via g_module_open()).

	* gtk/gtkquery.[ch]: Private query object for the search
	engines.

	* gtk/gtkfilechooserprivate.h:
	* gtk/gtkfilechooserdefault.c: Use the GtkSearchEngine to
	query a search engine backend using GtkQuery; create a new
	operating mode, OPERATION_MODE_SEARCH, and call the common
	operating mode OPERATION_MODE_BROWSE; add support for virtual
	shortcuts inside the shortcuts model and create a new "Search"
	virtual shortcut.

	* gtk/Makefile.am: Update the build with the new files

svn path=/trunk/; revision=17783
2007-05-02 22:51:43 +00:00
Matthias Clasen
a9423f4964 add a new struct field to clear the file entry after the current folder
2007-05-01  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (struct UpdateCurrentFolderData),
        (update_current_folder_get_info_cb): add a new struct field to clear
        the file entry after the current folder has been updated.

        (gtk_file_chooser_default_update_current_folder),
        (change_folder_and_display_error): Add a new function parameter to
        trigger file entry clearing.

        (edited_idle_create_folder_cb),
        (file_list_drag_data_received_get_info_cb),
        (gtk_file_chooser_default_map),
        (gtk_file_chooser_default_set_current_folder),
        (switch_to_selected_folder), (save_entry_get_info_cb),
        (shortcuts_activate_volume_mount_cb), (shortcuts_activate_volume),
        (shortcuts_activate_get_info_cb), (list_row_activated),
        (path_bar_clicked): use new function parameter appropriately.

        (gtk_file_chooser_default_should_respond): trigger file entry clearing
        after the directory is updated instead of clearing it before, this way
        we avoid reloading the completion model with the soon to be old folder,
        causing a warning and a glitch in the folder where completion happens.
        (#379414, Carlos Garnacho)


svn path=/trunk/; revision=17754
2007-05-01 20:35:33 +00:00
Matthias Clasen
b608b56786 Add a keybinding (C-h) to toggle whether to show hidden files. (#344657,
2007-03-23  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c: Add a keybinding (C-h) to
        toggle whether to show hidden files.  (#344657,
        Wouter Bolsterlee, Priit Laes, et al)



svn path=/trunk/; revision=17557
2007-03-23 05:13:56 +00:00
Matthias Clasen
dabf04423b Add a keybinding to toggle the visibility of the location entry. (#383354,
2007-03-23  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c: Add a keybinding to
        toggle the visibility of the location entry.  (#383354,
        John Pye, patch by Carlos Garnacho)



svn path=/trunk/; revision=17555
2007-03-23 05:06:00 +00:00
Federico Mena Quintero
244bbfa043 Merged from gtk-2-10:
2007-03-15  Federico Mena Quintero  <federico@novell.com>

	Merged from gtk-2-10:

	* gtk/gtkfilechooserdefault.c (find_good_size_from_style):
	PANGO_PIXELS() gives us device units, which are *points* in
	pangocairo's parlance, but we want actual pixels.  So, get the
	screen's resolution to compute the actual number of pixels.
	Fixes bug #418585.

svn path=/trunk/; revision=17530
2007-03-16 00:53:09 +00:00
Kristian Rietveld
10d9b04e74 immediately bail out if current_folder is NULL. (#350988, lots of
2007-03-12  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtkfilechooserdefault.c (check_save_entry): immediately
	bail out if current_folder is NULL. (#350988, lots of reporters,
	modified patch by Jan Darmochwal).


svn path=/trunk/; revision=17479
2007-03-12 00:12:25 +00:00
Matthias Clasen
e4d9a1ccc6 Apply a patch by Carlos Garnacho to fix several problems with filechooser
2007-02-26  Matthias Clasen <mclasen@redhat.com>

        Apply a patch by Carlos Garnacho to fix several problems
        with filechooser size handling (#325477, #151169, 143213,
        #153785)

        * gtk/gtkfilechooserdefault.c: Increase NUM_LINES slightly.
        (browse_widgets_create): Don't force the paned position to 200.
        (find_good_size_from_style): Take the size of the extra widget
        into account.

        * gtk/gtkfilechooserdialog.c (file_chooser_widget_update_hints):
        Accept a minimal width parameter. Update all callers.


svn path=/trunk/; revision=17357
2007-02-26 19:45:33 +00:00
Peter Teichman
0177b21959 Save the expanded state of the folder browser with the file chooser
* gtk/gtkfilechooserdefault.c:
* gtk/gtkfilechooserprivate.h:
* gtk/gtkfilechoosersettings.c:
* gtk/gtkfilechoosersettings.h:
Save the expanded state of the folder browser with the file
chooser settings.  Resolves the expander portions of (#153828,
Lemmit Kaplinski)

svn path=/trunk/; revision=17121
2007-01-08 18:34:06 +00:00
Matthias Clasen
846197a5bd Exit early if we can't get file info - this happens if the iter points to
2007-01-03  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (update_chooser_entry):
        Exit early if we can't get file info - this happens
        if the iter points to the row where we are editing
        the name for a newly created folder.  (#392191, Michael
        Partridge, patch by Kristian Rietveld)



svn path=/trunk/; revision=17046
2007-01-04 01:45:19 +00:00
Matthias Clasen
7979cd6ac7 Move a few settings to gtksettings.c to make sure they show up in the
2006-12-30  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkprintoperation-unix.c:
        * gtk/gtkprintbackend.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtksettings.c: Move a few settings to gtksettings.c
        to make sure they show up in the docs.  (#365364, Christian
        Persch)



svn path=/trunk/; revision=16992
2006-12-31 05:54:46 +00:00
Matthias Clasen
721c3bc101 Replace a lot of idle and timeout calls by the new gdk_threads api.
2006-12-22  Matthias Clasen  <mclasen@redhat.com>

        * *.c: Replace a lot of idle and timeout calls by
        the new gdk_threads api.
2006-12-22 19:10:43 +00:00
Christian Persch
fc3b484688 Don't make the "Location" label bold. Bug #372449.
2006-11-08  Christian Persch  <chpe@cvs.gnome.org>

	* gtk/gtkfilechooserdefault.c (browse_widgets_create): Don't make
	the "Location" label bold. Bug #372449.
2006-11-08 17:09:24 +00:00
Matthias Clasen
07e7719441 Apply a cleanup patch by Kjartan Maraas (#341812)
2006-10-08  Matthias Clasen  <mclasen@redhat.com>

	* Apply a cleanup patch by Kjartan Maraas  (#341812)
2006-10-08 05:07:55 +00:00
Matthias Clasen
09f461b01e Make remote bookmarks work better (#354887)
2006-09-22  Matthias Clasen  <mclasen@redhat.com>

	Make remote bookmarks work better (#354887)

	* gtk/gtkfilechooserdefault.c (shortcuts_reload_icons):
	(shortcuts_insert_path):
	* gtk/gtkfilechooserbutton.c (change_icon_theme):
	(model_add_bookmarks):
	(model_update_current_folder):
	(update_label_and_image):
	If the bookmark points to a remote file, don't call get_info(),
	since that may a) take a long time and b) pop up an auth dialog.
	Instead, just use a folder icon and create a display name
	from the uri.

	* gtk/gtkfilechooserdefault.c (_gtk_file_chooser_label_for_uri):
	New function to create a suitable display name for a remote
	uri. This should really be done in GtkFileSystem.
2006-09-22 16:11:04 +00:00
Matthias Clasen
19063333ad Display an error when we come to the root.
2006-09-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
	Display an error when we come to the root.
2006-09-19 14:18:18 +00:00
Matthias Clasen
f45a35921a Commit a patch by Behdad to fix typos, omissions and other errors in the
2006-09-10  Matthias Clasen  <mclasen@redhat.com>

        * Commit a patch by Behdad to fix typos, omissions and other
        errors in the symbol aliasing, and add checks for local PLT
        entries.  (#354687, Behdad Esfahbod)
2006-09-10 06:39:16 +00:00
Kristian Rietveld
f270f2250f if setting the given folder failed, try setting the parent folder until we
2006-09-04  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
	if setting the given folder failed, try setting the parent folder
	until we succeed; display an error box at the end.
2006-09-04 20:09:08 +00:00
Kristian Rietveld
023cb79cd2 change file_exists_and_is_not_folder checks to get the file info for the
2006-09-03  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtkfilechooserdefault.c (save_entry_get_info_cb),
	(file_exists_get_info_cb), (gtk_file_chooser_default_should_respond):
	change file_exists_and_is_not_folder checks to get the file info
	for the path directly instead of querying the current file folder
	of the save entry.

	* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserDefault): add
	new field.

	* tests/autotestfilechooser.c (wait_for_idle_idle), (wait_for_idle),
	(test_reload_sequence), (test_button_folder_states_for_action): wait
	for idle after setting a folder to ensure the async operations to load
	the folder are finished,
	(test_confirm_overwrite), (test_confirm_overwrite_for_path):
	factor out test_confirm_overwrite code so we can add tests for more
	paths more easily.
2006-09-03 20:47:54 +00:00
Kristian Rietveld
254b684e4c First part of file chooser fixes.
2006-09-02  Kristian Rietveld  <kris@imendio.com>

	First part of file chooser fixes.

	* gtk/gtkfilechooserbutton.c (model_add_special): also set the
	handle in the model for the desktopdir case.

	* gtk/gtkfilechooserdefault.c (shortcuts_add_current_folder): free
	volume in case we retrieved it but don't pass it on to insert_path,
	(shortcuts_model_create): change the column type for the handles
	to pointer instead of GObject so our handle ref counting is not
	disturbed,
	(show_and_select_paths_finished_loading): don't forget to unref
	the dialog.

	* gtk/gtkfilesystemunix.c (gtk_file_system_unix_class_init),
	(gtk_file_system_unix_init), (gtk_file_system_unix_dispose):
	remove pending execute_callbacks_idle during dispose, also
	execute all callbacks waiting to be run in the next idle,
	(queue_*callback), (execute_callbacks_idle): refactor to maintain
	a list of callbacks to call per file system instead of globally,
	guard the file system during callback invocation,
	(gtk_file_system_unix_get_folder): only add load folder idle if
	none has been added yet.
2006-09-02 14:26:12 +00:00
Federico Mena Quintero
ad0ca3897b Enable "/" and "~" as bindings to activate the location entry again. Fixes
2006-08-17  Federico Mena Quintero  <federico@novell.com>

	* gtk/gtkfilechooserdefault.c
	(_gtk_file_chooser_default_class_init): Enable "/" and "~" as
	bindings to activate the location entry again.  Fixes bug #340856.
	(tree_view_keybinding_cb): Likewise.
	(trap_activate_cb): Likewise.
	(location_popup_handler): Handle the "path" argument again; set it
	as the text on the location entry.
	(location_set_user_text): New helper function.
	(load_setup_timer): Fix comment.

	* tests/autotestfilechooser.c (main): Oops, enable all the tests again.
2006-08-17 21:31:08 +00:00
Federico Mena Quintero
3f498adfb0 Fix https://bugzilla.novell.com/show_bug.cgi?id=184875 - make the location
2006-07-18  Federico Mena Quintero  <federico@novell.com>

	Fix https://bugzilla.novell.com/show_bug.cgi?id=184875 - make the
	location entry in Save mode preserve the stuff from
	set_filename(); it was overwriting it with $cwd.

	This is the same fix for
	http://bugzilla.gnome.org/show_bug.cgi?id=347066

	* tests/autotestfilechooser.c: (test_black_box): Added black-box
	test for set_filename() and set_current_name().

	* gtk/gtkfilechooser.c (gtk_file_chooser_get_type): Cast to
	GClassInitFunc in the call to g_type_register_static_simple(), to
	avoid a compiler warning.

	* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserDefault):
	Added a browse_files_last_selected_name field.  We'll copy the
	logic from gtkfilesel.c to see when to clear the location entry.
	(struct _GtkFileChooserDefault): Removed the
	processing_pending_selections field.

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
	Free impl->browse_files_last_selected_name.
	(pending_select_paths_process): Don't use
	impl->processing_pending_selections.
	(update_chooser_entry): Keep track of the name that was last
	selected in the file list.  We use this to know when to clear the
	location entry.  The logic is similar to that of
	gtkfilesel.c:gtk_file_selection_file_changed().  This also lets us
	get rid of the processing_pending_selections flag.
	(update_chooser_entry): Clear the entry if we didn't have a
	selection before.
	(location_switch_to_filename_entry): Do not set $cwd as the
	contents of the location entry here...
	(location_popup_handler): ... but do it here instead, only as the
	result of the user asking to turn on the location entry.
	(gtk_file_chooser_default_get_paths): If the location entry is
	empty, do the fallback of seeing if it is sensible to say that
	$cwd is the selected path.
	(gtk_file_chooser_default_update_current_folder): Don't set the
	text of the location entry; this is no longer needed with the
	fixes above.
	(shortcuts_activate_iter): Clear the location entry when
	activating a shortcut if we are not in SAVE mode.  This keeps the
	contents of the location entry consistent even when switching
	folders via the shortcuts.
2006-07-18 16:36:19 +00:00
Matthias Clasen
c3741c0038 Mark the text of the location label as translatable.
2006-07-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (browse_widgets_create): Mark
	the text of the location label as translatable.
2006-07-17 03:17:24 +00:00
Matthias Clasen
f8794cccca Improve consistency of signal and property names 2006-07-06 05:14:03 +00:00
Matthias Clasen
894b902206 Avoid a near-duplicate string and add some translator comments. (#345320,
2006-06-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c:
	Avoid a near-duplicate string and add some
	translator comments.  (#345320, #345321, Hendrik Richter)
2006-06-19 17:43:59 +00:00
Matthias Clasen
2b125d2284 Avoid a near-duplicate string. (#345320, Hendrik Richter)
2006-06-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_add_shortcut_folder):
	Avoid a near-duplicate string.  (#345320, Hendrik Richter)
2006-06-19 17:40:43 +00:00
Matthias Clasen
8d22851ae6 Add support for pasting filenames into the filechooser. (#153212, Bastian
2006-06-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Add support for pasting
	filenames into the filechooser.  (#153212, Bastian Nocera)
2006-06-12 15:11:39 +00:00
Matthias Clasen
854b26a441 Turn off profiling 2006-06-08 19:20:12 +00:00
Kristian Rietveld
c0ec5cedd8 put the newly selected row(s) the in the middle of the view,
2006-05-16  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtkfilechooserdefault.c
	(show_and_select_paths_finished_loading): put the newly selected
	row(s) the in the middle of the view,
	(update_current_folder_get_info_cb),
	(gtk_file_chooser_default_update_current_folder): make sure reload
	state is set to RELOAD_HAS_FOLDER while loading the new folder,
	so _map() won't start loading the current working directory. (Fixes
	#341028, reported by Michael Natterer).
2006-05-16 12:34:01 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Matthias Clasen
9b62142d44 Fix some typos in messages. (#341091, Tino Meinen)
2006-05-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_add_shortcut_folder):
	* gtk/gtktextbufferserialize.c (parse_attr_element): Fix some typos in
	messages.  (#341091, Tino Meinen)
2006-05-09 02:25:46 +00:00
Federico Mena Quintero
d955928bd5 Merged the federico-filename-entry branch, to fix bug #136541. Combined
2006-05-03  Federico Mena Quintero  <federico@novell.com>

	Merged the federico-filename-entry branch, to fix bug #136541.
	Combined ChangeLogs:

	2006-04-17  Federico Mena Quintero  <federico@novell.com>

	* gtk/gtkfilechooserdefault.c (pending_select_paths_process):
	Oops, we *do* need to check that we are in OPEN mode before
	selecting the first row in the file list.  See
	https://bugzilla.novell.com/show_bug.cgi?id=166906
	(gtk_file_chooser_default_get_paths): If we are in the case for
	the file list, and the list has no selected rows, jump to the case
	for the filename entry.  This is so that

	       1. The user types a filename in the SAVE filename entry
	          ("foo.txt").

	       2. He then double-clicks on a folder ("bar") in the file
		  list.

	will yield the expected "bar/foo.txt" selection.

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

	* gtk/gtkpathbar.c (gtk_path_bar_init): Reduce the inter-button
	spacing to 0.

	* gtk/gtkfilechooserdefault.c (browse_widgets_create): Make the
	location label bold.

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

	* gtk/gtkfilechooserdefault.c (location_mode_set): Just change the
	location_mode field if we are in SAVE/CREATE_FOLDER modes.
	(gtk_file_chooser_default_get_paths): Get the path based on the
	currently focused widget, or the last-focused widget.  This is
	what we should have been doing in the beginning, but it worked out
	fine because we didn't have the possibility of a filename entry in
	OPEN mode.
	(gtk_file_chooser_default_should_respond): Handle the case where
	the last focused widget is the location_entry.

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

	* gtk/gtkfilechoosersettings.[ch]: New files with a simple
	framework for saving/loading settings from the file chooser in
	$XDG_CONFIG_HOME/gtk-2.0/gtkfilechooser.

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_unmap):
	Save the current settings.
	(settings_save): New helper function.  We save the location_mode
	and show_hidden flags.
	(gtk_file_chooser_default_map): Load the settings.
	(settings_load): New helper function.

	* gtk/gtkfilechooserentry.c
	(_gtk_file_chooser_entry_set_file_part): Oops, don't modify
	in_change.  Our handlers are what set the file_part, so they
	*must* be run when we modify the text.

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

	* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserDefault):
	Removed the save_file_name_entry.  We'll make this be the same as
	the location_entry widget.
	(struct _GtkFileChooserDefault): Leave only location_button,
	location_entry_box, location_label, location_entry.  We'll use a
	single toggle button for the location entry, which will appear
	below the path bar.
	(struct _GtkFileChooserDefault): Added a
	processing_pending_selections flag.

	* gtk/gtkfilechooserdefault.c (save_widgets_create): Destroy the
	old location_entry if necessary, and hide the location toggle
	widgets.
	(update_chooser_entry): In multiple selection mode, just clear the
	location_entry.
	(check_save_entry): Allow running in OPEN or SELECT_FOLDER modes
	if we are in LOCATION_MODE_FILENAME_ENTRY.
	(gtk_file_chooser_default_should_respond): Switch to a folder if
	the location_entry contains a folder name in OPEN and SAVE mode,
	not just SAVE mode.  If the entry doesn't contain a folder name,
	but is otherwise well-formed, and we are in OPEN mode, return that
	we should respond with that filename.
	(gtk_file_chooser_default_initial_focus): Focus the location_entry
	if appropriate.
	(browse_widgets_create): Create the location_entry_box and the
	location_label here.
	(update_appearance): Call location_mode_set() when switching back
	to OPEN/SELECT_FOLDER mode.  Hide the location_button when
	switching to SAVE/CREATE_FOLDER mode.
	(pending_select_paths_process): Turn the
	processing_pending_selections flag on and off around changes to
	the current selection.  Don't special-case OPEN mode anymore,
	since the new flag will take care of things in
	update_chooser_entry().
	(update_chooser_entry): Don't do anything if
	processing_pending_selections is TRUE.  This keeps the entry from
	being polluted when changing folders.
	(location_popup_handler): In OPEN/SELECT_FOLDER modes, toggle
	between the path bar and the entry.  In SAVE/CREATE_FOLDER modes, simply focus the
	location_entry.
	(update_from_entry): Removed.
	(location_entry_create): Removed.
	(open_location_cb): Removed.
	(file_list_build_popup_menu): Don't add an "Open _Location" menu item.
	(location_entry_set_initial_text): Don't do anything if
	current_folder is NULL.

	* gtk/gtkfilechooserentry.c
	(_gtk_file_chooser_entry_set_file_part): Turn in_change on and off
	around the call to gtk_entry_set_text().  This makes completion
	not happen when the caller has explicitly set a name.

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

	* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserDefault):
	Added fields location_mode_box, location_pathbar_radio,
	location_filename_radio, location_widget_box, location_label,
	location_entry.  The radio buttons will switch between the pathbar
	and the location entry; the other boxes are for layout purposes.
	(enum LocationMode): New enum.
	(struct _GtkFileChooserDefault): Added a location_mode field.

	* gtk/gtkfilechooserdefault.c (browse_widgets_create): Create the
	location radio buttons to switch between the pathbar and the
	location entry.  Pack the browse_path_bar in the new
	location_widget_box instead of a generic hbox.
	(location_buttons_create): New function.
	(gtk_file_chooser_default_init): Initialize impl->location_mode.
	(location_switch_to_path_bar): New function.
	(location_switch_to_filename_entry): New function.

	* gtk/gtkfilechooserbutton.c (model_add_special): The display_name
	should not be const.
2006-05-03 22:30:52 +00:00
Matthias Clasen
f26aad1916 Boilerplate reduction 2006-05-02 23:56:43 +00:00
Kristian Rietveld
2c97a8f6e8 Merge of the GTK+ asynchronous file chooser branch. Please see the
2006-05-01  Kristian Rietveld  <kris@imendio.com>

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

	* configure.in: increase binary version to 2.9.0.

	* gtk.symbols:
	* gtkfilechooser.c:
	* gtkfilechooserbutton.c:
	* gtkfilechooserdefault.c:
	* gtkfilechooserdialog.c:
	* gtkfilechooserembed.c:
	* gtkfilechooserembed.h:
	* gtkfilechooserentry.c:
	* gtkfilechooserentry.h:
	* gtkfilechooserprivate.h:
	* gtkfilesystem.c:
	* gtkfilesystem.h:
	* gtkfilesystemmodel.c:
	* gtkfilesystemmodel.h:
	* gtkfilesystemunix.c:
	* gtkpathbar.c:
	* gtkpathbar.h:
	Merge from kris-async-branch.
2006-05-01 21:41:12 +00:00
Matthias Clasen
a560c6ba97 Handle double queuing, rather than asserting that it does not happen.
2006-03-29  Matthias Clasen  <mclasen@redhat.com>

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

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

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

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

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

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

	Fixes bug #328820:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Fixes bug #317999:

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

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

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

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

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

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

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

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

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

	* tests/Makefile.am: Added testcellrenderertext.

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

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

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

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

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

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

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

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

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

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

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

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

	* gtk/gtkfilechooserdialog.c: See above.

	* gtk/gtkfilechooserwidget.c: See above.

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

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

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

	* gtk/gtkfilechooserdefault.c: (shortcuts_add_volumes),
	(shortcuts_activate_volume):
	Handle base_path being null in the rest of the cases (#310270)
2005-09-02 13:33:06 +00:00
Matthias Clasen
94eec04267 Intern some more strings.
2005-09-01  Matthias Clasen  <mclasen@redhat.com>

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

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

	* gtk/*.c:
	* gdk/x11/*.c:
	* gdk/*.c: Intern type names before registering the type to avoid
	unnecessary copies.
2005-08-31 16:53:43 +00:00
Matthias Clasen
d0ef4dec81 Fix a C99ism. (#314262, Robert Jeff Mitchell)
2005-08-23  Matthias Clasen  <mclasen@redhat.com>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Fix #157787, reported by Jonathan Blandford:

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

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

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

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

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

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

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

	Merged from gtk-2-6:

	Fix #302087:

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

	Merged from gtk-2-6:

	Fixes #307640:

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_should_respond): Oops, I broke SAVE
	mode.  If the parent path is a folder, only create a subfolder if
	we are in CREATE_FOLDER mode; if we are in SAVE mode, just return
	and respond.  Also, pick up the case where the user types
	"dirname/" instead of "dirname".
	(check_save_entry): Make the return type void.  Add some return
	parameters so that we can do more thorough checking.
	(gtk_file_chooser_default_get_paths): If the file part is empty
	and we are in SAVE mode, return an empty selection.
2005-06-14 23:30:12 +00:00
Federico Mena Quintero
ab44ea2b8c Merged from gtk-2-6:
2005-06-10  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fixes #162358:

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

	* gtk/gtkfilechooserentry.c (check_completion_callback): Only
	insert the common prefix if we are in an "open" mode.  Use a
	helper function.
	(append_common_prefix): New helper function; code moved over from
	check_completion_callback().
	(find_common_prefix): New helper function.
	(gtk_file_chooser_entry_focus): Append the common prefix if the
	user requests it explicitly.
2005-06-10 05:54:28 +00:00
Matthias Clasen
39d710eabe Don't grab the focus away from the file list when operating the filter
2005-05-23  Matthias Clasen  <mclasen@redhat.com>

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

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init):
	Remove the no longer needed workaround.
2005-05-18 16:22:20 +00:00