Skip to content

Commit

Permalink
Options: Add option to show "invisible" files
Browse files Browse the repository at this point in the history
I dunno, maybe you like seeing FINDER.DATA when browsing GS/OS
volumes. I won't judge you. DeskTop windows need to be manually
refreshed after toggling the option. Also affects whether "invisible"
files are found by the Find Files accessory or printed by the Print
Catalog accessory.
  • Loading branch information
inexorabletash committed Oct 24, 2024
1 parent 0a2edbb commit 2c13b0c
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Project Page: https://github.com/a2stuff/a2d
* Detect Pravetz 8A/C
* Screen Dump: Improve use of SSC and IW2.
* Print Catalog: Improve use of SSC and IW2.
* Options: Add option to show invisible files.

## 1.4

Expand Down
1 change: 1 addition & 0 deletions common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ DeskTopSettings::kOptionsSkipRAMCard = %00000001 ; skip copy to RAMCard, if se
DeskTopSettings::kOptionsSkipSelector = %00000010 ; skip starting Selector, if set
DeskTopSettings::kOptionsShowShortcuts = %00000100 ; show button shortcuts, if set
DeskTopSettings::kOptionsSetCaseBits = %00001000 ; write GS/OS case bits, if set
DeskTopSettings::kOptionsShowInvisible = %00010000 ; show "invisible" files, if set
DeskTopSettings::kSysCapIsIIgs = %00000001
DeskTopSettings::kSysCapIsIIc = %00000010 ; also set for IIc Plus
Expand Down
7 changes: 7 additions & 0 deletions desk.acc/find.files.s
Original file line number Diff line number Diff line change
Expand Up @@ -993,11 +993,16 @@ OpenDone:
;;;******************************************************
;;;
.proc VisitFile
ldx #DeskTopSettings::options
jsr ReadSetting
and #DeskTopSettings::kOptionsShowInvisible
IF_ZERO
;; Is the file visible?
ldy #FileEntry::access
lda (entPtr),y
and #ACCESS_I
bne exit
END_IF

;; Does the file match the search pattern?
lda pattern ; Skip if pattern is empty
Expand Down Expand Up @@ -1438,6 +1443,8 @@ fail:

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

ReadSetting = JUMP_TABLE_READ_SETTING

.include "../lib/uppercase.s"

;;; ============================================================
Expand Down
10 changes: 6 additions & 4 deletions desk.acc/options.s
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ grafport: .tag MGTK::GrafPort

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

kNumButtons = 4
kNumButtons = 5
kButtonLeft = 10
kButtonTop = 10
kButtonSpacing = kSystemFontHeight + 2
Expand All @@ -174,18 +174,20 @@ kButtonSpacing = kSystemFontHeight + 2

DEFINE_BUTTON casebits_button, kDAWindowId, res_string_label_case, res_string_shortcut_apple_4, kButtonLeft, kButtonTop + kButtonSpacing * 3

DEFINE_BUTTON invisible_button, kDAWindowId, res_string_label_invisible, res_string_shortcut_apple_5, kButtonLeft, kButtonTop + kButtonSpacing * 4

button_button_table:
.addr ramcard_button, selector_button, shortcuts_button, casebits_button
.addr ramcard_button, selector_button, shortcuts_button, casebits_button, invisible_button
ASSERT_ADDRESS_TABLE_SIZE button_button_table, kNumButtons

;;; Which bit in DeskTopSettings::options this checkbox corresponds to
button_mask_table:
.byte DeskTopSettings::kOptionsSkipRAMCard, DeskTopSettings::kOptionsSkipSelector, DeskTopSettings::kOptionsShowShortcuts, DeskTopSettings::kOptionsSetCaseBits
.byte DeskTopSettings::kOptionsSkipRAMCard, DeskTopSettings::kOptionsSkipSelector, DeskTopSettings::kOptionsShowShortcuts, DeskTopSettings::kOptionsSetCaseBits, DeskTopSettings::kOptionsShowInvisible
ASSERT_TABLE_SIZE button_mask_table, kNumButtons

;;; For inverting the sense of a bit vs. its checkbox; high bit set to invert
button_eor_table:
.byte 0, 0, BTK::kButtonStateChecked, BTK::kButtonStateChecked
.byte 0, 0, BTK::kButtonStateChecked, BTK::kButtonStateChecked, BTK::kButtonStateChecked
ASSERT_TABLE_SIZE button_eor_table, kNumButtons


Expand Down
5 changes: 5 additions & 0 deletions desk.acc/print.catalog.s
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,16 @@ OpenDone:
;;;******************************************************
;;;
.proc VisitFile
ldx #DeskTopSettings::options
jsr ReadSetting
and #DeskTopSettings::kOptionsShowInvisible
IF_ZERO
;; Is the file visible?
ldy #FileEntry::access
lda (entPtr),y
and #ACCESS_I
RTS_IF_NOT_ZERO
END_IF

jsr PrintName

Expand Down
1 change: 1 addition & 0 deletions desk.acc/res/options.res.da
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Vis Genveje ved opstart"
.define res_string_label_shortcuts "Vis tastaturgenveje i dialoger"
.define res_string_label_case "Bevar store og sm} bogstaver i navne"
.define res_string_label_invisible "Vis usynlige filer"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.de
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Kurzbefehle beim Start anzeigen"
.define res_string_label_shortcuts "Tastaturk}rzel in Dialogen anzeigen"
.define res_string_label_case "Behalten Sie Gro~- und Kleinschreibung in Namen bei"
.define res_string_label_invisible "Unsichtbare Dateien anzeigen"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.en
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Show Shortcuts on startup"
.define res_string_label_shortcuts "Show keyboard shortcuts in dialogs"
.define res_string_label_case "Preserve uppercase and lowercase in names"
.define res_string_label_invisible "Show invisible files"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.es
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Mostrar Atajos al inicio"
.define res_string_label_shortcuts "Mostrar atajos en los di\x10logos"
.define res_string_label_case "Conservar may\x14sculas y min\x14sculas en los nombres"
.define res_string_label_invisible "Mostrar archivos invisibles"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.fr
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Afficher Raccourcis au d{marrage"
.define res_string_label_shortcuts "Afficher les raccourcis clavier dans les boites de dialogue"
.define res_string_label_case "Conserver les majuscules et les minuscules dans les noms"
.define res_string_label_invisible "Afficher les fichiers invisibles"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.it
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Mostra Collegamenti all'avvio"
.define res_string_label_shortcuts "Mostra scorciatoie da tastiera nelle finestre di dialogo"
.define res_string_label_case "Conserva le maiuscole e le minuscole nei nomi"
.define res_string_label_invisible "Mostra file invisibili"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.nl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Toon Opdrachten bij opstarten"
.define res_string_label_shortcuts "Toon sneltoetsen in dialoogvensters"
.define res_string_label_case "Behoud hoofdletters en kleine letters in namen"
.define res_string_label_invisible "Toon onzichtbare bestanden"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Mostrar Atalhos na inicializa][o"
.define res_string_label_shortcuts "Mostrar atajos de teclado en cuadros de di@logo"
.define res_string_label_case "Preservar letras mai|sculas e min|sculas nos nomes"
.define res_string_label_invisible "Mostrar arquivos invis{veis"
1 change: 1 addition & 0 deletions desk.acc/res/options.res.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.define res_string_label_selector "Visa Genv{gar vid start"
.define res_string_label_shortcuts "Visa kortkommandon i dialogrutor"
.define res_string_label_case "Bevara versaler och gemener i namn"
.define res_string_label_invisible "Visa osynliga filer"
5 changes: 5 additions & 0 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -7084,10 +7084,15 @@ L71F7: ldx #$00
beq next ; inactive entry
sta record,x

ldx #DeskTopSettings::options
jsr ReadSetting
and #DeskTopSettings::kOptionsShowInvisible
IF_ZERO
ldy #FileEntry::access
lda (entry_ptr),y
and #ACCESS_I
bne do_entry
END_IF

inc record_count

Expand Down

0 comments on commit 2c13b0c

Please sign in to comment.