home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d9xx
/
d946
/
trashicon.lha
/
TrashIcon
/
TrashIcon.doc
< prev
next >
Wrap
Text File
|
1993-12-20
|
14KB
|
323 lines
TrashIcon V2.2 © 1993 Mark McPherson
=======================================
Overview
========
TrashIcon is a program which places an icon on the WorkBench, and will
delete any files dragged to that icon by the user - ie it uses the WB2
feature of AppIcons. Because of this it will only work under WB2.04 and
above.
The standard trashcan in use on the Amiga has several difficulties. It
can only delete files on the disk containing the trashcan, and also doesn't
delete files immediately. TrashIcon overcomes these difficulties.
TrashIcon is highly configurable and gives the user great flexibility
over what is deleted. It will, unlike some other similar programs, keep
the WorkBench in step with what you are deleting. You can also format disks
either quickly or fully.
Distribution
============
All code is Copyright © 1993 Mark McPherson. It may be copied and
distributed so long as no commercial profit is made out of it. it may not
be modified, sold, or included in any commercial distribution without my
written permission. Public Domain vendors are not allowed to sell this
program for more than the price of a regular disk, which should be no
more than the equivalent of 5 Dollars. The author takes no responsibility
for any loss or damage resulting from the use of this program.
This distribution should contain the following files:
TrashIcon
TrashIcon.info
TrashIcon.doc
TrashIcon.doc.info
though they may of course be archived with a program such as LhA.
Installation
============
TrashIcon works best when started from the WBStartup drawer of your
boot disk. It can also be started simply by double clicking on the
TrashIcon program icon. It should not be started from the CLI.
To automatically run, simply copy the program and its icon to the
WBStartup drawer. Otherwise just copy them to where you want the program
to reside. Make sure that the program and its icon stay together else
TrashIcon will most likely fail to work. You can copy the documentation
to anywhere you like, or simply deleted if you never want to use it again.
Usage
=====
TrashIcon has many different features available making it flexible
and configurable to how you want to use it.
The icon that is placed on the WorkBench is simple the program icon,
and may be changed if you don't like the icon supplied. All of the
program options are set by the icon's ToolTypes, but can be changed and
set completely from within the program. The position of this icon can be
set on the WorkBench if you want.
The main use of TrashIcon is obviously to delete files. This is done
by dragging an icon (or selection of icons) of the objects to delete, to
the icon on the WorkBench. If you drag a disk icon to TrashIcon, then
you will be given the option of formatting that disk. You can choose, if
the confirm option is set, to delete some or all of the files you have
dragged. If you drag a drawer, you can choose to delete both the drawer
and all its contents or only delete it if it is empty. Some files may be
protected from deletion and you can choose whether you want to delete
these automatically, not delete them, or be asked whether you want to
delete them.
By double clicking on the TrashIcon icon, you will bring up an options
window where you can change the current settings of the program. You can
also make these changes permanent or simply temporary, or even forget them.
Repeatedly double clicking on the icon will close and reopen this window.
Note that while this window is open you can still drag icons to be deleted
to the TrashIcon on the WorkBench, or even drag them into the window itself.
It is this feature which is one of the major differences between this version
of TrashIcon and earlier versions, or other similar programs.
Options
=======
TrashIcon has many different options, all of which may be changed from
its options window. Each option is detailed below.
The window itself is controlled by clicking on the buttons marked:
QUIT - this will cause TrashIcon to finish all deletion of files
and then close the window, remove the icon, and quit.
ABOUT - this will bring up an "about" requestor with details about
the version of the program etc.
USE - this will close the options window, retaining any changes
to the current options that you have set.
SAVE - this will cause the current options to be saved, so that the
next time TrashIcon is run, those will be the default options.
It also saves the current position of the options window. This
is all done by setting the ToolTypes of the program icon. You
should never have to set these manually, except to add those
such as DONOTWAIT which are used by the WorkBench and
not TrashIcon. Clicking on this button will also close the
options window.
CANCEL - this will close the options window and revert to the original
settings before the window was opened.
Icon X Position - this is the horizontal coordinate on the WorkBench
of TrashIcon's icon. If something else occupies
this position then the WorkBench will decide where
to put the icon.
Icon Y Position - same as above, but for the vertical coordinate.
Icon text - this is the text that appears below the icon on
the WorkBench. It defaults to the program name,
but can be changed to anything else, including
a blank name.
Open Window - if this is set, then when the program is started,
the options window will open immediately.
Ignore Protection - this is set to what should happen if you try to
delete a file that is protected from deletion.
if set to ASK, then you will be given the option
of deleting the file. If set to YES, then such
files will always be deleted. If set to NO, then
such files will never be deleted.
Recursive Delete - if this is set, then when you drag a drawer to
TrashIcon, both it and its contents will be
deleted. If not, then the drawer will only
be deleted if it is empty.
Confirm Deletion - if this is set, then before any deletion takes
place, you will be given the choice of either
continuing (OK) in which case the deletion will
take place as normal, stopping (CANCEL) and not
deleting anything, or CONFIRM EACH where you
will be asked before deleting every file. If
CONFIRM EACH is selected, then for every file you
will be asked if you want to delete that file and
continuing (YES), deleting that file and every one
after it without any more prompting (ALL), not
deleting that file and continuing (NO), or stopping
at that point (NONE).
Technical Notes
===============
To delete a particular file, TrashIcon goes through the following steps:
- it will first check if the file has an icon.
- if so then it will delete the file and its icon.
- if it is a drawer, and WorkBench has its window open, then TrashIcon will
first delete the icon in order to get WorkBench to close the window. It
will then try to delete the drawer. If it still can't delete the drawer,
then it will put the icon back.
- if the file has no icon or if it is an icon with no associated file then
it will delete this.
- if the object is a drawer icon but there is no associated drawer, then
TrashIcon will open its options window. This isn't a bug in TrashIcon,
but an unfortunate side-effect of the way WorkBench tells TrashIcon what
to delete. Note that many other programs have similar behaviour.
- if an object cannot be deleted, then neither will its icon.
REMEMBER: that non-empty directories cannot be deleted. eg, if a file
in a directory is locked for some reason and cannot be deleted,
then the directory will not be able to be removed - not even
with the Recursive Delete option set.
The History of TrashIcon
========================
TrashIcon has had many different versions - some of which have been
released, some of which haven't. Public release means that I have
distributed that version properly. Semi-Public release means that I
have freely given copies of the program to people, but haven't actually
released it properly. Internal release means that only I and a couple
of close friends have used that version.
V0.1 - 15/01/93 Internal release
The first version of the program. Had an appicon and could
recusively delete files, but had no options window. It also
didn't update the WorkBench in all cases.
V0.5 - 20/01/93 Internal release
Added an options window. Could now override the protection on
files.
V0.6 - 20/02/93 Public release
Made the position of the icon user-definable. Also added initial
confirmation of deletion of files. Wrote some documentation!!!
V1.0 - 22/02/93 Internal release
Added purge option for wiping a file completely.
V1.1 - 24/02/93 Internal release
Fixed a minor bug in the options window, and made the purge option
even more secure.
V1.2 - 26/02/93 Public release
Totally removed purge option due to finding MAJOR unreliability in
the method used. Decided that I wouldn't implement this until there
was a fool-proof method available. Added extra confirmation handling,
and the ability to format disks.
V1.3 - 28/02/93 Semi-Public release
Changed the deletion code significantly and fixed a couple of minor
bugs in the process.
V1.4 - 13/05/93 Public release
Note the time lapse - I had exams!!! Removed all Enforcer hits.
Unfortunately, this version has a VERY large bug which I didn't spot
until too late. This version been put on a Fred Fish disk - I hope
nobody uses it!
10/9/93 - Amiga Shopper reviewed this version and gave it 9/10. Do
they really test the programs they review???
V1.5 - 27/05/93 Public release
Fixed the bug in V1.4. Added the Icon Text option.
V1.6 - 23/06/93 Public release
Completely rewrote the file deletion routines. This version keeps
WorkBench in step with deleted files MOST of the time...
V2.0 - 01/07/93 Semi-Public release
Code was rewritten from scratch. The options window was made into
an AppWindow so that files could be dragged to it as well as the icon.
Also made ALL the options changeable here. Up until now, options could
only be set by changing the program icon's ToolTypes. Made the program
multitask while formatting a disk. The delete routine now ALWAYS keeps
WorkBench in step with it. All these new options and TrashIcon has
actually got SMALLER!
V2.1 - 12/09/93 Semi-Public release
Changed the way in which deletion of .info files without a program
file was handled. This makes the program run faster and also makes
the code tidier, but does make the program a few bytes larger ;o)
V2.2 - 29/09/93 Public release
Made changing the icon's positioning and text occur when USE or SAVE
is clicked on. These only worked when first running TrashIcon in earlier
releases. Also changed the SAVE routine - making it smaller, more
efficient, and more importantly removing a (possible) bug. The program
is now even smaller than V2.0!
Thanks and Testing
==================
This version of TrashIcon has been tested under V37.175, V39.106 and
V40.003 of the Operating System, on both accelerated and unaccelerated
machines. I have yet to test it on an '040 machine since I don't know
anybody with one! It should work on one OK though. It definitely works
on A500's, A600's, A2000's, A1200's, A3000's and A4000/030's.
I have had a lot of people saying that TrashIcon doesn't seem to work
properly when deleting from the RAM disk. I don't know why this happens,
especially since I do most of my testing in RAM: (for obvious reasons!)
If it DOES happen then send me a report specifying your setup and the
circumstances in which it happened (a snoopdos or similar program's report
would be handy!)
In all testing I must say thank you to Matt Jennings for allowing me to
use his Amiga 3000. Without this, finding and removing Enforcer hits would
have been nearly impossible! Thanks also to everybody who wrote to me
and told me what bugs there were. I'm pretty sure that this version is
finally bug free, but who knows ;-)
About the Author
================
Hi! TrashIcon was written by me, Mark McPherson, in my spare time
while studying for a BSc in Compter Science at the University of Kent
at Canterbury, in England. I have never asked for money for this program,
but have on one occasion been sent some! I like to hear from all people
who use this program, and any suggestions on how to improve it are
welcomed. When I started on this project, I simply wanted a small but
fast program that deleted my files! All the other similar programs
around simply didn't do what I wanted, or were ridiculously large for
what they did. TrashIcon finally does everything that I want it to
do, but I will continue to support it and update it if there is a need.
I can be contacted on the Internet by E-Mail at "msm@ukc.ac.uk", so please
send me some E-Mail if you can. For those of you without such access,
you can write to me at:
Mark McPherson
54 Wrestwood Road,
Bexhill-On-Sea,
East Sussex,
TN40 2LL
England
Note that if you want the latest version of this program then either
contact me via E-Mail and I'll send you the latest version, or send me a
blank disk and the cost of return postage, and I'll post it to you.
Anyway, I hope you like this program.
Mark McPherson - 29th September 1993