[maemo-commits] [maemo-commits] r11866 - projects/haf/trunk/hildon-fm/hildon-fm
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri May 25 17:26:10 EEST 2007
- Previous message: [maemo-commits] r11865 - in projects/haf/trunk/gtk+: . gtk
- Next message: [maemo-commits] r11867 - projects/haf/hafbuildbot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: marivoll
Date: 2007-05-25 17:26:08 +0300 (Fri, 25 May 2007)
New Revision: 11866
Modified:
projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c
Log:
* hildon-fm/hildon-file-selection.c (trigger_repair): New.
(repair_button_clicked): Call it.
Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c 2007-05-25 14:19:49 UTC (rev 11865)
+++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-selection.c 2007-05-25 14:26:08 UTC (rev 11866)
@@ -45,6 +45,8 @@
#include <stdlib.h>
#include <libintl.h>
+#include <dbus/dbus.h>
+
#include "hildon-file-selection.h"
#include <hildon/hildon-banner.h>
#include <hildon/hildon-defines.h>
@@ -2918,6 +2920,53 @@
}
static void
+trigger_repair (const char *device)
+{
+ DBusConnection *conn;
+ DBusMessage *message;
+ dbus_bool_t ret;
+
+ conn = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
+ if (conn == NULL)
+ {
+ ULOG_ERR_F("dbus_bus_get failed");
+ return;
+ }
+
+ message = dbus_message_new_method_call ("com.nokia.ke_recv",
+ "/com/nokia/ke_recv/repair_card",
+ "com.nokia.ke_recv",
+ "repair_card");
+ if (message == NULL)
+ {
+ ULOG_ERR_F("dbus_message_new_method_call failed");
+ return;
+ }
+
+ ret = dbus_message_append_args (message,
+ DBUS_TYPE_STRING, device,
+ DBUS_TYPE_STRING, "", /* label */
+ DBUS_TYPE_INVALID);
+
+ if (!ret)
+ {
+ ULOG_ERR_F("dbus_message_append_args failed");
+ dbus_message_unref(message);
+ return;
+ }
+
+ if (!dbus_connection_send(conn, message, NULL))
+ {
+ ULOG_ERR_F("dbus_connection_send failed");
+ dbus_message_unref(message);
+ return;
+ }
+
+ dbus_connection_flush(conn);
+ dbus_message_unref(message);
+}
+
+static void
repair_button_clicked (GtkWidget *button, HildonFileSelection *self)
{
HildonFileSelectionPrivate *priv = self->priv;
@@ -2928,17 +2977,20 @@
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
- char *uri, *extra;
+ char *uri, *device;
gtk_tree_model_get (model, &iter,
HILDON_FILE_SYSTEM_MODEL_COLUMN_URI, &uri,
- HILDON_FILE_SYSTEM_MODEL_COLUMN_EXTRA_INFO, &extra,
+ HILDON_FILE_SYSTEM_MODEL_COLUMN_EXTRA_INFO, &device,
-1);
- fprintf (stderr, "REPAIR %s %s\n", uri, extra);
+ fprintf (stderr, "REPAIR %s %s\n", uri, device);
+ if (device)
+ trigger_repair (device);
+
g_free (uri);
- g_free (extra);
+ g_free (device);
}
}
- Previous message: [maemo-commits] r11865 - in projects/haf/trunk/gtk+: . gtk
- Next message: [maemo-commits] r11867 - projects/haf/hafbuildbot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
