The branch, eden has been updated
       via  626dbcef9394cc46bce777b1bc3a3b6b0692f1fe (commit)
      from  e679686e9c426237e24d40b0fe617c6df28a3347 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=626dbcef9394cc46bce777b1bc3a3b6b0692f1fe

commit 626dbcef9394cc46bce777b1bc3a3b6b0692f1fe
Author: amet <[email protected]>
Date:   Sun Jun 10 00:48:11 2012 +0400

    [script.linux.nm] -v0.1.4
    
    [B]Version 0.1.4[/B]
    Check for dbus and nm on init
    
    [B]Version 0.1.3[/B]
    Check number of wifi devices on init
    Access Points sorted by strength
    language tag added
    Error handling/messages tuned
    Possibility to enable ipv6 in settings. disabled default.
    Double connection when incorrect key fixed
    Prompt for key if needed when connecting to existing connection

diff --git a/script.linux.nm/addon.xml b/script.linux.nm/addon.xml
index 4c4a7f0..b613b13 100644
--- a/script.linux.nm/addon.xml
+++ b/script.linux.nm/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.linux.nm"
        name="Network-Manager"
-       version="0.1.2"
+       version="0.1.4"
        provider-name="vikjon0">
   <requires>
     <import addon="xbmc.python" version="2.0"/>
@@ -9,6 +9,7 @@
   <extension point="xbmc.python.script"
              library="default.py" />
   <extension point="xbmc.addon.metadata">
+       <language>en</language>
     <platform>linux</platform>
     <summary lang="en">xbmc Network-Manager front-end. Configures wifi from 
within xbmc.</summary>
     <description lang="en">xbmc Network-Manager front-end. Configures wifi 
from within xbmc. Requires Network-Manager 0.9, which are included in 
XBMCbuntu.</description>
diff --git a/script.linux.nm/changelog.txt b/script.linux.nm/changelog.txt
index ccd2c61..512f8c5 100644
--- a/script.linux.nm/changelog.txt
+++ b/script.linux.nm/changelog.txt
@@ -1,3 +1,15 @@
+[B]Version 0.1.4[/B]
+Check for dbus and nm on init
+
+[B]Version 0.1.3[/B]
+Check number of wifi devices on init
+Access Points sorted by strength
+language tag added
+Error handling/messages tuned
+Possibility to enable ipv6 in settings. disabled default.
+Double connection when incorrect key fixed
+Prompt for key if needed when connecting to existing connection
+
 [B]Version 0.1.2[/B]
 Script id changed to standard format
 
diff --git a/script.linux.nm/default.py b/script.linux.nm/default.py
index 8a3729d..0696164 100644
--- a/script.linux.nm/default.py
+++ b/script.linux.nm/default.py
@@ -3,20 +3,21 @@ import os
 import xbmc
 import xbmcaddon
 
-__addon__      = xbmcaddon.Addon()
-__version__    = __addon__.getAddonInfo('version')
-__language__   = __addon__.getLocalizedString
-__cwd__        = __addon__.getAddonInfo('path')
+__addon__       = xbmcaddon.Addon()
+__version__     = __addon__.getAddonInfo('version')
+__id__          = __addon__.getAddonInfo('id')
+__language__    = __addon__.getLocalizedString
+__cwd__         = __addon__.getAddonInfo('path')
 
 BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( __cwd__, 'resources', 
'lib' ) )
 sys.path.append (BASE_RESOURCE_PATH)
 
-print "[SCRIPT] '%s: version %s' initialized!" % (__addon__, __version__, )
+print "[SCRIPT] '%s: version %s' initialized!" % (__id__, __version__, )
 
 if (__name__ == "__main__"):
     import gui
 ## To do - chnage name of xml (skins /default)
-    ui = gui.GUI( "script_linux_nm-main.xml" , __cwd__ , "default")
+    ui = gui.GUI( "script_linux_nm-main.xml" , __cwd__ , "default",msg='', 
first=True)
     del ui
 
 sys.modules.clear()
diff --git a/script.linux.nm/resources/language/English/strings.xml 
b/script.linux.nm/resources/language/English/strings.xml
index ad39b01..b83e5e7 100644
--- a/script.linux.nm/resources/language/English/strings.xml
+++ b/script.linux.nm/resources/language/English/strings.xml
@@ -21,7 +21,6 @@
   <string id="628">Status</string>  

   <string id="629">Add Hidden</string>  

   <string id="630">Refresh</string>  

-  <string id="30100">General</string>

   <string id="30101">Enter password</string>

   <string id="30102">Installing</string>

   <string id="30103">Enter SSID</string>

@@ -33,7 +32,6 @@
   <string id="30111">Internet is not accessable</string>

   <string id="30112">Please wait...</string>

   <string id="30113">Connection attempt made</string>

-  <string id="30114">Unix username</string>

   <string id="30115">Refreshing...</string>

   <string id="30116">Connection Created</string>

   <string id="30117">Disconnecting....</string>

@@ -46,7 +44,12 @@
   <string id="30124">Enter encryption (NONE, WEP or WPA)</string>

   <string id="30125">That is not a known encryption</string>

   <string id="30126">Done</string>

+  <string id="30127">More than one wifi device found. This could cause 
problem.</string>

+  <string id="30128">No wifi device found</string>

+  <string id="30130">dbus not available</string>

+  <string id="30131">Could not connect to dbus</string>

+  <string id="30132">Could not connect to network-manager</string>

   <string id="99999"></string>

-

-

+  <string id="32100">General</string>

+  <string id="32101">Disable ipv6 (in NEW connections only)</string>

 </strings>

diff --git a/script.linux.nm/resources/lib/addConnection.py 
b/script.linux.nm/resources/lib/addConnection.py
index 17c8514..b8d5b5f 100644
--- a/script.linux.nm/resources/lib/addConnection.py
+++ b/script.linux.nm/resources/lib/addConnection.py
@@ -8,14 +8,9 @@ import sys
 #enable localization
 getLS   = sys.modules[ "__main__" ].__language__
 __cwd__ = sys.modules[ "__main__" ].__cwd__
+__addon__      = xbmcaddon.Addon()
 
 
-
-#TODO Connect to hidden network
-#TODO Re-add connect button and add connect dialog with more options
-#TODO Display network detail window
-#TODO Create a new con name if name=ssid is taken
-
 class GUI(xbmcgui.WindowXMLDialog):
 
     def __init__(self, *args, **kwargs):
@@ -24,14 +19,20 @@ class GUI(xbmcgui.WindowXMLDialog):
 
 
     def onInit(self):
+        self.disable_ipv6 = __addon__.getSetting( "disable_ipv6" )
+        if self.disable_ipv6 == "true":
+            self.disable_ipv6 = True
+        else:
+            self.disable_ipv6 = False
+            
         self.defineControls()
 
-        self.status_msg = ""
-        self.status_label.setLabel(self.status_msg)
+        self.msg = ""
+        self.status_label.setLabel(self.msg)
         
         self.showDialog()
                 
-        self.status_label.setLabel(self.status_msg)
+        self.status_label.setLabel(self.msg)
         self.remove_auto_button.setEnabled(False)
         #self.disconnect_button.setEnabled(False)
        
@@ -63,16 +64,17 @@ class GUI(xbmcgui.WindowXMLDialog):
 
     def showDialog(self):
         self.updateList()
+        self.setFocus(self.list )
 
     def closeDialog(self):        
         import gui
-        mainUI = gui.GUI("script_linux_nm-main.xml", __cwd__, "default")
+        mainUI = gui.GUI("script_linux_nm-main.xml", __cwd__, 
"default",msg=self.msg, first=False)
         self.close()
         del mainUI
 
     def onClick(self, controlId):
-        self.status_msg = ""
-        self.status_label.setLabel(self.status_msg)
+        self.msg = ""
+        self.status_label.setLabel(self.msg)
         
         #Add connection from list
         if controlId == self.control_list_id:
@@ -82,21 +84,23 @@ class GUI(xbmcgui.WindowXMLDialog):
 
             ssid =  item.getLabel2()  
             encryption = item.getProperty('encryption')
-            self.add_wireless(ssid,encryption)        
-            self.closeDialog()
+            connection_created = self.add_wireless(ssid,encryption)       
+            if connection_created == True:
+                self.closeDialog()
        
         #Refresh
         elif controlId == self.control_refresh_button_id:
-            msg = getLS(30115) #Refreshing
-            self.status_label.setLabel(msg)
+            self.msg = getLS(30115) #Refreshing
+            self.status_label.setLabel(self.msg)
             self.updateList()
-            msg = ""
-            self.status_label.setLabel(msg)
+            self.msg = ""
+            self.status_label.setLabel(self.msg)
         
         #Add hidden button
         elif controlId == self.control_add_hidden_button_id:
-            self.add_hidden()
-            self.closeDialog()
+            connection_created = self.add_hidden()
+            if connection_created == True:
+                self.closeDialog()
 
         #cancel dialog
         elif controlId == self.control_cancel_button_id:
@@ -119,9 +123,9 @@ class GUI(xbmcgui.WindowXMLDialog):
         if (kb.isConfirmed()):
             ssid=kb.getText()
         if ssid == '':
-            msg = getLS(30108)  
-            self.status_label.setLabel(msg)
-            return        
+            self.msg = getLS(30108)  
+            self.status_label.setLabel(self.msg)
+            return False       
         
         encryption = ''
         kb = xbmc.Keyboard("", getLS(30124), False)
@@ -132,17 +136,20 @@ class GUI(xbmcgui.WindowXMLDialog):
                 encryption = encryption.upper()
                 
         if encryption == '' or not any(encryption in s for s in ['NONE', 
'WEP', 'WPA']):
-            msg = getLS(30125)  
-            self.status_label.setLabel(msg)
-            return  
-        self.add_wireless(ssid, encryption)
+            self.msg = getLS(30125)  
+            self.status_label.setLabel(self.msg)
+            return  False
+        return self.add_wireless(ssid, encryption)
         
     def add_wireless(self, ssid, encryption):
         finished = False
+        connection_created = False
+        con_path = ''
         while not finished  :
-            finished = self.add_wireless_sub(ssid, encryption)
-         
-    def add_wireless_sub(self, ssid, encryption):
+            finished, connection_created, con_path = 
self.add_wireless_sub(ssid, encryption, connection_created, con_path)
+        return connection_created
+    
+    def add_wireless_sub(self, ssid, encryption, connection_created, con_path):
         #Prompt for key
         key = ""
         if not encryption == 'NONE':
@@ -153,40 +160,45 @@ class GUI(xbmcgui.WindowXMLDialog):
                 errors = qfpynm.validate_wifi_input(key,encryption)
            
             if key == "" or errors != '':
-                msg = getLS(30109)  
-                self.status_label.setLabel(msg)
-                return True
+                self.msg = getLS(30109)  
+                self.status_label.setLabel(self.msg)
+                return True, connection_created, con_path
         if encryption == 'WEP':
             wep_alg = 'shared'
         else:
             wep_alg = ''
+        if connection_created == False:
+            con_path = 
qfpynm.add_wifi(ssid,key,encryption,wep_alg,self.disable_ipv6 )
+        else:
+            aUUID = qfpynm.get_con_uuid_by_path(con_path)
+            qfpynm.update_wifi(aUUID, key, encryption)
+            qfpynm.activate_connection(aUUID)
             
-        con_path = qfpynm.add_wifi(ssid,key,encryption,wep_alg)
         for i in range(1, 150):
             state,stateTXT = qfpynm.get_device_state(qfpynm.get_wifi_device())
-            msg = stateTXT
-            self.status_label.setLabel(msg)
+            self.msg = stateTXT
+            self.status_label.setLabel(self.msg)
             # Do not exit directly just to be sure.
             # If trying with a bad key when wifi is disconnected do not give 
state 60 but 30....
             # better never to disconnect wifi and only deactivate c
             if (i > 10 and state == 60) or (i > 10 and state == 30)  or (state 
== 100 and i >2):
                 break
             time.sleep(1)
-            msg = ''
-            self.status_label.setLabel(msg)
+            self.msg = ''
+            self.status_label.setLabel(self.msg)
             time.sleep(1)
         if state == 100:
-            msg = getLS(30120) #"Connected!"
-            self.status_label.setLabel(msg)
-            return True
+            self.msg = getLS(30120) #"Connected!"
+            self.status_label.setLabel(self.msg)
+            return True, True, con_path
         if (state == 60  or state == 30) and encryption != "NONE":
-            msg = getLS(30121) #"Not Autorized!"
-            self.status_label.setLabel(msg)
-            return False
+            self.msg = getLS(30121) #"Not Autorized!"
+            self.status_label.setLabel(self.msg)
+            return False, True, con_path
         
-        msg = getLS(30122) #"Connection failed"
-        self.status_label.setLabel(msg)      
-        return True
+        self.msg = getLS(30122) #"Connection failed"
+        self.status_label.setLabel(self.msg)      
+        return True, True, con_path
 
 
     def updateList(self):
diff --git a/script.linux.nm/resources/lib/gui.py 
b/script.linux.nm/resources/lib/gui.py
index b749d37..bc3b793 100644
--- a/script.linux.nm/resources/lib/gui.py
+++ b/script.linux.nm/resources/lib/gui.py
@@ -10,35 +10,70 @@ getLS   = sys.modules[ "__main__" ].__language__
 __cwd__ = sys.modules[ "__main__" ].__cwd__
 
 
-#TODO Display connection status while connection
-#TODO Display connection status when coming back from add
-#TODO Display status when disconnecting
-#TODO Add hidden
-#TODO add connect button
-#TODO Check for wifi devices
-#TODO Check and display device status
-#TODO ADD Refresh button on AP window
+#Longer term
+#TODO Build a service that monitor state and display a notification about 
changes
+#TODO Display network detail window
+#TODO Create a new con name if name=ssid is taken
+#TODO the > only indicates active connection. would be nice to show 
connectivity status as well
+
 
 class GUI(xbmcgui.WindowXMLDialog):
 
     def __init__(self, *args, **kwargs):
         xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
+        self.msg = kwargs['msg']
+        self.first = kwargs['first']
         self.doModal()
 
 
     def onInit(self):
         self.defineControls()
 
-        self.status_msg = ""
-        self.status_label.setLabel(self.status_msg)
+        self.status_label.setLabel(self.msg)
         
         self.showDialog()
-                
-        #self.status_label.setLabel(self.status_msg)
+        
+        if self.first == True:
+            nm_OK, err = self.check_nm() 
+            if nm_OK == True:
+                devlist = qfpynm.list_wifi_devices()        
+                if len(devlist) > 1:
+                    self.msg = getLS(30127)
+                elif len(devlist) == 0:
+                    self.msg = getLS(30128)
+            else:
+                self.msg = getLS(err)
+        
+        self.status_label.setLabel(self.msg)
         
         #self.disconnect_button.setEnabled(False)
         #self.delete_button.setEnabled(False)
         
+    def check_nm(self):
+        try:
+            import dbus
+        except:
+            # dbus not available
+            err = 30130
+            return False, err
+        
+        try:
+            bus = dbus.SystemBus()
+        except:
+            # could not connect to dbus
+            err =  30131
+            return False, err
+            
+        try:
+            nm_proxy = bus.get_object("org.freedesktop.NetworkManager", 
"/org/freedesktop/NetworkManager")
+            nm_iface = dbus.Interface(nm_proxy, 
"org.freedesktop.NetworkManager")
+        except:
+            # could not connect to network-manager
+            err = 30132    
+            return False, err
+        
+        return True, ''
+        
     def defineControls(self):
         #actions
         self.action_cancel_dialog = (9, 10)
@@ -76,8 +111,8 @@ class GUI(xbmcgui.WindowXMLDialog):
         self.close()
 
     def onClick(self, controlId):
-        self.status_msg = ""
-        self.status_label.setLabel(self.status_msg)
+        self.msg = ""
+        self.status_label.setLabel(self.msg)
         
                     
         #Activate connection from list
@@ -88,15 +123,36 @@ class GUI(xbmcgui.WindowXMLDialog):
             item = self.list.getSelectedItem()
 
             uuid =  item.getProperty('uuid') 
+            encryption = item.getProperty('encryption') 
             #print uuid
             
             self.activate_connection(uuid)
-            for i in range(1, 50):
+            for i in range(1, 100):
                 state,stateTXT = 
qfpynm.get_device_state(qfpynm.get_wifi_device())
                 msg = stateTXT
                 self.status_label.setLabel(msg)
-                if (i > 2 and state == 60)  or (state == 100 and i >2):
+                if (state == 100 and i >2):
                     break
+                if (i > 2 and state == 60):
+                    if encryption not in ['WPA','WEP']:
+                        print ("Strange encryption:" + encryption)
+                        break
+                    #Prompt for key
+                    key = ""
+                    kb = xbmc.Keyboard("", getLS(30104), False)
+                    kb.doModal()
+                    if (kb.isConfirmed()):
+                        key=kb.getText()
+                        errors = qfpynm.validate_wifi_input(key,encryption)
+                   
+                    if key == "" or errors != '':
+                        self.msg = getLS(30109)  
+                        self.status_label.setLabel(self.msg)
+                        break
+
+                    qfpynm.update_wifi(uuid, key, encryption)
+                    qfpynm.activate_connection(uuid)     
+                    continue                 
                 time.sleep(1)
                 msg = ''
                 self.status_label.setLabel(msg)
@@ -121,31 +177,31 @@ class GUI(xbmcgui.WindowXMLDialog):
             
         #disconnect button
         elif controlId == self.control_disconnect_button_id:
-
-            msg = getLS(30117) #Disconnecting
-            self.status_label.setLabel(msg)
             self.disconnect()
-            
-            msg = getLS(30115) #Refreshing
-            self.status_label.setLabel(msg)
+                        
+            for i in range(1, 20):
+                state,stateTXT = 
qfpynm.get_device_state(qfpynm.get_wifi_device())
+                self.msg = stateTXT
+                self.status_label.setLabel(self.msg)
+           
+                if (state == 30):
+                    break
+                time.sleep(1)
             self.updateList()
             
-            msg = getLS(30126) #Done
-            self.status_label.setLabel(msg)
-        
+            
         #Delete button
         elif controlId == self.control_delete_button_id:
             item = self.list.getSelectedItem()
 
             uuid =  item.getProperty('uuid') 
-            print uuid
             
             self.delete_connection(uuid)
             
             msg = getLS(30115) #Refreshing
             self.status_label.setLabel(msg)
         
-            #time.sleep(10)
+            time.sleep(2)
             self.updateList()
             
             msg = getLS(30126) #Done
@@ -198,6 +254,7 @@ class GUI(xbmcgui.WindowXMLDialog):
             item = xbmcgui.ListItem (label=sts, label2 = connection_dict['id'])
             item.setProperty('ssid',connection_dict['ssid'])
             item.setProperty('uuid',connection_dict['uuid'])
+            item.setProperty('encryption',connection_dict['encryption'])
             self.list.addItem(item)
     
     
diff --git a/script.linux.nm/resources/lib/qfpynm.py 
b/script.linux.nm/resources/lib/qfpynm.py
index 7f2355d..e051b1d 100644
--- a/script.linux.nm/resources/lib/qfpynm.py
+++ b/script.linux.nm/resources/lib/qfpynm.py
@@ -27,12 +27,8 @@
 #    
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python
 
 
-#TODO Reverse the list puting strongest first
-#TODO What if more than one wifi card exists? list devices and select which 
one we mean
-#TODO catch errors on the dbus actions..including the import. Test with nm not 
installed etc.
 #TODO Check if the ssid is already added, if so just activate it and set to 
auto / or new name
-#TODO Test state when switching from one wifi to another. make sure no delay 
from state 100 on old
-
+#TODO Use itemgetter and attrgetter to handle config?
 
 #Longer term
 #TODO Add detection of group/enterprise encryption
@@ -40,6 +36,8 @@
 #TODO Add handling of static IP
 #TODO Add wired and 3G connections
 #TODO Change it all into a class?
+#TODO Add detailed config 
+
 
 #########################################################
 #    Limitations: 
@@ -49,6 +47,8 @@
 #    Only dhcp
 #    Does not display enterprise/group enncryptions
 
+#    Version 0.1.1 2012-05-17
+
 import dbus
 import uuid
 
@@ -129,10 +129,24 @@ def get_connections():
                 connection_dict['auto'] = config['connection']['autoconnect']
             else:
                 connection_dict['auto'] = 1
+            
+            if  '802-11-wireless-security' in config:
+                key_mgmt = config['802-11-wireless-security']['key-mgmt']
+                if key_mgmt == 'none':
+                    encryption = 'WEP'
+                elif key_mgmt == 'wpa-psk':
+                    encryption  = 'WPA'
+                else:
+                    encryption = 'UNKNOWN'
+            else:
+                encryption = 'NONE'
+            
+            connection_dict['encryption'] = encryption
                 
             connection_list.append(connection_dict)
                     
     return (connection_list)
+
         
 def print_connections():
     print 'SSID\t\tactive\tauto\tUUID\t\t\t\t\tID'
@@ -150,7 +164,27 @@ def print_connections():
             connection_dict['uuid'],
             connection_dict['id'],
             "")
+def list_wifi_devices():
+    # Get all network devices (list of device paths)
+    devices = nm_iface.GetDevices()
+    l = []
+    for d_path in devices:
+        dev_proxy = bus.get_object("org.freedesktop.NetworkManager", d_path )
+        dev_prop_iface = dbus.Interface(dev_proxy, 
"org.freedesktop.DBus.Properties")
+
+        # Make sure the device is enabled before we try to use it
+        state = dev_prop_iface.Get("org.freedesktop.NetworkManager.Device", 
"State")
+        if state <= 2:
+            continue
         
+        # Get device's type; we only want wifi devices
+        #iface = prop_iface.Get("org.freedesktop.NetworkManager.Device", 
"Interface")
+        dtype = dev_prop_iface.Get("org.freedesktop.NetworkManager.Device", 
"DeviceType")
+        if dtype == 2:   # WiFi
+            name = 
dev_prop_iface.Get("org.freedesktop.NetworkManager.Device","Interface")
+            l.append(name)
+    return l
+            
 def get_wifi_device():
     #Assuming only one exists
     #Returns device path
@@ -222,7 +256,8 @@ def get_wireless_networks():
 
         wlessL.append(net_dict)
         
-    return (wlessL)
+    SortedL = sorted(wlessL, key=lambda k: k['signal'],reverse=True)     
+    return (SortedL)
 
 def print_wireless():
     print '#\tBSSID\t\tChnl\tSts\tESSID\t\tenctype'
@@ -289,7 +324,7 @@ def delete_connection(uuid):
         
     con_iface.Delete()
 
-def create_wifi_config(ssid,akey,encryption,wep_alg):
+def create_wifi_config(ssid,akey,encryption,wep_alg,disable_ipv6):
     
     encryption = encryption.upper()
     if encryption[:3] == 'WPA':
@@ -309,9 +344,12 @@ def create_wifi_config(ssid,akey,encryption,wep_alg):
 
 
     s_ip4 = { 'method': 'auto', 'name': 'ipv4' } 
-    s_ip6 = { 'method': 'ignore', 'name': 'ipv6' } 
     
-
+    if disable_ipv6 == True:
+        s_ip6 = { 'method': 'ignore', 'name': 'ipv6' } 
+    else:
+        s_ip6 = { 'method': 'auto', 'name': 'ipv6' } 
+    
     s_wsec = {}
     if (encryption == "WPA"):
         s_wsec['key-mgmt'] = 'wpa-psk'
@@ -332,8 +370,8 @@ def create_wifi_config(ssid,akey,encryption,wep_alg):
         config = { 'connection': s_con, '802-11-wireless': s_wifi, 'ipv4': 
s_ip4,'ipv6': s_ip6 }
     return config
 
-def add_wifi(ssid,akey,encryption,wep_alg):
-    config = create_wifi_config(ssid,akey,encryption,wep_alg)
+def add_wifi(ssid,akey,encryption,wep_alg,disable_ipv6):
+    config = create_wifi_config(ssid,akey,encryption,wep_alg,disable_ipv6)
     con_path =  nm_settings_iface.AddConnection(config)
     activate_connection(get_con_uuid_by_path(con_path))
 
@@ -469,6 +507,7 @@ if __name__ == '__main__':
     print "7 State"
     print "8 Chnage pwd on WPA connection by UUID"
     print "9 Deactivete connection by UUID"
+    print "10 TEST"
     
     
     aSelect = raw_input('Please enter a value:')
@@ -489,7 +528,7 @@ if __name__ == '__main__':
         if not errors == '':
             print (errors)
             1/0
-        acon_path = add_wifi(aNetwork_id,akey,aencryption,wep_alg)
+        acon_path = add_wifi(aNetwork_id,akey,aencryption,wep_alg, False)
         import time
         for i in range(1, 150):
             state,stateTXT = get_device_state(get_wifi_device())
@@ -555,4 +594,10 @@ if __name__ == '__main__':
     if aSelect == "9":
         aUUID =  (raw_input('Enter UUID:'))
         deactivate_connection(aUUID)
-
+        
+    if aSelect == "10":
+        l = list_wifi_devices()    
+        print len(l)
+        print ','.join(l)
+        l = []
+        print len(l)
diff --git a/script.linux.nm/resources/settings.xml 
b/script.linux.nm/resources/settings.xml
index 5fac71b..0f9779a 100644
--- a/script.linux.nm/resources/settings.xml
+++ b/script.linux.nm/resources/settings.xml
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <settings>
-
+    <category label="32100">
+       <setting id="disable_ipv6" type="bool" label="32101" default="true"/>
+    </category>
 </settings>
diff --git 
a/script.linux.nm/resources/skins/default/720p/script_linux_nm-add.xml 
b/script.linux.nm/resources/skins/default/720p/script_linux_nm-add.xml
index f07f049..f035b3b 100644
--- a/script.linux.nm/resources/skins/default/720p/script_linux_nm-add.xml
+++ b/script.linux.nm/resources/skins/default/720p/script_linux_nm-add.xml
@@ -1,5 +1,5 @@
 <window id="129">

-       <defaultcontrol>10</defaultcontrol>

+       <defaultcontrol>11</defaultcontrol>

        <coordinates>

                <system>1</system>

                <posx>240</posx>

@@ -313,7 +313,7 @@
                        <posx>580</posx>

                        <posy>105</posy>

                        <control type="button" id="11">

-                               <description>Scan button</description>

+                               <description>add button</description>

                                <label>$ADDON[script.linux.nm 629]</label>

                                <visible>true</visible>

                                <posx>0</posx>

@@ -331,7 +331,7 @@
                                <ondown>13</ondown>

                        </control>

                        <control type="button" id="13">

-                               <description>Disconnect</description>

+                               <description>refresh</description>

                                <label>$ADDON[script.linux.nm 630]</label>

                                <visible>true</visible>

                                <posx>0</posx>

diff --git 
a/script.linux.nm/resources/skins/default/720p/script_linux_nm-main.xml 
b/script.linux.nm/resources/skins/default/720p/script_linux_nm-main.xml
index 93a0b22..d0c8970 100644
--- a/script.linux.nm/resources/skins/default/720p/script_linux_nm-main.xml
+++ b/script.linux.nm/resources/skins/default/720p/script_linux_nm-main.xml
@@ -193,6 +193,7 @@
                                <control type="label">

                                        <posx>320</posx>

                                        <posy>0</posy>

+                                       <visible>false</visible>

                                        <width>120</width>

                                        <height>40</height>

                                        <font>font13</font>

@@ -272,6 +273,7 @@
                                <control type="label">

                                        <posx>320</posx>

                                        <posy>0</posy>

+                                       <visible>false</visible>

                                        <width>120</width>

                                        <height>40</height>

                                        <font>font13</font>


-----------------------------------------------------------------------

Summary of changes:
 script.linux.nm/addon.xml                          |    3 +-
 script.linux.nm/changelog.txt                      |   12 ++
 script.linux.nm/default.py                         |   13 ++-
 .../resources/language/English/strings.xml         |   11 ++-
 script.linux.nm/resources/lib/addConnection.py     |  106 +++++++++++--------
 script.linux.nm/resources/lib/gui.py               |  111 +++++++++++++++-----
 script.linux.nm/resources/lib/qfpynm.py            |   71 ++++++++++---
 script.linux.nm/resources/settings.xml             |    4 +-
 .../skins/default/720p/script_linux_nm-add.xml     |    6 +-
 .../skins/default/720p/script_linux_nm-main.xml    |    2 +
 10 files changed, 237 insertions(+), 102 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to