Commit Graph

689 Commits

Author SHA1 Message Date
Matthias Clasen
2169f50919 Add an animation mode, to test how the combobox behaves if the model
Wed Mar  3 00:28:59 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/testcombochange.c: Add an animation mode, to test
	how the combobox behaves if the model changes while it is popped
	up.
2004-03-02 23:29:21 +00:00
Owen Taylor
ce52e0776e Move the /nonexistant stuff out of the main window, keep the main window
Tue Mar  2 16:47:40 2004  Owen Taylor  <otaylor@redhat.com>

        * tests/testfilechooser.c (set_filename_existing_nonexistent_cb):
        Move the /nonexistant stuff out of the main window,
        keep the main window somewhat normal looking.
2004-03-02 21:55:01 +00:00
Owen Taylor
d0f6b48199 gtk/gtktreestore.c (gtk_tree_store_reorder) Fix up the interpretation of
Tue Mar  2 16:18:43 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtktreestore.c (gtk_tree_store_reorder)
        * gtk/gtkliststore.c (gtk_list_store_reorder): Fix
        up the interpretation of new_order to match what
        it means elsewhere, document the meaning of new_order.

        * gtk/gtkcombobox.c (gtk_combo_box_model_rows_reordered):
        Fix interpretation of new_order.

        * tests/testcombochange.c (on_reorder): Fix interpretation
        of new_order.

        * tests/testcombochange.c (on_reorder): Fix hitting
        "reorder" with an empty list.
2004-03-02 21:34:19 +00:00
Soeren Sandmann
cddfd994ef Patch from Frederic Crozat, test code from Jean-Philippe Chancelier. Fixes
Tue Mar  2 21:23:30 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	Patch from Frederic Crozat, test code from Jean-Philippe
	Chancelier. Fixes bug #120479.

	* gtk/gtkcombo.c (gtk_combo_popup_list): Make sure popup belongs
	to the right window group.

	* gtk/gtkmenu.c (gtk_menu_popup): Same

	* tests/testsocket.c (main): Pack the plugs into an hbox instead
	of a vbox.

	* tests/testsocket_common.c: Add a GtkMenuBar, a GtkCombo and a
	GtkComboBox to the children.
2004-03-02 20:49:15 +00:00
Owen Taylor
f05cb42db9 If the model was empty before, select the first inserted item.
Tue Mar  2 14:38:23 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkcombobox.c (gtk_combo_box_model_row_inserted):
        If the model was empty before, select the first inserted
        item.

        * gtk/gtkcombobox.c (gtk_combo_box_model_row_deleted):
        Fix up the logic for the new row to select.

        * gtk/gtkcombobox.c (gtk_combo_box_class_init):
        Rename "appearance" property to "appears-as-list".

        * tests/testcombochange.c tests/Makefile.am: Test case
        for combos and dynamically changing models.
2004-03-02 20:42:14 +00:00
Federico Mena Quintero
9133c58b8d Don't update the save folder combo if we are already switching folders;
2004-03-02  Federico Mena Quintero  <federico@ximian.com>

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

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

	* tests/testfilechooser.c (extra_widget_create): Add a bunch of
	buttons to test various things.
2004-03-02 20:05:08 +00:00
Matthias Clasen
596cbff960 Add testentrycompletion.
Tue Mar  2 20:59:23 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/Makefile.am: Add testentrycompletion.

	* tests/testentrycompletion.c: New file to test some of the
	more exotic GtkEntryCompletion features.
2004-03-02 19:59:20 +00:00
Jonathan Blandford
fe8838bce2 improve tests a little.
Tue Mar  2 14:38:10 2004  Jonathan Blandford  <jrb@redhat.com>

        * tests/testfilechooser.c (main): improve tests a little.
2004-03-02 19:38:54 +00:00
Morten Welinder
e4cec76b6d Don't scale images that are small enough to fit. Avoid using incompatibly
2004-03-02  Morten Welinder  <terra@gnome.org>

	* tests/testfilechooser.c (size_prepared_cb): Don't scale images
	that are small enough to fit.  Avoid using incompatibly typed data
	pointer.
2004-03-02 17:03:04 +00:00
Owen Taylor
d52caae6d1 Add gtk_drag_source_set/get_target_list(). (#127499, based on patch from
Mon Mar  1 19:30:25 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkdnd.[ch]: Add gtk_drag_source_set/get_target_list().
        (#127499, based on patch from Michael Natterer)

        * tests/testgtk.c: Fix bidi strings to display correctly
        with new auto-bidi.
2004-03-02 00:45:33 +00:00
Owen Taylor
4ea9813d23 Add gtk_entry_set_alignment() to allow right-aligned entries and a
Sun Feb 29 22:01:49 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkentry.[ch]: Add gtk_entry_set_alignment()
        to allow right-aligned entries and a "xalign"
        property. (#59799, patch from Egon Andersen and
        Steffen Gutmann)

        * gtk/gtkmisc.c (gtk_misc_class_init): Use improved
        xalign property description here too.

        * tests/testtext.c: UNDERLINE_ERROR test addition
        from Nicolas Settons' patch.
2004-03-01 03:30:27 +00:00
Matthias Clasen
1637a9c55b New convenience API to construct simple text combos, implemented by Damon
Thu Feb 26 22:20:44 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcomboboxentry.h:
	* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text): New
	convenience API to construct simple text combos, implemented by
	Damon Chaplin.

	* tests/testcombo.c: Use gtk_combo_box_entry_new_text.
2004-02-26 21:40:09 +00:00
Michael Meeks
c19aa6739d re-arrange widgets to allow more overflowing toolbar goodness.
2004-02-20  Michael Meeks  <michael@ximian.com>

	* tests/testtoolbar.c (main): re-arrange widgets to allow
	more overflowing toolbar goodness.
2004-02-20 16:20:20 +00:00
Federico Mena Quintero
863252b654 Don't set a default size for the dialog - Federico 2004-02-14 02:11:47 +00:00
Federico Mena Quintero
ab09a860ed Fixes #133995, patch by Morten Welinder <mortenw@gnome.org>.
2004-02-10  Federico Mena Quintero  <federico@ximian.com>

	Fixes #133995, patch by Morten Welinder <mortenw@gnome.org>.

	* tests/prop-editor.c (create_prop_editor): Free the title.
	(object_changed): Free the children list.
2004-02-10 17:49:14 +00:00
Federico Mena Quintero
9a98cd8f87 Fix #59707.
2004-02-04  Federico Mena Quintero  <federico@ximian.com>

	Fix #59707.

	* gtk/gtklabel.c (gtk_label_focus): Removed, so we don't ignore
	the focus chain.
	(gtk_label_button_press): Fix prototype.
	(gtk_label_button_release): Likewise.
	(gtk_label_motion): Likewise.

	* tests/testgtk.c (create_message_dialog): For the dialog with
	only GTK_BUTTONS_CLOSE, make GTK_RESPONSE_CLOSE the default.
2004-02-04 21:55:33 +00:00
Hans Breuer
2d19ee19be new GTK_STOCK_NETWORK ... gtk/gtkstock.[hc] : ... define ...
2004-01-28  Hans Breuer  <hans@breuer.org>

	* gtk/stock-icons/stock_network_(16|24).png : new GTK_STOCK_NETWORK ...
	  gtk/gtkstock.[hc] : ... define ...
	  gtk/gtkiconfactory.c : ... register ...
	  gtk/stock-icons/Makefile.am gtk/stock-icons/makefile.msc : ... compile ...
	* gtk/gtkfilesystemwin32.c : ... and use. Also adapt to recent
	IFace changes.

	* gtk/gtk.def : added a bunch of new exported symbols

	* tests/testfilechooser.c (no_backup_files_filter) : don't crash
	on filter_info->display_name being NULL

	* tests/testgtk.c : make testgtk --bench=all work again
2004-01-28 21:46:02 +00:00
Soeren Sandmann
accc299dfa Set a small size request and make the window resizable, to test
Sun Jan 18 13:16:34 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* tests/testgtk.c (create_toolbar): Set a small size request and
	make the window resizable, to test mapping/unmapping of buttons.

	* gtk/gtktoolbar.c (gtk_toolbar_remove_content,
	gtk_toolbar_insert_tool_item): remove these functions.

	* gtk/gtktoolbar.c (gtk_toolbar_show_all,
	toolbar_content_show_all, gtk_toolbar_hide_all,
	toolbar_content_hide_all): New functions.

	Ignore show_all/hide_all for buttons created in compatibility mode.

	* gtk/gtktoolbar.c (internal_insert_element, gtk_toolbar_show_all,
	gtk_toolbar_hide_all): Make sure buttons are ignored by
	gtk_toolbar_show_all() and gtk_toolbar_hide_all().

	* gtk/gtktoolbar.c: s/regular_widget/compatibility/g

	* gtk/gtktoolbar.c (struct _ToolbarContent): Allocate
	GtkToolbarChild inline. Get rid of GtkToolbarChildSpace.

	* gtk/gtktoolbar.c (toolbar_content_expose): Fix bug where widget
	could become NULL.

	* gtk/gtktoolbar.c (gtk_toolbar_add): Append new tool items
	instead of prepending them.

	* gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Use the same
	'elapsed' for all items.

	* gtk/gtktoolbar.c (struct _GtkToolbarPrivate): Turn booleans
	into bitfields.

	* gtk/gtktoolbar.c: Many formatting fixes
2004-01-18 12:28:38 +00:00
Jody Goldberg
c73ab06ef5 Adjust to the new connect_proxy signals.
Mon Jan 12 23:40:34 2004  Matthias Clasen  <maclas@gmx.de>

	* tests/testmerge.c: Adjust to the new connect_proxy signals.

	* gtk/gtkuimanager.c
	* gtk/gtkactiongroup.c
	* gtk/gtkaction.c: Move the connect_proxy and disconnect_proxy signals
	from GtkAction to GtkActionGroup and proxy it on GtkUIManager. This
	removes the confusion between the disconnect_/connect_proxy signals
	and the (unrelated) virtual functions of the same name and aligns
	the setup with the pre_/post_activate signals.

2004-01-12  Jody Goldberg <jody@gnome.org>

	* gtk/gtkaction.c (connect_proxy) : only connect activate for menus
	  with no submenus otherwise it looks like we activate every time a
	  submenu opens.

2004-01-10  Jody Goldberg <jody@gnome.org>

	* gtk/gtkuimanager.c (d) : Add a debug macro to quiet the spew.
	s/merge_signals/ui_manager_signals/ for readability.
	(gtk_ui_manager_class_init) : add pre_activate and post_activate
	  signals.
	(cb_proxy_pre_activate) : new.
	(cb_proxy_post_activate) : new.
	(gtk_ui_manager_insert_action_group) : connect the proxies for
	  GtkActionGroup::pre/post_activate
	(gtk_ui_manager_remove_action_group) : disconnect them.

	* gtk/gtkactiongroup.c (gtk_action_group_class_init) : add
	  'sensitive', and 'visible' properties.  Also add pre_activate and
	  post_activate signals to help deal with activations at a higher
	  level (eg GtkUIManager)
	(gtk_action_group_init) : init sensitive and visible
	(gtk_action_group_set_property) : add sensitive and visible
	(gtk_action_group_get_property) : add sensitive and visible
	(gtk_action_group_get_sensitive) : new.
	(gtk_action_group_get_visible) : new.
	(cb_set_action_sensitivity) : new with minor optimization that only
	  signals sensitivity changes if the action could possibly change.
	(cb_set_action_visiblility) : ditto.
	(gtk_action_group_set_sensitive) : new.  walk the actions directly
	  rather than using notify::sensitive because that is simpler, easier
	  to read, and more efficient.
	(gtk_action_group_set_visible) : ditto.
	(gtk_action_group_add_action) : Each action can only be in 1 group,
	  set GtkAction::action_group.
	(gtk_action_group_remove_action) : clear it.
	(gtk_action_group_add_toggle_actions_full) : warning suppression.
	(gtk_action_group_add_radio_actions_full) : warning suppression.
	(_gtk_action_group_emit_pre_activate) : new protected routine for use
	  by GtkAction.
	(_gtk_action_group_emit_post_activate) : ditto.

	* gtk/gtkaction.c (gtk_action_class_init) : add 'action_group' property.
	(gtk_action_init) : initialize it.
	(gtk_action_get_property) : get.
	(gtk_action_set_property) : set it via
	(gtk_action_set_action_group) : new function.
	(gtk_action_sync_sensitivity) : new routine to sync proxy sensitivity
	  with the logical sensitivity (action & group) rather than the simple
	  action::sensitivity.
	(gtk_action_sync_visible) : use gtk_action_is_visible to handle
	  logical visibility (action & group) rather than the simple
	  action::visible.  Use widget show/hide directly.
	(connect_proxy) : handle the custom sensitivity handler.
	  Make the TOOL_BUTTON signals more general and support TOOL_ITEM
	  directly, with special cases for TOOL_BUTTON.  Still not especially
	  good it might be useful to handle label/use_underline by parmspec
	  lookup.  Those are likely to be implemented by custom types, and are
	  assumed to exist in GtkToolItem.
	(disconnect_proxy) : disconnect the new sensitivity handler.
	(_gtk_action_emit_activate) : add pre/post signals.
	(gtk_action_activate) : use logical sensitivity.
	(gtk_action_is_sensitive) : logical sensitivity.
	(gtk_action_get_sensitive) : actual sensitivity.
	(closure_accel_activate) : use logical sensitivity.
2004-01-12 22:45:45 +00:00
Matthias Clasen
f2bb20cc15 New function to obtain a list of toplevel widgets constructed by the ui
Fri Jan  9 00:34:57 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkuimanager.h:
	* gtk/gtkuimanager.c (gtk_ui_manager_get_toplevels): New function to
	obtain a list of toplevel widgets constructed by the ui manager.

	* gtk/gtkuimanager.h (GtkUIManagerItemType): Change to flags, so that
	the values can be combined for gtk_ui_manager_get_toplevels().

	* tests/testmerge.c: Add a "Dump toplevels" button to test
	gtk_ui_manager_get_toplevels().
2004-01-08 23:37:34 +00:00
Matthias Clasen
e902118f0f Pull accelerator key from the stock item if stock_id is given, but
Wed Dec 31 02:05:39 2003  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkactiongroup.c (gtk_action_group_add_actions_full):
	(gtk_action_group_add_toggle_actions_full):
	(gtk_action_group_add_radio_actions_full): Pull accelerator key
	from the stock item if stock_id is given, but accelerator
	not.  (Noticed by Jeff Franks and Jody Goldberg)

	* tests/testmerge.c: Remove the accelerator from the "Open" entry
	to test the above change.
2003-12-31 01:05:57 +00:00
Hans Breuer
4acd98a836 handle GTK_DATADIR similar as the other filesystem placement 'constants'
2003-12-14  Hans Breuer  <hans@breuer.org>

	* gtk/gtkprivate.h gtk/gtkmain.c : handle GTK_DATADIR
	similar as the other filesystem placement 'constants' (dynamic
	resolving on win32)

	* gtk/gtkfilechooserwidget.c : handle file system to win32
	renaming here as will
	* gtk/gtkfilesystemwin32.c : implement render_icon

	* gtk/gtk.def gdk/gdk.def : updated externals

	* gdk/win32/gdkdisplay-win32.c : make it compile without
	<multimon.h> - i.e. even older sdk

	* gdk/win32/gdkevents-win32.c : match resize_timer_proc
	with TIMERPROC prototype

	* gdk/win32/gdkwindow-win32.c : older msvc does not know
	BITMAPV5HEADER (from win xp) either

	* gtk/gtkimmodule.c : make it compile even if GTK_LOCALEDIR is
	not defined

	* tests/testfilechooser.c : recent GLib crashes on
	g_print ("%s", NULL) so avoid this
2003-12-14 19:03:02 +00:00
Federico Mena Quintero
c9c99b3f1b Added toolbar items for the filter separator and the filter item.
2003-12-10  Federico Mena Quintero  <federico@ximian.com>

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

	* tests/testfilechooser.c (main): Dramatically improved the
	usability of the extra widget through careful word choice.
2003-12-10 20:49:44 +00:00
Kristian Rietveld
a4e8e3dee5 grrrr. broken pipe. 2003-11-16 23:20:23 +00:00
Hans Breuer
947b32b7dc updated added all the new tests
2003-11-15  Hans Breuer  <hans@breuer.org>

	* gdk/makefile.msc gdk/gdk.def
            gtk/gtk.def gtk/makefile.msc.in : updated
	* tests/makefile.msc : added all the new tests

	* gtk/gtkfilefilter.c(finalize) : initialize filter
	from object not from itself

	* gtk/gtkfilesystemwin32.[hc] : copied from gtkfilesystemunix.[hc]
	modified as less as posible to have aworking implementation
	on win32. There maybe the desire to merge the unchanged pats into
	a common base class.
	Also implemented a simple glib based bookmark handling, which
	is currently missing in gtkfilesystemunix.[hc] but can be copied
	over there.
	* gtk/gtkfilechooserwidget.c : conditional include gtkfilesystemwin32.h

	* gdk/win32/gdkwindow-win32.c : implement
	gdk_window_set_keep_above() and gdk_window_set_keep_below()

	* tests/testmerge.c : don't include unistd.h unconditionally,
	#define STDOUT_FILENO if it isn't defined

	* tests/testfilechooser.c : make it compile on win32
2003-11-15 20:35:55 +00:00
Soeren Sandmann
eb3f5776ac delete this function (toolbar_item_is_homogeneous): cache
Fri Oct 31 02:43:34 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtktoolbar.c (get_item_requisition): delete this function
	(toolbar_item_is_homogeneous): cache max_homogeneous_pixels
	instead of re-calculating for each item.
	(gtk_toolbar_size_allocate): Update comments
2003-10-31 02:10:03 +00:00
Soeren Sandmann
aca1b6f391 Make it work even when item 0 is a placeholder. (#125826) add an assertion
Thu Oct 30 17:57:53 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtktoolbar.c (logical_to_physical): Make it work even when
	item 0 is a placeholder. (#125826)
	* tests/testtoolbar.c: add an assertion that
	gtk_toolbar_get_nth_item (0) != NULL
2003-10-30 17:08:49 +00:00
Soeren Sandmann
f36e68a1e8 Add this function; remove gtk_toolbar_highlight_drop_location() and
Wed Oct 29 02:54:35 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtktoolbar.[ch] (gtk_toolbar_set_drop_highlight_item): Add this
	function; remove gtk_toolbar_highlight_drop_location() and
	gtk_toolbar_unhighlight_drop_location().

	Also fix bug where the number of overflowed items were miscounted.
2003-10-29 01:58:38 +00:00
Søren Sandmann Pedersen
2ce4f1bc5b Broken pipe 2003-10-25 19:59:31 +00:00
Owen Taylor
9bca8eced6 cvsignore updates 2003-10-23 04:31:28 +00:00
Owen Taylor
b3bae3b40a gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]: Basic framework
Wed Oct 22 23:20:04 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkfilechooser.[ch] gtk/gtkfilefilter.[ch]
        gtk/gtkfilechooserwidget.[ch] gtk/gtkfilechooserdialog.[ch]:
        gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]:
        Basic framework for the new file selector widget.

        * gtk/gtkfilechooserdefault.[ch] gtk/gtkcellrenderersep.[ch]
        gtk/gtkfilechooserentry.[ch] gtk/gtkfilesystemmodel.[ch]:
        Initial implementation of the GtkFileChooser user interface.

        * gtk/gtkfilesystemunix.[ch]: GtkFileSystem implementation
        for Unix files.

        * configure.in gtk/Makefile.am gtk/xdgmime: Build code
        for freedesktop.org MIME system on Unix.

        * tests/testfilechooser.c: Test program for GtkFileChooser

        * tests/prop-editor.c: Add support for properties on interfaces.
2003-10-23 04:22:32 +00:00
Soeren Sandmann
7c659465e2 Add support for OS X like sliding of toolbar items during drag and drop,
Mon Oct 20 20:27:22 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	Add support for OS X like sliding of toolbar items during drag and
	drop, (#110919, Dave Bordoley)

	Make dnd highlighting the responsibility of the
	application. (Fixes #116298, Owen Taylor)

	* gtk/gtktoolbar.h: Add prototypes for new API.

	* gtk/gtktoolbar.c
	(physical_to_logical, logical_to_physical): new functions
	converting between "position including placeholders" and "position
	excluding placeholders".
	(gtk_toolbar_class_init): remove drag_leave and drag_motion
	handlers
	(struct _ToolbarContent): new struct containing information
	related to toolbar items.
	(gtk_toolbar_highlight_drop_location): new public function
	(gtk_toolbar_unhighlight_drop_location): new public function

	* tests/testtoolbar.c
	(toolbar_drag_motion, toolbar_drag_leave): new functions
	(main): connect to dnd signals.  Make the "New" item expand to
	make drag and drop more exciting.
2003-10-20 18:56:05 +00:00
Federico Mena Quintero
b49a5ec5b4 Removed. (gtk_file_system_gnome_vfs_set_bookmarks): Removed.
2003-10-17  Federico Mena Quintero  <federico@ximian.com>

	* gtkfilesystemgnomevfs.c
	(gtk_file_system_gnome_vfs_get_supports_bookmarks): Removed.
	(gtk_file_system_gnome_vfs_set_bookmarks): Removed.
	(gtk_file_system_gnome_vfs_add_bookmark): Implement.
	(gtk_file_system_gnome_vfs_remove_bookmark): Implement.

	* gtkfilechooserprivate.h (struct _GtkFileChooserIface): Replaced
	the ::set_shortcut_folders() method with :;add_shortcut_folder()
	and ::remove_shortcut_folder().

	* gtkfilechooserutils.c (delegate_add_shortcut_folder): New function.
	(delegate_remove_shortcut_folder): New function.
	(delegate_list_shortcut_folders): New function.

	* gtkfilechooserimpldefault.c (create_shortcuts_model): Insert the
	Desktop directory as well.
	(shortcuts_insert_path): Renamed from shortcuts_append_path; now
	takes a position index instead of a parent node iter.  Also takes
	a GError argument.
	(struct _GtkFileChooserImplDefault): Removed the shortcuts_folder
	list.  It is all kept in the model now.
	(shortcuts_append_home): Save whether adding a shortcut for the
	home directory was successful.
	(shortcuts_append_desktop): Likewise for the desktop.
	(shortcuts_append_file_system_roots): Count and save the number of
	roots added.
	(shortcuts_append_shortcut_folders): Removed.
	(gtk_file_chooser_impl_default_add_shortcut_folder): Implement.
	(shortcuts_append_bookmarks): Now that we don't have a bookmarks
	parent node, don't expand the tree.
	(add_bookmark_button_clicked_cb): Use gtk_file_system_add_bookmark().
	(remove_bookmark_button_clicked_cb): Use gtk_file_system_remove_bookmark().
	(gtk_file_chooser_impl_default_list_shortcut_folders): Get the
	folders from the shortcuts model; we no longer keep a separate list.

	* gtkfilesystem.h (struct _GtkFileSystemIface): Oops, there
	shouldn't be shortcuts-related virtual methods here.

	* gtkfilechooser.c (file_paths_to_strings): New helper function.
	(gtk_file_chooser_get_filenames): Use file_paths_to_strings().
	(gtk_file_chooser_get_uris): Likewise.
	(gtk_file_chooser_set_shortcut_folders): Removed.
	(gtk_file_chooser_list_shortcut_folders): Return a list of
	strings, not of GtkFilePath*.
	(gtk_file_chooser_list_shortcut_folder_uris): New function.
	(gtk_file_chooser_add_shortcut_folder): New function.
	(gtk_file_chooser_remove_shortcut_folder): New function.
	(gtk_file_chooser_add_shortcut_folder_uri): New function.
	(gtk_file_chooser_remove_shortcut_folder_uri): New function.
	(_gtk_file_chooser_add_shortcut_folder): New function.
	(_gtk_file_chooser_remove_shortcut_folder): New function.

	* gtkfilechooser.h: New enum.

	* gtkfilechooser.c (gtk_file_chooser_error_quark): New function.

	* gtkfilesystem.c (gtk_file_system_get_supports_bookmarks): Removed.
	(gtk_file_system_set_bookmarks): Removed.
	(gtk_file_system_add_bookmark): New function.
	(gtk_file_system_remove_bookmark): New function.

	* gtkfilesystemunix.c
	(gtk_file_system_unix_get_supports_bookmarks): Removed.
	(gtk_file_system_unix_set_bookmarks): Removed.
	(gtk_file_system_unix_add_bookmark): Just a stub for now.
	(gtk_file_system_unix_remove_bookmark): Likewise.

	* testfilechooser.c (main): Add a shortcut for testing purposes.
2003-10-18 04:29:40 +00:00
Kristian Rietveld
d4627e1da4 Still uses option menus, so turn off GTK_DISABLE_DEPRECATED.
Mon Oct 13 19:41:55 2003  Kristian Rietveld  <kris@gtk.org>

	* tests/testmenus.c: Still uses option menus, so turn off
	GTK_DISABLE_DEPRECATED.
2003-10-13 17:43:48 +00:00
Matthias Clasen
999256120a These files still use option menus, so turn off GTK_DISABLE_DEPRECATED to
Sun Oct 12 00:18:02 2003  Matthias Clasen  <maclas@gmx.de>

	* tests/testtreeview.c:
	* demos/testpixbuf-scale.c:
	* tests/prop-editor.c: These files still use option menus,
	so turn off GTK_DISABLE_DEPRECATED to fix the build.
2003-10-11 22:21:04 +00:00
Matthias Clasen
7d7bbef321 Remove an extraneous unref. (#122336, Frederic Crozat)
Sun Oct  5 23:59:03 2003  Matthias Clasen  <maclas@gmx.de>

	* tests/testsocket.c (child_read_watch): Remove an
        extraneous unref.  (#122336, Frederic Crozat)
2003-10-05 22:00:49 +00:00
Kristian Rietveld
40743e126f implement the GtkCellLayout interface, drop packing/attribute/cell data
Wed Oct  1 22:43:40 2003  Kristian Rietveld  <kris@gtk.org>

	* gtk/gtkcellview.[ch]: implement the GtkCellLayout interface, drop
	packing/attribute/cell data functions from the header,
	(gtk_cell_view_set_cell_data): added support for cell data funcs.

	* gtk/gtkcombobox.[ch]: implement the GtkCellLayout interface, drop
	packing/attribute/cell data functions from the header, implemented
	cell data func support.

	* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new): updated
	for the move to GtkCellLayout.

	* tests/testcombo.c (create_combo_box_grid_demo), (main): ditto.
2003-10-01 20:51:54 +00:00
Matthias Clasen
6e87629f1a Introduce a separate "hide_if_empty" property for empty menu handling.
2003-10-01  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkaction.c (gtk_action_class_init):
	(gtk_action_[gs]et_property): Introduce a separate
	"hide_if_empty" property for empty menu handling.
	(_gtk_action_sync_menu_visible): ...and use it here.

	* tests/testmerge.c (main): ...and here.
2003-10-01 19:07:36 +00:00
Matthias Clasen
57f13d815d Test handling of empty menus.
2003-09-30  Matthias Clasen  <maclas@gmx.de>

	* tests/merge-*.ui:
	* tests/testmerge.c: Test handling of empty menus.

	* gtk/gtkuimanager.c (_gtk_menu_is_empty): New function to determine
	whether a menu is empty. Used in gtkaction.c.
	(update_smart_separators): Also update the visibility of empty menus.
	(update_node): When creating a new menu proxy, insert an "Empty" menu
	item which only gets shown if the menu is empty.

	* gtk/gtkaction.c (gtk_action_class_init): Document the meaning of
	"is_important" for menu proxies.
	(_gtk_action_sync_menu_visible): New function to sync the visibility
	of menu proxies. Used in gtkuimanager.c.
	(gtk_action_sync_visible): New function to sync the visibility of
	proxies.
2003-09-30 20:55:24 +00:00
Matthias Clasen
e4507b6018 Turn off GTK_DISABLE_DEPRECATED, since this test uses the
2003-09-27  Matthias Clasen  <maclas@gmx.de>

	* tests/testtext.c: Turn off GTK_DISABLE_DEPRECATED, since
	this test uses the soon-to-be-deprecated GtkItemFactory.

	* demos/gtk-demo/Makefile.am (demos): Add ui_manager.c,
	remove item_factory.c

	* demos/gtk-demo/ui_manager.c: Duplicate of item_factory.c
	using GtkUIManager instead of GtkItemFactory.
2003-09-26 23:33:46 +00:00
Matthias Clasen
eeed9d1890 Demonstrate the use of the connect-proxy signal.
2003-09-27  Matthias Clasen  <maclas@gmx.de>

	* tests/testmerge.c: Demonstrate the use of the
	connect-proxy signal.

	* gtk/gtkaction.c (connect_proxy): Add connect-proxy and
	disconnect-proxy signals to do small customizations
	like displaying tooltips in the statusbar without
	custom actions.  (#122894, Philip Langdale)

	* gtk/gtkuimanager.c (update_node): Don't leak tooltip.
2003-09-26 23:01:32 +00:00
Kristian Rietveld
c920afd9c5 Landing the new ComboBox. Note that only gtkcombobox.h and
Fri Sep 26 23:49:44 2003  Kristian Rietveld  <kris@gtk.org>

	Landing the new ComboBox. Note that only gtkcombobox.h and
	gtkcomboboxentry.h are public.

	* gtk/gtkcellview.[ch], gtk/gtkcellviewmenuitem.[ch],
	gtk/gtkcombobox.[ch], gtk/gtkcomboboxentry.[ch]: new files.

	* gtk/Makefile.am, gtk/gtk.h: adding the new files.

	* tests/testcombo.c: and a new test.

	* tests/Makefile.am: adding the new test.
2003-09-26 21:57:06 +00:00
Matthias Clasen
cf639f4168 Initially activate the JUSTIFY_RIGHT group member to test the fix for
2003-09-22  Matthias Clasen  <maclas@gmx.de>

	* tests/testmerge.c (main): Initially activate the JUSTIFY_RIGHT
	group member to test the fix for #122904.

	* gtk/gtkactiongroup.c (gtk_action_group_add_radio_actions_full):
	Add the action to the group before activating it, otherwise we
	may end up with multiple active group members.  (#122904, Marco
	Pesenti Gritti)
2003-09-22 08:54:23 +00:00
Matthias Clasen
0ceb0db081 Install accelerators on actions, not on proxies, support accelerator-only
2003-09-18  Matthias Clasen  <maclas@gmx.de>

	Install accelerators on actions, not on proxies, support
	accelerator-only actions:

	* gtk/gtkmenu.c (get_accel_path): New function to get the accel path
	and its lock status either via _gtk_widget_get_accel_path() or by
	looking at the accel_path stored in the menu item itself and determining
	its lock status by peeking into the contained accel label. This was
	already (accidentally) committed a week ago.

	* gtk/gtkaction.h (gtk_action_set_accel_group):
	(gtk_action_[dis]connect_accelerator): New functions.

	* gtk/gtkaction.c (struct _GtkActionPrivate): Add accel_group,
	accel_closure and accel_count. We must have a reference to the accel_group,
	since we need it in connect_proxy. The count is necessary to ensure
	that the accelerator isn't removed before the last proxy requesting
	it has been unmerged.
	(connect_proxy): Connect the accelerator to the
	action now, only set the accel_path on the menuitem.
	(remove_proxy): Disconnect the accelerator from the action, not from
	the menuitem.
	(gtk_action_set_accel_group): Set the accel group.
	(gtk_action_[dis]connect_accelerator): Count the number of times
	this functions have been called and install/remove the accelerator if
	the count leaves/reaches zero.

	* gtk/gtkuimanager.h (GtkUIManagerItemType): Add
	GTK_UI_MANAGER_ACCELERATOR.

	* gtk/gtkuimanager.c (NodeType): Add NODE_TYPE_ACCELERATOR.
	(start_element_handler): Create NODE_TYPE_ACCELERATOR nodes from
	<accelerator> elements.
	(gtk_ui_manager_add_ui): Create NODE_TYPE_ACCELERATOR nodes when
	type is GTK_UI_MANAGER_ACCELERATOR.
	(update_node): Set the accel group on actions before creating their
	proxies. Don't set the accel group on created menus. For
	NODE_TYPE_ACCELERATOR nodes, [dis]connect the actions' accelerator.
	(print_node): Also emit <accelerator> elements.

	* tests/testmerge.c (dump_accels): Add a "Dump Accels" button.
2003-09-17 23:58:28 +00:00
Matthias Clasen
c77b0caab1 New function which implements "smart" separators by iterating once over
* gtk/gtkuimanager.c (update_smart_separators): New function which
	implements "smart" separators by iterating once over the entries of a
	menu, hiding and showing separators as necessary.
	(update_node): Mark separators used as fences of placeholders as
	hidden. Explicitly added separators are marked as smart. Call
	update_smart_separators after updating a menu or toolbar node.
	Connect update_smart_separators to "notify::visible" signal on menu
	and tool items.

	* tests/merge-[12].ui: Test smart separators.

	* gtk/tmpl/gtkuimanager.sgml: Add a paragraph about smart separators.
2003-09-15 20:35:28 +00:00
Matthias Clasen
caf380c793 Add value parameter to allow setting the currently selected group member
2003-09-15  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkactiongroup.[hc]: (gtk_action_group_add_radio_actions):
	(gtk_action_group_add_radio_actions_full): Add value parameter to allow
	setting the currently selected group member before connecting signals.
	(GtkToggleActionEntry): Separate struct for constructing toggle actions,
	including a boolean to initialize the action state before connecting
	signals.
	(gtk_action_group_add_toggle_actions):
	(gtk_action_group_add_toggle_actions_full): New functions to construct
	toggle actions from an array of GtkToggleActionEntries.

	* demos/gtk-demo/appwindow.c:
	* tests/testactions.c:
	* tests/testmerge.c: Adjust to new action group API.

	* gtk/gtk-sections.txt: Add gtk_action_group_add_toggle_actions[_full].
2003-09-15 19:51:55 +00:00
Matthias Clasen
6f81c10a54 Add table menu tests.
2003-09-11  Matthias Clasen  <maclas@gmx.de>

	* tests/testgtk.c: Add table menu tests.

	* gtk/gtkmenu.c (gtk_menu_free_private): Don't forget to free the
	GtkMenuPrivate struct itself. Pointed out by valgrind.

	* gtk/gtkuimanager.c (gtk_ui_manager_finalize): Clean up
	properly.  (#121998)
2003-09-11 21:02:24 +00:00
Federico Mena Quintero
9044d774bb Added an API point about needing a way to fetch the hpaned position so we
2003-09-10  Federico Mena Quintero  <federico@ximian.com>

	* TODO: Added an API point about needing a way to fetch the hpaned
	position so we can save it.

	* gtkfilechooser.c (_gtk_file_chooser_get_paths): Fixed API docs.
	(gtk_file_chooser_get_uris): Likewise.
	(gtk_file_chooser_get_filenames): Likewise.

	* gtkfilechooserdialog.c (file_chooser_widget_file_activated): New
	callback, calls gtk_window_activate_default().

	* testfilechooser.c (response_cb): Print the selected files if the
	user clicks OK.
2003-09-11 00:56:46 +00:00
Federico Mena Quintero
613b441b5b Free the display_key.
2003-09-08  Federico Mena Quintero  <federico@ximian.com>

	* gtkfilesystem.c (gtk_file_info_free): Free the display_key.

	* gtkfilechooserimpldefault.c (list_mtime_data_func): New
	function.
	(create_file_list): Add a modification time column; remove the
	size column.
	(mtime_sort_func): New callback.
	(tree_selection_changed): Add a sorting function for the mtime
	column.  Have the model fetch the modification time as well.
	(tree_selection_changed): Do allow the file list model to show
	directories.

	* testfilechooser.c (my_new_from_file_at_size): Do not try to read
	non-regular files.
2003-09-09 15:18:29 +00:00
Alexander Larsson
0217c9dbfb Implement gtk_event_box_get/set_input_only()
2003-09-08  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkeventbox.[hc]:
	Implement gtk_event_box_get/set_input_only()

	* tests/testgtk.c:
	Tests for the new input only event boxes
2003-09-08 20:04:49 +00:00