Skip to content

Commit

Permalink
DeskTop: Prompt to re-insert system disk for Apple Menu items
Browse files Browse the repository at this point in the history
This worked in A2D 1.1 but regressed in 1.2 when support for placing
arbitrary files in the Apple Menu was added. Add an entry point that
sets a flag to prompt/retry, and use it from the Apple Menu "DA" item
invocation.

(Also, do a spellcheck pass on the test plan.)
  • Loading branch information
inexorabletash committed Nov 9, 2024
1 parent 9cdb95a commit b467559
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 36 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Project Page: https://github.com/a2stuff/a2d
* Special > Make Alias now creates link file in same directory as original.
* Add Edit menu with Cut/Copy/Paste/Clear, relocate Select All.
* Ensure the modification date for copied folders matches the original.
* Prompt to re-insert system disk when launching Apple Menu items.

### Selector

Expand Down
22 changes: 19 additions & 3 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,12 @@ tmp_path_buf:
;;; Inputs: Path in `src_path_buf` (a.k.a. `INVOKER_PREFIX`)

.proc LaunchFileWithPath
clc
bcc :+ ; always
sys_disk:
sec
: ror sys_prompt_flag

jsr SetCursorWatch ; before invoking

;; Assume no interpreter to start
Expand All @@ -886,9 +892,18 @@ tmp_path_buf:
param_call MakePathAbsolute, src_path_buf

;; Get the file info to determine type.
jsr GetSrcFileInfo
retry: jsr GetSrcFileInfo
bcc :+
jmp ShowAlert

sys_prompt_flag := *+1
lda #SELF_MODIFIED_BYTE
jpl ShowAlert

lda #kErrInsertSystemDisk
jsr ShowAlert
cmp #kAlertResultOK
beq retry ; ok, so try again
rts ; cancel, so fail

;; Check file type.
: copy src_file_info_params::file_type, icontype_filetype
Expand Down Expand Up @@ -1164,6 +1179,7 @@ check_header:
DEFINE_GET_PREFIX_PARAMS get_prefix_params, INVOKER_INTERPRETER

.endproc ; LaunchFileWithPath
LaunchFileWithPathOnSystemDisk := LaunchFileWithPath::sys_disk

;;; ============================================================

Expand Down Expand Up @@ -1670,7 +1686,7 @@ skip: iny
stx path

;; Allow arbitrary types in menu (e.g. folders)
jmp LaunchFileWithPath
jmp LaunchFileWithPathOnSystemDisk
.endproc ; CmdDeskaccImpl
CmdDeskAcc := CmdDeskaccImpl::start

Expand Down
Loading

0 comments on commit b467559

Please sign in to comment.