X S E R I E S / P E E K E R B I T S ------------------------------------- XTrash 1.01 ©/Program 1992 SP/PeekerBits Author: Stefan Plöchinger Kleiststraße 27 DW- 8012 Ottobrunn programmed in KICKPascal (MAXON GmbH) requiring AMIGA OS2.0 minimum of stack size: 10000 ··········· XTrash 1.01 is FreeWare. All rights prohibited. The program may only be distributed for non-commercial purposes. ··········· 1 . T H E P U R P O S E O F X T R A S H Who doesn't know the NeXT's "Recycler" or the MacIntosh "Trashcan"? You drag an icon over them - and you can say bye bye to that icon... Well, on the AMIGA, there is also a trashcan. But, in contrast to the other two examples, it's nothing else than a dir in which all files dragged over are moved in. You may empty that trashcan, but that's all. But that was not the trashcan I wanted. I wanted a trashcan to really delete files and not only to move. And, why couldn't I drag volume icons over the trashcan, which would start a formatting program? Well, OK, you know what I want to say: XTrash was born. 2 . C O N C E P T I O N Having started XTrash, an icon will appear on your workbench screen or window. You may drag icons over it, which start the trashing process, or you may double-click the icon. In the last case, a window appears. Here, you see the © informations and the version and revision number of XTrash (can only be 1.01). Besides, you may quit the program here or switch to the preferences window. The window also has a menu which only offers the same possi- bilities. Well, let's see what happens if dragging icons over the XTrash work- bench icon. Then, the status window appears (see below). If the trashing process is confirmed here, another window, the processing window will be opened (but I have to say that this is only optional and may be switched off in the preferences). Then, the things selec- ted to trash will be trashed. "A propos": You may also drag an old workbench trashcan icon over the XTrash icon. Then, you may delete the trashcan :-) or empty it. 3 . P A R A M E T E R S T O X T R A S H The parameters are read like this: When started from the CLI, XTrash first checks the CLI arguments. Then, it tests whether there are tool types in the XTrash program icon. When started from the work- bench, only the last thing is done. 3.1 CLI ARGUMENTS Template: "CONFIG" This is a standard Commodore template. The option means: "CONFIG": The path to the configuration file (may be "STD" for "ENVARC:XTrash.Config"). 3.2 WORKBENCH ARGUMENTS There is only one possible tool type for XTrash: "CONFIG=": The following string is the path to the config file (may be "STD" here, too). 4 . T H E S T A T U S W I N D O W This window appears if you drag an icon over the XTrash Icon. In the field at the top, you see what is specified to trash. All files, directories, trashes and volumes are listed numerically. Under this field, you see certain buttons. They are discussed later. At the bottom, you are able to cancel the operation. The window is closed then, and no operation is specified. You may also set the buttons above to standard values. These values may be specified in the preferences window. Besides, the left gadget "Trash..." starts the deleting or formatting process. Now let's discuss the buttons appearing under the field (oh yea!): There may be the radio buttons "Delete Files" or "Move Files in Trashcan" (only appearing if you dragged at least one file or dir). If you select "Move files in Trashcan", all files are copied in a dir specified in the prefs window before being deleted. "Empty Trashcan" and "Delete Trashcan" are two other radio buttons. They only appear if at least one trashcan has been dragged over the XTrash icon. You may specify if a trash is to be deleted or to be emptied. "Fmt. Name" and "Options" refer on volumes. So, they only appear if at least one volume icon has been dragged. In these text gadgets you enter a name for the formatted volume or any formatting options. See later for these gadgets. 5 . P R O C E S S I N G P A N E L This panel appears if a. the preferences are set right and b. if trashing has been started. At the top, you see what XTrash currently is doing. Below, the current trashing path is displayed. If the directory "DH0:System" is deleted (better don't test...), it looks like this: DH0: System If XTrash has to delete a subdir of the dir to delete, for example "DH0:System/Icons", the path list looks like this: DH0: System Icons The trashing process may be paused with "Pause" and be stopped with "Stop". The processing panel may be closed. Then, XTrash trashes in the background. You can enter the processing panel by double-clicking the XTrash icon. Perhaps, all actions in the panel may not react in real time. You may click "Pause", and nothing pauses. The reason: XTrash doesn't delete, format or copy synchronous to the input con- trol. 6 . P R E F E R E N C E S You enter the Preferences by selecting the Menu item "Preferences" in the Project menus or the corrosponding gadget in the window appearing when double-clicking the XTrash icon.. The first six gadgets look like the gadgets appearing in the status window. The values currently set in that window may be set here by pressing "Current Values", too. The values specified here are set if pressing "Std. Values" in the status window. The other gadgets: "Program"/"Stack": Now, the most complex part of this story: XTrash uses a seperate formatting program to format volumes. You can specify the stack of this program, and the program's path and parameters. The last is entered in the "Program" text gadget. By pressing "Get...", a file requester appears. Then specify the formatting program you'd like to use. The parameters are to be specified in the normal cli way, simply by entering them just after the program's name. But there are some problems: Where should XTrash place the volume's name? Where the options? Where the volume's device? XTrash offers the possibility to enter them by using placeholders. They are the following: "\d": the volume's device "\n": the volume's name after having formatted the volume "\o": the options string An example: "SYS:System/Format DRIVE \d NAME "\n" \o" starts the program "SYS:System/Format". Instead of "\d", the device of the volume that has been dragged over the XTrash icon is set. Let's say it was "DF0:". The "\n" is replaced by the string entered in the status window's "Fmt. Name" text gadget. The string in the "Options" text gadget in the status window is put at the position of the "\o". Let's say that the "Fmt. Name" string was "Empty", and that the "Options" string was "QUICK NOICONS". The program would then be started like this: "SYS:System/Format DRIVE DF0: NAME "Empty" QUICK NOICONS" You may not enter the the "\n" or "\o" string. Then, the corros- ponding text gadget in the status window doesn't appear. If you want to specify a "\n" in the program's name or somewhere else, and it oughtn't to stand for the volume's name, simply write "\\n". This means that you have to specify two "\" for every "\" in the program gadget. "\\" would mean "\\\\" then. "Move-Trashcan": The directory in which files are to be moved in move mode. "Icon File": A ".info" file for the XTrash icon outfit. "Name": A name for the XTrash icon. "X"/"Y": The position of the XTrash icon. "Textgadg. coloured": Specify if the XTrash text gadgets are to be coloured when selected. "Processing panel": Specify if the process panel is to be opened when trashing. "Save": Stores the settings and leaves the requester. "Use": Leaves the requester and uses the settings now specified. "Cancel": Leaves the requester and uses the settings that were used before going into the Preferences requester. The XTrash Preferences window owns a menu in which you can switch between the default XTrash Prefs, the last saved prefs and the current prefs. It's built up like any Preferences "Edit" window. 7 . B U G R E P O R T ¡! Well, currently, I kno two bugs in XTrash. These are no real bugs in XTrash, but of the AMIGA OS. The first one is normally rather uninteresting, but has to be specified: XTrash has problems with links. These links are a new advantage of the AMIGA OS 2. But never drag the icon of a directory hich is only a link to another one over the XTrash icon - XTrash will delete the original directory! The bug lies, as I found out, in the workbench communication system. Dragging an linked dir icon over an application icon like the XTrash icon will always cause a message referring to the icon which has been linked. What is paradox, the whole thing works properly with linked file icons! You may cope with the bug by using the "Delete..." menu item out of the workbench "Icons" menu. Here, the deleting works properly be- cause the workbench doesnt't have to send a message to itself. XTrash receives a message that isn't built up correctly, the work- bench only looks up in its variables. It may be (but it's unlikely) that the error is caused by the pro- gram "WBLink" by Dave Schreiber which has been used for creating the links. But: perhaps, links may cause another behaviour at your personal AMIGA :-). Maybe, you have a newer OS (mine is 2.04) or anything else. In this case, contact me under the address above! ¡! The second bug in XTrash is again a bug of the AMIGA OS. Try to delete a file or dir iconless - and what happens on your workbench screen? Nothing? Well, this is the problem. The workbench doesn't recognize whether a file or dir is deleted or not. In contrast to this, it reconizes if an icon is deleted! Well, don't wonder but use the command "Update" out of your workbench "Window" menu and hope that the OS bug will be fixed soon... ··········· Tata! Now, we present again: Thanks people out there in the world's non-german-speaking areas that you have been able to read this doc to this char position! Switch off and click the close gadget! It's over now! The nightmare is over!, thanks to Langenscheidt for the English vocabulary..., thanks to the "KICKStart" and the "AMIGA Magazin". Without their help, such a perfect and complete program, as wonderful and glorious as it is, would never have been possible! :-) ··········· X T R A S H P R O G R A M H I S T O R Y : V1.0 First "Final Release", but I really did love it :-) V1.01 Exactly one bug removed: Now, you can change the workbench screen when XTrash is started.