Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Synchronet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
126
Issues
126
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main
Synchronet
Commits
5c2519c2
Commit
5c2519c2
authored
May 11, 2020
by
rswindell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mouse hotspot support to the file listing/flagging/downloading stuff.
parent
1d8819b8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
14 deletions
+36
-14
src/sbbs3/listfile.cpp
src/sbbs3/listfile.cpp
+33
-12
src/sbbs3/sbbs.h
src/sbbs3/sbbs.h
+1
-1
src/sbbs3/viewfile.cpp
src/sbbs3/viewfile.cpp
+2
-1
No files found.
src/sbbs3/listfile.cpp
View file @
5c2519c2
...
...
@@ -59,6 +59,7 @@ int sbbs_t::listfiles(uint dirnum, const char *filespec, int tofile, long mode)
int
file
,
found
=
0
,
lastbat
=
0
,
disp
;
long
m
=
0
,
n
,
anchor
=
0
,
next
,
datbuflen
;
int32_t
l
;
ulong
file_row
[
26
];
file_t
f
,
bf
[
26
];
/* bf is batch flagged files */
if
(
mode
&
FL_ULTIME
)
{
...
...
@@ -131,7 +132,7 @@ int sbbs_t::listfiles(uint dirnum, const char *filespec, int tofile, long mode)
&&
!
(
mode
&
(
FL_EXFIND
|
FL_VIEW
)))
{
flagprompt
=
0
;
lncntr
=
0
;
if
((
i
=
batchflagprompt
(
dirnum
,
bf
,
letter
-
'A'
,
l
/
F_IXBSIZE
))
==
2
)
{
if
((
i
=
batchflagprompt
(
dirnum
,
bf
,
file_row
,
letter
-
'A'
,
l
/
F_IXBSIZE
))
==
2
)
{
m
=
anchor
;
found
-=
letter
-
'A'
;
letter
=
'A'
;
...
...
@@ -308,6 +309,7 @@ int sbbs_t::listfiles(uint dirnum, const char *filespec, int tofile, long mode)
}
}
}
long
currow
=
row
;
next
=
m
;
disp
=
1
;
if
(
mode
&
(
FL_EXFIND
|
FL_VIEW
))
{
...
...
@@ -368,7 +370,8 @@ int sbbs_t::listfiles(uint dirnum, const char *filespec, int tofile, long mode)
bf
[
letter
-
'A'
].
dateuled
=
ixbbuf
[
m
+
3
]
|
((
long
)
ixbbuf
[
m
+
4
]
<<
8
)
|
((
long
)
ixbbuf
[
m
+
5
]
<<
16
)
|
((
long
)
ixbbuf
[
m
+
6
]
<<
24
);
bf
[
letter
-
'A'
].
datedled
=
ixbbuf
[
m
+
7
]
|
((
long
)
ixbbuf
[
m
+
8
]
<<
8
)
|
((
long
)
ixbbuf
[
m
+
9
]
<<
16
)
|
((
long
)
ixbbuf
[
m
+
10
]
<<
24
);
|
((
long
)
ixbbuf
[
m
+
9
]
<<
16
)
|
((
long
)
ixbbuf
[
m
+
10
]
<<
24
);
file_row
[
letter
-
'A'
]
=
currow
;
}
m
+=
11
;
if
(
flagprompt
||
letter
==
'Z'
||
!
disp
||
...
...
@@ -379,7 +382,7 @@ int sbbs_t::listfiles(uint dirnum, const char *filespec, int tofile, long mode)
flagprompt
=
0
;
lncntr
=
0
;
lastbat
=
found
;
if
((
int
)(
i
=
batchflagprompt
(
dirnum
,
bf
,
letter
-
'A'
+
1
,
l
/
F_IXBSIZE
))
<
1
)
{
if
((
int
)(
i
=
batchflagprompt
(
dirnum
,
bf
,
file_row
,
letter
-
'A'
+
1
,
l
/
F_IXBSIZE
))
<
1
)
{
free
((
char
*
)
ixbbuf
);
free
((
char
*
)
datbuf
);
if
((
int
)
i
==-
1
)
...
...
@@ -667,7 +670,7 @@ bool sbbs_t::movefile(file_t* f, int newdir)
/* Returns -1 if 'Q' or Ctrl-C, 0 if skip, 1 if [Enter], 2 otherwise */
/* or 3, backwards. */
/****************************************************************************/
int
sbbs_t
::
batchflagprompt
(
uint
dirnum
,
file_t
*
bf
,
uint
total
int
sbbs_t
::
batchflagprompt
(
uint
dirnum
,
file_t
*
bf
,
u
long
*
row
,
u
int
total
,
long
totalfiles
)
{
char
ch
,
str
[
256
],
fname
[
128
],
*
p
,
remcdt
=
0
,
remfile
=
0
;
...
...
@@ -690,7 +693,7 @@ int sbbs_t::batchflagprompt(uint dirnum, file_t* bf, uint total
,
cfg
.
lib
[
cfg
.
dir
[
dirnum
]
->
lib
]
->
sname
,
udir
+
1
,
cfg
.
dir
[
dirnum
]
->
sname
,
totalfiles
);
,
total
,
total
files
);
ch
=
getkey
(
K_UPPER
);
clearline
();
if
(
ch
==
'?'
)
{
...
...
@@ -722,8 +725,14 @@ int sbbs_t::batchflagprompt(uint dirnum, file_t* bf, uint total
CRLF
;
return
(
2
);
}
link_list_t
saved_hotspots
=
mouse_hotspots
;
ZERO_VAR
(
mouse_hotspots
);
for
(
i
=
0
;
i
<
total
;
i
++
)
add_hotspot
((
char
)(
'A'
+
i
),
/* hungry: */
true
,
-
1
,
-
1
,
row
[
i
]);
bputs
(
text
[
BatchDlFlags
]);
d
=
getstr
(
str
,
BF_MAX
,
K_UPPER
|
K_LOWPRIO
|
K_NOCRLF
);
clear_hotspots
();
mouse_hotspots
=
saved_hotspots
;
lncntr
=
0
;
if
(
sys_status
&
SS_ABORT
)
return
(
-
1
);
...
...
@@ -788,8 +797,14 @@ int sbbs_t::batchflagprompt(uint dirnum, file_t* bf, uint total
return
(
-
1
);
return
(
2
);
}
link_list_t
saved_hotspots
=
mouse_hotspots
;
ZERO_VAR
(
mouse_hotspots
);
for
(
i
=
0
;
i
<
total
;
i
++
)
add_hotspot
((
char
)(
'A'
+
i
),
/* hungry: */
true
,
-
1
,
-
1
,
row
[
i
]);
bputs
(
text
[
BatchDlFlags
]);
d
=
getstr
(
str
,
BF_MAX
,
K_UPPER
|
K_LOWPRIO
|
K_NOCRLF
);
clear_hotspots
();
mouse_hotspots
=
saved_hotspots
;
lncntr
=
0
;
if
(
sys_status
&
SS_ABORT
)
return
(
-
1
);
...
...
@@ -843,8 +858,14 @@ int sbbs_t::batchflagprompt(uint dirnum, file_t* bf, uint total
d
=
1
;
}
else
{
link_list_t
saved_hotspots
=
mouse_hotspots
;
ZERO_VAR
(
mouse_hotspots
);
for
(
i
=
0
;
i
<
total
;
i
++
)
add_hotspot
((
char
)(
'A'
+
i
),
/* hungry: */
true
,
-
1
,
-
1
,
row
[
i
]);
bputs
(
text
[
BatchDlFlags
]);
d
=
getstr
(
str
,
BF_MAX
,
K_UPPER
|
K_LOWPRIO
|
K_NOCRLF
);
d
=
getstr
(
str
,
BF_MAX
,
K_UPPER
|
K_LOWPRIO
|
K_NOCRLF
);
clear_hotspots
();
mouse_hotspots
=
saved_hotspots
;
}
lncntr
=
0
;
if
(
sys_status
&
SS_ABORT
)
...
...
@@ -1109,19 +1130,19 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
CRLF
;
if
(
f
.
opencount
)
{
mnemonics
(
text
[
QuitOrNext
]);
strcpy
(
str
,
"Q
\r
"
);
strcpy
(
str
,
"Q
N
\r
"
);
}
else
if
(
dir_op
(
dirnum
))
{
mnemonics
(
text
[
SysopRemoveFilePrompt
]);
strcpy
(
str
,
"VEFMCQR
\r
"
);
strcpy
(
str
,
"VEFMCQR
N
\r
"
);
}
else
if
(
useron
.
exempt
&
FLAG
(
'R'
))
{
mnemonics
(
text
[
RExemptRemoveFilePrompt
]);
strcpy
(
str
,
"VEMQR
\r
"
);
strcpy
(
str
,
"VEMQR
N
\r
"
);
}
else
{
mnemonics
(
text
[
UserRemoveFilePrompt
]);
strcpy
(
str
,
"VEQR
\r
"
);
strcpy
(
str
,
"VEQR
N
\r
"
);
}
switch
(
getkeys
(
str
,
0
))
{
case
'V'
:
...
...
@@ -1367,7 +1388,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
openfile
(
&
f
);
SYNC
;
mnemonics
(
text
[
ProtocolBatchQuitOrNext
]);
sprintf
(
str
,
"B%c
\r
"
,
text
[
YNQP
][
2
]);
sprintf
(
str
,
"B%c
N
\r
"
,
text
[
YNQP
][
2
]);
for
(
i
=
0
;
i
<
cfg
.
total_prots
;
i
++
)
if
(
cfg
.
prot
[
i
]
->
dlcmd
[
0
]
&&
chk_ar
(
cfg
.
prot
[
i
]
->
ar
,
&
useron
,
&
client
))
{
...
...
@@ -1385,7 +1406,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
closefile
(
&
f
);
break
;
}
}
else
if
(
ch
!=
CR
)
{
else
if
(
ch
!=
CR
&&
ch
!=
'N'
)
{
for
(
i
=
0
;
i
<
cfg
.
total_prots
;
i
++
)
if
(
cfg
.
prot
[
i
]
->
dlcmd
[
0
]
&&
cfg
.
prot
[
i
]
->
mnemonic
==
ch
&&
chk_ar
(
cfg
.
prot
[
i
]
->
ar
,
&
useron
,
&
client
))
...
...
src/sbbs3/sbbs.h
View file @
5c2519c2
...
...
@@ -980,7 +980,7 @@ public:
int
listfiles
(
uint
dirnum
,
const
char
*
filespec
,
int
tofile
,
long
mode
);
int
listfileinfo
(
uint
dirnum
,
char
*
filespec
,
long
mode
);
void
listfiletofile
(
char
*
fname
,
char
*
buf
,
uint
dirnum
,
int
file
);
int
batchflagprompt
(
uint
dirnum
,
file_t
bf
[],
uint
total
,
long
totalfiles
);
int
batchflagprompt
(
uint
dirnum
,
file_t
bf
[],
u
long
row
[],
u
int
total
,
long
totalfiles
);
/* bat_xfer.cpp */
void
batchmenu
(
void
);
...
...
src/sbbs3/viewfile.cpp
View file @
5c2519c2
...
...
@@ -57,7 +57,7 @@ int sbbs_t::viewfile(file_t* f, int ext)
ASYNC
;
sprintf
(
str
,
text
[
FileInfoPrompt
],
unpadfname
(
f
->
name
,
tmp
));
mnemonics
(
str
);
ch
=
(
char
)
getkeys
(
"BEVQ
\r
"
,
0
);
ch
=
(
char
)
getkeys
(
"BEVQ
N
\r
"
,
0
);
if
(
ch
==
'Q'
||
sys_status
&
SS_ABORT
)
return
(
0
);
switch
(
ch
)
{
...
...
@@ -71,6 +71,7 @@ int sbbs_t::viewfile(file_t* f, int ext)
case
'V'
:
ext
=
0
;
continue
;
case
'N'
:
case
CR
:
return
(
1
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment