~cairo-dock-team/cairo-dock-plug-ins/plug-ins

« back to all changes in this revision

Viewing changes to Network-Monitor/src/applet-menu.c

  • Committer: Fabounet (Fabrice Rey) - http://cairo-dock.org
  • Date: 2010-01-06 00:43:45 UTC
  • Revision ID: fabounet_fabrice_rey_-_httpcairo-dock.org-20100106004345-2q0knfv2i8eyk3xn
added some debug ENTER/LEAVE + Network-Monitor : few minor changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
        {
138
138
                /// il faut creer une connection ...
139
139
                g_print ("aucune des connexions existantes ne convient pour ce point d'acces\n");
140
 
                 
 
140
                
 
141
                GHashTable *pSettings = g_hash_table_new_full (g_str_hash,
 
142
                        g_str_equal,
 
143
                        g_free,
 
144
                        g_hash_table_destroy);
 
145
                
 
146
                GHashTable *pSubSettings = g_hash_table_new_full (g_str_hash,
 
147
                        g_str_equal,
 
148
                        g_free,
 
149
                        g_free);
 
150
                g_hash_table_insert (pSettings, "connection", pSubSettings);
 
151
                g_hash_table_insert (pSubSettings, "type", g_strdup ("802-11-wireless"));
 
152
                g_hash_table_insert (pSettings, "id", g_strdup_printf ("CD - %s", pItemData->cSsid));
 
153
                
 
154
                pSubSettings = g_hash_table_new_full (g_str_hash,
 
155
                        g_str_equal,
 
156
                        g_free,
 
157
                        g_free);
 
158
                g_hash_table_insert (pSubSettings, "ssid", g_strdup (pItemData->cSsid));
 
159
                g_hash_table_insert (pSubSettings, "mode", g_strdup ("infrastructure"));
 
160
                
 
161
                // AddConnection
 
162
                DBusGProxy *dbus_proxy_Settings = cairo_dock_create_new_system_proxy (
 
163
                        myData.cServiceName,
 
164
                        "/org/freedesktop/NetworkManagerSettings",
 
165
                        "org.freedesktop.NetworkManagerSettings");
 
166
                
 
167
                GError *erreur = NULL;
 
168
                dbus_g_proxy_call (dbus_proxy_Settings, "AddConnection", &erreur,
 
169
                        CD_DBUS_TYPE_HASH_TABLE_OF_HASH_TABLE, pSettings,
 
170
                        G_TYPE_INVALID,
 
171
                        G_TYPE_INVALID);
 
172
                if (erreur != NULL)
 
173
                {
 
174
                        cd_warning (erreur->message);
 
175
                        g_error_free (erreur);
 
176
                        return ;
 
177
                }
 
178
                
 
179
                /// on attend le signal NewConnection ...
 
180
                
 
181
                
 
182
                
 
183
                /// on active la connexion...
 
184
                
 
185
                
 
186
                
141
187
        }
142
188
        else
143
189
        {
428
474
                                        pItemData->cDevice = g_strdup (cDevice);
429
475
                                        pItemData->iPercent = iPercent;
430
476
                                        pItemData->cAccessPoint = g_strdup (cAccessPointPath);
 
477
                                        pItemData->cSsid = g_strdup (cSsid);
431
478
                                        if (pConnList)
432
479
                                        {
433
480
                                                int n = GPOINTER_TO_INT (pConnList->data);