Commit Graph

69 Commits

Author SHA1 Message Date
Matthias Clasen
d5eb6847e5 Don't use guint8 for bitfields, since some compilers choke on that.
2007-11-26  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c:
        * gtk/gtktoolbar.c: Don't use guint8 for bitfields, since
        some compilers choke on that.  (#467722)


svn path=/trunk/; revision=19051
2007-11-26 17:10:00 +00:00
Michael Natterer
a5bebb2e7b remove useless member "has_title" from the private struct and simply set
2007-09-11  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserbutton.c: remove useless member "has_title"
	from the private struct and simply set the default title in
	constructor() whenever we create a dialog or the supplied one has
	no title. Also accept RESPONSE_ACCEPT *and* RESPONSE_OK as
	affirmative responses and document that accordingly. Fixes bug
	#436576. Fixed all compiler warnings in the file.


svn path=/trunk/; revision=18796
2007-09-11 18:54:00 +00:00
Matthias Clasen
9046ebc9f1 Plug a memleak. (#455721, Christian Persch)
2007-07-16  Matthias Clasen <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c (model_add_special_get_info_cb):
        Plug a memleak. (#455721, Christian Persch)



svn path=/trunk/; revision=18476
2007-07-16 15:30:43 +00:00
Xan Lopez
960b4fcd39 Remove extra braces.
svn path=/trunk/; revision=18174
2007-06-17 12:02:44 +00:00
Xan Lopez
ee0411ae72 Update changelog
svn path=/trunk/; revision=18173
2007-06-17 12:02:42 +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
Matthias Clasen
b8673de8cd Handle the row reference path being NULL. (#410565, Joe Markus Clarke,
2007-03-12  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c (change_icon_theme_get_info_cb):
        Handle the row reference path being NULL.  (#410565, Joe Markus
        Clarke, patch by Chris Wilson)

svn path=/trunk/; revision=17487
2007-03-12 04:09:25 +00:00
Mariano Suárez-Alvarez
0b0746e44d Add a file-set signal to the filechooser button. Bug 353196.
2006-12-26  Mariano Suárez-Alvarez  <mariano@gnome.org>

	* gtk/gtkfilechooserbuuton.[hc]: Add a file-set signal to the
	filechooser button. Bug 353196.
2006-12-26 22:20:06 +00:00
Matthias Clasen
2dc9ec7c43 Allow any GtkDialog that implements GtkFileChooser as dialog. (#335473,
2006-12-20  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_new_with_dialog):
        Allow any GtkDialog that implements GtkFileChooser as
        dialog.  (#335473, Tommi Komulainen)
2006-12-20 19:02:21 +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
1077a08e5d Protect against base_path being NULL. (#358405, many reporters)
2006-09-30  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c (update_combo_box): Protect
        against base_path being NULL.  (#358405, many reporters)
2006-09-30 13:30:55 +00:00
Matthias Clasen
6323f98da8 make it build 2006-09-22 17:48:57 +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
ec62ff149d Use bookmark labels in the combobox.
2006-09-17  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c: Use bookmark labels in
	the combobox.
2006-09-17 04:20:43 +00:00
Matthias Clasen
993e1a1e76 Don't add remote volumes and bookmarks to the model in local-only mode, to
2006-09-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c: Don't add remote volumes and
	bookmarks to the model in local-only mode, to avoid
	authentication dialogs pop up for invisible bookmarks, and
	to fix issues with separators not being hidden when
	they should.  (#354887, Dennis Cranston)
2006-09-17 03:34:17 +00:00
Matthias Clasen
e7d8f0575c Request the display name too, otherwise "Desktop" does not appear in the
2006-09-10  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (model_add_special): Request
	the display name too, otherwise "Desktop" does not appear
	in the file chooser button.
2006-09-11 02:39:26 +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
Matthias Clasen
23b37da67d Handle the case where the filechooser button is destroyed quickly.
2006-08-17  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (set_info_get_info_cb)
	(model_add_special_get_info_cb): Handle the case where the
	filechooser button is destroyed quickly.
2006-08-17 04:42:27 +00:00
Matthias Clasen
8e552c4144 Fix some memory handling issues. (#347043, Chris Wilson)
2006-07-10  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c: Fix some memory handling
	issues.  (#347043, Chris Wilson)
2006-07-10 16:51:52 +00:00
Matthias Clasen
a6497203fd Fix a small leak 2006-07-09 00:44:15 +00:00
Matthias Clasen
dbecb7995f Get the display name for the home directory. (#346498, Dennis Cranston,
2006-07-06  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c: Get the display name
        for the home directory.  (#346498, Dennis Cranston,
        patch by Andreas Köhler)
2006-07-06 22:09:49 +00:00
Matthias Clasen
f8794cccca Improve consistency of signal and property names 2006-07-06 05:14:03 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +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
Murray Cumming
5cb13a7512 _GtkFileChooserButtonPrivate: Added has_title flag so we can remember
2006-04-19  Murray Cumming  <murrayc@murrayc.com>

        * gtk/gtkfilechooserbutton.c: _GtkFileChooserButtonPrivate:
        Added has_title flag so we can remember whether a title has
        been set.
        (gtk_file_chooser_button_constructor): If no title has been
        set then set it to the default title. This means that the
        default title will be used if the dialog was instantiated with
        g_object_new(), without using the gtk_file_chooser_button_new()
        convenience function. This helps language bindings.
        (gtk_file_chooser_button_set_property): Set has_title when
        setting the title.
2006-04-19 17:21:55 +00:00
Matthias Clasen
78d9ea1ddc Don't put relevant callss in g_assert(). (#329876, Kristian Rietveld)
2006-02-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c: Don't put relevant callss
	in g_assert().  (#329876, Kristian Rietveld)
2006-02-08 19:35:08 +00:00
Matthias Clasen
82b5d16dd6 And free the string... 2006-01-06 21:54:09 +00:00
Matthias Clasen
fd96117f72 Just use the directory name for the home dir. (#325817, Federico Mena
2006-01-06  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (model_add_special): Just use the
	directory name for the home dir.  (#325817, Federico Mena Quintero)
2006-01-06 21:49:59 +00:00
Matthias Clasen
0ce29ee614 Add a focus-on-click property with setter and getter. (#318945, Christian
2005-11-07  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtk.symbols:
	* gtk/gtkfilechooserbutton.h:
	* gtk/gtkfilechooserbutton.c: Add a focus-on-click property
	with setter and getter.  (#318945, Christian Persch)
2005-11-07 15:57:19 +00:00
Matthias Clasen
60ec536ce3 Doc updates 2005-10-26 19:10:08 +00:00
Federico Mena Quintero
cca9302927 Fixes bug #317999:
2005-10-07  Federico Mena Quintero  <federico@ximian.com>

	Fixes bug #317999:

	* tests/autotestfilechooser.c (test_reload_sequence): Ensure that
	the the result of gtk_file_chooser_get_folder() is NULL or
	non-NULL at the right times.  Log the tests.
	(test_button_folder_states): New test for the initial states of
	the current folder in GtkFileChooserButton.
	(main): Test that the number of warnings/errors/critical errors is
	zero.

	* gtk/gtkfilechooser.c (gtk_file_chooser_get_current_folder):
	Clarify the documentation on when this can return NULL.
	(gtk_file_chooser_get_current_folder_uri): Likewise.

	* gtk/gtkfilechooserbutton.c (struct
	_GtkFileChooserButtonPrivate): Added a folder_has_been_set flag;
	we use it to keep track of whether a folder has been set.
	(gtk_file_chooser_button_map):  Implement.  If no folder has been
	loaded before, we at least try to load $cwd here.
	(gtk_file_chooser_button_constructor): If the construct-time
	dialog already has a folder set, turn on our folder_has_been_set
	flag.
	(dialog_current_folder_changed_cb): Turn on our
	folder_has_been_set flag.
2005-10-07 19:54:32 +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
313b8ffabf Handle pixbuf being NULL without warnings. Also, don't leak pixbuf
2005-08-19  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (change_icon_theme)
	(model_add_special, model_add_special, model_add_volumes):
	Handle pixbuf being NULL without warnings. Also, don't
	leak pixbuf references when the icon theme is changed.
2005-08-19 18:21:31 +00:00
Matthias Clasen
6f74e05c5a Add GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION.
2005-07-20  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_[sg]et_property):
	Add GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION.
2005-07-20 17:55:49 +00:00
Matthias Clasen
ae1e9866d0 Free the data of the row before overwriting it. (#307490, Kjartan Maraas)
2005-06-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (model_update_current_folder):
	Free the data of the row before overwriting it.  (#307490,
	Kjartan Maraas)
2005-06-13 13:50:49 +00:00
Kjartan Maraas
471b638bd3 Merge leak fix from stable. Bug 306754.
2005-06-07  Kjartan Maraas  <kmaraas@gnome.org>

	* gtk/gtkfilechooserbutton.c: (update_label_and_image):
	Merge leak fix from stable. Bug 306754.
2005-06-07 21:24:19 +00:00
Matthias Clasen
116c3e66af Handle the Cancel button properly. (#304234, Sven Neumann)
2005-05-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (dialog_response_cb): Handle the
	Cancel button properly.  (#304234, Sven Neumann)
2005-05-18 20:34:30 +00:00
Matthias Clasen
382fa5c382 Make sure the action of the button and the dialog are in sync, when the
2005-05-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_constructor):
	Make sure the action of the button and the dialog are in sync,
	when the dialog is provided by the app.  (#303987, David A Knight)
2005-05-16 21:07:16 +00:00
Matthias Clasen
4c28ce0877 Use canonical names for g_object_notify() as well.
2005-03-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.c:
	* gdk/gdkdisplaymanager.c:
	Use canonical names for g_object_notify() as well.
2005-03-26 05:49:15 +00:00
Matthias Clasen
340cf63e28 Remove a call whose result was unused and leaked. (#170776, Kjartan
2005-03-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (update_combo_box): Remove
	a call whose result was unused and leaked.  (#170776,
	Kjartan Maraas)
2005-03-23 14:07:21 +00:00
Matthias Clasen
269d89c79c Define macros GTK_PARAM_READABLE, GTK_PARAM_WRITABLE, GTK_PARAM_READWRITE
2005-03-21  Matthias Clasen  <mclasen@redhat.com>

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

	* gtk/*.c: Mark param spec strings as static, using
	the new macros.
2005-03-22 02:14:55 +00:00
Matthias Clasen
cca8dd6347 Make PLT-reduction work with gcc4, and don't include everything in
2005-03-20  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in gdkalias.h:

	* gtk/grk.symbols: Group symbols by header and source file.
	* gtk/makegtkalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegtkalias.pl -def
	* gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate
	this file.
	* gtk/*.c: Include gtkalias.h after the other headers,
	include gtkaliasdef.c at the bottom.
	* gtk/*.h: Small cleanups.
2005-03-20 07:01:23 +00:00
Matthias Clasen
1c10200c25 Complete the fix for #165770, Vincent Untz:
2005-02-11  Matthias Clasen  <mclasen@redhat.com>

	Complete the fix for #165770, Vincent Untz:

	* gtk/gtkfilechooserbutton.c (FALLBACK_ICON_SIZE): Make the
	fallback size be 16, to be equal to the default for
	GTK_ICON_SIZE_MENU (in gtkiconfactory.c:init_icon_sizes()).
	(gtk_file_chooser_button_init):
	(change_icon_theme): Use GTK_ICON_SIZE_MENU instead of
	GTK_ICON_SIZE_SMALL_TOOLBAR.
2005-02-11 06:17:16 +00:00
James M. Cape
977a557a67 Use default title if NULL is passed.
2005-01-06  James M. Cape  <jcape@ignore-your.tv>

	* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_new)
	(gtk_file_chooser_button_new_with_backend): Use default title if
	NULL is passed.

	* docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml: Make examples
	match API.
2005-01-06 06:25:30 +00:00
Matthias Clasen
27c23e4dd5 Don't add a shortcut here. (#162752, Tor Lillqvist)
2005-01-02  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_remove_shortcut_folder):
	Don't add a shortcut here.  (#162752, Tor Lillqvist)
2005-01-03 04:26:33 +00:00
Tor Lillqvist
c668f46d9e Add -lole32, needed for CoTaskMemFree in get_special_folder() below.
2005-01-02  Tor Lillqvist  <tml@iki.fi>

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

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

	* gtk/gtk.symbols: Add _gtk_file_system_win32_path_compare.

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

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

	(gtk_file_system_win32_init): Start one timeout per
	GtkFileSystemWin32.

	(gtk_file_system_win32_finalize): Remove the timeout.

	(get_special_folder): Copied from GLib.

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

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

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

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

	(gtk_file_system_win32_volume_get_is_mounted): Always return TRUE.

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

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

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

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

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

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

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

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

	(filename_is_server_share): New function.

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

	* gtk/gtkfilesystemwin32.h: Declare
	_gtk_file_system_win32_path_compare().
2005-01-02 23:15:21 +00:00
Matthias Clasen
6b62d82581 2.6.0 second try 2004-12-16 19:13:58 +00:00
Matthias Clasen
6cd1c58c92 Only unblock the handlers if they are blocked.
2004-12-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c (dialog_response_cb): Only unblock the handlers
	if they are blocked.
2004-12-16 14:18:52 +00:00
Matthias Clasen
860228fa36 Don't crash if enable_search is FALSE. (#161267, Jorn Baayen)
2004-12-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): Don't
	crash if enable_search is FALSE.  (#161267, Jorn Baayen)

	* gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_mnemonic_activate):
	Re-fix #152925, reported by Dennis Cranston.
2004-12-16 13:33:43 +00:00
Matthias Clasen
521c21e0a3 Add missing includes.
2004-12-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserbutton.c: Add missing includes.
2004-12-16 04:57:18 +00:00