ContentView tabs now switch based on sidebar
This required a change to the Provider URL format to simplify testing of tabs with different content.
This commit is contained in:
@@ -49,9 +49,9 @@ def getUrl(base: str, path: str) -> dict:
|
||||
|
||||
|
||||
class Provider(QObject):
|
||||
def __init__(self, ip: str, port: int, parent=None):
|
||||
def __init__(self, url: str, parent=None):
|
||||
super().__init__(parent)
|
||||
self.url: str = f"http://{ip}:{port}"
|
||||
self.url: str = url
|
||||
|
||||
describe: dict = getUrl(self.url, "describe")
|
||||
self._name: str = describe["name"]
|
||||
@@ -85,9 +85,7 @@ class Provider(QObject):
|
||||
|
||||
class DataSource:
|
||||
def __init__(self, providers=[]):
|
||||
self.providers: list[Provider] = [
|
||||
Provider(ip, port) for (ip, port) in providers
|
||||
]
|
||||
self.providers: list[Provider] = [Provider(url) for url in providers]
|
||||
|
||||
|
||||
def DatabaseType(data_source) -> Type:
|
||||
@@ -109,7 +107,11 @@ def main():
|
||||
|
||||
# data_source = DataSource(["Anime", "TV", "Movies", "Settings"])
|
||||
data_source = DataSource(
|
||||
[("127.0.0.1", "8080"), ("127.0.0.1", "8080"), ("127.0.0.1", "8080")]
|
||||
[
|
||||
"http://127.0.0.1:8080/a/",
|
||||
"http://127.0.0.1:8080/b/",
|
||||
"http://127.0.0.1:8080/c/",
|
||||
]
|
||||
)
|
||||
|
||||
qmlRegisterType(DatabaseType(data_source), "Ikinuki.Client", 1, 0, "Database")
|
||||
|
||||
Reference in New Issue
Block a user