Commit Graph

30 Commits

Author SHA1 Message Date
Emmanuele Bassi
4191ec6a02 Move filtering of the recent files list into the shared implementation; do
2007-03-15  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchooserprivate.h:
	* gtk/gtkrecentchooserutils.c: Move filtering of the recent
	files list into the shared implementation; do the filtering
	before the sorting, so that we always clamp on the desired
	size. (#418219)

	* gtk/gtkrecentchoosermenu.c: Remove the filtering of the
	list, as it's already been done.

	* gtk/gtkrecentchooserdefault.c: Ditto; also remove the
	GtkTreeModelFilter: just reload the view if the sorting and
	filtering properties change.

	* gtk/testrecentchoosermenu.c: Exercise the limit property.

svn path=/trunk/; revision=17516
2007-03-15 10:05:34 +00:00
Emmanuele Bassi
86ea351bd7 Various clean ups in the GtkRecent code. (see #338843)
2007-03-14  Emmanuele Bassi  <ebassi@gnome.org>

	Various clean ups in the GtkRecent code. (see #338843)

	* gtk/gtkrecentchooserdefault.c:
	* gtk/gtkrecentchoosermenu.c:
	* gtk/gtkrecentchooserprivate.h:
	* gtk/gtkrecentchooserutils.c: Move the recent chooser function
	for getting the sorted and clamped list of recent files from the
	manager outside the implementations.

	* gtk/gtkrecentchooserdefault.c (chooser_set_sort_type): Repopulate
	the list when the sorting order changes.

	(gtk_recent_chooser_default_dispose),
	(gtk_recent_chooser_default_finalize): Move object unref and
	source removal from finalize to dispose.

	* gtk/gtkrecentchooser.c (gtk_recent_chooser_type_init): Relax the
	prerequisite for the GtkRecentChooser interface implementations,
	from GtkObject to GObject.

	(gtk_recent_chooser_class_init): Use GTK_PARAM_* instead of
	G_PARAM_*

svn path=/trunk/; revision=17514
2007-03-14 10:33:36 +00:00
Emmanuele Bassi
939a466f4a Fix the english of the comment; remove some type checking; use better
2007-02-10  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c: Fix the english of the comment;
	remove some type checking; use better variable naming for the
	internal menu item markers.

svn path=/trunk/; revision=17284
2007-02-10 12:14:39 +00:00
Emmanuele Bassi
4a559d6ec8 Add support for both prepending and appending custom menu items.
2007-02-09  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c: Add support for both prepending
	and appending custom menu items.

	(gtk_recent_chooser_menu_constructor): Add a placeholder menu
	item for the empty menu case, and for giving us a starting
	point for the recent items populating process.

	(gtk_recent_chooser_menu_insert_item),
	(gtk_recent_chooser_menu_dispose_items): Insert an item at
	the position following the placeholder (and find that position
	if needed).

	(idle_populate_func), (idle_populate_clean_up): Show the
	placeholder menu item, instead of creating one each time.

	(gtk_recent_chooser_menu_populate): Kill some indirections
	and hide the placeholder before populating the menu.

	(set_recent_manager): Remember to remove the idle population
	source if the manager changes.

	* tests/testrecentchoosermenu.c: Test the appending and
	prepending of the menu items to the recent chooser menu
	widget.

svn path=/trunk/; revision=17281
2007-02-09 14:24:19 +00:00
Emmanuele Bassi
ada1782221 Keep count of the displayed items to build the menu items mnemonic instead
2007-02-08  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c (idle_populate_func): Keep count
	of the displayed items to build the menu items mnemonic instead
	of the overall item count. (#377164)

	(idle_populate_clean_up): Append a menu item if all the items
	got filtered in the idle populate function. (#405696)

svn path=/trunk/; revision=17277
2007-02-08 14:22:20 +00:00
Emmanuele Bassi
cd87d06cf7 Ellipsize the menu items label if they grow too much. (#357303)
2007-01-15  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c: Ellipsize the menu items label
	if they grow too much. (#357303)

svn path=/trunk/; revision=17156
2007-01-15 12:44:28 +00:00
Emmanuele Bassi
5169423a9b Don't leak the icon pixbuf after setting it to the image menu item. Found
2007-01-08  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c (gtk_recent_chooser_menu_create_item):
	Don't leak the icon pixbuf after setting it to the image menu
	item.  Found by Paolo Borelli.

svn path=/trunk/; revision=17119
2007-01-08 16:47:19 +00:00
Emmanuele Bassi
2e372626d7 Use the right object when disconnecting from the GtkRecentManager::changed
2006-12-31  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c (set_recent_manager): Use the
	right object when disconnecting from the GtkRecentManager::changed
	signal; save us a few indirections using a variable.

svn path=/trunk/; revision=16999
2006-12-31 16:54:56 +00:00
Emmanuele Bassi
ccd897d2fc Move the signal and idle disconnections into the dispose function, as well
2006-12-31  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c: Move the signal and idle
	disconnections into the dispose function, as well as the
	object unrefs; reset every handler id and the
	pointers. (suggested by Paolo Borelli, #390873)

svn path=/trunk/; revision=16997
2006-12-31 16:35:00 +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
Emmanuele Bassi
ade821a03e Apply the tip only if we have a displayable name for the item. (#365031,
2006-11-16  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c:
	(gtk_recent_chooser_menu_add_tip): Apply the tip only
	if we have a displayable name for the item. (#365031,
	patch by padraig.obriain(at)sun.com)
2006-11-16 10:10:44 +00:00
Emmanuele Bassi
cbf6d898fb Provide a fast path returning NULL when the limit is set to 0.
2006-11-16  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentmanager.c: Provide a fast path returning
	NULL when the limit is set to 0.

	* gtk/gtkrecentchooserdefault.c:
	* gtk/gtkrecentchoosermenu.c: Add the same fast path
	inside the RecentChooser implementation; add a check
	in the list clamping code. (#373466 and duplicates)
2006-11-16 09:57:45 +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
Emmanuele Bassi
22add3e02b Break when an item is found and activated. (#353449, based on a patch by
2006-08-29  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c
	(gtk_recent_chooser_menu_set_current_item): Break when an item
	is found and activated. (#353449, based on a patch by Jan Arne
	Petersen)
2006-08-29 18:38:59 +00:00
Matthias Clasen
90c4ee8643 initialize a variable 2006-08-18 02:41:52 +00:00
Emmanuele Bassi
e4f6c9d4d0 Add a check on the filter argument, instead of blindly passing it to
2006-08-14  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchooser.c:
	(gtk_recent_chooser_add_filter),
	(gtk_recent_chooser_remove_filter),
	(gtk_recent_chooser_set_filter): Add a check on the
	filter argument, instead of blindly passing it to
	underlying implementation.

	* gtk/gtkrecentchoosermenu.c:
	(gtk_recent_chooser_menu_add_filter),
	(gtk_recent_chooser_menu_remove_filter),
	(gtk_recent_chooser_menu_list_filters): Implement
	these GtkRecentChooser methods, by setting and
	returning the only GtkRecentFilter object supported
	by a GtkRecentChooserMenu. (#347856, reported by Rod
	Butcher)
2006-08-14 20:58:21 +00:00
Emmanuele Bassi
490bdc1ddd Remove the idle source in ::finalize...
2006-08-10  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c:
	(gtk_recent_chooser_menu_finalize): Remove the idle
	source in ::finalize...

	(idle_populate_func),
	(idle_populate_clean_up): ...and reset the idle source
	id at the end of the idle loop while we hold the GDK mutex
	lock. (#350605, reported by Wouter Bolsterlee, patch by
	Chris Wilson)
2006-08-10 12:08:51 +00:00
Emmanuele Bassi
9dd4f220fe Show non existing resources by default. (recent_meta_data_func): Do not
2006-08-07  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchooserdefault.c:
	(_gtk_recent_chooser_default_init): Show non existing
	resources by default.
	(recent_meta_data_func): Do not mark non existing
	resources as insensitive.

	* gtk/gtkrecentchoosermenu.c:
	(gtk_recent_chooser_menu_init): Show non existing
	resources by default.
	(gtk_recent_chooser_menu_create_item): Do not mark
	non existing resources as insensitive.
2006-08-06 23:44:46 +00:00
Emmanuele Bassi
cace1bce28 Lazily populate the menu when creating it and after the manager emits the
2006-08-03  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c:
	(set_recent_managet), (gtk_recent_chooser_menu_populate),
	(idle_populate_func), (idle_populate_clean_up),
	(manager_changed_cb): Lazily populate the menu when creating
	it and after the manager emits the "changed" signal; this
	fixes the initial bad placing of the GtkRecentChooserMenu
	widget when its set as the menu of a GtkMenuToolButton.

	(gtk_recent_chooser_menu_map),
	(gtk_recent_chooser_menu_class_init): Remove the ::map method
	override, since it's not needed anymore.
2006-08-03 20:26:31 +00:00
Michael Natterer
bdacdff192 fix typo to make it compile again.
2006-07-20  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkrecentchoosermenu.c (gtk_recent_chooser_menu_finalize):
	fix typo to make it compile again.
2006-07-20 10:32:23 +00:00
Emmanuele Bassi
dc095c0b88 Correctly chain up the finalization vfunc. (#348089, Chris Wilson)
2006-07-20  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c:
	(gtk_recent_chooser_menu_finalize): Correctly chain up the
	finalization vfunc. (#348089, Chris Wilson)
2006-07-20 08:09:59 +00:00
Matthias Clasen
f8794cccca Improve consistency of signal and property names 2006-07-06 05:14:03 +00:00
Emmanuele Bassi
adb725eadc Do not leak the groups string vector. (#344607, John Finlay)
2006-06-11  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchooserdefault.c
	(get_is_recent_filtered):
	* gtk/gtkrecentchoosermenu.c
	(get_is_recent_filtered):
	Do not leak the groups string vector. (#344607,
	John Finlay)
2006-06-11 20:47:43 +00:00
Matthias Clasen
3eb71f1fdd Allow NULL to mean the default manager. (#344530, John Finlay)
2006-06-10  Matthias Clasen <mclasen@redhat.com>

        * gtk/gtkrecentchooserwidget.c
        (gtk_recent_chooser_widget_new_for_manager):
        * gtk/gtkrecentchoosermenu.c
        (gtk_recent_chooser_menu_new_for_manager):
        Allow NULL to mean the default manager.  (#344530,
        John Finlay)
2006-06-11 03:13:50 +00:00
Matthias Clasen
a208b8b2a6 avoid some trivial differences in translated strings 2006-05-28 02:55:51 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Behdad Esfahbod
0ef457c730 Add missing break. (#336769, Morten Welinder)
2006-03-31  Behdad Esfahbod  <behdad@gnome.org>

        * gtk/gtkrecentchoosermenu.c (gtk_recent_chooser_menu_get_property):
        Add missing break. (#336769, Morten Welinder)
2006-04-01 00:28:27 +00:00
Matthias Clasen
8910e9333d Fix some symbol aliasing glitches 2006-03-29 21:08:06 +00:00
Emmanuele Bassi
58caa5c095 Make gtkalias.h the last included file.
2006-03-29  Emmanuele Bassi  <ebassi@cvs.gnome.org>

	* gtk/gtkrecentchoosermenu.c: Make gtkalias.h the last included file.
2006-03-29 21:01:36 +00:00
Emmanuele Bassi
056f6db533 Import GtkRecent* from libegg.
2006-03-29  Emmanuele Bassi  <ebassi@cvs.gnome.org>

	Import GtkRecent* from libegg.

	* gtk/gtkrecentmanager.[ch]: Add GtkRecentManager, an object
	for managing a list of recently used resources.

	* gtk/gtkrecentchooser.[ch]:
	* gtk/gtkrecentchooserdefault.[ch]:
	* gtk/gtkrecentchooserdialog.[ch]:
	* gtk/gtkrecentchoosermenu.[ch]:
	* gtk/gtkrecentchooserprivate.h:
	* gtk/gtkrecentchooserutils.[ch]:
	* gtk/gtkrecentchooserwidget.[ch]: Add GtkRecentChooser, a
	GTypeInterface for widgets implementing viewers for recently
	used resources.

	* gtk/gtkrecentfilter.[ch]: GtkRecentFilter, a filter object
	for GtkRecentChooser implementations.

	* gtk/gtk.h:
	* gtk/gtk.symbols:
	* gtk/Makefile.am: Build glue for GtkRecent*.
2006-03-29 20:16:44 +00:00