Browse Source

Different way of doing progress bars

Bob Mottram 7 years ago
parent
commit
fccc78c627
1 changed files with 20 additions and 2 deletions
  1. 20
    2
      src/freedombone-controlpanel

+ 20
- 2
src/freedombone-controlpanel View File

@@ -69,11 +69,29 @@ done
69 69
 
70 70
 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
71 71
 file_ctr=0
72
-for f in $UTILS_FILES; do echo "$((file_ctr * 100 / utils_files))"; include_source $f; file_ctr=$((file_ctr + 1)); done | dialog --gauge $"Loading utilities" 7 70 0
72
+dialog --title "$PROJECT_NAME" --gauge "Loading utils..." 7 75 < <(
73
+    for f in $UTILS_FILES
74
+    do
75
+        echo "$((file_ctr * 100 / utils_files))";
76
+cat <<EOF
77
+source $f
78
+EOF
79
+        file_ctr=$((file_ctr + 1))
80
+    done
81
+)
73 82
 
74 83
 APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
75 84
 file_ctr=0
76
-for f in $APP_FILES; do echo "$((file_ctr * 100 / apps_files))"; include_source $f; file_ctr=$((file_ctr + 1)); done | dialog --gauge $"Loading apps" 7 70 0
85
+dialog --title "$PROJECT_NAME" --gauge "Loading apps..." 7 75 < <(
86
+    for f in $APP_FILES
87
+    do
88
+        echo "$((file_ctr * 100 / apps_files))";
89
+cat <<EOF
90
+source $f
91
+EOF
92
+        file_ctr=$((file_ctr + 1))
93
+    done
94
+)
77 95
 
78 96
 COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
79 97
 SELECTED_USERNAME=