Started support for WATC on provider
authorSimón Pena <spenap@gmail.com>
Sun, 20 Jun 2010 16:46:17 +0000 (18:46 +0200)
committerSimón Pena <spenap@gmail.com>
Sun, 20 Jun 2010 16:46:17 +0000 (18:46 +0200)
* Updated Makefile.am to generate signal's marshal
* Included signal's marshal (string + pointer)
* Updated signal to send interface and object path
* Updated xml interface to reflect the signal change
* Updated tmdb-movie to use another dbus interface
* Updated moviemanager to receive the interface

src/Makefile.am
src/marshal.list [new file with mode: 0644]
src/mvs-minfo-provider-service.c
src/mvs-minfo-provider.xml
src/mvs-tmdb-movie.xml
ui/maeviesui/util/moviemanager.py

index 94e9ace..b568481 100644 (file)
@@ -25,7 +25,9 @@ maevies_service_SOURCES = \
        mvs-watc-movie.h \
        mvs-tmdb-movie-service.c \
        mvs-tmdb-movie-service.h \
-       mvs-tmdb-movie-service-glue.h
+       mvs-tmdb-movie-service-glue.h \
+       mvs-marshal.c \
+       mvs-marshal.h
 
 maevies_service_CFLAGS = \
        $(DEPS_CFLAGS)
@@ -43,8 +45,16 @@ mvs-minfo-provider-service-glue.h: mvs-minfo-provider.xml
 mvs-tmdb-movie-service-glue.h: mvs-tmdb-movie.xml
        dbus-binding-tool --mode=glib-server --prefix=mvs_tmdb_movie_service $< > $@
 
+mvs-marshal.h: marshal.list
+       glib-genmarshal --header --prefix=mvs_marshal $< > $@
+
+mvs-marshal.c: marshal.list
+       glib-genmarshal --body --prefix=mvs_marshal $< > $@
+
 DISTCLEANFILES = $(MAINTAINERCLEANFILES)
 
 BUILT_SOURCES =                        \
        mvs-minfo-provider-service-glue.h \
-       mvs-tmdb-movie-service-glue.h
\ No newline at end of file
+       mvs-tmdb-movie-service-glue.h \
+       mvs-marshal.h \
+       mvs-marshal.c
\ No newline at end of file
diff --git a/src/marshal.list b/src/marshal.list
new file mode 100644 (file)
index 0000000..b4ae674
--- /dev/null
@@ -0,0 +1 @@
+VOID:STRING,POINTER
index 5066470..56a3e38 100644 (file)
 #include "mvs-minfo-provider.h"
 #include "mvs-tmdb-movie-service.h"
 #include "mvs-tmdb-movie.h"
+#include "mvs-marshal.h"
 
 #define MINFO_PROVIDER_SERVICE_OBJECT_PATH "/MInfoProvider"
 #define MINFO_PROVIDER_SERVICE_NAME "com.simonpena.maevies.minfoprovider"
+#define TMDB_MOVIE_INTERFACE "com.simonpena.maevies.tmdbmovie"
 
 G_DEFINE_TYPE (MvsMInfoProviderService, mvs_minfo_provider_service, G_TYPE_OBJECT)
 
@@ -71,6 +73,7 @@ response_received_cb (MvsMInfoProvider *provider, GList *list,
         GError *error = NULL;
         GList *iter = NULL;
         gchar  **object_paths= g_new0 (gchar*, g_list_length (list) + 1);
+        gchar *movie_interface = g_strdup (TMDB_MOVIE_INTERFACE);
         guint i = 0;
 
         for (iter = list; iter; iter = iter->next) {
@@ -90,8 +93,10 @@ response_received_cb (MvsMInfoProvider *provider, GList *list,
         }
         object_paths[i] = NULL;
 
-        g_signal_emit (self, mvs_minfo_provider_service_signals[RESPONSE_RECEIVED], 0, object_paths);
+        g_signal_emit (self, mvs_minfo_provider_service_signals[RESPONSE_RECEIVED],
+                       0, movie_interface, object_paths);
         g_strfreev (object_paths);
+        g_free (movie_interface);
         self->priv->search_id++;
 }
 
@@ -183,9 +188,10 @@ mvs_minfo_provider_service_class_init (MvsMInfoProviderServiceClass *klass)
                          0,
                          NULL,
                          NULL,
-                         g_cclosure_marshal_VOID__POINTER,
+                         mvs_marshal_VOID__STRING_POINTER,
                          G_TYPE_NONE,
-                         1,
+                         2,
+                         G_TYPE_STRING,
                          G_TYPE_STRV,
                          NULL);
 }
index df1123f..18c1229 100644 (file)
@@ -9,6 +9,7 @@
                        <arg type="s" name="SearchTerms" />
                </method>
                <signal name="ResponseReceived">
+                       <arg type="s" name="Interface" />
                        <arg type="as" name="Results" />
                </signal>
        </interface>
index bcc124c..175892d 100644 (file)
@@ -3,7 +3,7 @@
          "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
          "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
 <node name="/">
-       <interface name="com.simonpena.maevies.movie">
+       <interface name="com.simonpena.maevies.tmdbmovie">
                <method name="GetTitle">
                        <arg type="s" name="Title" direction="out" />
                </method>
index bee0472..3879fe0 100644 (file)
@@ -29,7 +29,7 @@ glib.init_threads()
 
 MINFO_PROVIDER_INTERFACE = 'com.simonpena.maevies.minfoprovider'
 MINFO_PROVIDER_BUS_NAME = 'com.simonpena.maevies.minfoprovider'
-TMDB_MOVIE_INTERFACE = 'com.simonpena.maevies.movie'
+TMDB_MOVIE_INTERFACE = 'com.simonpena.maevies.tmdbmovie'
 TMDB_MOVIE_BUS_NAME = 'com.simonpena.maevies.tmdbmovie'
 TMDB = 0
 WATC = 1
@@ -63,7 +63,7 @@ class MovieManager:
         except DBusException:
             self._on_response_received([])
 
-    def _on_response_received(self, object_paths):
+    def _on_response_received(self, interface, object_paths):
         movies = []
         for path in object_paths:
             movies.append(MovieProxy(self._bus, path))