Exemplo n.º 1
0
static void connect_callback(GtkButton *button, gpointer user_data)
{
    GtkTreeModel *model;
    GtkTreeIter iter;
    DBusGProxy *proxy;
    const gchar *path;
    gboolean enabled;

    if (gtk_tree_selection_get_selected(selection, &model, &iter) == FALSE)
        return;

    gtk_tree_model_get(model, &iter, CONNMAN_COLUMN_PROXY, &proxy,
                       CONNMAN_COLUMN_ENABLED, &enabled, -1);

    path = dbus_g_proxy_get_path(proxy);

    if (enabled == FALSE)
        connman_client_connect(client, path);
    else
        connman_client_disconnect(client, path);

    g_object_unref(proxy);

    if (enabled == FALSE)
        g_object_set(button_connect,
                     "label", GTK_STOCK_DISCONNECT, NULL);
    else
        g_object_set(button_connect,
                     "label", GTK_STOCK_CONNECT, NULL);
}
Exemplo n.º 2
0
static void disconnect_callback(GtkWidget *editable, gpointer user_data)
{
	struct config_data *data = user_data;

	connman_client_disconnect(data->client, data->device);
}