Ignore:
Timestamp:
12/17/07 18:44:30 (5 years ago)
Author:
mickey
Message:

openmoko-panel-gsm: indicate cipher status in popup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c

    r3535 r3664  
    2323#include <gtk/gtkbox.h> 
    2424#include <gtk/gtk.h> 
     25 
     26#include <string.h> 
    2527#include <time.h> 
    2628 
     
    3840    char operator_name[255]; 
    3941    GtkMenuItem* information; 
     42    gboolean cipher; 
    4043} GsmApplet; 
    4144 
     
    123126} 
    124127 
     128static void gsm_applet_update_cipher_status(MokoGsmdConnection* self, int status) 
     129{ 
     130    g_debug( "gsm_applet_update_cipher_status: status = %d", status ); 
     131    gsm_applet_show_status( 0, theApplet ); 
     132} 
     133 
    125134static void gsm_applet_network_current_operator_cb(MokoGsmdConnection *self, const gchar* name) 
    126135{ 
     
    181190        case 1: 
    182191            summary = g_strdup_printf( "Connected to '%s'", applet->operator_name ); 
    183             details = g_strdup_printf( "Type: Home Network\nCell ID: %04x : %04x\nSignal: %i dbM", applet->lac, applet->cell, -113 + applet->strength*2 ); 
     192            details = g_strdup_printf( "Type: Home Network\nCell ID: %04x : %04x\nSignal: %i dbM\nCipher Status: %s", applet->lac, applet->cell, -113 + applet->strength*2, applet->cipher ? "Encrypted" : "No Encryption" ); 
    184193        break; 
    185194 
     
    232241{ 
    233242    GsmApplet* applet = g_slice_new0(GsmApplet); 
     243    applet->cipher = TRUE; // default GSM is ciphered 
    234244    theApplet = applet; // nasty global variable 
    235245    strcpy( applet->operator_name, "<unknown>" ); 
     
    251261    g_signal_connect( G_OBJECT(applet->gsm), "pin-requested", G_CALLBACK(gsm_applet_sim_pin_requested), applet ); 
    252262#endif 
     263    g_signal_connect( G_OBJECT(applet->gsm), "cipher-status-changed", G_CALLBACK(gsm_applet_update_cipher_status), applet ); 
    253264 
    254265    // tap-with-hold menu (NOTE: temporary: left button atm.) 
Note: See TracChangeset for help on using the changeset viewer.