[pulseaudio-commits] [SCM] PulseAudio Preferences Tool branch, master, updated. v0.9.9-2-gf7e2488

Colin Guthrie gitmailer-noreply at 0pointer.de
Sun Nov 29 04:15:41 PST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Preferences Tool" repository.

The master branch has been updated
      from  7d59faee21b2cad60245efc9461991e8c73e2e22 (commit)

- Log -----------------------------------------------------------------
f7e2488 Enable the PackageKit install buttons only when PackageKit is available
-----------------------------------------------------------------------

Summary of changes:
 src/paprefs.cc |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

-----------------------------------------------------------------------

commit f7e2488b33bf9177047e0239f73cc92dc6549903
Author: Christopher James Halse Rogers <raof at ubuntu.com>
Date:   Sun Nov 29 17:42:21 2009 +1100

    Enable the PackageKit install buttons only when PackageKit is available

diff --git a/src/paprefs.cc b/src/paprefs.cc
index f711e17..a45092c 100644
--- a/src/paprefs.cc
+++ b/src/paprefs.cc
@@ -28,6 +28,7 @@
 #include <gconfmm.h>
 #include <libintl.h>
 #include <dbus/dbus-glib.h>
+#include <dbus/dbus.h>
 #include <gdk/gdkx.h>
 
 #define PA_GCONF_ROOT "/system/pulseaudio"
@@ -92,6 +93,7 @@ public:
 
     void readFromGConf();
 
+    void checkForPackageKit();
     void checkForModules();
 
     void writeToGConfRemoteAccess();
@@ -108,6 +110,7 @@ public:
     void installFiles(const char *a, const char *b);
 
     bool
+        packageKitAvailable,
         rtpRecvAvailable,
         rtpSendAvailable,
         zeroconfPublishAvailable,
@@ -145,6 +148,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
     x->get_widget("rtpSpeakerRadioButton", rtpSpeakerRadioButton);
     x->get_widget("rtpNullSinkRadioButton", rtpNullSinkRadioButton);
 
+    checkForPackageKit();
     checkForModules();
 
     gconf = Gnome::Conf::Client::get_default_client();
@@ -288,7 +292,7 @@ void MainWindow::onChangeUpnp() {
 }
 
 void MainWindow::showInstallButton(Gtk::Button *button, bool available) {
-  if (available)
+  if (available || !packageKitAvailable)
     button->hide();
   else
     button->show();
@@ -629,6 +633,23 @@ void MainWindow::checkForModules() {
         g_find_program_in_path("rygel");
 }
 
+void MainWindow::checkForPackageKit() {
+
+    DBusError err;
+    dbus_error_init(&err);
+    DBusConnection *sessionBus = dbus_bus_get(DBUS_BUS_SESSION, &err);
+
+    if(dbus_error_is_set(&err)) {
+        g_warning("Error connecting to DBus: %s", err.message);
+        packageKitAvailable = FALSE;
+    } else {
+        packageKitAvailable = dbus_bus_name_has_owner(sessionBus, "org.freedesktop.PackageKit", NULL);
+        dbus_connection_unref(sessionBus);
+    }
+    dbus_error_free(&err);
+}
+
+
 int main(int argc, char *argv[]) {
 
     /* Initialize the i18n stuff */

-- 
hooks/post-receive
PulseAudio Preferences Tool



More information about the pulseaudio-commits mailing list