def init(self, connection):
        if connection == None:
            self.connection_type = None
        else:
            self.connection = connection
            mobile_type = connection.get_setting("connection").type
            self.connection_type = mobile_type
        Dispatcher.send_submodule_crumb(_("Region"), 2)

        from mm.provider import ServiceProviders
        self.__sp = ServiceProviders()
        self.country_list = self.__sp.get_country_name_list()
        self.country_tree.delete_all_items()
        self.country_tree.add_items(
            [CountryItem(_(country)) for country in self.country_list])
        # add a bottom line for last item

        code = self.__sp.get_country_from_timezone()

        self.country_codes = self.__sp.get_country_list()
        try:
            selected_country = self.country_tree.visible_items[
                self.country_codes.index(code)]
            self.country_tree.select_items([selected_country])
            self.auto_scroll_to()
            self.country_tree.emit("button-press-item", selected_country, 0, 1,
                                   1)
        except:
            pass
Ejemplo n.º 2
0
    def init(self, connection):
        if connection == None:
            self.connection_type = None
        else:
            self.connection = connection
            mobile_type = connection.get_setting("connection").type
            self.connection_type = mobile_type
        Dispatcher.send_submodule_crumb(_("Region"), 2)

        from mm.provider import ServiceProviders
        self.__sp = ServiceProviders()
        self.country_list = self.__sp.get_country_name_list()
        self.country_tree.delete_all_items()
        self.country_tree.add_items([CountryItem(_(country)) for country in self.country_list])
        # add a bottom line for last item

        code = self.__sp.get_country_from_timezone()

        self.country_codes = self.__sp.get_country_list()
        try:
            selected_country = self.country_tree.visible_items[self.country_codes.index(code)]
            self.country_tree.select_items([selected_country])
            self.auto_scroll_to()
            self.country_tree.emit("button-press-item", selected_country, 0, 1, 1)
        except:
            pass
    def load_list(self, network_object):
        '''
        will add hasattr part for network_object
        '''

        log.info("sidebar start load list")
        self.network_object = network_object
        self.connections = self.network_object.get_connections()
        #print self.connections, "load_list"
        connections = []
        for connection in self.connections:
            if isinstance(connection, NMRemoteConnection):
                connection.init_settings_prop_dict()
            connections.append(connection)
        self.connections = connections
        self.connection_tree = EntryTreeView()
        self.connection_tree.set_expand_column(1)
        self.__init_tree(self.connections)

        if hasattr(self.network_object, "add_new_connection"):
            self.new_connection = self.network_object.add_new_connection
            #self.add_button.change_add_setting(self.network_object.add_new_connection)
        if hasattr(self.network_object, "delete_request_redraw"):
            self.request_redraw = self.network_object.delete_request_redraw
        self.init_select(network_object.spec_connection)
        # FIXME: COME ON, why check the connections count?!
        #if self.connections !=[]:
        crumb_name = network_object.crumb_name
        if crumb_name == "":
            crumb_name = _("Hidden network")
        Dispatcher.send_submodule_crumb(2, crumb_name)
        Dispatcher.slide_to_page("setting", "none")
    def load_list(self, network_object):
        '''
        will add hasattr part for network_object
        '''
        
        log.info("sidebar start load list")
        self.network_object = network_object
        self.connections = self.network_object.get_connections()
        #print self.connections, "load_list"
        connections = []
        for connection in self.connections:
            if isinstance(connection, NMRemoteConnection):
                connection.init_settings_prop_dict()
            connections.append(connection)
        self.connections = connections
        self.connection_tree = EntryTreeView()
        self.connection_tree.set_expand_column(1)
        self.__init_tree(self.connections)

        if hasattr(self.network_object, "add_new_connection"):
            self.new_connection = self.network_object.add_new_connection
            #self.add_button.change_add_setting(self.network_object.add_new_connection)
        if hasattr(self.network_object, "delete_request_redraw"):
            self.request_redraw = self.network_object.delete_request_redraw
        self.init_select(network_object.spec_connection)
        # FIXME: COME ON, why check the connections count?!
        #if self.connections !=[]:
        crumb_name = network_object.crumb_name
        if crumb_name == "":
            crumb_name = _("Hidden network")
        Dispatcher.send_submodule_crumb(2, crumb_name)
        Dispatcher.slide_to_page("setting", "none")
 def slide_to_event(self, widget, event):
     settings = ProxyConfig()
     settings.init()
     slider.slide_to_page(settings, "none")
     Dispatcher.send_submodule_crumb(2, _("Proxy"))
Ejemplo n.º 6
0
 def slide_to_event(self, widget, event):
     settings = ProxyConfig()
     settings.init()
     slider.slide_to_page(settings, "none")
     Dispatcher.send_submodule_crumb(2, _("Proxy"))
 def advanced_button_click(self, widget):
     ppp = PPPConf(self.module_frame, Dispatcher.set_button)
     ppp.refresh(self.connection)
     Dispatcher.send_submodule_crumb(3, _("Advanced"))
     nm_module.slider.slide_to_page(ppp, "none")
 def advanced_button_click(self, widget):
     ppp = PPPConf(self.module_frame, Dispatcher.set_button)
     ppp.refresh(self.connection)
     Dispatcher.send_submodule_crumb(3, _("Advanced"))
     nm_module.slider.slide_to_page(ppp, "none")