mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
Update the error enum and the gtk_recent_manager_add and
2006-05-11 Emmanuele Bassi <ebassi@cvs.gnome.org> * gtk/tmpl/gtkrecentmanager.sgml: Update the error enum and the gtk_recent_manager_add and gtk_recent_manager_add_full parameters. * gtk/migrating-GtkRecentChooser.sgml: Mention gtk_recent_manager_get_default() and update the code examples.
This commit is contained in:
parent
f8cfd44ff8
commit
dc918cbf75
@ -1,3 +1,11 @@
|
||||
2006-05-11 Emmanuele Bassi <ebassi@cvs.gnome.org>
|
||||
|
||||
* gtk/tmpl/gtkrecentmanager.sgml: Update the error enum and the
|
||||
gtk_recent_manager_add and gtk_recent_manager_add_full parameters.
|
||||
|
||||
* gtk/migrating-GtkRecentChooser.sgml: Mention
|
||||
gtk_recent_manager_get_default() and update the code examples.
|
||||
|
||||
2006-05-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtk-sections.txt: Add gtk_message_dialog_set_image.
|
||||
|
@ -57,23 +57,23 @@
|
||||
you of changes inside the list.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Usually, instead of creating a new #GtkRecentManager each time you
|
||||
need it, you'll want to use the gtk_recent_manager_get_default()
|
||||
function.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To add a document to the list, you can use gtk_recent_manager_add_item(),
|
||||
like:
|
||||
<informalexample><programlisting>
|
||||
GtkRecentManager *manager;
|
||||
GError *error = NULL;
|
||||
|
||||
manager = gtk_recent_manager_new (<!-- -->);
|
||||
|
||||
gtk_recent_manager_add_item (manager, document_uri, &error);
|
||||
if (error)
|
||||
if (!gtk_recent_manager_add_item (manager, document_uri))
|
||||
{
|
||||
g_warning ("Unable to add '%s' to the list of recently used documents: %s\n",
|
||||
document_uri,
|
||||
error->message);
|
||||
|
||||
g_error_free (error);
|
||||
/* warn about the error */
|
||||
}
|
||||
|
||||
g_object_unref (manager);
|
||||
@ -85,7 +85,6 @@
|
||||
<informalexample><programlisting>
|
||||
GtkRecentManager *manager;
|
||||
GtkRecentData *recent_data;
|
||||
GError *error = NULL;
|
||||
|
||||
manager = gtk_recent_manager_new (<!-- -->);
|
||||
|
||||
@ -111,8 +110,7 @@
|
||||
*/
|
||||
recent_data-&app_exec = g_strjoin (" ", g_get_prgname (<!-- -->), "--open-file", "%u", NULL);
|
||||
|
||||
gtk_recent_manager_add_full (manager, document_uri, recent_data, &error);
|
||||
if (error)
|
||||
if (!gtk_recent_manager_add_full (manager, document_uri, recent_data))
|
||||
{
|
||||
/* warn about the error */
|
||||
}
|
||||
@ -130,8 +128,11 @@
|
||||
around, so you must remember to free the data inside the list and then
|
||||
the list itself when you are done using it:
|
||||
<informalexample><programlisting>
|
||||
GtkRecentManager *manager;
|
||||
GList *recent_items, *l;
|
||||
|
||||
manager = gtk_recent_manager_get_default(<!-- -->);
|
||||
|
||||
recent_items = gtk_recent_manager_get_items (manager);
|
||||
for (l = recent_items; l != NULL; l = l->next)
|
||||
{
|
||||
|
@ -29,15 +29,9 @@ file is as simple as:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
GtkRecentManager *manager;
|
||||
GError *error = NULL;
|
||||
|
||||
manager = gtk_recent_manager_get_default ();
|
||||
gtk_recent_manager_add_item (manager, file_uri, &error);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Could not add the file: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
gtk_recent_manager_add_item (manager, file_uri);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
||||
@ -129,7 +123,6 @@ The #GQuark used for #GtkRecentManagerError errors.
|
||||
@GTK_RECENT_MANAGER_ERROR_INVALID_MIME:
|
||||
@GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING:
|
||||
@GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED:
|
||||
@GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING:
|
||||
@GTK_RECENT_MANAGER_ERROR_READ:
|
||||
@GTK_RECENT_MANAGER_ERROR_WRITE:
|
||||
@GTK_RECENT_MANAGER_ERROR_UNKNOWN:
|
||||
@ -175,7 +168,6 @@ The #GQuark used for #GtkRecentManagerError errors.
|
||||
|
||||
@manager:
|
||||
@uri:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
@ -187,7 +179,6 @@ The #GQuark used for #GtkRecentManagerError errors.
|
||||
@manager:
|
||||
@uri:
|
||||
@recent_data:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user