[yelp/gdbus: 85/86] Merge branch 'master' into gdbus



commit bff85a2245cf505195d5c26b9617251f9f26365e
Merge: c75080d aa2d430
Author: Shaun McCance <shaunm gnome org>
Date:   Wed Jun 16 14:33:58 2010 -0500

    Merge branch 'master' into gdbus

 NEWS                                          |   50 ++
 configure.ac                                  |   17 +-
 data/Makefile.am                              |   11 +-
 data/org.gnome.yelp.gschema.xml               |    5 +-
 libyelp/Makefile.am                           |    6 +-
 libyelp/yelp-docbook-document.c               |   26 +-
 libyelp/yelp-document.c                       |   89 ++-
 libyelp/yelp-info-document.h                  |    1 -
 libyelp/yelp-info-parser.c                    |    5 -
 libyelp/yelp-location-entry.h                 |    2 +
 libyelp/yelp-mallard-document.c               |   92 ++--
 libyelp/yelp-man-document.c                   |  506 +++++++++++++
 libyelp/yelp-man-document.h                   |   51 ++
 {src => libyelp}/yelp-man-parser.c            |  159 ++---
 {src => libyelp}/yelp-man-parser.h            |    4 +-
 libyelp/yelp-settings.c                       |   46 +-
 libyelp/yelp-simple-document.c                |   44 +-
 libyelp/yelp-uri.c                            |  253 +++++--
 libyelp/yelp-uri.h                            |    2 +
 libyelp/yelp-view.c                           |  729 ++++++++++++++++++-
 libyelp/yelp-view.h                           |   29 +-
 po/ChangeLog                                  |    4 +
 po/POTFILES.in                                |    1 +
 po/POTFILES.skip                              |    1 -
 po/de.po                                      |  703 ++++++++----------
 po/es.po                                      |  313 +++++---
 po/et.po                                      |  943 ++++++++++++++----------
 po/gl.po                                      |  271 ++++---
 po/he.po                                      |  975 +++++++++++--------------
 po/nb.po                                      |  575 ++++++---------
 po/or.po                                      |  845 ++++++++--------------
 po/sl.po                                      |  221 ++++---
 po/zh_CN.po                                   |  899 ++++++++---------------
 src/yelp-application.c                        |  188 +++++-
 src/yelp-application.h                        |   41 +-
 src/yelp-man.c                                |  490 -------------
 src/yelp-man.h                                |   53 --
 src/yelp-toc.c                                |    2 +-
 src/yelp-window.c                             |  675 ++++++++++++++++-
 stylesheets/Makefile.am                       |    1 +
 stylesheets/db2html.xsl.in                    |   49 --
 stylesheets/info2html.xsl.in                  |  173 ++---
 stylesheets/mal2html.xsl.in                   |   36 +-
 stylesheets/{man2html.xsl => man2html.xsl.in} |  193 ++---
 stylesheets/yelp-common.xsl.in                |   64 ++-
 tests/test-uri.c                              |    4 +-
 46 files changed, 5525 insertions(+), 4322 deletions(-)
---
diff --cc src/yelp-application.c
index 3a6679c,4ce1ae6..6339f37
--- a/src/yelp-application.c
+++ b/src/yelp-application.c
@@@ -645,34 -704,79 +739,106 @@@ yelp_application_get_bookmarks (YelpApp
      return g_settings_get_value (settings, "bookmarks");
  }
  
 +static void
 +packages_installed (GDBusConnection *connection,
 +                    GAsyncResult *res,
 +                    YelpApplication *app)
 +{
 +    GError *error = NULL;
 +    g_dbus_connection_invoke_method_finish (connection, res, &error);
 +    if (error) {
 +        const gchar *err = NULL;
 +        if (error->domain == G_DBUS_ERROR) {
 +            if (error->code == G_DBUS_ERROR_SERVICE_UNKNOWN)
 +                err = _("You do not have PackageKit installed.  Package installation links require PackageKit.");
 +            else
 +                err = error->message;
 +        }
 +        if (err != NULL) {
 +            GtkWidget *dialog = gtk_message_dialog_new (NULL, 0,
 +                                                        GTK_MESSAGE_ERROR,
 +                                                        GTK_BUTTONS_CLOSE,
 +                                                        "%s", err);
 +            gtk_dialog_run ((GtkDialog *) dialog);
 +            gtk_widget_destroy (dialog);
 +        }
 +        g_error_free (error);
 +    }
 +}
 +
  void
+ yelp_application_add_read_later (YelpApplication   *app,
+                                  const gchar       *doc_uri,
+                                  const gchar       *full_uri,
+                                  const gchar       *title)
+ {
+     GSettings *settings;
+ 
+     settings = application_get_doc_settings (app, doc_uri);
+ 
+     if (settings) {
+         GVariantBuilder builder;
+         GVariantIter *iter;
+         gchar *this_uri, *this_title;
+         gboolean broken = FALSE;
+         g_settings_get (settings, "readlater", "a(ss)", &iter);
+         g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ss)"));
+         while (g_variant_iter_loop (iter, "(&s&s)", &this_uri, &this_title)) {
+             if (g_str_equal (full_uri, this_uri)) {
+                 /* Already have this link */
+                 broken = TRUE;
+                 break;
+             }
+             g_variant_builder_add (&builder, "(ss)", this_uri, this_title);
+         }
+         g_variant_iter_free (iter);
+ 
+         if (!broken) {
+             GVariant *value;
+             g_variant_builder_add (&builder, "(ss)", full_uri, title);
+             value = g_variant_builder_end (&builder);
+             g_settings_set_value (settings, "readlater", value);
+             g_signal_emit (app, signals[READ_LATER_CHANGED], 0, doc_uri);
+         }
+     }
+ }
+ 
+ void
+ yelp_application_remove_read_later (YelpApplication *app,
+                                     const gchar     *doc_uri,
+                                     const gchar     *full_uri)
+ {
+     GSettings *settings;
+ 
+     settings = application_get_doc_settings (app, doc_uri);
+ 
+     if (settings) {
+         GVariantBuilder builder;
+         GVariantIter *iter;
+         gchar *this_uri, *this_title;
+         g_settings_get (settings, "readlater", "a(ss)", &iter);
+         g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ss)"));
+         while (g_variant_iter_loop (iter, "(&s&s)", &this_uri, &this_title)) {
+             if (!g_str_equal (this_uri, full_uri))
+                 g_variant_builder_add (&builder, "(ss)", this_uri, this_title);
+         }
+         g_variant_iter_free (iter);
+ 
+         g_settings_set_value (settings, "readlater", g_variant_builder_end (&builder));
+         g_signal_emit (app, signals[READ_LATER_CHANGED], 0, doc_uri);
+     }
+ }
+ 
+ GVariant *
+ yelp_application_get_read_later (YelpApplication *app,
+                                  const gchar     *doc_uri)
+ {
+     GSettings *settings = application_get_doc_settings (app, doc_uri);
+ 
+     return g_settings_get_value (settings, "readlater");
+ }
+ 
+ void
  yelp_application_install_package (YelpApplication  *app,
                                    const gchar      *pkg,
                                    const gchar      *alt)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]