def do_activate(self):
        WebPlayer.DBAccess.rbshell = self.object
        WebPlayer.PlayerControl.rbshell = self.object
        Views.Views.rbplugin = self
        Views.Views.add_template_path("web/")

        # Get port and adress settings from schema
        port = settings.get_int("server-port")
        address = settings.get_string("server-address")
        print ("starting server " + address + ":" + str(port) + " ...")
        self.__server = WebServer(address, port, "webplayer.settings")
        self.__server.start()
    def do_create_configure_widget(self):
        builder = Gtk.Builder()
        builder.add_from_file(
            rb.find_plugin_file(self, "ui/rhythmremote-prefs.ui"))

        # Get the preferences dialog widgets
        self.address_entry = builder.get_object("server_ip")
        self.port_entry = builder.get_object("server_port")
        self.apply_button = builder.get_object("apply_button")
        self.prefs_frame = builder.get_object("prefs_frame")

        # Populate the Entry widgets with values stored in the schema
        self.address_entry.set_text(settings.get_string("server-address"))
        self.port_entry.set_text(str(settings.get_int("server-port")))

        # Connect a handler to update settings in the schema
        self.apply_button.connect("clicked", self.on_apply_button_clicked)

        return self.prefs_frame