summaryrefslogtreecommitdiff
path: root/gui/qml/logic.js
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-24 20:35:09 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-24 20:35:23 +0100
commita234a8ef5bf8564221f615d0010a810e501905bb (patch)
tree100c2d12d0ac1a9c08ec9c3ce9fcc85bf55294f7 /gui/qml/logic.js
parent4e92b1103dc0ea1eba07f2568afd1c250aee31d1 (diff)
[ui] remove old qml folder
Diffstat (limited to 'gui/qml/logic.js')
-rw-r--r--gui/qml/logic.js77
1 files changed, 0 insertions, 77 deletions
diff --git a/gui/qml/logic.js b/gui/qml/logic.js
deleted file mode 100644
index 4709008..0000000
--- a/gui/qml/logic.js
+++ /dev/null
@@ -1,77 +0,0 @@
-var status = 'off';
-var needsReconnect = false;
-
-function setNeedsReconnect(val) {
- needsReconnect = val;
-}
-
-function getNeedsReconnect() {
- return needsReconnect;
-}
-
-function setStatus(st) {
- status = st;
-}
-
-function getStatus() {
- return status;
-}
-
-function setNeedsDonate(val) {
- needsDonate = val;
-}
-
-function toHuman(st) {
- switch (st) {
- case "off":
- //: %1 -> application name
- return qsTr("%1 off").arg(ctx.appName)
- case "on":
- //: %1 -> application name
- return qsTr("%1 on").arg(ctx.appName)
- case "connecting":
- //: %1 -> application name
- return qsTr("Connecting to %1").arg(ctx.appName)
- case "stopping":
- //: %1 -> application name
- return qsTr("Stopping %1").arg(ctx.appName)
- case "failed":
- //: %1 -> application name
- return qsTr("%1 blocking internet").arg(
- ctx.appName) // TODO failed is not handled yet
- }
-}
-
-// Helper to show notification messages
-function showNotification(ctx, msg) {
- console.log("Going to show notification message: ", msg)
- if (supportsMessages) {
- let appname = ctx ? ctx.appName : "VPN"
- showMessage(appname, msg, null, 15000)
- } else {
- console.log("System doesn't support systray notifications")
- }
-}
-
-function shouldAllowEmptyPass(providers) {
- let obj = JSON.parse(providers.getJson())
- let active = obj['default']
- let allProviders = obj['providers']
- for (var i = 0; i < allProviders.length; i++) {
- if (allProviders[i]['name'] === active) {
- return (allProviders[i]['authEmptyPass'] === 'true')
- }
- }
- return false
-}
-
-function getSelectedProvider(providers) {
- let obj = JSON.parse(providers.getJson())
- return obj['default']
-}
-
-function debugInit() {
- console.debug("Platform:", Qt.platform.os)
- console.debug("DEBUG: Pre-seeded providers:")
- console.debug(providers.getJson())
-}