mirror of
https://github.com/daijro/camoufox.git
synced 2026-08-18 16:00:58 +00:00
Missing geoip support message in gui
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user