mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-18 07:49:26 +00:00
Scripts: File › Scripts shows a Loading scripts row until the folder is first read
Before the first read of the Scripts folder ended, File › Scripts showed only Check Script… and Other Script…, the same as an empty folder. The menu now shows a disabled "Loading scripts…" row above them until the first listing arrives, and "The Scripts folder is still being read" once that read has taken 2 seconds. A first read that cannot start, or ends without a listing, shows "The Scripts folder cannot be read", and the next read tries again. Later reads keep the last listing in the menu while they run. The menu revision changes when the row appears, turns slow and goes away, so the macOS menu bar rebuilds with it. Both labels have rows in every catalog, and docs/mcp.md describes the row next to the other Scripts-folder notes.
This commit is contained in:
@@ -2439,6 +2439,8 @@ font-technology Variable Променливи
|
||||
Other Library… Друга библиотека…
|
||||
Some scripts were not listed Някои скриптове не са изброени
|
||||
The Scripts folder cannot be read Папката Scripts не може да бъде прочетена
|
||||
Loading scripts… Зареждане на скриптовете…
|
||||
The Scripts folder is still being read Папката Scripts все още се чете
|
||||
Other Script… Друг скрипт…
|
||||
Out of Gamut Warning Предупреждение за излизане извън цветовата гама
|
||||
Out of Web Color Warning Предупреждение за цвят извън уеб палитрата
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -64,6 +64,8 @@
|
||||
Check Script Provjeri skriptu
|
||||
Some scripts were not listed Neke skripte nisu navedene
|
||||
The Scripts folder cannot be read Folder Scripts se ne može pročitati
|
||||
Loading scripts… Učitavanje skripti…
|
||||
The Scripts folder is still being read Folder Scripts se još čita
|
||||
Other Script… Druga skripta…
|
||||
Document Setup… Postavke dokumenta…
|
||||
Switch Units Promijeni jedinice
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -5680,6 +5680,8 @@ digits Malayalam Malaiàlam
|
||||
@msg the script is no longer in the Scripts folder l'script ja no és a la carpeta Scripts
|
||||
Some scripts were not listed Alguns scripts no s'han llistat
|
||||
The Scripts folder cannot be read No es pot llegir la carpeta Scripts
|
||||
Loading scripts… S’estan carregant els scripts…
|
||||
The Scripts folder is still being read Encara s’està llegint la carpeta Scripts
|
||||
@msg the script's run is no longer available l'execució de l'script ja no està disponible
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped una ordre fallida ha canviat passos de desfer que no s'han pogut restaurar, així que l'script s'ha aturat
|
||||
@msg a recovery copy could not be written, so the script was not run no s'ha pogut escriure una còpia de recuperació, per tant l'script no s'ha executat
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -4771,6 +4771,8 @@ imageTrace Outline Obrys
|
||||
@msg the script is no longer in the Scripts folder skript už není ve složce Scripts
|
||||
Some scripts were not listed Některé skripty nebyly uvedeny
|
||||
The Scripts folder cannot be read Složku Scripts nelze přečíst
|
||||
Loading scripts… Načítání skriptů…
|
||||
The Scripts folder is still being read Složka Scripts se stále načítá
|
||||
@msg the script's run is no longer available běh skriptu již není k dispozici
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped neúspěšný příkaz změnil kroky zpět, které nebylo možné obnovit, proto byl skript zastaven
|
||||
@msg a recovery copy could not be written, so the script was not run záložní kopii se nepodařilo zapsat, proto skript nebyl spuštěn
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -742,6 +742,8 @@ liquify-list-end {0}, {1} {0} og {1}
|
||||
Check Script Kontrollér script
|
||||
Some scripts were not listed Nogle scripter blev ikke vist
|
||||
The Scripts folder cannot be read Mappen Scripts kan ikke læses
|
||||
Loading scripts… Indlæser scripter…
|
||||
The Scripts folder is still being read Mappen Scripts læses stadig
|
||||
Other Script… Andet script…
|
||||
Document Setup… Dokumentopsætning…
|
||||
Switch Units Skift enheder
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4370,6 +4370,8 @@ theme Appearance Erscheinungsbild
|
||||
@msg the script is no longer in the Scripts folder das Skript befindet sich nicht mehr im Ordner „Scripts“
|
||||
Some scripts were not listed Einige Skripte wurden nicht aufgeführt
|
||||
The Scripts folder cannot be read Der Ordner „Scripts“ kann nicht gelesen werden
|
||||
Loading scripts… Skripte werden geladen…
|
||||
The Scripts folder is still being read Der Ordner „Scripts“ wird noch gelesen
|
||||
@msg the script's run is no longer available der Lauf des Skripts ist nicht mehr verfügbar
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped ein fehlgeschlagener Befehl hat Rückgängig-Schritte geändert, die nicht wiederhergestellt werden konnten, daher wurde das Skript angehalten
|
||||
@msg a recovery copy could not be written, so the script was not run eine Wiederherstellungskopie konnte nicht geschrieben werden, daher wurde das Skript nicht ausgeführt
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2442,6 +2442,8 @@ axis Both Και τα δύο
|
||||
@msg the script is no longer in the Scripts folder το σενάριο δεν βρίσκεται πλέον στον φάκελο Scripts
|
||||
Some scripts were not listed Ορισμένα σενάρια δεν εμφανίζονται στη λίστα
|
||||
The Scripts folder cannot be read Δεν είναι δυνατή η ανάγνωση του φακέλου Scripts
|
||||
Loading scripts… Φόρτωση σεναρίων…
|
||||
The Scripts folder is still being read Ο φάκελος Scripts διαβάζεται ακόμα
|
||||
@msg the script's run is no longer available η εκτέλεση του σεναρίου δεν είναι πλέον διαθέσιμη
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped μια εντολή που απέτυχε άλλαξε βήματα αναίρεσης που δεν ήταν δυνατό να επαναφερθούν, οπότε το σενάριο σταμάτησε
|
||||
@msg a recovery copy could not be written, so the script was not run δεν ήταν δυνατή η εγγραφή αντιγράφου ανάκτησης, οπότε το σενάριο δεν εκτελέστηκε
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4452,6 +4452,8 @@ axis Both Ambos
|
||||
@msg the script is no longer in the Scripts folder el script ya no está en la carpeta Scripts
|
||||
Some scripts were not listed Algunos scripts no se han incluido en la lista
|
||||
The Scripts folder cannot be read No se puede leer la carpeta Scripts
|
||||
Loading scripts… Cargando scripts…
|
||||
The Scripts folder is still being read Aún se está leyendo la carpeta Scripts
|
||||
@msg the script's run is no longer available la ejecución del script ya no está disponible
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped un comando fallido cambió pasos de deshacer que no se pudieron restaurar, así que el script se detuvo
|
||||
@msg a recovery copy could not be written, so the script was not run no se pudo escribir una copia de recuperación, así que el script no se ejecutó
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -4685,6 +4685,8 @@ imageTrace Outline Ääriviiva
|
||||
@msg the script is no longer in the Scripts folder komentosarja ei ole enää Scripts-kansiossa
|
||||
Some scripts were not listed Kaikkia komentosarjoja ei ole lueteltu
|
||||
The Scripts folder cannot be read Scripts-kansiota ei voi lukea
|
||||
Loading scripts… Ladataan komentosarjoja…
|
||||
The Scripts folder is still being read Scripts-kansiota luetaan vielä
|
||||
@msg the script's run is no longer available komentosarjan suoritus ei ole enää käytettävissä
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped epäonnistunut komento muutti kumoamisvaiheita, joita ei voitu palauttaa, joten komentosarja pysäytettiin
|
||||
@msg a recovery copy could not be written, so the script was not run palautuskopiota ei voitu kirjoittaa, joten komentosarjaa ei suoritettu
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -4437,6 +4437,8 @@ axis Both Les deux
|
||||
@msg the script is no longer in the Scripts folder le script ne se trouve plus dans le dossier Scripts
|
||||
Some scripts were not listed Certains scripts ne sont pas répertoriés
|
||||
The Scripts folder cannot be read Impossible de lire le dossier Scripts
|
||||
Loading scripts… Chargement des scripts…
|
||||
The Scripts folder is still being read Le dossier Scripts est encore en cours de lecture
|
||||
@msg the script's run is no longer available l’exécution du script n’est plus disponible
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped une commande en échec a modifié des étapes d’annulation qui n’ont pas pu être rétablies, le script a donc été arrêté
|
||||
@msg a recovery copy could not be written, so the script was not run une copie de récupération n’a pas pu être écrite, le script n’a donc pas été exécuté
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3922,6 +3922,8 @@
|
||||
Thai થાઈ
|
||||
The Print Tiling tool placed the pages. પ્રિન્ટ ટાઇલિંગ ટૂલે પૃષ્ઠો ગોઠવ્યાં.
|
||||
The Scripts folder cannot be read સ્ક્રિપ્ટ્સ ફોલ્ડર વાંચી શકાતું નથી
|
||||
Loading scripts… સ્ક્રિપ્ટ લોડ થઈ રહી છે…
|
||||
The Scripts folder is still being read સ્ક્રિપ્ટ્સ ફોલ્ડર હજી વંચાઈ રહ્યું છે
|
||||
The VECTORCRAFT_TITLEBAR environment variable chooses the title bar while it is set. જ્યારે VECTORCRAFT_TITLEBAR એન્વાયર્નમેન્ટ વેરિએબલ સેટ હોય ત્યારે તે ટાઇટલ બાર પસંદ કરે છે.
|
||||
The active document changed while the screen color sampler was open સ્ક્રીન રંગ સેમ્પલર ખુલ્લું હતું ત્યારે સક્રિય દસ્તાવેજ બદલાયો
|
||||
The art keeps its own colors. આર્ટમાં પોતાના રંગો રહે છે.
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -6799,6 +6799,8 @@ antiAlias Sharp शार्प
|
||||
@msg the script is no longer in the Scripts folder स्क्रिप्ट अब Scripts फ़ोल्डर में नहीं है
|
||||
Some scripts were not listed कुछ स्क्रिप्ट सूचीबद्ध नहीं की गईं
|
||||
The Scripts folder cannot be read Scripts फ़ोल्डर पढ़ा नहीं जा सकता
|
||||
Loading scripts… स्क्रिप्ट लोड हो रही हैं…
|
||||
The Scripts folder is still being read Scripts फ़ोल्डर अभी भी पढ़ा जा रहा है
|
||||
@msg the script's run is no longer available स्क्रिप्ट का रन अब उपलब्ध नहीं है
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped एक विफल कमांड ने पूर्ववत चरण बदल दिए जिन्हें वापस नहीं रखा जा सका, इसलिए स्क्रिप्ट रोक दी गई
|
||||
@msg a recovery copy could not be written, so the script was not run रिकवरी प्रति नहीं लिखी जा सकी, इसलिए स्क्रिप्ट नहीं चलाई गई
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -5273,6 +5273,8 @@ imageTrace Outline Körvonal
|
||||
@msg the script is no longer in the Scripts folder a parancsfájl már nincs a Scripts mappában
|
||||
Some scripts were not listed Néhány szkript nem szerepel a listában
|
||||
The Scripts folder cannot be read A Scripts mappa nem olvasható
|
||||
Loading scripts… Szkriptek betöltése…
|
||||
The Scripts folder is still being read A Scripts mappa olvasása még tart
|
||||
@msg the script's run is no longer available a parancsfájl futása már nem érhető el
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped egy sikertelen parancs olyan visszavonási lépéseket módosított, amelyeket nem lehetett visszaállítani, ezért a parancsfájl leállt
|
||||
@msg a recovery copy could not be written, so the script was not run a helyreállítási másolatot nem sikerült kiírni, ezért a parancsfájl nem futott le
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -57,6 +57,8 @@
|
||||
Check Script Periksa skrip
|
||||
Some scripts were not listed Beberapa skrip tidak dicantumkan
|
||||
The Scripts folder cannot be read Folder Scripts tidak dapat dibaca
|
||||
Loading scripts… Memuat skrip…
|
||||
The Scripts folder is still being read Folder Scripts masih dibaca
|
||||
Other Script… Skrip lain…
|
||||
Document Setup… Pengaturan dokumen…
|
||||
Switch Units Ganti satuan
|
||||
|
||||
|
@@ -4504,6 +4504,8 @@ axis Both Entrambi
|
||||
@msg the script is no longer in the Scripts folder lo script non è più nella cartella Scripts
|
||||
Some scripts were not listed Alcuni script non sono stati elencati
|
||||
The Scripts folder cannot be read Impossibile leggere la cartella Scripts
|
||||
Loading scripts… Caricamento degli script…
|
||||
The Scripts folder is still being read La cartella Scripts è ancora in lettura
|
||||
@msg the script's run is no longer available l'esecuzione dello script non è più disponibile
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped un comando non riuscito ha modificato passaggi di annullamento che non è stato possibile ripristinare, quindi lo script è stato interrotto
|
||||
@msg a recovery copy could not be written, so the script was not run non è stato possibile scrivere una copia di recupero, quindi lo script non è stato eseguito
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -5272,6 +5272,8 @@ swatch Bright Violet ビビッドバイオレット
|
||||
@msg the script is no longer in the Scripts folder スクリプトは Scripts フォルダーにもうありません
|
||||
Some scripts were not listed 一部のスクリプトは一覧に表示されていません
|
||||
The Scripts folder cannot be read Scripts フォルダーを読み込めません
|
||||
Loading scripts… スクリプトを読み込み中…
|
||||
The Scripts folder is still being read Scripts フォルダーをまだ読み込んでいます
|
||||
@msg the script's run is no longer available スクリプトの実行は利用できなくなりました
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped 失敗したコマンドが元に戻せない取り消し手順を変更したため、スクリプトを停止しました
|
||||
@msg a recovery copy could not be written, so the script was not run 復元用のコピーを書き込めなかったため、スクリプトは実行されませんでした
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7769,6 +7769,8 @@ imageTrace Outline კონტური
|
||||
@msg the script is no longer in the Scripts folder სკრიპტი აღარ არის Scripts საქაღალდეში
|
||||
Some scripts were not listed ზოგიერთი სკრიპტი არ არის ჩამოთვლილი
|
||||
The Scripts folder cannot be read Scripts საქაღალდის წაკითხვა შეუძლებელია
|
||||
Loading scripts… სკრიპტების ჩატვირთვა…
|
||||
The Scripts folder is still being read Scripts საქაღალდე ჯერ კიდევ იკითხება
|
||||
@msg the script's run is no longer available სკრიპტის გაშვება აღარ არის ხელმისაწვდომი
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped წარუმატებელმა ბრძანებამ დაბრუნების ნაბიჯები შეცვალა და მათი პირვანდელ მდგომარეობაში მოყვანა ვერ მოხერხდა, ამიტომ სკრიპტი შეჩერდა
|
||||
@msg a recovery copy could not be written, so the script was not run აღდგენის ასლის ჩაწერა ვერ მოხერხდა, ამიტომ სკრიპტი არ გაეშვა
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -5199,6 +5199,8 @@ theme Appearance 외관
|
||||
@msg the script is no longer in the Scripts folder 스크립트가 더 이상 Scripts 폴더에 없습니다
|
||||
Some scripts were not listed 일부 스크립트가 나열되지 않았습니다
|
||||
The Scripts folder cannot be read Scripts 폴더를 읽을 수 없습니다
|
||||
Loading scripts… 스크립트 불러오는 중…
|
||||
The Scripts folder is still being read Scripts 폴더를 아직 읽는 중입니다
|
||||
@msg the script's run is no longer available 스크립트 실행을 더 이상 사용할 수 없습니다
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped 실패한 명령이 되돌릴 수 없는 실행 취소 단계를 변경하여 스크립트를 중지했습니다
|
||||
@msg a recovery copy could not be written, so the script was not run 복구 사본을 쓸 수 없어 스크립트를 실행하지 않았습니다
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -611,6 +611,8 @@ liquify-list-end {0}, {1} {0} en {1}
|
||||
Check Script Script controleren
|
||||
Some scripts were not listed Sommige scripts zijn niet weergegeven
|
||||
The Scripts folder cannot be read De map Scripts kan niet worden gelezen
|
||||
Loading scripts… Scripts laden…
|
||||
The Scripts folder is still being read De map Scripts wordt nog gelezen
|
||||
Other Script… Ander script…
|
||||
Document Setup… Documentinstellingen…
|
||||
Switch Units Eenheden wisselen
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4595,6 +4595,8 @@ imageTrace Outline Kontur
|
||||
@msg the script is no longer in the Scripts folder skryptu nie ma już w folderze Scripts
|
||||
Some scripts were not listed Niektóre skrypty nie zostały wyświetlone
|
||||
The Scripts folder cannot be read Nie można odczytać folderu Scripts
|
||||
Loading scripts… Wczytywanie skryptów…
|
||||
The Scripts folder is still being read Folder Scripts jest nadal odczytywany
|
||||
@msg the script's run is no longer available uruchomienie skryptu nie jest już dostępne
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped nieudane polecenie zmieniło kroki cofania, których nie udało się przywrócić, więc skrypt został zatrzymany
|
||||
@msg a recovery copy could not be written, so the script was not run nie udało się zapisać kopii odzyskiwania, więc skrypt nie został uruchomiony
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -5501,6 +5501,8 @@ axis Both Ambos
|
||||
@msg the script is no longer in the Scripts folder o script não está mais na pasta Scripts
|
||||
Some scripts were not listed Alguns scripts não foram listados
|
||||
The Scripts folder cannot be read Não é possível ler a pasta Scripts
|
||||
Loading scripts… Carregando scripts…
|
||||
The Scripts folder is still being read A pasta Scripts ainda está sendo lida
|
||||
@msg the script's run is no longer available a execução do script não está mais disponível
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped um comando que falhou alterou etapas de desfazer que não puderam ser restauradas, então o script foi interrompido
|
||||
@msg a recovery copy could not be written, so the script was not run não foi possível gravar uma cópia de recuperação, portanto o script não foi executado
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4489,6 +4489,8 @@ axis Both Оба
|
||||
@msg the script is no longer in the Scripts folder скрипт больше не находится в папке Scripts
|
||||
Some scripts were not listed Некоторые сценарии не показаны
|
||||
The Scripts folder cannot be read Не удалось прочитать папку Scripts
|
||||
Loading scripts… Загрузка сценариев…
|
||||
The Scripts folder is still being read Папка Scripts ещё читается
|
||||
@msg the script's run is no longer available выполнение скрипта больше недоступно
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped неудавшаяся команда изменила шаги отмены, которые не удалось восстановить, поэтому скрипт остановлен
|
||||
@msg a recovery copy could not be written, so the script was not run не удалось записать копию для восстановления, поэтому скрипт не выполнен
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4358,6 +4358,8 @@ axis Both Båda
|
||||
@msg the script is no longer in the Scripts folder skriptet finns inte längre i mappen Scripts
|
||||
Some scripts were not listed Vissa skript visas inte i listan
|
||||
The Scripts folder cannot be read Mappen Scripts kan inte läsas
|
||||
Loading scripts… Läser in skript…
|
||||
The Scripts folder is still being read Mappen Scripts läses fortfarande
|
||||
@msg the script's run is no longer available skriptets körning är inte längre tillgänglig
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped ett misslyckat kommando ändrade ångrasteg som inte kunde återställas, så skriptet stoppades
|
||||
@msg a recovery copy could not be written, so the script was not run en återställningskopia kunde inte skrivas, så skriptet kördes inte
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4214,6 +4214,8 @@ axis Both Her İkisi
|
||||
@msg the script is no longer in the Scripts folder betik artık Scripts klasöründe değil
|
||||
Some scripts were not listed Bazı komut dosyaları listelenmedi
|
||||
The Scripts folder cannot be read Scripts klasörü okunamıyor
|
||||
Loading scripts… Betikler yükleniyor…
|
||||
The Scripts folder is still being read Scripts klasörü hâlâ okunuyor
|
||||
@msg the script's run is no longer available betiğin çalıştırması artık kullanılamıyor
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped başarısız bir komut geri yüklenemeyen geri alma adımlarını değiştirdi, bu yüzden betik durduruldu
|
||||
@msg a recovery copy could not be written, so the script was not run kurtarma kopyası yazılamadı, bu nedenle betik çalıştırılmadı
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4488,6 +4488,8 @@ axis Both Обидві
|
||||
@msg the script is no longer in the Scripts folder скрипт більше не міститься в папці Scripts
|
||||
Some scripts were not listed Деякі сценарії не показано
|
||||
The Scripts folder cannot be read Не вдалося прочитати папку Scripts
|
||||
Loading scripts… Завантаження сценаріїв…
|
||||
The Scripts folder is still being read Папка Scripts ще читається
|
||||
@msg the script's run is no longer available виконання скрипта більше не доступне
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped невдала команда змінила кроки скасування, які не вдалося відновити, тому скрипт зупинено
|
||||
@msg a recovery copy could not be written, so the script was not run не вдалося записати копію для відновлення, тому скрипт не виконано
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -4929,6 +4929,8 @@ theme Appearance Giao diện
|
||||
@msg the script is no longer in the Scripts folder tập lệnh không còn trong thư mục Scripts
|
||||
Some scripts were not listed Một số tập lệnh không được liệt kê
|
||||
The Scripts folder cannot be read Không thể đọc thư mục Scripts
|
||||
Loading scripts… Đang tải tập lệnh…
|
||||
The Scripts folder is still being read Thư mục Scripts vẫn đang được đọc
|
||||
@msg the script's run is no longer available lần chạy tập lệnh không còn khả dụng
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped một lệnh thất bại đã thay đổi các bước hoàn tác không thể khôi phục, nên tập lệnh đã bị dừng
|
||||
@msg a recovery copy could not be written, so the script was not run không thể ghi bản sao khôi phục nên tập lệnh không được chạy
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 205 and column 5.
|
@@ -4950,6 +4950,8 @@ imageTrace Outline 轮廓
|
||||
@msg the script is no longer in the Scripts folder 脚本已不在 Scripts 文件夹中
|
||||
Some scripts were not listed 部分脚本未列出
|
||||
The Scripts folder cannot be read 无法读取 Scripts 文件夹
|
||||
Loading scripts… 正在载入脚本…
|
||||
The Scripts folder is still being read 仍在读取 Scripts 文件夹
|
||||
@msg the script's run is no longer available 脚本运行已不可用
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped 失败的命令更改了无法恢复的撤销步骤,因此脚本已停止
|
||||
@msg a recovery copy could not be written, so the script was not run 无法写入恢复副本,因此未运行脚本
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2582,6 +2582,8 @@ file-filter Templates 範本
|
||||
@msg the script is no longer in the Scripts folder 指令碼已不在 Scripts 資料夾中
|
||||
Some scripts were not listed 部分指令碼未列出
|
||||
The Scripts folder cannot be read 無法讀取 Scripts 資料夾
|
||||
Loading scripts… 正在載入指令碼…
|
||||
The Scripts folder is still being read 仍在讀取 Scripts 資料夾
|
||||
@msg the script's run is no longer available 指令碼執行已無法使用
|
||||
@msg a failed command changed undo steps that could not be put back, so the script was stopped 失敗的命令變更了無法還原的復原步驟,因此指令碼已停止
|
||||
@msg a recovery copy could not be written, so the script was not run 無法寫入復原副本,因此未執行指令碼
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7,6 +7,10 @@
|
||||
//! active one, and each time the File menu of the window's menu bar opens ([`refresh`]). The menus show the last finished
|
||||
//! listing ([`items`]), so a script added to the folder is listed without a restart.
|
||||
//!
|
||||
//! Until the first read ends the menu shows [`LOADING`], and [`SLOW`] once that read has taken
|
||||
//! [`SLOW_SECS`]; a first read that cannot start or ends without a listing shows [`UNREADABLE`],
|
||||
//! and the next read tries again.
|
||||
//!
|
||||
//! `ui.runInstalledScript {path}` runs a listed script (`script.run`) without the warning Other
|
||||
//! Script… shows: the file was put in the folder to be run from the menu. The path is one a
|
||||
//! listing gave; a file that is no longer a plain script under the folder is not run.
|
||||
@@ -28,8 +32,14 @@ pub const COMMAND: &str = "ui.runInstalledScript";
|
||||
pub const TRUNCATED: &str = "Some scripts were not listed";
|
||||
/// The menu's note when the folder is there and cannot be read.
|
||||
pub const UNREADABLE: &str = "The Scripts folder cannot be read";
|
||||
/// The menu's note while the first read is under way.
|
||||
pub const LOADING: &str = "Loading scripts…";
|
||||
/// The menu's note once the first read has taken [`SLOW_SECS`].
|
||||
pub const SLOW: &str = "The Scripts folder is still being read";
|
||||
/// The notes, for the catalogs ([`crate::menus::menu_strings`]).
|
||||
pub const LABELS: &[&str] = &[TRUNCATED, UNREADABLE];
|
||||
pub const LABELS: &[&str] = &[TRUNCATED, UNREADABLE, LOADING, SLOW];
|
||||
/// How long the first read runs before the menu shows [`SLOW`].
|
||||
pub const SLOW_SECS: f64 = 2.0;
|
||||
|
||||
#[derive(Default)]
|
||||
struct State {
|
||||
@@ -45,6 +55,43 @@ struct State {
|
||||
started: bool,
|
||||
/// The window was the active one at the last [`poll`].
|
||||
focused: bool,
|
||||
/// A listing has been taken in.
|
||||
loaded: bool,
|
||||
/// When the first read started ([`crate::clock::now_secs`]), while it is under way.
|
||||
first_read: Option<f64>,
|
||||
/// The first read has taken [`SLOW_SECS`].
|
||||
slow: bool,
|
||||
/// No listing yet, and the last read could not start or ended without one.
|
||||
failed: bool,
|
||||
}
|
||||
|
||||
impl State {
|
||||
/// The note in place of a listing before the first one.
|
||||
fn first_read_note(&self) -> Option<&'static str> {
|
||||
if self.loaded {
|
||||
return None;
|
||||
}
|
||||
if self.reading.is_some() {
|
||||
return Some(if self.slow { SLOW } else { LOADING });
|
||||
}
|
||||
self.failed.then_some(UNREADABLE)
|
||||
}
|
||||
|
||||
/// No listing yet, and the read under way ended without one or could not start.
|
||||
fn first_read_failed(&mut self) {
|
||||
if !self.loaded {
|
||||
(self.first_read, self.slow, self.failed) = (None, false, true);
|
||||
self.revision += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/// Show [`SLOW`] once the first read has run [`SLOW_SECS`] by `now`.
|
||||
fn mark_slow(&mut self, now: f64) {
|
||||
if !self.loaded && !self.slow && self.reading.is_some() && self.first_read.is_some_and(|t| now - t >= SLOW_SECS) {
|
||||
self.slow = true;
|
||||
self.revision += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The listing the menus show. One per process in the app; one per thread in unit tests, which run
|
||||
@@ -92,7 +139,8 @@ pub(crate) fn intern(s: &str) -> Option<&'static str> {
|
||||
Some(v)
|
||||
}
|
||||
|
||||
/// Changes whenever the menus' listing changes (the macOS menu bar follows it).
|
||||
/// Changes whenever the menus' listing or the note before the first listing changes (the macOS
|
||||
/// menu bar follows it).
|
||||
pub fn revision() -> u64 {
|
||||
state().revision
|
||||
}
|
||||
@@ -108,18 +156,28 @@ pub fn refresh(app: &VectorcraftApp, ctx: Option<&egui::Context>) {
|
||||
return;
|
||||
}
|
||||
let (tx, rx) = std::sync::mpsc::channel();
|
||||
let ctx = ctx.cloned();
|
||||
let worker_ctx = ctx.cloned();
|
||||
let spawned = std::thread::Builder::new().name("vectorcraft-scripts".into()).spawn(move || {
|
||||
// The app's own folder, read for the person at the keyboard.
|
||||
let listing = vectorcraft_engine::file_access::unconfined(|| vectorcraft_engine::script::folder::list(&root));
|
||||
if tx.send(listing).is_ok()
|
||||
&& let Some(ctx) = ctx
|
||||
&& let Some(ctx) = worker_ctx
|
||||
{
|
||||
ctx.request_repaint();
|
||||
}
|
||||
});
|
||||
if spawned.is_ok() {
|
||||
state.reading = Some(rx);
|
||||
if spawned.is_err() {
|
||||
state.first_read_failed();
|
||||
return;
|
||||
}
|
||||
state.reading = Some(rx);
|
||||
if !state.loaded && state.first_read.is_none() {
|
||||
// The menus show the loading note, and a frame comes when it is due to change to SLOW.
|
||||
state.first_read = Some(crate::clock::now_secs());
|
||||
state.revision += 1;
|
||||
if let Some(ctx) = ctx {
|
||||
ctx.request_repaint_after(std::time::Duration::from_secs_f64(SLOW_SECS));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +195,7 @@ pub fn poll(app: &VectorcraftApp, ctx: &egui::Context) {
|
||||
refresh(app, Some(ctx));
|
||||
}
|
||||
take(false);
|
||||
state().mark_slow(crate::clock::now_secs());
|
||||
let again = {
|
||||
let mut state = state();
|
||||
let again = state.pending && state.reading.is_none();
|
||||
@@ -157,14 +216,22 @@ fn take(wait: bool) {
|
||||
let listing = if wait { reading.recv().map_err(|_| TryRecvError::Disconnected) } else { reading.try_recv() };
|
||||
match listing {
|
||||
Ok(listing) => {
|
||||
if *state.listing != listing {
|
||||
let changed = *state.listing != listing;
|
||||
if changed {
|
||||
state.listing = Arc::new(listing);
|
||||
}
|
||||
// The first listing also takes the place of the loading note.
|
||||
if changed || !state.loaded {
|
||||
state.revision += 1;
|
||||
}
|
||||
(state.loaded, state.first_read, state.slow, state.failed) = (true, None, false, false);
|
||||
state.reading = None;
|
||||
}
|
||||
Err(TryRecvError::Empty) => {}
|
||||
Err(TryRecvError::Disconnected) => state.reading = None,
|
||||
Err(TryRecvError::Disconnected) => {
|
||||
state.reading = None;
|
||||
state.first_read_failed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +241,27 @@ pub(crate) fn wait() {
|
||||
take(true);
|
||||
}
|
||||
|
||||
/// The read under way ends without a listing, as when its thread stops early.
|
||||
#[cfg(test)]
|
||||
pub(crate) fn lose_read() {
|
||||
let mut state = state();
|
||||
if state.reading.is_some() {
|
||||
state.reading = Some(std::sync::mpsc::channel::<Listing>().1);
|
||||
}
|
||||
}
|
||||
|
||||
/// When the first read started, while it is under way.
|
||||
#[cfg(test)]
|
||||
pub(crate) fn first_read_started() -> Option<f64> {
|
||||
state().first_read
|
||||
}
|
||||
|
||||
/// What [`poll`] does about a slow first read, at `now` ([`crate::clock::now_secs`]).
|
||||
#[cfg(test)]
|
||||
pub(crate) fn check_slow(now: f64) {
|
||||
state().mark_slow(now);
|
||||
}
|
||||
|
||||
/// Wait for the read under way to end and leave its listing to be taken in, so the read is under
|
||||
/// way until the next [`poll`].
|
||||
#[cfg(test)]
|
||||
@@ -188,7 +276,8 @@ pub(crate) fn end_untaken() {
|
||||
}
|
||||
|
||||
/// File › Scripts' items: the listed scripts and subfolders, a note when some may be missing or
|
||||
/// the folder cannot be read, then Check Script… and Other Script….
|
||||
/// the folder cannot be read, or one before the first listing, then Check Script… and Other
|
||||
/// Script….
|
||||
pub fn items() -> Vec<Item> {
|
||||
// A row whose name is past [`MAX_NAMES`] is left out (`dropped`).
|
||||
fn level(entries: &[Entry], dropped: &mut bool) -> Vec<Item> {
|
||||
@@ -208,7 +297,10 @@ pub fn items() -> Vec<Item> {
|
||||
}
|
||||
items
|
||||
}
|
||||
let listing = state().listing.clone();
|
||||
let (listing, note) = {
|
||||
let state = state();
|
||||
(state.listing.clone(), state.first_read_note())
|
||||
};
|
||||
let mut dropped = false;
|
||||
let mut items = level(&listing.entries, &mut dropped);
|
||||
if listing.truncated || dropped {
|
||||
@@ -217,6 +309,7 @@ pub fn items() -> Vec<Item> {
|
||||
if listing.unreadable {
|
||||
items.push(Item::Header(UNREADABLE));
|
||||
}
|
||||
items.extend(note.map(Item::Header));
|
||||
if !items.is_empty() {
|
||||
items.push(Item::Sep);
|
||||
}
|
||||
|
||||
@@ -80,19 +80,22 @@ fn finish(app: &mut VectorcraftApp) {
|
||||
|
||||
const DRAW: &str = "vc.run('shape.rectangle', {x:0,y:0,width:10,height:10}); vc.run('shape.rectangle', {x:20,y:0,width:10,height:10});";
|
||||
|
||||
/// The items File › Scripts always ends with.
|
||||
const FIXED: &str = "Check Script…, Other Script…";
|
||||
|
||||
#[test]
|
||||
fn the_folders_scripts_are_listed_above_check_script_and_other_script() {
|
||||
let dir = folder("listed");
|
||||
let app = app(&dir);
|
||||
assert_eq!(shape(&scripts()), "Check Script…, Other Script…", "before the first listing");
|
||||
assert_eq!(shape(&scripts()), FIXED, "before the first read");
|
||||
read(&app);
|
||||
assert_eq!(shape(&scripts()), "Check Script…, Other Script…", "an empty folder");
|
||||
assert_eq!(shape(&scripts()), FIXED, "an empty folder");
|
||||
let draw = write(&dir, "Draw Two.jsx", DRAW);
|
||||
write(&dir, "Export/All Artboards.js", "");
|
||||
write(&dir, "notes.txt", "");
|
||||
read(&app);
|
||||
let items = scripts();
|
||||
assert_eq!(shape(&items), "Draw Two, Export/[All Artboards], -, Check Script…, Other Script…");
|
||||
assert_eq!(shape(&items), format!("Draw Two, Export/[All Artboards], -, {FIXED}"));
|
||||
assert!(matches!(&items[0], Item::Cmd(_, scripts_menu::COMMAND, p) if *p == json!({ "path": draw })), "{:?}", items[0]);
|
||||
// A script added to the folder is listed by the next read, with no restart.
|
||||
write(&dir, "Added.js", "");
|
||||
@@ -201,7 +204,7 @@ fn a_script_that_left_the_folder_is_not_run_and_the_folder_is_read_again() {
|
||||
assert_eq!(e, "the script is no longer in the Scripts folder");
|
||||
assert!(!app.session.script_running());
|
||||
scripts_menu::wait();
|
||||
assert_eq!(shape(&scripts()), "kept, -, Check Script…, Other Script…");
|
||||
assert_eq!(shape(&scripts()), format!("kept, -, {FIXED}"));
|
||||
// A file outside the folder is not one of its scripts, and a call needs a path.
|
||||
let outside = dir.join("outside.js");
|
||||
std::fs::write(&outside, DRAW).unwrap();
|
||||
@@ -246,12 +249,12 @@ fn the_menu_notes_a_listing_that_stopped_and_a_folder_it_cannot_read() {
|
||||
read(&app);
|
||||
let items = scripts();
|
||||
assert_eq!(items.len(), vectorcraft_engine::script::folder::MAX_SCRIPTS + 4);
|
||||
assert_eq!(shape(&items[items.len() - 4..]), format!("({}), -, Check Script…, Other Script…", scripts_menu::TRUNCATED));
|
||||
assert_eq!(shape(&items[items.len() - 4..]), format!("({}), -, {FIXED}", scripts_menu::TRUNCATED));
|
||||
// A file where the folder should be.
|
||||
std::fs::remove_dir_all(dir.join("Scripts")).unwrap();
|
||||
std::fs::write(dir.join("Scripts"), "").unwrap();
|
||||
read(&app);
|
||||
assert_eq!(shape(&scripts()), format!("({}), -, Check Script…, Other Script…", scripts_menu::UNREADABLE));
|
||||
assert_eq!(shape(&scripts()), format!("({}), -, {FIXED}", scripts_menu::UNREADABLE));
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
@@ -284,7 +287,7 @@ fn names_past_the_session_limit_are_left_out_with_the_note() {
|
||||
let app = app(&dir);
|
||||
write(&dir, "Kept.js", "");
|
||||
read(&app);
|
||||
assert_eq!(shape(&scripts()), "Kept, -, Check Script…, Other Script…");
|
||||
assert_eq!(shape(&scripts()), format!("Kept, -, {FIXED}"));
|
||||
// Names other listings showed fill what one session keeps.
|
||||
for n in 0..scripts_menu::MAX_NAMES {
|
||||
if scripts_menu::intern(&format!("renamed {n}")).is_none() {
|
||||
@@ -294,7 +297,7 @@ fn names_past_the_session_limit_are_left_out_with_the_note() {
|
||||
write(&dir, "New.js", "");
|
||||
write(&dir, "Folder/Inside.js", "");
|
||||
read(&app);
|
||||
assert_eq!(shape(&scripts()), format!("Kept, ({}), -, Check Script…, Other Script…", scripts_menu::TRUNCATED));
|
||||
assert_eq!(shape(&scripts()), format!("Kept, ({}), -, {FIXED}", scripts_menu::TRUNCATED));
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
@@ -305,7 +308,8 @@ fn the_macos_menu_bar_lists_the_same_scripts_and_follows_a_new_listing() {
|
||||
let path = write(&dir, "Export/All Artboards.js", "");
|
||||
let before = scripts_menu::revision();
|
||||
read(&app);
|
||||
assert_eq!(scripts_menu::revision(), before + 1);
|
||||
// The loading note showed, then the listing took its place.
|
||||
assert_eq!(scripts_menu::revision(), before + 2);
|
||||
let bar = native_menu::from_tree(&app, &menus::menu_tree());
|
||||
let file = bar.menus.iter().find(|m| m.title == "File").unwrap();
|
||||
let scripts = file.children.iter().find_map(|n| match n {
|
||||
@@ -321,10 +325,10 @@ fn the_macos_menu_bar_lists_the_same_scripts_and_follows_a_new_listing() {
|
||||
assert!(script.enabled && script.shortcut.is_none());
|
||||
// A read that finds the same scripts changes nothing the menu bar would rebuild for.
|
||||
read(&app);
|
||||
assert_eq!(scripts_menu::revision(), before + 1);
|
||||
assert_eq!(scripts_menu::revision(), before + 2);
|
||||
write(&dir, "More.jsx", "");
|
||||
read(&app);
|
||||
assert_eq!(scripts_menu::revision(), before + 2);
|
||||
assert_eq!(scripts_menu::revision(), before + 3);
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
@@ -424,9 +428,130 @@ fn a_read_asked_for_during_another_runs_when_that_one_ends() {
|
||||
fn an_app_without_a_scripts_folder_keeps_the_two_fixed_items() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), crate::Services::default());
|
||||
read(&app);
|
||||
assert_eq!(shape(&scripts()), "Check Script…, Other Script…");
|
||||
assert_eq!(shape(&scripts()), FIXED, "no loading note: there is no folder to read");
|
||||
let e = menus::run_ui_command(&mut app, scripts_menu::COMMAND, &json!({ "path": "draw.js" })).unwrap().unwrap_err();
|
||||
assert_eq!(e, "the script is no longer in the Scripts folder");
|
||||
assert_eq!(menus::UI_COMMANDS.iter().filter(|c| c.0 == scripts_menu::COMMAND).count(), 1);
|
||||
let _: Value = app.run("script.listInstalled", json!({})).unwrap();
|
||||
}
|
||||
|
||||
/// File › Scripts in the macOS menu bar as text, as [`shape`] gives the in-window menu.
|
||||
fn native_shape(app: &VectorcraftApp) -> String {
|
||||
fn one(nodes: &[Node]) -> String {
|
||||
let node = |n: &Node| match n {
|
||||
Node::Item(it) if it.command.is_none() => format!("({})", it.label),
|
||||
Node::Item(it) => it.label.clone(),
|
||||
Node::Header(label) => format!("({label})"),
|
||||
Node::Submenu { label, children } => format!("{label}/[{}]", one(children)),
|
||||
Node::Separator => "-".to_string(),
|
||||
Node::Standard(s) => format!("{s:?}"),
|
||||
};
|
||||
nodes.iter().map(node).collect::<Vec<_>>().join(", ")
|
||||
}
|
||||
let bar = native_menu::from_tree(app, &menus::menu_tree());
|
||||
let file = bar.menus.iter().find(|m| m.title == "File").unwrap();
|
||||
let scripts = file.children.iter().find_map(|n| match n {
|
||||
Node::Submenu { label, children } if label == "Scripts" => Some(children),
|
||||
_ => None,
|
||||
});
|
||||
one(scripts.unwrap())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_first_read_shows_a_loading_note_until_its_listing_comes() {
|
||||
let dir = folder("loading");
|
||||
let app = app(&dir);
|
||||
write(&dir, "first.js", "");
|
||||
let before = scripts_menu::revision();
|
||||
scripts_menu::refresh(&app, None);
|
||||
scripts_menu::end_untaken();
|
||||
let loading = format!("({}), -, {FIXED}", scripts_menu::LOADING);
|
||||
assert_eq!(shape(&scripts()), loading);
|
||||
assert_eq!(native_shape(&app), loading, "the macOS menu bar shows the same note");
|
||||
assert_eq!(scripts_menu::revision(), before + 1, "the macOS menu bar rebuilds for the note");
|
||||
scripts_menu::wait();
|
||||
assert_eq!(shape(&scripts()), format!("first, -, {FIXED}"));
|
||||
assert_eq!(native_shape(&app), format!("first, -, {FIXED}"));
|
||||
assert_eq!(scripts_menu::revision(), before + 2);
|
||||
// A later read keeps the listing, with no note, while it is under way.
|
||||
write(&dir, "second.js", "");
|
||||
scripts_menu::refresh(&app, None);
|
||||
scripts_menu::end_untaken();
|
||||
assert_eq!(shape(&scripts()), format!("first, -, {FIXED}"));
|
||||
assert_eq!(scripts_menu::revision(), before + 2);
|
||||
scripts_menu::wait();
|
||||
assert_eq!(shape(&scripts()), format!("first, second, -, {FIXED}"));
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_empty_or_unreadable_first_listing_takes_the_place_of_the_loading_note() {
|
||||
let dir = folder("loading-empty");
|
||||
let app = app(&dir);
|
||||
let before = scripts_menu::revision();
|
||||
read(&app);
|
||||
assert_eq!(shape(&scripts()), FIXED);
|
||||
assert_eq!(scripts_menu::revision(), before + 2, "the note went, though the listing is the empty one it started from");
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
// A thread of its own has a menu that has not listed yet.
|
||||
let dir = folder("loading-unreadable");
|
||||
std::fs::remove_dir_all(dir.join("Scripts")).unwrap();
|
||||
std::fs::write(dir.join("Scripts"), "").unwrap();
|
||||
let there = dir.clone();
|
||||
std::thread::spawn(move || {
|
||||
let app = self::app(&there);
|
||||
read(&app);
|
||||
assert_eq!(shape(&scripts()), format!("({}), -, {FIXED}", scripts_menu::UNREADABLE));
|
||||
})
|
||||
.join()
|
||||
.unwrap();
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_slow_first_read_says_so_until_its_listing_comes() {
|
||||
let dir = folder("slow");
|
||||
let app = app(&dir);
|
||||
write(&dir, "first.js", "");
|
||||
scripts_menu::refresh(&app, None);
|
||||
scripts_menu::end_untaken();
|
||||
let started = scripts_menu::first_read_started().unwrap();
|
||||
let before = scripts_menu::revision();
|
||||
scripts_menu::check_slow(started + scripts_menu::SLOW_SECS / 2.0);
|
||||
assert_eq!(shape(&scripts()), format!("({}), -, {FIXED}", scripts_menu::LOADING));
|
||||
assert_eq!(scripts_menu::revision(), before);
|
||||
scripts_menu::check_slow(started + scripts_menu::SLOW_SECS);
|
||||
assert_eq!(shape(&scripts()), format!("({}), -, {FIXED}", scripts_menu::SLOW));
|
||||
assert_eq!(native_shape(&app), format!("({}), -, {FIXED}", scripts_menu::SLOW));
|
||||
assert_eq!(scripts_menu::revision(), before + 1);
|
||||
// Asking again while it reads starts no second read.
|
||||
scripts_menu::refresh(&app, None);
|
||||
scripts_menu::check_slow(started + 10.0 * scripts_menu::SLOW_SECS);
|
||||
assert_eq!(scripts_menu::revision(), before + 1);
|
||||
scripts_menu::wait();
|
||||
assert_eq!(shape(&scripts()), format!("first, -, {FIXED}"));
|
||||
assert_eq!(scripts_menu::first_read_started(), None);
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_first_read_that_ends_without_a_listing_says_the_folder_cannot_be_read_and_the_next_read_tries_again() {
|
||||
let dir = folder("lost");
|
||||
let app = app(&dir);
|
||||
write(&dir, "first.js", "");
|
||||
scripts_menu::refresh(&app, None);
|
||||
scripts_menu::end_untaken();
|
||||
scripts_menu::lose_read();
|
||||
let before = scripts_menu::revision();
|
||||
scripts_menu::wait();
|
||||
assert_eq!(shape(&scripts()), format!("({}), -, {FIXED}", scripts_menu::UNREADABLE), "no loading note left behind");
|
||||
assert_eq!(native_shape(&app), format!("({}), -, {FIXED}", scripts_menu::UNREADABLE));
|
||||
assert_eq!(scripts_menu::revision(), before + 1);
|
||||
assert_eq!(scripts_menu::first_read_started(), None);
|
||||
scripts_menu::refresh(&app, None);
|
||||
scripts_menu::end_untaken();
|
||||
assert_eq!(shape(&scripts()), format!("({}), -, {FIXED}", scripts_menu::LOADING));
|
||||
scripts_menu::wait();
|
||||
assert_eq!(shape(&scripts()), format!("first, -, {FIXED}"));
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
@@ -2730,6 +2730,10 @@ The rest of this section is VectorCraft's own rules:
|
||||
read finds new names after the menus have shown 16,384 different script and folder names since VectorCraft started.
|
||||
When the folder is there and cannot be read, the menu shows
|
||||
`The Scripts folder cannot be read`.
|
||||
- Until the first read ends, the menu shows `Loading scripts…` in place of the listing, and
|
||||
`The Scripts folder is still being read` once that read has taken 2 seconds. A first read that cannot start, or
|
||||
ends without a listing, shows `The Scripts folder cannot be read`, and the next read tries again. Later reads keep
|
||||
the last listing in the menu while they run.
|
||||
- A listed file is checked again when it is chosen. A file that is gone, is no longer a `.js` or `.jsx` file under
|
||||
the folder, or is or lies behind a link ends with `the script is no longer in the Scripts folder`, and nothing runs.
|
||||
The file is read once for that check, and the text that read checked is the text that runs; its `#include` lines
|
||||
|
||||
Reference in New Issue
Block a user