|
From: <me...@us...> - 2007-10-25 17:43:18
|
Revision: 878
http://gmyth.svn.sourceforge.net/gmyth/?rev=878&view=rev
Author: melunko
Date: 2007-10-25 10:43:23 -0700 (Thu, 25 Oct 2007)
Log Message:
-----------
Added gmyth-dbus/debian files for package generation
Added Paths:
-----------
trunk/gmyth-dbus/debian/
trunk/gmyth-dbus/debian/changelog
trunk/gmyth-dbus/debian/compat
trunk/gmyth-dbus/debian/control
trunk/gmyth-dbus/debian/rules
Added: trunk/gmyth-dbus/debian/changelog
===================================================================
--- trunk/gmyth-dbus/debian/changelog (rev 0)
+++ trunk/gmyth-dbus/debian/changelog 2007-10-25 17:43:23 UTC (rev 878)
@@ -0,0 +1,6 @@
+gmyth-dbus (0.1) unstable; urgency=low
+
+ * Initial Package.
+
+ -- Hallyson Melo <hal...@in...> Fri, 25 Oct 2006 14:00:16 -0300
+
Added: trunk/gmyth-dbus/debian/compat
===================================================================
--- trunk/gmyth-dbus/debian/compat (rev 0)
+++ trunk/gmyth-dbus/debian/compat 2007-10-25 17:43:23 UTC (rev 878)
@@ -0,0 +1 @@
+4
Added: trunk/gmyth-dbus/debian/control
===================================================================
--- trunk/gmyth-dbus/debian/control (rev 0)
+++ trunk/gmyth-dbus/debian/control 2007-10-25 17:43:23 UTC (rev 878)
@@ -0,0 +1,13 @@
+Source: gmyth-dbus
+Priority: optional
+Maintainer: Hallyson Melo <hal...@in...>
+Build-Depends: debhelper (>= 4.0.0), autotools-dev, cdbs (>= 0.4.0), gmyth-dev (>= 0.4), libdbus-glib-1-dev
+Standards-Version: 3.6.2
+Section: user/library
+
+Package: gmyth-dbus
+Section: user/library
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, gmyth (>= 0.4), libdbus-glib-1-2
+Description: The gmyth dbus interface.
+
Added: trunk/gmyth-dbus/debian/rules
===================================================================
--- trunk/gmyth-dbus/debian/rules (rev 0)
+++ trunk/gmyth-dbus/debian/rules 2007-10-25 17:43:23 UTC (rev 878)
@@ -0,0 +1,20 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/rules/utils.mk
+
+# debian package version
+version=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
+
+maint: debian/control
+
+common_conf_flags = \
+ --disable-debug
+
+# FIXME: should disable docs for arch only builds
+DEB_CONFIGURE_EXTRA_FLAGS := $(common_conf_flags)
+
+
+.PHONY: maint
Property changes on: trunk/gmyth-dbus/debian/rules
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-10-29 19:56:36
|
Revision: 883
http://gmyth.svn.sourceforge.net/gmyth/?rev=883&view=rev
Author: renatofilho
Date: 2007-10-29 12:56:35 -0700 (Mon, 29 Oct 2007)
Log Message:
-----------
implemented error propagation
Modified Paths:
--------------
trunk/gmyth-dbus/debian/changelog
trunk/gmyth-dbus/src/gmyth-dbus-server.c
Modified: trunk/gmyth-dbus/debian/changelog
===================================================================
--- trunk/gmyth-dbus/debian/changelog 2007-10-26 22:03:22 UTC (rev 882)
+++ trunk/gmyth-dbus/debian/changelog 2007-10-29 19:56:35 UTC (rev 883)
@@ -1,3 +1,9 @@
+gmyth-dbus (0.1.1) unstable; urgency=low
+
+ * Implemented error propagation;
+
+ -- Hallyson Melo <hal...@in...> Fri, 29 Oct 2006 14:00:16 -0300
+
gmyth-dbus (0.1) unstable; urgency=low
* Initial Package.
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.c
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.c 2007-10-26 22:03:22 UTC (rev 882)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.c 2007-10-29 19:56:35 UTC (rev 883)
@@ -26,15 +26,31 @@
#endif
+#include <glib/gi18n.h>
#include <gmyth/gmyth.h>
#include <dbus/dbus-glib-bindings.h>
-
#include "gmyth-dbus-common.h"
#include "gmyth-dbus-server.h"
#define MYTH_DEFAULT_DB "mythconverg"
+enum
+{
+ GMYTH_DBUS_ERROR_MYTHTV,
+ GMYTH_DBUS_ERROR_CONNECTION,
+ GMYTH_DBUS_ERROR_EPG,
+ GMYTH_DBUS_ERROR_SCHEDULE
+};
+
+#define GMYTH_DBUS_ERROR gmyth_dbus_error_quark ()
+
+GQuark
+gmyth_dbus_error_quark (void)
+{
+ return g_quark_from_static_string ("gmyth-dbus-error-quark");
+}
+
typedef struct _GMythDbusServerPrivate GMythDbusServerPrivate;
struct _GMythDbusServerPrivate
@@ -83,10 +99,11 @@
gint channel_id,
const gchar *start_time,
const gchar *end_time,
- GPtrArray **program_list);
+ GPtrArray **program_list,
+ GError **error);
static gboolean gmyth_dbus_server_get_schedule_list (GObject *obj,
- GPtrArray **schedule_list);
-
+ GPtrArray **schedule_list,
+ GError **error);
static gboolean gmyth_dbus_server_connected (GObject *obj,
gboolean *status,
GError **error);
@@ -168,13 +185,20 @@
}
static gboolean
-gmyth_dbus_server_connect_epg (GMythDbusServer *server)
+gmyth_dbus_server_connect_epg (GMythDbusServer *server, GError **error)
{
GMythDbusServerPrivate *priv;
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
if (!priv->connected)
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_CONNECTION,
+ _("Not connected"));
+
return FALSE;
+ }
if (!priv->myth_epg)
{
@@ -183,6 +207,12 @@
{
g_object_unref (priv->myth_epg);
priv->myth_epg = NULL;
+
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_EPG,
+ _("Fail to connect with EPG"));
+
return FALSE;
}
}
@@ -191,13 +221,21 @@
}
static gboolean
-gmyth_dbus_server_connect_scheduler (GMythDbusServer *server)
+gmyth_dbus_server_connect_scheduler (GMythDbusServer *server,
+ GError **error)
{
GMythDbusServerPrivate *priv;
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
if (!priv->connected)
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_CONNECTION,
+ _("Not connected"));
+
return FALSE;
+ }
if (!priv->myth_scheduler)
{
@@ -207,6 +245,12 @@
{
g_object_unref (priv->myth_scheduler);
priv->myth_scheduler = NULL;
+
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_SCHEDULE,
+ _("Fail to connect with Schedule"));
+
return FALSE;
}
}
@@ -230,7 +274,7 @@
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
- if (priv->myth_backend)
+ if (priv->connected)
{
gmyth_dbus_server_disconnect (obj, NULL);
}
@@ -249,10 +293,14 @@
}
else
{
- g_debug ("FAIL TO CONNECT");
g_object_unref (priv->myth_backend);
priv->myth_backend = NULL;
*result = FALSE;
+
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_CONNECTION,
+ _("Fail to connect with backend"));
}
priv->connected = *result;
@@ -329,6 +377,16 @@
socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
+ if (!socket)
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("MythTv not avaliable"));
+ return FALSE;
+
+ }
+
details = NULL;
gmyth_util_get_backend_details (socket,
&details);
@@ -341,6 +399,13 @@
ret = TRUE;
}
+ else
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("Fail to get MythTv details"));
+ }
g_object_unref (socket);
@@ -375,8 +440,10 @@
g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
- if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj), error))
+ {
return FALSE;
+ }
ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
@@ -391,6 +458,13 @@
*info = g_value_get_boxed (&v);
return TRUE;
}
+ else
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_EPG,
+ _("no channel info avaliable"));
+ }
return FALSE;
}
@@ -411,7 +485,7 @@
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
- if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
@@ -460,7 +534,8 @@
gint channel_id,
const gchar *start_time,
const gchar *end_time,
- GPtrArray **programs)
+ GPtrArray **programs,
+ GError **error)
{
GList *list;
GList *walk;
@@ -474,7 +549,7 @@
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
g_return_val_if_fail (priv->myth_backend, FALSE);
- if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
g_time_val_from_iso8601 (start_time, &start_time_val);
@@ -574,7 +649,7 @@
g_return_val_if_fail (priv->myth_backend, FALSE);
- if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
record_type = GMYTH_DBUS_RECORD_G_TYPE;
@@ -597,7 +672,15 @@
return TRUE;
}
+ else
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_EPG,
+ _("no record info avaliable"));
+ }
+
return FALSE;
}
@@ -617,7 +700,7 @@
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
- if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
@@ -652,7 +735,8 @@
static gboolean
gmyth_dbus_server_get_schedule_list (GObject *obj,
- GPtrArray **schedules)
+ GPtrArray **schedules,
+ GError **error)
{
GList *list;
GList *walk;
@@ -664,7 +748,7 @@
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
g_return_val_if_fail (priv->myth_backend, FALSE);
- if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
@@ -733,12 +817,25 @@
g_return_val_if_fail (priv->myth_backend, FALSE);
if (!gmyth_util_file_exists (priv->myth_backend, uri))
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("File not exists"));
+
goto fail;
+ }
file_transfer = gmyth_file_transfer_new (priv->myth_backend);
if (!gmyth_file_transfer_open (file_transfer, uri))
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("Fail to open file"));
goto fail;
+ }
filesize = gmyth_file_transfer_get_filesize (file_transfer);
if (filesize <= 0)
@@ -747,13 +844,27 @@
*image = g_byte_array_new ();
result = gmyth_file_transfer_read (file_transfer, *image, filesize, FALSE);
if (result == GMYTH_FILE_READ_ERROR)
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("Fail to read file"));
+
goto fail;
+ }
gmyth_file_transfer_close (file_transfer);
g_object_unref (file_transfer);
if (filesize > (*image)->len)
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("Empty file"));
+
goto fail;
+ }
return TRUE;
@@ -785,12 +896,23 @@
*icon = NULL;
if (channel == NULL)
+ {
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("Invalid channel"));
+
return FALSE;
+ }
if (!gmyth_epg_channel_has_icon(priv->myth_epg, channel))
{
gmyth_channel_info_free (channel);
- g_debug("Channel does not have icon available");
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("Channel does not have icon available"));
+
return FALSE;
}
@@ -802,7 +924,11 @@
&icon_length))
{
gmyth_channel_info_free (channel);
- g_warning("Could not get channel icon for channel id = %u", channel_id);
+ g_set_error (error,
+ GMYTH_DBUS_ERROR,
+ GMYTH_DBUS_ERROR_MYTHTV,
+ _("Could not get channel icon for channel id = %u"),
+ channel_id);
return FALSE;
}
@@ -828,7 +954,7 @@
priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
g_return_val_if_fail (priv->myth_backend, FALSE);
- if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
ret = gmyth_scheduler_stop_recording (priv->myth_scheduler,
@@ -893,7 +1019,7 @@
g_return_val_if_fail (priv->myth_backend, FALSE);
- if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
@@ -980,7 +1106,7 @@
g_return_val_if_fail (priv->myth_backend, FALSE);
- if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
g_time_val_from_iso8601 (start_time, &start_vtime);
@@ -1020,7 +1146,7 @@
g_return_val_if_fail (priv->myth_backend, FALSE);
- if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)))
+ if (!gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj), error))
return FALSE;
return gmyth_scheduler_delete_schedule (priv->myth_scheduler, schedule_id);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2008-02-01 13:38:22
|
Revision: 910
http://gmyth.svn.sourceforge.net/gmyth/?rev=910&view=rev
Author: melunko
Date: 2008-02-01 05:38:20 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
fixed dbus xml interface bug for add_exception function
Modified Paths:
--------------
trunk/gmyth-dbus/debian/changelog
trunk/gmyth-dbus/src/gmyth-dbus-server.c
trunk/gmyth-dbus/src/gmyth-dbus-server.xml
Modified: trunk/gmyth-dbus/debian/changelog
===================================================================
--- trunk/gmyth-dbus/debian/changelog 2008-01-31 20:02:39 UTC (rev 909)
+++ trunk/gmyth-dbus/debian/changelog 2008-02-01 13:38:20 UTC (rev 910)
@@ -1,3 +1,9 @@
+gmyth-dbus (0.1.4) unstable; urgency=low
+
+ * Fixed dbus interface bug for add_exception function.
+
+ -- Hallyson <hal...@nd...> Fri, 01 Feb 2008 10:35:55 -0300
+
gmyth-dbus (0.1.3) unstable; urgency=low
* updated to gmyth 0.6;
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.c
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.c 2008-01-31 20:02:39 UTC (rev 909)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.c 2008-02-01 13:38:20 UTC (rev 910)
@@ -82,7 +82,7 @@
/* Dbus */
static gboolean gmyth_dbus_server_connect (GObject *obj,
const gchar *host,
- guint port,
+ gint port,
const gchar *user,
const gchar *password,
GError **error);
@@ -139,7 +139,7 @@
gboolean *result,
GError **error);
static gboolean gmyth_dbus_server_add_schedule (GObject *obj,
- guint channel_id,
+ gint channel_id,
const gchar *program_id,
const gchar *start_time,
const gchar *end_time,
@@ -149,7 +149,7 @@
GError **error);
static gboolean gmyth_dbus_server_add_exception (GObject *obj,
guint schedule_id,
- guint channel_id,
+ gint channel_id,
const gchar *program_id,
const gchar *start_time,
const gchar *end_time,
@@ -290,7 +290,7 @@
static gboolean
gmyth_dbus_server_connect (GObject *obj,
const gchar *host,
- guint port,
+ gint port,
const gchar *user,
const gchar *password,
GError **error)
@@ -1046,7 +1046,7 @@
static gboolean
gmyth_dbus_server_add_schedule (GObject *obj,
- guint channel_id,
+ gint channel_id,
const gchar *program_id,
const gchar *start_time,
const gchar *end_time,
@@ -1073,14 +1073,13 @@
g_time_val_from_iso8601 (start_time, &start_vtime);
g_time_val_from_iso8601 (end_time, &end_vtime);
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
+
sch_info = gmyth_dbus_server_new_schedule_info (description,
channel_id,
program_id,
&start_vtime,
&end_vtime);
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
if (sch_info != NULL) {
GMythScheduleType type;
GTimeVal t_now;
@@ -1092,20 +1091,17 @@
g_get_current_time (&t_now);
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler,
channel_id,
(time_t) start_vtime.tv_sec);
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
if ((t_now.tv_sec >= start_vtime.tv_sec)
&& (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
{
GMythSocket *socket;
gboolean res = FALSE;
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
channel_id,
@@ -1113,21 +1109,17 @@
if (res) {
GMythStringList *slist = gmyth_string_list_new();
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
gmyth_socket_sendreceive_stringlist(socket, slist);
res = (gmyth_string_list_get_int(slist, 0) == 1);
g_object_unref(slist);
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
}
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
g_object_unref(socket);
return res;
}
else
{
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
sch_info,
type))
@@ -1136,11 +1128,8 @@
return FALSE;
}
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
(*schedule_id) = sch_info->schedule_id;
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
gmyth_schedule_info_free (sch_info);
- g_debug ("%s:%d", __FUNCTION__, __LINE__);
return TRUE;
}
}
@@ -1150,7 +1139,7 @@
static gboolean
gmyth_dbus_server_add_exception (GObject *obj,
guint schedule_id,
- guint channel_id,
+ gint channel_id,
const gchar *program_id,
const gchar *start_time,
const gchar *end_time,
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.xml
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.xml 2008-01-31 20:02:39 UTC (rev 909)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.xml 2008-02-01 13:38:20 UTC (rev 910)
@@ -84,8 +84,8 @@
<method name="AddException">
<arg type="u" name="schedule_id" direction="in" />
+ <arg type="i" name="channel_id" direction="in" />
<arg type="s" name="program_id" direction="in" />
- <arg type="i" name="channel_id" direction="in" />
<arg type="s" name="start_time" direction="in" />
<arg type="s" name="end_time" direction="in" />
<arg type="s" name="description" direction="in" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2008-02-08 00:03:03
|
Revision: 922
http://gmyth.svn.sourceforge.net/gmyth/?rev=922&view=rev
Author: melunko
Date: 2008-02-07 16:03:03 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Added method to check mythtv backend connection
Modified Paths:
--------------
trunk/gmyth-dbus/configure.ac
trunk/gmyth-dbus/src/gmyth-dbus-server.c
trunk/gmyth-dbus/src/gmyth-dbus-server.xml
Modified: trunk/gmyth-dbus/configure.ac
===================================================================
--- trunk/gmyth-dbus/configure.ac 2008-02-07 19:36:22 UTC (rev 921)
+++ trunk/gmyth-dbus/configure.ac 2008-02-08 00:03:03 UTC (rev 922)
@@ -67,7 +67,7 @@
PKG_CHECK_MODULES(GMYTH, gmyth >= 0.7, HAVE_GMYTH=yes, HAVE_GMYTH=no)
if test "x$HAVE_GMYTH" = "xno"; then
- AC_MSG_ERROR(you need libgmyth-dev installed)
+ AC_MSG_ERROR(you need libgmyth-dev >= 0.7 installed)
fi
AC_SUBST(GMYTH_CFLAGS)
AC_SUBST(GMYTH_LIBS)
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.c
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.c 2008-02-07 19:36:22 UTC (rev 921)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.c 2008-02-08 00:03:03 UTC (rev 922)
@@ -92,7 +92,11 @@
const gchar *user,
const gchar *password,
GError **error);
-
+static gboolean
+gmyth_dbus_server_check_server_connection (GObject *obj,
+ const gchar *host,
+ gint port,
+ GError **error);
static gboolean gmyth_dbus_server_get_channel_list (GObject *obj,
GPtrArray **channels,
GError **error);
@@ -1313,6 +1317,32 @@
if (!ret) {
g_set_error (error, GMYTH_DBUS_ERROR, GMYTH_DBUS_ERROR_CONNECTION,
+ _("Fail to connect with backend database"));
+ }
+
+ return ret;
+}
+
+static gboolean
+gmyth_dbus_server_check_server_connection (GObject *obj,
+ const gchar *host,
+ gint port,
+ GError **error)
+{
+ GMythSocket *msocket = gmyth_socket_new ();
+ gboolean ret;
+
+ gmyth_debug ("");
+
+ g_debug ("Checking server connection");
+ ret = gmyth_socket_connect_with_timeout (msocket, host, port, 2);
+ g_debug ("Return %s", ret ? "ok" : "bad");
+ gmyth_socket_close_connection (msocket);
+
+ g_object_unref (msocket);
+
+ if (!ret) {
+ g_set_error (error, GMYTH_DBUS_ERROR, GMYTH_DBUS_ERROR_CONNECTION,
_("Fail to connect with backend"));
}
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.xml
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.xml 2008-02-07 19:36:22 UTC (rev 921)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.xml 2008-02-08 00:03:03 UTC (rev 922)
@@ -18,6 +18,11 @@
<arg type="s" name="password" direction="in" />
</method>
+ <method name="CheckServerConnection">
+ <arg type="s" name="host" direction="in" />
+ <arg type="i" name="port" direction="in" />
+ </method>
+
<method name="Connected">
<arg type="b" name="status" direction="out" />
</method>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|