Missing geoip support message in gui

This commit is contained in:
daijro
2026-02-07 19:53:30 -06:00
parent 3c13e6ed5f
commit febffaa85c
2 changed files with 36 additions and 1 deletions
+7
View File
@@ -272,6 +272,7 @@ class Backend(QObject):
self._worker = None
self._channel_data = None
self._geoip_available = False
self._geoip_sources = []
self._geoip_names = []
self._geoip_installed = ""
@@ -335,6 +336,10 @@ class Backend(QObject):
item = self._version_model.get(self._selected)
return item.is_prerelease if item else False
@Property(bool, notify=geoipChanged)
def geoipAvailable(self):
return self._geoip_available
@Property(list, notify=geoipChanged)
def geoipSources(self):
return self._geoip_sources
@@ -788,9 +793,11 @@ class Backend(QObject):
)
if not ALLOW_GEOIP:
self._geoip_available = False
self.geoipChanged.emit()
return
self._geoip_available = True
repos, _ = _load_geoip_repos()
self._geoip_names = self._geoip_sources = [r.get('name', '?') for r in repos]
+29 -1
View File
@@ -861,8 +861,35 @@ ApplicationWindow {
}
}
Rectangle {
Layout.fillWidth: true
visible: !backend.geoipAvailable
height: visible ? notInstalledCol.height + s4 * 2 : 0
color: c.fg
ColumnLayout {
id: notInstalledCol
anchors.centerIn: parent
spacing: s2
T {
Layout.alignment: Qt.AlignHCenter
text: "IP Geolocation support is missing."
font.pixelSize: textMd
}
T {
Layout.alignment: Qt.AlignHCenter
text: "Run: pip install camoufox[geoip]"
color: c.muted
font.family: root.fontMain
}
}
}
Column {
Layout.fillWidth: true
visible: backend.geoipAvailable
spacing: 0
Repeater {
@@ -940,10 +967,11 @@ ApplicationWindow {
}
}
Rule { Layout.fillWidth: true; Layout.topMargin: s3 }
Rule { Layout.fillWidth: true; Layout.topMargin: s3; visible: backend.geoipAvailable }
// IP Lookup
ColumnLayout {
visible: backend.geoipAvailable
Layout.fillWidth: true
Layout.margins: s4
spacing: s2