simply add to your remotes
then open via menus
once your info is showing you can send a line to your
clipboard by double clicking it.
updated
lmao now called Zmodems drive properties
nice one man :)
menu * {
Drive Properties:dialog $iif($dialog(drive.properties),-v,-dm) drive.properties drive.properties
}
alias -l load.drives {
var %i = $disk(0)
while (%i) {
did -a drive.properties 3 $disk(%i).path
dec %i
}
}
dialog drive.properties {
title "Drive Properties"
size -1 -1 71 90
option dbu
box "", 1, 2 2 67 86
text "Drive Properties:",2, 6 7 50 8
combo 3, 4 16 30 26, autohs drop sort
button "Get Info", 4, 36 16 30 10
list 5, 4 27 63 59, size
}
on *:dialog:drive.properties:*:*: {
var %d = $dname, %e = $devent, %i = $did
if (%e == init) { did -b %d 4 | load.drives }
if (%e == sclick) {
if (%i == 3) { did - $+ $iif($disk($did(3)).type,e,b) %d 4 }
if ((%i == 4) && ($disk($did(3)).type)) {
var %a = did -a drive.properties 5, %drive = $did(drive.properties,3)
did -r drive.properties 5
%a Listing %drive Properties
%a ------------------------
%a Path: $disk(%drive).path
%a Type: $disk(%drive).type
%a Label: $disk(%drive).label
%a Size: $bytes($disk(%drive).size,g) Gbs
%a Free: $bytes($disk(%drive).free,g) Gbs
}
}
if ((%e == dclick) && (%i == 5)) { clipboard $did(5,$did(5).sel) }
}
Okay, I still felt like contributing, so I made a few adds/changes:
[b]Added a combo box that lists all of the disk drives when the dialog opens. This will make it easier to get info on any available disk drive.
Dialog will now display info for CDROM drives as well, including other types of drives that return a $false for the $disk() value.[/b]
Here is an update of the code:
menu * {
Drive Properties:dialog $iif($dialog(drive.properties),-v,-dm) drive.properties drive.properties
}
alias -l load.drives {
var %i = $disk(0)
while (%i) {
did -a drive.properties 3 $disk(%i).path
dec %i
}
}
dialog drive.properties {
title "Drive Properties"
size -1 -1 71 90
option dbu
box "", 1, 2 2 67 86
text "Drive Properties:",2, 6 7 50 8
combo 3, 4 16 30 26, autohs drop sort
button "Get Info", 4, 36 16 30 10
list 5, 4 27 63 59, size
}
on *:dialog:drive.properties:*:*: {
var %d = $dname, %e = $devent, %i = $did
if (%e == init) { did -b %d 4 | load.drives }
if (%e == sclick) {
if (%i == 3) { did - $+ $iif($disk($did(3)).type,e,b) %d 4 }
if ((%i == 4) && ($disk($did(3)).type)) {
var %a = did -a drive.properties 5, %drive = $did(drive.properties,3)
did -r drive.properties 5
%a Listing %drive Properties
%a ------------------------
%a Path: $disk(%drive).path
%a Type: $disk(%drive).type
%a Label: $disk(%drive).label
%a Size: $bytes($disk(%drive).size,g) Gbs
%a Free: $bytes($disk(%drive).free,g) Gbs
}
}
if ((%e == dclick) && (%i == 5)) { clipboard $did(5,$did(5).sel) }
}
You've still got the drive being set globally, basically due to not inferring the var function before it. All you really need to do is move the variable up after the first declared local variable, adding a comma of course.
Suggestion: How about double-clicking a line in the listbox sends the line to your clipboard?
You can also save line and spaces, and also clean up the code, by grouping the dialog events into one event. Here's the new event, all you would need is to replace the other on dialog events with just this one (with the clipboard thing added):
on *:dialog:drive.properties:*:*: {
var %d = $dname, %e = $devent, %i = $did
if (%e == init) { did -b %d 4 }
if ((%e == edit) && (%i == 3)) { did - $+ $iif($disk($did(3)),e,b) %d 4 }
if ((%e == sclick) && (%i == 4) && ($disk($did(3)))) {
var %a = did -a drive.properties 5, %drive = $did(drive.properties,3)
did -r drive.properties 5
%a Listing %drive Properties
%a ------------------------
%a Path: $disk(%drive).path
%a Type: $disk(%drive).type
%a Label: $disk(%drive).label
%a Size: $bytes($disk(%drive).size,g) Gbs
%a Free: $bytes($disk(%drive).free,g) Gbs
}
if ((%e == dclick) && (%i == 5)) { clipboard $did(5,$did(5).sel) }
}
nice lil dialog.
on this line
set %drive $did(drive.properties,3)
no real need to make it a global var when a local will do the job.
also you may just as well change this line
dialog -dm drive.properties drive.properties
to
dialog $iif($dialog(drive.properties),-v,-dm) drive.properties drive.properties
just incase you have morons trying to opening it while it's already open so they dont get an error ;x
Hey, thanks and I'm glad you enjoyed that! :-D You can also cut corners in the code in a bunch of spots. I will suggest more in the morning, but basically, in your sclick event, you've got a ton of room for space-saving. Your recursive usage of the $($+(... is completely unnecessary. In other words, you can replace your sclick dialog event with this:
on *:dialog:drive.properties:sclick:*: {
var %a = did -a drive.properties 5
if (($did = 4) && ($disk($did(drive.properties,3)))) {
did -r drive.properties 5
set %drive $did(drive.properties,3)
%a Listing %drive Properties
%a ------------------------
%a Path: $disk(%drive).path
%a Type: $disk(%drive).type
%a Label: $disk(%drive).label
%a Size: $bytes($disk(%drive).size,g) Gbs
%a Free: $bytes($disk(%drive).free,g) Gbs
}
}
And, oh my god, guess what? I have a few suggestions! :-D
First off, you are going to want to make sure that the drive they enter is valid! There is a bunch of stuff that will pertain to this, but your main area of concern should be the dialog event. After your main dialog code, replace everything else with this:
on *:dialog:drive.properties:init:*: {
did -b $dname 4
}
on *:dialog:drive.properties:edit:3: {
did - $+ $iif($disk($did(3)),e,b) $dname 4
}
on *:dialog:drive.properties:sclick:*: {
if (($did = 4) && ($disk($did(drive.properties,3)))) {
did -r drive.properties 5
set %drive $did(drive.properties,3)
did -a drive.properties 5 Listing %drive Properties
did -a drive.properties 5 ------------------------
did -a drive.properties 5 Path: $disk($($+(%,drive),2)|0).path
did -a drive.properties 5 Type: $disk($($+(%,drive),2)|0).type
did -a drive.properties 5 Label: $disk($($+(%,drive),2)|0).label
did -a drive.properties 5 Size: $bytes($disk($($+(%,drive),2)|0).size,g) Gbs
did -a drive.properties 5 Free: $bytes($disk($($+(%,drive),2)|0).free,g) Gbs
}
}
The info button will be disabled until a valid drive is entered. I hope you can understand this. If not, let me know, I would be more than happy to outline the details. Good luck! :-D