aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-02-26 10:57:52 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-02-26 10:57:52 +0100
commit7c17f3ed179ec9c2c2143228f0ca11afbdf8eda7 (patch)
treef22cab612e6a2d05c90b008875cad45df183952f
parentfc94fc697b69e227783b1f4f78625e3b265a6a15 (diff)
downloadconnman-gnome-7c17f3ed179ec9c2c2143228f0ca11afbdf8eda7.tar.gz
Start scanning when status icon has been clicked
-rw-r--r--applet/main.c2
-rw-r--r--common/client.c27
-rw-r--r--common/client.h2
3 files changed, 31 insertions, 0 deletions
diff --git a/applet/main.c b/applet/main.c
index e61cb93..12dc304 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -188,6 +188,8 @@ static gboolean menu_callback(GtkMenu *menu)
GtkWidget *item;
gboolean cont;
+ client_propose_scanning();
+
model = client_get_active_model();
cont = gtk_tree_model_get_iter_first(model, &parent);
diff --git a/common/client.c b/common/client.c
index 3e730f6..67686b1 100644
--- a/common/client.c
+++ b/common/client.c
@@ -819,6 +819,33 @@ void client_set_state_callback(client_state_callback callback)
execute_state_callback();
}
+void client_propose_scanning(void)
+{
+ GtkTreeModel *model = GTK_TREE_MODEL(store);
+ GtkTreeIter iter;
+ gboolean cont;
+
+ cont = gtk_tree_model_get_iter_first(model, &iter);
+
+ while (cont == TRUE) {
+ DBusGProxy *proxy;
+ gboolean active;
+
+ gtk_tree_model_get(model, &iter,
+ CLIENT_COLUMN_ACTIVE, &active,
+ CLIENT_COLUMN_PROXY, &proxy, -1);
+ if (proxy == NULL || active == FALSE)
+ continue;
+
+ dbus_g_proxy_call(proxy, "Scan", NULL,
+ G_TYPE_INVALID, G_TYPE_INVALID);
+
+ g_object_unref(proxy);
+
+ cont = gtk_tree_model_iter_next(model, &iter);
+ }
+}
+
GtkTreeModel *client_get_model(void)
{
return gtk_tree_model_filter_new(GTK_TREE_MODEL(store), NULL);
diff --git a/common/client.h b/common/client.h
index 3521a2f..10ab599 100644
--- a/common/client.h
+++ b/common/client.h
@@ -81,6 +81,8 @@ void client_set_userdata(const gchar *index, gpointer user_data);
typedef void (* client_state_callback) (guint state, gint signal);
void client_set_state_callback(client_state_callback callback);
+void client_propose_scanning(void);
+
GtkTreeModel *client_get_model(void);
GtkTreeModel *client_get_active_model(void);