~brian-murray/update-manager/open-url-fix

« back to all changes in this revision

Viewing changes to UpdateManager/Core/roam.py

  • Committer: Michael Vogt
  • Date: 2011-03-01 06:02:25 UTC
  • Revision ID: michael.vogt@ubuntu.com-20110301060225-mswoyihf1wjf69mg
display warning when on 3g and when roaming

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
        property = props.Get(interface, property)
118
118
        return property
119
119
 
120
 
    def is_active_connection_gsm_or_cdma_roaming(self):
 
120
    def is_active_connection_gsm_or_cdma(self):
121
121
        res = False
122
122
        actives = self.get_dbus_property(
123
123
            self.proxy, self.NM_DBUS_IFACE, 'ActiveConnections')
134
134
                type = self.get_dbus_property(
135
135
                    dev, self.NM_DBUS_IFACE + ".Device", 'DeviceType')
136
136
                if type == self.NM_DEVICE_TYPE_GSM:
137
 
                    mmhelper = ModemManagerHelper()
138
 
                    res |= mmhelper.is_gsm_roaming()
 
137
                    return True
139
138
                elif type == self.NM_DEVICE_TYPE_CDMA:
140
 
                    mmhelper = ModemManagerHelper()
141
 
                    res |= mmhelper.is_cdma_roaming()
 
139
                    return True
142
140
                else:
143
141
                    continue
144
142
        return res
145
143
 
 
144
    def is_active_connection_gsm_or_cdma_roaming(self):
 
145
        res = False
 
146
        if self.is_active_connection_gsm_or_cdma():
 
147
            mmhelper = ModemManagerHelper()
 
148
            res |= mmhelper.is_gsm_roaming()
 
149
            res |= mmhelper.is_cdma_roaming()
 
150
        return res
 
151
 
146
152
if __name__ == "__main__":
147
153
    
148
154
    # test code