Ejemplo n.º 1
0
 def save_settings(self):
     settings = UserSettings("Rpcd")
     settings.beginGroup("Client")
     hosts_list = [self.host]
     for i in xrange(self.host_edit.count()):
         s = unicode(self.host_edit.itemText(i))
         if s != self.host:
             hosts_list.append(s)
     settings.setStringList("host", hosts_list)
     settings.setUnicode("login", self.login)
     settings.setInt("port", self.port)
     settings.setInt("streaming_port", self.streaming_port)
     settings.setUnicode("protocol", self.protocol)
     # no, we won't save the password (plain text)
     settings.endGroup()
Ejemplo n.º 2
0
    def load_settings(self):
        settings = UserSettings("Rpcd")
        settings.beginGroup("Client")
        self.login = settings.getUnicode("login", DEFAULT_LOGIN)

        host_list = settings.getStringList("host", None)
        if not host_list:
            host_list = [DEFAULT_HOST]
        self.host = unicode(host_list[0])
        for host in host_list:
            self.host_edit.addItem(host)

        self.protocol = settings.getUnicode("protocol", DEFAULT_PROTOCOL)
        self.port = settings.getInt("port", DEFAULT_HTTPS_PORT)
        self.streaming_port = settings.getInt("streaming_port", DEFAULT_STREAMING_PORT)
        settings.endGroup()