Source
...
Target
Commits (4)
  • Robert Sprowson's avatar
    Minor filer fixes · 41d6847d
    Robert Sprowson authored
    When a viewer is in 'sort by size' mode the size of image files was not being considered. So, a dir full of ZIP files (SparkFS not run) would be in size order amongst the other files, but if SparkFS was running the image files would be sorted as dirs of 0 size.
    Fix for ticket #400, the *Filer_Run command now defaults to '-noshift' and inspecting the shift key state must be requested (opt in instead of opt out). This solves two key annoyances, running the !Boot sequence and holding shift causes you to enter the desktop with the obey files from the Tasks directory unhelpfully loaded in a text editor, and when setting a task alarm in !Alarm if the alarm happens to go off when you're typing with the shift key the task's !Run file opens in a text editor.
    
    SortDir.s: count image files as files so they're sorted like they were in Filer 2.26
    Commands.s: parse new option switch, and consider -noshift the default
    Messages/HelpSrc: add the switch to the command syntax
    
    Tested with a task alarm in !Alarm with and without shift held down, and running a !Boot sequence similarly.
    
    Version 2.40. Tagged as 'Filer-2_40'
    41d6847d
  • Jeffrey Lee's avatar
    Fix null pointer dereferences in keyboard shortcut handling. Fix Ctrl-R... · c5d2c65d
    Jeffrey Lee authored
    Fix null pointer dereferences in keyboard shortcut handling. Fix Ctrl-R renaming not always working.
    
    Detail:
      s/Redraw - Introduce always_create_rename_writeable, as a variation of create_rename_writeable. This new version ignores the mouse position and positions the caret at the end of the filename.
      s/KeyPress - Fix delete shortcut handling to do nothing if nothing selected (avoids null pointer dereference in Filer_Action). Fix null pointer dereference in 'open parent' shortcut handling if parent already open. Change rename handling to use always_create_rename_writeable instead of trying to generate a fake mouse position (old code only worked for some filer view modes). Fix comments for next/prev dir shortcuts to match reality, and wrap rename code in AltRenaming switch to match the implementation in s/Redraw.
    Admin:
      Tested on Pandaboard
      Fixes null pointer dereferences reported on forums:
      https://www.riscosopen.org/forum/forums/4/topics/3447
    
    
    Version 2.41. Tagged as 'Filer-2_41'
    c5d2c65d
  • Jeffrey Lee's avatar
    Avoid unnecessary remainder calculations · 1146ab07
    Jeffrey Lee authored
    Detail:
      s/Open - Avoid unnecessary remainder calculations in DivRem macro
    Admin:
      Tested on Cortex-A15
    
    
    Version 2.42. Tagged as 'Filer-2_42'
    1146ab07
  • Robert Sprowson's avatar
    Remove use of RESOURCEEXTRA · 464f5e25
    Robert Sprowson authored
    Requires BuildSys-6_91.
    
    Version 2.43. Tagged as 'Filer-2_43'
    464f5e25
......@@ -23,7 +23,7 @@
#
COMPONENT = Filer
RESOURCEEXTRA = resources_templates
INSTRES_FILES = Templates
HELPSRC = s.HelpSrc
TOKHELPSRC = ${TOKENSOURCE}
......
No preview for this file type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.39"
Module_Version SETA 239
Module_MajorVersion SETS "2.43"
Module_Version SETA 243
Module_MinorVersion SETS ""
Module_Date SETS "17 Nov 2014"
Module_ApplicationDate SETS "17-Nov-14"
Module_Date SETS "29 May 2016"
Module_ApplicationDate SETS "29-May-16"
Module_ComponentName SETS "Filer"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Filer"
Module_FullVersion SETS "2.39"
Module_HelpVersion SETS "2.39 (17 Nov 2014)"
Module_FullVersion SETS "2.43"
Module_HelpVersion SETS "2.43 (29 May 2016)"
END
/* (2.39)
/* (2.43)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.39
#define Module_MajorVersion_CMHG 2.43
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 17 Nov 2014
#define Module_Date_CMHG 29 May 2016
#define Module_MajorVersion "2.39"
#define Module_Version 239
#define Module_MajorVersion "2.43"
#define Module_Version 243
#define Module_MinorVersion ""
#define Module_Date "17 Nov 2014"
#define Module_Date "29 May 2016"
#define Module_ApplicationDate "17-Nov-14"
#define Module_ApplicationDate "29-May-16"
#define Module_ComponentName "Filer"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Filer"
#define Module_FullVersion "2.39"
#define Module_HelpVersion "2.39 (17 Nov 2014)"
#define Module_LibraryVersionInfo "2:39"
#define Module_FullVersion "2.43"
#define Module_HelpVersion "2.43 (29 May 2016)"
#define Module_LibraryVersionInfo "2:43"
......@@ -50,10 +50,11 @@ $name._Code
Pull "r1"
EXIT NE
ADR r0, %FT5
ADR r0, ErrorBlock_$name._Syntax
BL LookupError
EXIT
5
ErrorBlock_$name._Syntax
DCD ErrorNumber_Syntax
DCB "$errtok",0
ALIGN
......@@ -303,7 +304,7 @@ Filer_CloseDir_Code Entry
; .............................................................................
Filer_Run_Accept
DCB "noshift=ns/S,"
DCB "shift=s/S,noshift=ns/S,"
DCB "/A"
DCB 0
......@@ -311,12 +312,21 @@ Filer_Run_Accept
; Fields in the ReadArgs output vector
^ 0,sp
frun_noshift # 4
frun_shift # 4
frun_noshift # 4 ; default, therefore no-op
frun_fsp # 4
ReadArgs Filer_Run,"r9,r12",256,{TRUE},SFLRRUN
; The [No]Shift switch is mutually exclusive
LDR r1, frun_shift
LDR r2, frun_noshift
ANDS r2, r2, r1
ADRNE r0, ErrorBlock_Filer_Run_Syntax
BLNE LookupError
EXIT VS
; Find the object type of the object
LDR r1, frun_fsp
MOV r0, #OSFile_ReadInfo
......@@ -333,9 +343,9 @@ frun_fsp # 4
; Get the file type from the info
BL FindFileType_FromInfo
LDR r1, frun_noshift
LDR r1, frun_shift
TEQ r1, #0
BNE %FT35
BEQ %FT35
MOV r0, #&81
MOV r1, #&FF
......
......@@ -60,7 +60,7 @@ Filer_Run_Help
Filer_Run_Syntax
= "Syntax: *"
= TokenEscapeChar,Token0
= " [-NoShift] <file>|<application>", 0
= " [-Shift|-NoShift] <file>|<application>", 0
Filer_Boot_Help
= "*", TokenEscapeChar,Token0
......@@ -103,7 +103,7 @@ Filer_Layout_Help
Filer_Layout_Syntax
= "Syntax: *"
= TokenEscapeChar,Token0
= " [-LargeIcons | -SmallIcons | -FullInfo] [-SortByName | -SortByType | -SortBySize | -SortByDate] [-ReverseSort] [-NumericalSort]", 0
= " [-LargeIcons|-SmallIcons|-FullInfo] [-SortByName|-SortByType|-SortBySize|-SortByDate] [-ReverseSort] [-NumericalSort]", 0
Filer_DClickHold_Help
= "*", TokenEscapeChar,Token0
......
......@@ -138,8 +138,10 @@ event_key_pressed Entry
BEQ DecodeMenu_SelectAll
TEQ r0, #6 ; Ctrl-F
BEQ key_toggle_format
[ AltRenaming
TEQ r0, #18 ; Ctrl-R
BEQ key_rename
]
TEQ r0, #19 ; Ctrl-S
BEQ key_toggle_sort
[ AddSetDirectory
......@@ -154,9 +156,9 @@ event_key_pressed Entry
BEQ key_delete_files
SUB r2, r0, #&180
TEQ r2, #&A ; Shift-TAB
TEQ r2, #&A ; TAB
BEQ key_next_dir
TEQ r2, #&1A ; Ctrl-TAB
TEQ r2, #&1A ; Shift-TAB
BEQ key_prev_dir
TEQ r2, #&22 ; Ctrl-F2
BEQ key_close_dir
......@@ -169,6 +171,8 @@ key_open
EXIT
key_delete_files
CMP r5, #Nowt
EXIT EQ
Push "r15"
BL DecodeMenu_File_Delete
NOP
......@@ -192,6 +196,7 @@ key_toggle_format
MOVHS r0, #0
B DecodeMenu_Display
[ AltRenaming
key_rename
LDR r0, [r1, #0]
CMP r5, #Nowt
......@@ -205,21 +210,18 @@ key_rename
STR r0, windowhandle
BL GetFileBox
; need co-ordinates for positioning caret
LDR r0, filebox1 + 8
LDR r1, filebox1 + 12
STR r0, relmousex
STR r1, relmousey
BL create_rename_writeable
BL always_create_rename_writeable
EXIT
]
key_open_parent
Push "r15"
BL DecodeMenu_OpenParent
NOP
LDRVC r0, [r7, #d_handle]
BLVC AssignFocus
EXIT VS
TEQ r7, #0
LDRNE r0, [r7, #d_handle]
BLNE AssignFocus
EXIT
key_close_dir ROUT ; NOENTRY
......
......@@ -85,7 +85,7 @@ event_open_window Entry "r1-r11"
|
SUB r2, r2, #vscroll_width
]
DivRem r7, r2, r11, r14
DivRem r7, r2, r11, r14, norem
CMP r7, #1
MOVLT r7, #1
......@@ -142,7 +142,7 @@ event_open_window Entry "r1-r11"
[ bug1596
SUB r8, r8, #dvr_rhsgap ; Don't include the rhsgap when dividing
]
DivRem r7, r8, r11, r14 ; r7 := no of boxes that fit across
DivRem r7, r8, r11, r14, norem ; r7 := no of boxes that fit across
CMP r7, #1 ; in requested width of window
MOVLT r7, #1 ; at least 1 column! Rounding down
MUL r8, r7, r11 ; Set width to accomodate an integer no
......@@ -170,7 +170,7 @@ event_open_window Entry "r1-r11"
|
ADD r8, r8, #dvr_rhsgap ; Nobble rhs gap
]
DivRem r7, r8, r11, r14 ; r7 := no of boxes that fit across
DivRem r7, r8, r11, r14, norem ; r7 := no of boxes that fit across
CMP r7, #1 ; in this width of window
MOVLT r7, #1 ; at least 1 column!
......
......@@ -15,6 +15,7 @@
[ AltRenaming
wr_filename_validation DCB "s;pptr_write;A~ .:*#$&@^%\\|",34,0
ALIGN
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -26,12 +27,15 @@ wr_filename_validation DCB "s;pptr_write;A~ .:*#$&@^%\\|",34,0
; In: r4 -> directory block
; r5 -> file block
;
; Out: r0 - set if click was claimed, else 0
; Out: EQ - click was claimed
; NE - click not claimed
create_rename_writeable Entry
create_rename_writeable
Entry "r0-r12"
Push "r0-r12"
MOV r8, #0 ; Zero -> use mouse pos
01
; Check if filesystem is read-only (eg. ROM), in which case rename not allowed.
LDR r2, [r4, #d_filesystem]
TST r2, #fod_readonly
......@@ -89,6 +93,10 @@ create_rename_writeable Entry
MLA r4, r0, r1, r4
Pull "r0-r3" ; Restore r0 - r3
TEQ r8, #0
STRNE r3, relmousex ; Pretend click was on right edge of writable
STRNE r4, relmousey
LDR r6, relmousex ; load mouse x relative to window origin in r6
LDR r7, relmousey ; load mouse y relative to window origin in r6
CMP r6, r1 ; compare x with left hand extreme of bouding box
......@@ -176,14 +184,24 @@ create_rename_writeable Entry
SWI XWimp_SetCaretPosition
06 ; exit claimed click
Pull "r0-r12"
CMP r0, r0
EXIT
08
Pull "r0-r12" ; exit unclaimed click
08 ; exit unclaimed click
CMP pc, #0
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
; always_create_rename_writeable
; ==============================
;
; Like create_rename_writable, but ignores mouse pos
;
always_create_rename_writeable
ALTENTRY
MOV r8, #1 ; Non-zero -> ignore mouse pos
B %BT01
]
......
......@@ -222,7 +222,7 @@ $label LDRB $rdlo, [$rs, #df_type]
ASSERT dft_file < dft_dir
[ version >= 143
TEQ $rdlo, #dft_partition
MOVEQ $rdlo, #dft_dir ; equate partitions to dirs
MOVEQ $rdlo, #dft_file ; equate partitions to files
]
SUBS $rdhi, $rdlo, #dft_dir ; = 0 => 0 = dirs lowest
MOVGT $rdhi, #1 ; > 0 => 1 = applications next
......