alqindiirsyam 2 жил өмнө
parent
commit
1b8a61ae0e

+ 15 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/BackupRestoreView.swift

@@ -8,6 +8,7 @@
 import UIKit
 import QuickLook
 import Zip
+import NotificationBannerSwift
 
 public class BackupRestoreView: UIViewController, UITableViewDataSource, UITableViewDelegate {
     private var tableView: UITableView!
@@ -204,6 +205,13 @@ public class BackupRestoreView: UIViewController, UITableViewDataSource, UITable
             if isBackupStart || isRestoreStart {
                 return
             }
+            if !CheckConnection.isConnectedToNetwork() {
+                let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
+                imageView.tintColor = .white
+                let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
+                banner.show()
+                return
+            }
             isBackupStart = true
             labelPreparing.text = "Preparing...".localized();
             tableView.beginUpdates()
@@ -216,6 +224,13 @@ public class BackupRestoreView: UIViewController, UITableViewDataSource, UITable
             if isBackupStart || isRestoreStart || valueLastBackup == "-" {
                 return
             }
+            if !CheckConnection.isConnectedToNetwork() {
+                let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
+                imageView.tintColor = .white
+                let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
+                banner.show()
+                return
+            }
             isRestoreStart = true
             labelRestoring.text = "Downloading...".localized();
             tableView.beginUpdates()

+ 7 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/SetInternalCSAccount.swift

@@ -226,6 +226,13 @@ public class SetInternalCSAccount: UITableViewController {
     
     public override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         tableView.deselectRow(at: indexPath, animated: true)
+        if !CheckConnection.isConnectedToNetwork() {
+            let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
+            imageView.tintColor = .white
+            let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
+            banner.show()
+            return
+        }
         let user: User
         if isFilltering {
             user = fillteredUser[indexPath.row]

+ 37 - 3
src/mainPalio4.py

@@ -144,7 +144,7 @@ def change_font(path_dest, font, package):
                 f.write(replaced)
 
 
-def change_package(path_dest, package):
+def change_package(path_dest, package, enable_location):
     build_gradle = os.path.join(path_dest, 'app/build.gradle')
     with open(build_gradle, "r") as f:
         file_source = f.read()
@@ -185,6 +185,37 @@ def change_package(path_dest, package):
         with open(j, "w") as f:
             f.write(replaced)
 
+    queue_page = os.path.join(path_dest, code_path, "QueueBank.java")
+    with open(queue_page, "r") as f:
+        lines = f.readlines()
+    with open(queue_page, "w") as f:
+        counter = 0
+        for line in lines:
+            if counter == 0:
+                if enable_location == 0 and "LocationOn1" in line:
+                    counter = 9
+                if enable_location == 0 and "LocationOn2" in line:
+                    counter = 17
+                else:
+                    f.write(line)
+            else:
+                counter = counter - 1
+
+    manifest = os.path.join(path_dest, "app/src/main/AndroidManifest.xml")
+    with open(manifest, "r") as f:
+        lines = f.readlines()
+    with open(manifest, "w") as f:
+        counter = 0
+        for line in lines:
+            if counter == 0:
+                if enable_location == 0 and "<!-- LocationOn/Off -->" in line:
+                    counter = 3
+                else:
+                    f.write(line)
+            else:
+                counter = counter - 1
+
+
     if package.__contains__('digipos') or package.__contains__('digisales'):
         settings_gradle = os.path.join(path_dest, "settings.gradle")
         with open(settings_gradle, "r") as f:
@@ -565,6 +596,7 @@ def build_apk():
         version_name = "1.0.0"
         font = 0
         enable_sms = 0
+        enable_location = 0
         key = {"alias": "nexilislite", "store_password": "allyourbase", "key_password": "allyourbase",
                "common_name": "all", "organization_unit": "your",
                "organization_name": "base", "locality_name": "are", "state_name": "belong", "country": "to"}
@@ -719,6 +751,8 @@ def build_apk():
                 version_name = "1.0.{}".format(version_code)
             if 'enable_sms' in request.form:
                 enable_sms = int(request.form['enable_sms'])
+            if 'enable_location' in request.form:
+                enable_sms = int(request.form['enable_location'])
         except BaseException as e:
             vprint(traceback.format_exc())
             return {"status": "1", "message": "Parameter mismatch\n{}\n".format(str(e))}
@@ -730,9 +764,9 @@ def build_apk():
                 change_acc(c_code_path, acc, enable_sms)
             if url:
                 change_url(c_code_path, url)
-            change_name(path_dest, app_name, enable_sms)
+            change_name(path_dest, app_name, enable_sms, enable_location)
             change_certificate(path_dest, key, keystore, app.keytool)
-            change_package(path_dest, package_id)
+            change_package(path_dest, package_id, enable_location)
             change_version(path_dest, version_code, version_name)
             change_font(path_dest, font, package_id)
             if logo: