~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric-updates

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe), Matthieu Baerts (matttbe), Iain Lane
  • Date: 2011-10-09 00:19:16 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20111009001916-9czstskx2t6l0b3x
Tags: 2.4.0~2-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New upstream bug fix release. (LP: #859984)
* Upstream (short) ChangeLog (2.4.0~0beta2 -> 2.4.0~1):
 - Powermanager: correctly release the reference on the device object
 - logout: now works if there is no session-manager
 - Status-Notifier: fixed a small bug
    (wrong callback in cairo_dock_stop_watching_dbus_name_owner)
 - Folders: fixed the positionning of the new icon
    and the dialog when dropping a folder inside the dock
    and fixed the icon-rendering
 - Dustbin: use the default theme if no icon is found
 - Impulse: the default context seems to be ok and not an error
 - Status-Notifier: On Ubuntu Oneiric (with indicator-0.4)
    the ApplicationAdded signal has changed and has a new parameter
 - Disable MeMenu on Oneiric (no longer available with indicator-0.4)
 - CMakeLists.txt: Improved output messages
 - Slide view: fixed a small offset in vertical view
 - musicPlayer:
  + split MPRIS 1.0 and 2.0 to help debugging and finding the right
     name of the bug.
  + 'rhythmbox-client' tool is no longer available: used MPRIS
  + Disable Amazon service (it no longer work)
  + Cover: fixed corrupted icons: some players (e.g. the latest version
     of RB) copy covers on their cache forlder but it takes a few time.
  + Fixed the update the icon and its name if the player is stopped.
  + Prevent a crash if the name given by MPRIS is NULL
 - Powermanager: try to prevent to have a few dialogues at the same time
 - PowerManager and AlsaMixer: hidden gnome2 or 3 apps if not available
 - Messaging-Menu: Updated for Natty and Oneiric
    (dbus-menu gives us GVariant instead of GValue objects)
 - Alsamixer: fixed a small bug on reload
 - Dbus: Bash interface: Fixed a typo with emblem positions
 - Sys-monitor: fixed a bug which prevented from getting
    the CPU temperature in some cases
 - Compiz (0.9): type filter: replaced type=utility by type=Utility
 - Updated the version of all applets that have gauges
   in order to use the right directory
 - Wifi: Fixed the status if we are not connected
 - Dbus: removed a conflict with the Help applet
 - Messaging-Menu: updated applet-menu.c => Memory leaks on pixbufs
 - Dbus: Fixed a crash when changing dock theme if a 'third-party' applet
    is running
 - Netspeed: in /proc/net/dev, there are 8 values to drop after the card id
    except if there is whitespaces just after this ':' character
    and fixed order and value for ON_ICON display
 - dock-rendering/toto: removed a useless file
 - Clipper: fixed the loading of the remembered items
    (they had the wrong type) and fixed a bug if we reduce the list of items
 - Folders, dustbin, Network-Monitor: tried to not use cast if it's possible
 - Code cleaned and re-organised a few functions
   (e.g. emblem references has been renamed)
 - Removed useless files: powermanager-dbus*
 - Updating translations
 - Fixed a few warnings at the compilation
 - Removed a few useless output messages
 - Fixed these LP bugs:
  + Empty trash from the trashcan does not delete files
     from usb harddisks: LP: #658681
  + Switcher applet doesn't respect desktop numbers LP: #626782
* Upstream (short) ChangeLog (2.4.0~1 -> 2.4.0~2):
 - Messaging-Menu: fixed a wrong g_object_unref (double free)
    and a small memory leak
 - Folders: fixed a tiny warning at the compilation (32bits)
 - switcher: removed an unnecessary config parameter
 - Folders: file size: used English instead of French translation.
 - Indicator applet: Forced a cast to remove an annoying warning
    due to clumsy dbusmenu_gtkmenu_new() declaration
 - Fixed the detection of the screensaver
 - Fixed tiny warnings at the compilation (with CAIRO_CONTAINER)
* debian/control:
 - Updated the version of cairo-dock-[core;data;dev].
 - Added gvfs as 'Suggests' for cairo-dock-plug-ins-integration
    (Used for managing files)
 - Removed 'libthunar-vfs-1-dev' (libthunar-vfs is no longer installed
    by default since XFCE 4.8 and it is replaced by gvfs)
 - Removed 'indicator-me' (no longer available
    and the installation of Cairo-Dock produces an error)
 - Moved 'indicator-messages' to 'Recommends'
* debian/rules:
 - Updated the name of CMake extras flags
* debian/cairo-dock-plug-ins-data.lintian-overrides:
 - Deleted (now useless)
* debian/cairo-dock-plug-ins.lintian-overrides:
 - Cairo-Dock Plug-Ins are not linked to gldi
 - shlib-without-versioned-soname: forwarded to upstream.
* debian/cairo-dock-plug-ins-integration.lintian-overrides:
 - Cairo-Dock Plug-Ins are not linked to gldi
 - ldconfig and shlibs are not needed
* debian/cairo-dock-plug-ins.install:
 - Fixed lintian errors: package-installs-python-bytecode
* debian/control: Fixed lintian warnings:
 - python-script-but-no-python-dep
 - description-synopsis-starts-with-article
* debian/changelog:
 - Fixed lintian warning: old-fsf-address-in-copyright-file
* debian/patches/01-switcher-force-compact-view.patch: 
 - Forced the compact view because the other doesn't work

[ Iain Lane ]
* Fix Mono/CLI build to be ~policy compliant and use correct compiler

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        gchar *cConnection;
33
33
        GHashTable *pSettings, *pSubSettings;
34
34
        GValue *v;
35
 
        int i;
 
35
        uint i;
36
36
        for (i = 0; i < paConnections->len; i++)
37
37
        {
38
38
                cConnection = (gchar *)g_ptr_array_index(paConnections, i);
119
119
        GList *pConnList = NULL;
120
120
        //\_____________ On cherche une connection qui ait le meme type (wifi ou filaire), et soit le meme SSID, soit la meme interface.
121
121
        gchar *cConnection;
122
 
        int i;
 
122
        uint i;
123
123
        for (i = 0; i < paConnections->len; i++)
124
124
        {
125
125
                cConnection = (gchar *)g_ptr_array_index(paConnections, i);
141
141
                GHashTable *pSettings = g_hash_table_new_full (g_str_hash,
142
142
                        g_str_equal,
143
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"));
 
144
                        (GDestroyNotify) g_hash_table_destroy);  // a table of tables.
 
145
                GHashTable *pSubSettings;
 
146
                
 
147
                // connection: type, id, uuid
 
148
                pSubSettings = g_hash_table_new_full (g_str_hash,
 
149
                        g_str_equal,
 
150
                        g_free,
 
151
                        g_free);
 
152
                g_hash_table_insert (pSettings, g_strdup ("connection"), pSubSettings);
 
153
                g_hash_table_insert (pSubSettings, g_strdup ("type"), g_strdup ("802-11-wireless"));
 
154
                g_hash_table_insert (pSubSettings, g_strdup ("id"), g_strdup_printf ("CD - %s", pItemData->cSsid));
 
155
                
 
156
                // 802-11-wireless: ssid, mode, seen-bssids
 
157
                pSubSettings = g_hash_table_new_full (g_str_hash,
 
158
                        g_str_equal,
 
159
                        g_free,
 
160
                        g_free);
 
161
                g_hash_table_insert (pSettings, g_strdup ("802-11-wireless"), pSubSettings);
 
162
                g_hash_table_insert (pSubSettings, g_strdup ("ssid"), g_strdup (pItemData->cSsid));
 
163
                g_hash_table_insert (pSubSettings, g_strdup ("mode"), g_strdup ("infrastructure"));
160
164
                
161
165
                // AddConnection
162
166
                DBusGProxy *dbus_proxy_Settings = cairo_dock_create_new_system_proxy (
191
195
                
192
196
                //ActivateConnection ( s: service_name, o: connection, o: device, o: specific_object )o
193
197
                GError *erreur = NULL;
194
 
                GValue active_connection_path = {0};
 
198
                GValue active_connection_path = G_VALUE_INIT;
195
199
                g_value_init (&active_connection_path, DBUS_TYPE_G_OBJECT_PATH);
196
200
                
197
201
                gchar *cNewActiveConnectionPath = NULL;
233
237
                DBusGProxy *dbus_proxy_ConnectionSettings;
234
238
                GError *erreur = NULL;
235
239
                GHashTable *pSettingsTable;
236
 
                int i;
 
240
                uint i;
237
241
                for (i = 0; i < paConnections->len; i++)
238
242
                {
239
243
                        cConnection = (gchar *)g_ptr_array_index(paConnections, i);
281
285
        gchar *cAccessPointPath;
282
286
        GHashTable *hProperties;
283
287
        GValue *v;
284
 
        guint iPercent;
285
 
        gchar *cSsid;
 
288
        gint iPercent;
 
289
        gchar *cSsid = NULL;
286
290
        const gchar *cHwAddress;
287
291
        int iMode, iWirelessCapabilities;
288
292
        CDMenuItemData *pItemData;
289
293
        GtkWidget *pHBox;
290
 
        int i, j;
 
294
        uint i, j;
291
295
        for (i = 0; i < paDevices->len; i++)
292
296
        {
293
297
                // on recupere le device.
387
391
                                v = (GValue *)g_hash_table_lookup (hProperties, "Strength");
388
392
                                if (v != NULL && G_VALUE_HOLDS_UCHAR (v))
389
393
                                {
390
 
                                        iPercent = (gint) g_value_get_uchar (v);
 
394
                                        iPercent = g_value_get_uchar (v);
391
395
                                }
392
396
                                
393
397
                                v = (GValue *)g_hash_table_lookup (hProperties, "Ssid");
398
402
                                }
399
403
                                
400
404
                                // on empeche les doublons.
401
 
                                pItemData = g_hash_table_lookup (pSsidTable, cSsid);
 
405
                                pItemData = (cSsid ? g_hash_table_lookup (pSsidTable, cSsid) : NULL);
402
406
                                if (pItemData != NULL)
403
407
                                {
404
408
                                        if (pItemData->iPercent > iPercent)
437
441
                                
438
442
                                cd_debug ("%d) %s : %s (%s, %d%%)\n", j, cSsid, cAccessPointPath, cHwAddress, iPercent);
439
443
                                
440
 
                                gchar *cImage = NULL;
 
444
                                const gchar *cImage = NULL;
441
445
                                if (iPercent > 80)
442
446
                                        cImage = MY_APPLET_SHARE_DATA_DIR"/link-5.svg";
443
447
                                else if (iPercent > 60)
480
484
                                                int n = GPOINTER_TO_INT (pConnList->data);
481
485
                                                pItemData->cConnection = g_strdup (g_ptr_array_index (paConnections, n));
482
486
                                        }
483
 
                                        cairo_dock_add_in_menu_with_stock_and_data (cSsid, cImage, _on_select_access_point, pMenu, pItemData);
 
487
                                        cairo_dock_add_in_menu_with_stock_and_data (cSsid, cImage, (GFunc) _on_select_access_point, pMenu, pItemData);
484
488
                                }
485
489
                                else
486
490
                                {
505
509
                                                        pItemData->cDevice = g_strdup (cDevice);
506
510
                                                        pItemData->cAccessPoint = g_strdup (cAccessPointPath);
507
511
                                                        
508
 
                                                        cairo_dock_add_in_menu_with_stock_and_data (cID, NULL, _on_select_access_point, pSubMenu, GINT_TO_POINTER (n));
 
512
                                                        cairo_dock_add_in_menu_with_stock_and_data (cID, NULL, (GFunc) _on_select_access_point, pSubMenu, GINT_TO_POINTER (n));
509
513
                                                }
510
514
                                        }
511
515
                                }