Move SSD status literals to typed Kotlin
ober
0d67032699c79c086451085a1c9c3c24471a1c22
--- a/templates/ssd-review.ss +++ b/templates/ssd-review.ss @@ -4657,6 +4657,9 @@ appendDialogTitle appendCanceledNoGroupStatus appendCanceledStatus scanningSsdPdfsStatus noSsdPdfsTitle + scanningDownloadsForSsdPdfsStatus + appendRequiresSelectedGroupStatus + ssdAreaModeInstructionStatus ssdAreaIgnoredTooSmallStatus noSsdPdfsInFolderMessage noSsdPdfsChooseFolderStatus openSsdPdfTitle noSsdPdfsDialogMessage noSsdPdfsFoundStatus @@ -5395,6 +5398,14 @@ "Append canceled: no selected group") (def (appendCanceledStatus) : String "Append canceled") + (def (appendRequiresSelectedGroupStatus) : String + "Select an existing group first, then tap Append") + (def (ssdAreaModeInstructionStatus) : String + "SSD area mode: drag around the ship SSD; tags outside that area will be removed") + (def (ssdAreaIgnoredTooSmallStatus) : String + "SSD area ignored: selection was too small") + (def (scanningDownloadsForSsdPdfsStatus) : String + "Scanning Downloads for SSD PDFs...") (def (scanningSsdPdfsStatus) : String "Scanning folder for SSD PDFs...") (def (noSsdPdfsTitle) : String @@ -7557,7 +7568,7 @@ " }" "" " private fun openPdf() {" - " setStatus(\"Scanning Downloads for SSD PDFs...\")" + " setStatus(scanningDownloadsForSsdPdfsStatus())" " thread {" " val choices = mutableListOf<SsdPdfChoice>()" " choices.addAll(findDownloadSsdPdfs())" @@ -7663,7 +7674,7 @@ " val group = mainActivitySelectRequestedGroup(this, reviewView, currentSession, selectedGroupId)" " if (ssdGroupMissing(group)) {" " mainActivityClearInteractionModes(this, reviewView)" - " setStatus(\"Select an existing group first, then tap Append\")" + " setStatus(appendRequiresSelectedGroupStatus())" " return" " }" " val appendGroup = ssdGroupOrEmpty(group)" @@ -7675,7 +7686,7 @@ " if (sessionMissing(currentSession)) return" " mainActivityStartSsdAreaInteractionForSelection(this, reviewView, selectedGroupId)" " reviewViewPerformHaptic(reviewView, HapticFeedbackConstants.CLOCK_TICK)" - " setStatus(\"SSD area mode: drag around the ship SSD; tags outside that area will be removed\")" + " setStatus(ssdAreaModeInstructionStatus())" " }" "" " private fun rotatePage() {" @@ -7710,7 +7721,7 @@ " val area = ssdSessionBoundedSsdArea(session, rect)" " if (ssdAreaSelectionTooSmall(area)) {" " finishSelectInteraction()" - " setStatus(\"SSD area ignored: selection was too small\")" + " setStatus(ssdAreaIgnoredTooSmallStatus())" " return" " }" " val details = ssdSessionApplySsdArea(session, area)" @@ -7951,7 +7962,7 @@ " setStatus(statusText)" " reviewView.postDelayed({" " if (sessionMissing(currentSession)) {" - " setStatus(\"Selection ignored: truth/detection is still loading\")" + " setStatus(selectionIgnoredLoadingStatus())" " return@postDelayed" " }" " if (applyAsSsdArea) {" @@ -7965,7 +7976,7 @@ " private fun showApproveDialog(rect: FloatArray, detectedIds: List<String>) {" " val session = currentSession" " if (sessionMissing(session)) {" - " setStatus(\"Selection ignored: truth/detection is still loading\")" + " setStatus(selectionIgnoredLoadingStatus())" " return" " }" " if (appendMode) {"