| 1 |
UseGettext |
| 2 |
WindowLocaleTitle {File Browser} |
| 3 |
WindowSize 360 340 # Size |
| 4 |
Font {} |
| 5 |
|
| 6 |
Init |
| 7 |
Begin |
| 8 |
Set $PWD=(GetScriptArgument 1) |
| 9 |
Set $POS=50 |
| 10 |
Set $LOOP=1 |
| 11 |
While $LOOP==1 Do |
| 12 |
Begin |
| 13 |
If (StrCopy $PWD $POS $POS)=={/} Then |
| 14 |
Set $LOOP=0 |
| 15 |
If $POS==0 Then |
| 16 |
Set $LOOP=0 |
| 17 |
Set $POS=(Add $POS -1) |
| 18 |
End |
| 19 |
Set $PWD=(StrCopy $PWD 1 $POS) |
| 20 |
Set $CMD2={cd;cd } $PWD {; pwd} |
| 21 |
Set $PWD=(GetOutput $CMD2 0 0) |
| 22 |
Set $OPT={ } |
| 23 |
Set $CMD={cd } $PWD {; ls} $OPT {-1 -F} |
| 24 |
Set $LS=(GetOutput $CMD 1 -1) |
| 25 |
Set $ID=2 |
| 26 |
While (GetOutput $CMD $ID -1) <> {} Do |
| 27 |
Begin |
| 28 |
Set $LS=$LS {|} (GetOutput $CMD $ID -1) |
| 29 |
Set $ID=(Add $ID 1) |
| 30 |
End |
| 31 |
ChangeTitle 7 $LS |
| 32 |
ChangeTitle 5 $PWD |
| 33 |
ChangeTitle 9 {} |
| 34 |
End |
| 35 |
|
| 36 |
Widget 1 |
| 37 |
Property |
| 38 |
Size 85 20 |
| 39 |
Position 60 300 |
| 40 |
Flags NoReliefString |
| 41 |
Type PushButton |
| 42 |
LocaleTitle {OK} |
| 43 |
Main |
| 44 |
Case message of |
| 45 |
SingleClic : |
| 46 |
Begin |
| 47 |
SendToScript (GetScriptFather) $PWD {/} (GetTitle 9) |
| 48 |
Quit |
| 49 |
End |
| 50 |
End |
| 51 |
|
| 52 |
Widget 2 |
| 53 |
Property |
| 54 |
Size 85 20 |
| 55 |
Position 195 300 |
| 56 |
Flags NoReliefString |
| 57 |
Type PushButton |
| 58 |
LocaleTitle {Cancel} |
| 59 |
Main |
| 60 |
Case message of |
| 61 |
SingleClic : |
| 62 |
Begin |
| 63 |
Quit |
| 64 |
End |
| 65 |
End |
| 66 |
|
| 67 |
Widget 3 |
| 68 |
Property |
| 69 |
Position 10 10 |
| 70 |
Flags NoReliefString |
| 71 |
Size 340 280 |
| 72 |
Type Rectangle |
| 73 |
Main |
| 74 |
Case message of |
| 75 |
SingleClic : |
| 76 |
Begin |
| 77 |
End |
| 78 |
End |
| 79 |
|
| 80 |
Widget 4 |
| 81 |
Property |
| 82 |
Position 20 15 |
| 83 |
Size 320 20 |
| 84 |
Flags NoReliefString NoFocus Left |
| 85 |
Type ItemDraw |
| 86 |
LocaleTitle {Path:} |
| 87 |
Main |
| 88 |
Case message of |
| 89 |
SingleClic : |
| 90 |
Begin |
| 91 |
End |
| 92 |
End |
| 93 |
|
| 94 |
Widget 5 |
| 95 |
Property |
| 96 |
Position 25 42 |
| 97 |
Flags NoReliefString NoFocus Left |
| 98 |
Size 270 0 |
| 99 |
Type ItemDraw |
| 100 |
Title {*} |
| 101 |
Main |
| 102 |
Case message of |
| 103 |
SingleClic : |
| 104 |
Begin |
| 105 |
End |
| 106 |
End |
| 107 |
|
| 108 |
Widget 10 |
| 109 |
Property |
| 110 |
Position 20 40 |
| 111 |
Size 320 20 |
| 112 |
Type Rectangle |
| 113 |
Main |
| 114 |
Case message of |
| 115 |
SingleClic : |
| 116 |
Begin |
| 117 |
End |
| 118 |
End |
| 119 |
|
| 120 |
|
| 121 |
Widget 6 |
| 122 |
Property |
| 123 |
Position 21 67 |
| 124 |
Flags NoReliefString |
| 125 |
Size 50 18 |
| 126 |
Title {up} |
| 127 |
#Icon up.xpm |
| 128 |
Type PushButton |
| 129 |
Main |
| 130 |
Case message of |
| 131 |
SingleClic : |
| 132 |
Begin |
| 133 |
Set $CMD={cd } $PWD {/..; pwd} |
| 134 |
Set $PWD=(GetOutput $CMD 0 0) |
| 135 |
Set $CMD={cd } $PWD {; ls} $OPT {-1 -F} |
| 136 |
Set $LS=(GetOutput $CMD 1 -1) |
| 137 |
Set $ID=2 |
| 138 |
While (GetOutput $CMD $ID -1) <> {} Do |
| 139 |
Begin |
| 140 |
Set $LS=$LS {|} (GetOutput $CMD $ID -1) |
| 141 |
Set $ID=(Add $ID 1) |
| 142 |
End |
| 143 |
ChangeTitle 7 $LS |
| 144 |
ChangeTitle 5 $PWD |
| 145 |
ChangeTitle 9 {} |
| 146 |
End |
| 147 |
End |
| 148 |
|
| 149 |
Widget 11 |
| 150 |
Property |
| 151 |
Position 91 67 |
| 152 |
Flags NoReliefString |
| 153 |
Size 50 18 |
| 154 |
Title {home} |
| 155 |
#Icon home.xpm |
| 156 |
Type PushButton |
| 157 |
Main |
| 158 |
Case message of |
| 159 |
SingleClic : |
| 160 |
Begin |
| 161 |
Set $PWD={~/} |
| 162 |
Set $CMD={cd } $PWD {; ls} $OPT {-1 -F} |
| 163 |
Set $LS=(GetOutput $CMD 1 -1) |
| 164 |
Set $ID=2 |
| 165 |
While (GetOutput $CMD $ID -1) <> {} Do |
| 166 |
Begin |
| 167 |
Set $LS=$LS {|} (GetOutput $CMD $ID -1) |
| 168 |
Set $ID=(Add $ID 1) |
| 169 |
End |
| 170 |
ChangeTitle 7 $LS |
| 171 |
ChangeTitle 5 $PWD |
| 172 |
ChangeTitle 9 {} |
| 173 |
End |
| 174 |
End |
| 175 |
|
| 176 |
Widget 12 |
| 177 |
Property |
| 178 |
Position 180 72 |
| 179 |
Flags NoReliefString |
| 180 |
Type CheckBox |
| 181 |
LocaleTitle { Show hidden files} |
| 182 |
Main |
| 183 |
Case message of |
| 184 |
SingleClic : |
| 185 |
Begin |
| 186 |
If (GetValue 12) == 1 Then |
| 187 |
Set $OPT={ -A } |
| 188 |
Else |
| 189 |
Set $OPT={ } |
| 190 |
Set $CMD={cd } $PWD {; ls} $OPT {-1 -F} |
| 191 |
Set $LS=(GetOutput $CMD 1 -1) |
| 192 |
Set $ID=2 |
| 193 |
While (GetOutput $CMD $ID -1) <> {} Do |
| 194 |
Begin |
| 195 |
Set $LS=$LS {|} (GetOutput $CMD $ID -1) |
| 196 |
Set $ID=(Add $ID 1) |
| 197 |
End |
| 198 |
ChangeTitle 7 $LS |
| 199 |
ChangeTitle 5 $PWD |
| 200 |
ChangeTitle 9 {} |
| 201 |
End |
| 202 |
End |
| 203 |
|
| 204 |
Widget 7 |
| 205 |
Property |
| 206 |
Position 20 100 |
| 207 |
Flags NoReliefString |
| 208 |
Size 320 115 |
| 209 |
Type List |
| 210 |
Title {} |
| 211 |
Main |
| 212 |
Case message of |
| 213 |
SingleClic : |
| 214 |
Begin |
| 215 |
Set $CMD3={cd } $PWD {; ls} $OPT {-1} |
| 216 |
Set $PWD2=$PWD {/} (GetOutput $CMD3 (GetValue 7) -1) |
| 217 |
Set $CMD2={cd } $PWD {;cd } $PWD2 { 2>/dev/null; pwd} |
| 218 |
Set $PWD2=(GetOutput $CMD2 0 0) |
| 219 |
If $PWD2 <> $PWD Then |
| 220 |
Begin |
| 221 |
Set $PWD = $PWD2 |
| 222 |
Set $CMD={cd } $PWD {; ls} $OPT {-1 -F} |
| 223 |
Set $LS=(GetOutput $CMD 1 -1) |
| 224 |
Set $ID=2 |
| 225 |
While (GetOutput $CMD $ID -1) <> {} Do |
| 226 |
Begin |
| 227 |
Set $LS=$LS {|} (GetOutput $CMD $ID -1) |
| 228 |
Set $ID=(Add $ID 1) |
| 229 |
End |
| 230 |
ChangeTitle 7 $LS |
| 231 |
ChangeTitle 5 $PWD |
| 232 |
ChangeTitle 9 {} |
| 233 |
End |
| 234 |
Else |
| 235 |
Begin |
| 236 |
ChangeTitle 9 (GetOutput $CMD3 (GetValue 7) -1) |
| 237 |
End |
| 238 |
End |
| 239 |
End |
| 240 |
|
| 241 |
Widget 8 |
| 242 |
Property |
| 243 |
Position 20 220 |
| 244 |
Flags NoReliefString NoFocus |
| 245 |
Type ItemDraw |
| 246 |
LocaleTitle {Selected file:} |
| 247 |
Main |
| 248 |
Case message of |
| 249 |
SingleClic : |
| 250 |
Begin |
| 251 |
End |
| 252 |
End |
| 253 |
|
| 254 |
Widget 9 |
| 255 |
Property |
| 256 |
Position 20 240 |
| 257 |
Flags NoReliefString |
| 258 |
Size 320 20 |
| 259 |
Type TextField |
| 260 |
Title {} |
| 261 |
Main |
| 262 |
Case message of |
| 263 |
SingleClic : |
| 264 |
Begin |
| 265 |
End |
| 266 |
End |
| 267 |
|