1 /*****************************************************************************
2 ** This is the Action custom class, a sub class of Area.mui.
3 ******************************************************************************/
7 #define USE_INLINE_STDARG
9 #include <proto/muimaster.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
12 #include <proto/poseidon.h>
13 #include <proto/intuition.h>
14 #include <proto/graphics.h>
15 #include <proto/usbclass.h>
16 #include <proto/icon.h>
17 #include <proto/utility.h>
20 #include "ActionClass.h"
21 #include "IconListClass.h"
22 #include "DevWinClass.h"
23 #include "CfgListClass.h"
26 extern struct ExecBase
*SysBase
;
27 extern struct Library
*ps
;
28 extern struct IntuitionBase
*IntuitionBase
;
29 extern struct DosLibrary
*DOSBase
;
31 #define NewList(list) NEWLIST(list)
33 #define USE_NEPTUNE8_BODY
34 //#define USE_NEPTUNE8_HEADER
35 #define USE_NEPTUNE8_COLORS
36 #include "neptune8logo.c"
38 #define CLASSPATH "SYS:Classes/USB"
39 #define STACKLOADER "Sys/poseidon.prefs"
41 /* /// "Some strings" */
42 static STRPTR mainpanels
[] =
54 static STRPTR errlvlstrings
[] =
56 NULL
, //"All messages",
57 NULL
, //"Warnings and worse",
58 NULL
, //"Errors and failures",
59 NULL
, //"Failures only",
63 static STRPTR popupnewdevicestrings
[] =
65 NULL
, //"Never open a popup window! Bah!",
66 NULL
, //"Only popup on an error condition",
67 NULL
, //"Popup on new, unknown devices",
68 NULL
, //"Popup, if there is no binding",
69 NULL
, //"Popup, if there is no config yet",
70 NULL
, //"Popup on configurable class",
71 NULL
, //"Popup, regardless of binding",
72 NULL
, //"Always immediately annoy me",
77 /* /// "Some lyrics" */
78 static char *aimeelyrics
[] =
81 "\33l\33iIn our endeavor we are never seeing eye to eye\n"
82 "No guts to sever so forever may we wave goodbye\n"
83 "And you're always telling me that it's my turn to move\n"
84 "When I wonder what could make the needle jump the groove\n"
85 "I won't fall for the oldest trick in the book\n"
86 "So don't sit there and think you're off of the hook\n"
87 "By saying there is no use changing 'cause\n\n"
88 "That's just what you are\n"
89 "That's just what you are\n"
93 "\33l\33iI can't do it\n"
95 "You're everything you're\n"
96 "Trying to make me believe\n"
97 "'Cause this show is\n"
99 "Too well to be held\n"
100 "With only me in mind\n\n"
101 "And how am I different?\n"
102 "How am I different?\n"
103 "How am I different?\n"
107 "\33l\33i'Cause I'll never prove that my\n"
108 "Motives were pure\n"
109 "So let's remove any question of cure\n"
110 "'Cause even though you've made it\n"
112 "Baby, it's clear, from here -\n"
113 "You're losing your atmosphere\n"
114 "From here, you're losing it\n"
118 "\33l\33iOh, for the sake of momentum\n"
119 "Even thought I agree with that stuff\n"
120 "About seizing the day\n"
121 "But I hate to think of effort expended\n"
122 "All those minutes and days and hours\n"
123 "I've have frittered away\n\n"
124 "And I know life is getting shorter\n"
125 "I can't bring myself to set the scene\n"
126 "Even when it's approaching torture\n"
127 "I've got my routine\n"
131 "\33l\33i'Cause nothing is good enough\n"
132 "For people like you\n"
133 "Who have to have someone\n"
135 "And something to sabotage -\n"
136 "Determined to lose it all\n\n"
137 "Ladies and gentlemen -\n"
139 "Didn't I try again?\n"
140 "And did the effort pay?\n"
141 "Wouldn't a smarter man\n"
142 "Simply walk away?\n"
152 "Now you can hardly\n"
155 "It's not going to stop\n"
156 "It's not going to stop\n"
157 "It's not going to stop\n"
162 "\33l\33iI don't know you from Adam, it could make my day\n"
163 "If you leave me a message I'll give it away\n"
164 "'Cause the most perfect strangers that you can talk to\n"
165 "Are the ones who pretend that you're not really you\n\n"
166 "And with any attempts here to play Frankenstein\n"
167 "Come with plenty of chances for changing your mind\n"
168 "When you're building your own creation\n"
169 "Nothing's better than real\n"
170 "Than a real imitation\n"
174 "\33l\33iOh, experience is cheap\n"
175 "If that's the company you keep\n"
176 "And before you know that it's free\n"
178 "Like most amazing things\n"
179 "It's easy to miss and easy to mistake\n"
180 "For when things are really great\n"
181 "It just means everything's in its place\n"
185 "\33l\33iSo here I'm sitting in my car at the same old stoplight\n"
186 "I keep waiting for a change but I don't know what\n"
187 "So red turns into green turning into yellow\n"
188 "But I'm just frozen here on the same old spot\n"
189 "And all I have to do is just press the pedal\n"
195 "\33l\33iSay you were split, you were split in fragments\n"
196 "And none of the pieces would talk to you\n"
197 "Wouldn't you want to be who you had been?\n"
198 "Well, baby I want that, too\n\n"
199 "So better take the keys and drive forever\n"
200 "Staying won't put these futures back together\n"
201 "All the perfect drugs and superheroes\n"
202 "wouldn't be enough to bring me up to zero\n"
206 "\33l\33iBut nobody wants to hear this tale\n"
207 "The plot is clichéd, the jokes are stale\n"
208 "And baby we've all heard it all before\n"
209 "Oh, I could get specific but\n"
210 "Nobody needs a catalog\n"
211 "With details of a love I can't sell anyone\n\n"
212 "And aside from that\n"
213 "This chain of reaction, baby, is losing a link\n"
214 "Thought I'd hope you'd know what\n"
215 "I tried to tell you and if you don't\n"
216 "I could draw you a picture in invisible ink\n"
220 "\33l\33iWell, she's the face\n"
221 "And I'm the double\n"
222 "Who keeps the pace\n"
223 "And clears the rubble\n"
224 "And, Lost In Space,\n"
225 "Fills up the bubble with air\n\n"
226 "By just pretending to care\n"
227 "Like I'm not even there\n"
228 "Gone, but I don't know where\n"
232 "\33l\33iOh Mario -- why if this is nothing\n"
233 "I'm finding it so hard to dismiss\n"
234 "If you're what I need,\n"
235 "Then only you can save me\n"
236 "So come on baby -- give me the fix\n"
237 "And let's just talk about it\n"
238 "I've got to talk about it\n\n"
239 "Because nobody knows\n"
240 "That's how I nearly fell\n"
242 "And ringing Pavlov's bell\n"
244 "Like it was show and tell\n"
248 "\33l\33iWe have crossed the rubicon\n"
249 "Our ship awash, our rudder gone\n"
250 "The rats have fled but I'm hanging on\n"
251 "Let me try, baby, try\n\n"
253 "Baby, please -- let me begin\n"
254 "Let me be your heroin\n"
255 "Hate the sinner but love the sin\n"
256 "Let me be your heroin\n"
260 "\33l\33iI was undecided like you\n"
262 "But I could not stem the tide of overwhelm\n"
264 "You try to keep it going, but a lot of avenues\n"
265 "Just aren't open to you\n"
266 "when you're real bad news\n\n"
267 "I've got love and anger\n"
268 "They come as a pair\n"
269 "You can take your chances\n"
272 "Make you feel bad\n"
274 "This big ball of sad isn't\n"
275 "Worth even filling with air\n"
279 "\33l\33iThe moth don't care if the flame is real\n"
280 "'Cause moth and flame got a sweetheart deal\n"
281 "And nothing fuels a good flirtation\n"
282 "Like need and anger and desperation\n"
283 "No, the moth don't care if the flame is real\n"
284 "No, the moth don't care if the flame is real\n\n"
285 "So come on, let's go -- ready or not\n"
286 "'Cause there's a flame I know, hotter than hot\n"
287 "And with a fuse that's so thoroughly shot away\n"
291 "\33l\33iYou've gotta hope\n"
292 "That there's someone for you\n"
293 "As strange as you are\n"
295 "With the things that you do\n"
296 "Without trying too hard\n\n"
298 "'Cause you can bend the truth\n"
299 "'Till it's suiting you\n"
300 "These things that you're wrapping all around you\n"
301 "Never know what they will amount to\n"
302 "If you're life is just going on without you\n"
303 "It's the end of the things you know\n"
308 "\33l\33iNothing in this world is gonna hold me\n"
309 "No thugs in this road are gonna roll me\n"
310 "No fast talking girl is gonna slow me\n"
311 "Nothing's gonna stop me at all\n"
312 "I'm walking through walls\n\n"
314 "Some people complain\n"
315 "Yeah they caterwaul\n"
316 "I could do the same\n"
317 "But I'm walking through walls\n"
321 "\33l\33iIt should be boredom by now\n"
322 "I know the tricks of the trade\n"
323 "But it goes on anyhow\n"
324 "Sometimes the answers are ready made\n\n"
326 "And I go for it every time\n"
327 "Just like a heavy drinker\n"
328 "I go for it every time\n"
329 "Hook, line and sinker\n"
333 "\33l\33iIn my dream I'm often running\n"
334 "To a place that's out of view\n"
335 "Of every kind of memory\n"
336 "With strings that tie to you\n\n"
338 "And though a change has taken place\n"
339 "And I no longer do adore her\n"
340 "Still every God forsaken place\n"
341 "Is always right around the corner\n"
345 "\33l\33iThings begin, things decay\n"
346 "And you've gotta find a way\n"
348 "But it you want to spend the day\n"
349 "Wond'ring what it's all about\n"
350 "Go and knock yourself out\n"
354 "\33l\33iThink your troubles are so serious\n"
355 "Well one day you'll be so long gone\n"
356 "Cause nothing ever lasts\n"
357 "It all gets torn to shreds\n"
358 "If something's ever lasting\n"
359 "It's over our heads\n"
360 "It's over our heads\n"
364 "\33l\33iAnd why should I begin?\n"
365 "Cause there's a whirl pool\n"
366 "Of people who will stop\n"
367 "And they will tell you\n"
368 "The things that you will not\n"
369 "They roll their eyes and they call you crazy\n\n"
370 "But you get the feeling\n"
371 "That you get what it's about\n"
372 "It's just a feeling\n"
373 "You can't really spell it out\n"
374 "You get the feeling\n"
375 "That you get what it's about\n"
379 "\33l\33iI don't wait by the phone like I used to\n"
380 "I don't hope for kind words you might say\n"
381 "You don't prey on my mind like you used to\n"
382 "But you can still ruin my day\n"
383 "You can still ruin my day\n"
387 "\33l\33iI had to break the window\n"
388 "It just had to be it was in my way\n"
389 "Better that I break the window\n"
390 "Then forget what I had to say\n\n"
392 "So again I've done the right thing\n"
393 "I was never worried about that\n"
394 "The answer's always been in clear view\n"
395 "But even when the window's clean\n"
396 "I still can't see for the fact\n"
397 "That when it's clean it's so clear\n"
398 "I can't tell what I'm looking through\n"
399 "\33r(Fiona Apple) ",
402 "\33l\33iI seem to you to seek a new disaster every day\n"
403 "You deem me due to clean my view and be at peace and lay\n"
404 "I mean to prove, I mean to move in my own way\n"
405 "And say I've been getting along for long before you came into the play\n\n"
407 "If there was a better way to go then it would find me\n"
408 "I can't help it the road just rolls out behind me\n"
409 "Be kind to me, or treat me mean\n"
410 "I'll make the most of it, I'm an extraordinary machine\n"
411 "\33r(Fiona Apple) ",
414 "\33l\33iEverything good I deem too good to be true\n"
415 "Everything else is just a bore\n"
416 "Everything I have to look forward to\n"
417 "Has a pretty painful and very imposing before\n\n"
419 "Oh sailor why'd you do it\n"
420 "What'd you do that for\n"
421 "Saying there's nothing to it\n"
422 "And then letting it go by the boards\n"
423 "\33r(Fiona Apple) ",
426 "\33l\33iIf you don't have a date\n"
428 "Go out and sit on the lawn\n"
430 "'Cause it's just what you must do\n"
431 "And nobody does it anymore\n\n"
432 "No, I don't believe in the wasting of time,\n"
433 "But I don't believe that I'm wasting mine\n"
434 "\33r(Fiona Apple) ",
437 "\33l\33i'Cause I do know what's good for me\n"
438 "And I've done what I could for you\n"
439 "But you're not benefiting, and yet I'm sitting\n"
440 "Singing again, sing, sing again\n\n"
441 "How can I deal with this, if he won't get with this\n"
442 "Am I gonna heal from this, he won't admit to it\n"
443 "Nothing to figure out, I got to get him out\n"
444 "It's time the truth was out that he don't give a shit about me\n"
445 "\33r(Fiona Apple) ",
448 "\33l\33iSo my darling, give me your absence tonight\n"
449 "Take all of your sympathy and leave it outside\n"
450 "'Cause there's no kind of loving that can make this alright\n"
451 "I'm trying to find a place I belong\n\n"
452 "And I suddenly feel like a different person\n"
453 "From the roots of my soul come a gentle coercion\n"
454 "And I ran my hand over a strange inversion\n"
455 "As the darkness turns into the dawn\n"
456 "The child is gone\n"
457 "\33r(Fiona Apple) ",
460 "\33l\33iBut then the dove of hope began its downward slope\n"
461 "And I believed for a moment that my chances were\n"
462 "Approaching to be grabbed\n"
463 "But as it came down near, so did a weary tear\n"
464 "I thought it was a bird, but it was just a paper bag\n"
465 "\33r(Fiona Apple) ",
468 "\33l\33iWait 'til I get him back\n"
469 "He won't have a back to scratch\n"
470 "Yeah, keep turning that chin\n"
471 "And you will see my face\n"
472 "As I figure how to kill what I cannot catch\n"
477 /* /// "HardwareListDisplayHook()" */
478 AROS_UFH3(LONG
, HardwareListDisplayHook
,
479 AROS_UFHA(struct Hook
*, hook
, A0
),
480 AROS_UFHA(char **, strarr
, A2
),
481 AROS_UFHA(struct HWListEntry
*, hlnode
, A1
))
486 static char buf2
[32];
489 struct IconListData
*data
= (struct IconListData
*) INST_DATA(IconListClass
->mcc_Class
, ((struct ActionData
*) hook
->h_Data
)->hwlistobj
);
493 psdSafeRawDoFmt(buf
, 16, "%ld", hlnode
->unit
);
494 psdSafeRawDoFmt(buf2
, 32, "\33O[%08lx] %s", hlnode
->phw
? data
->mimainlist
[18] : data
->mimainlist
[5], hlnode
->phw
? _(MSG_PANEL_HARDWARE_ONLINE_YES
) : _(MSG_PANEL_HARDWARE_ONLINE_NO
));
495 strptr
= hlnode
->devname
;
510 *strarr
= hlnode
->prodname
? hlnode
->prodname
: (STRPTR
) _(MSG_PANEL_HARDWARE_UNKNOWN
);
512 *strarr
++ = _(MSG_PANEL_HARDWARE_COLS_NAME
);
513 *strarr
++ = _(MSG_PANEL_HARDWARE_COLS_UNIT
);
514 *strarr
++ = _(MSG_PANEL_HARDWARE_COLS_ONLINE
);
515 *strarr
= _(MSG_PANEL_HARDWARE_COLS_PRODUCT
);
522 /* /// "PrefsListDisplayHook()" */
523 AROS_UFH3(LONG
, PrefsListDisplayHook
,
524 AROS_UFHA(struct Hook
*, hook
, A0
),
525 AROS_UFHA(char **, strarr
, A2
),
526 AROS_UFHA(struct PrefsListEntry
*, plnode
, A1
))
534 psdSafeRawDoFmt(buf
, 16, "%ld", plnode
->size
);
535 *strarr
++ = plnode
->type
;
536 *strarr
++ = plnode
->id
;
537 *strarr
++ = plnode
->owner
;
540 *strarr
++ = _(MSG_PANEL_CONFIG_COLS_TYPE
);
541 *strarr
++ = _(MSG_PANEL_CONFIG_COLS_DESC
);
542 *strarr
++ = _(MSG_PANEL_CONFIG_COLS_OWNER
);
543 *strarr
= _(MSG_PANEL_CONFIG_COLS_SIZE
);
550 /* /// "CheckDeviceValid()" */
551 BOOL
CheckDeviceValid(struct DevListEntry
*dlnode
)
553 struct Node
*pd
= NULL
;
558 while((pd
= psdGetNextDevice(pd
)))
572 /* /// "DeviceListDisplayHook()" */
573 AROS_UFH3(LONG
, DeviceListDisplayHook
,
574 AROS_UFHA(struct Hook
*, hook
, A0
),
575 AROS_UFHA(char **, strarr
, A2
),
576 AROS_UFHA(struct DevListEntry
*, dlnode
, A1
))
587 #ifdef AROS_USB30_CODE
588 IPTR devissuperspeed
;
593 IPTR devhasappbinding
;
594 IPTR devisconfigured
;
595 IPTR devlowpower
= 0;
597 IPTR devissuspended
= 0;
599 BOOL goodbinding
= FALSE
;
600 BOOL hasmultiple
= FALSE
;
605 struct List
*piflist
;
609 struct Library
*bindingcls
;
610 struct Task
*bindingtask
;
613 static char buf
[100];
614 static char buf2
[32];
615 static char buf3
[32];
618 struct IconListData
*data
= (struct IconListData
*) INST_DATA(IconListClass
->mcc_Class
, ((struct ActionData
*) hook
->h_Data
)->devlistobj
);
622 if(!CheckDeviceValid(dlnode
))
624 psdSafeRawDoFmt(buf2
, 32, "\33O[%08lx] %s",
627 psdSafeRawDoFmt(buf3
, 32, "\33O[%08lx] %s",
628 data
->mimainlist
[5], "Ghost");
629 *strarr
++ = "<You can't see me>";
637 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
638 DA_Binding
, &devbinding
,
639 DA_BindingClass
, &bindingcls
,
640 DA_ProductName
, strarr
++,
641 DA_IsLowspeed
, &devislowspeed
,
642 DA_IsHighspeed
, &devishighspeed
,
643 #ifdef AROS_USB30_CODE
644 DA_IsSuperspeed
, &devissuperspeed
,
646 DA_IsConnected
, &devisconnected
,
647 DA_HasAddress
, &devhasaddress
,
648 DA_HasDevDesc
, &devhasdevdesc
,
649 DA_IsConfigured
, &devisconfigured
,
650 DA_IsDead
, &devisdead
,
651 DA_IsSuspended
, &devissuspended
,
652 DA_LowPower
, &devlowpower
,
653 DA_HasAppBinding
, &devhasappbinding
,
655 DA_SubClass
, &devsubclass
,
656 DA_Protocol
, &devproto
,
657 DA_ConfigList
, &pclist
,
660 #ifdef AROS_USB30_CODE
661 *strarr
++ = (devislowspeed
? _(MSG_DEVICE_SPEED_LOW
) : (devissuperspeed
? _(MSG_DEVICE_SPEED_SUPER
) : (devishighspeed
? _(MSG_DEVICE_SPEED_HIGH
) : _(MSG_DEVICE_SPEED_FULL
))));
663 *strarr
++ = (devislowspeed
? _(MSG_DEVICE_SPEED_LOW
) : (devishighspeed
? _(MSG_DEVICE_SPEED_HIGH
) : _(MSG_DEVICE_SPEED_FULL
)));
668 statestr
= _(MSG_DEVICE_STATE_SUSPENDED
);
673 statestr
= devlowpower
? _(MSG_DEVICE_STATE_DEADLP
) : _(MSG_DEVICE_STATE_DEAD
);
678 statestr
= _(MSG_DEVICE_STATE_LOWPOWER
);
681 else if(devisconfigured
)
683 statestr
= _(MSG_DEVICE_STATE_CONFIGURED
);
686 else if(devhasdevdesc
)
688 statestr
= _(MSG_DEVICE_STATE_DEVDESC
);
691 else if(devhasaddress
)
693 statestr
= _(MSG_DEVICE_STATE_HASADDRESS
);
696 else if(devisconnected
)
698 statestr
= _(MSG_DEVICE_STATE_CONNECTED
);
701 statestr
= _(MSG_DEVICE_STATE_DEAD
);
708 pc
= pclist
->lh_Head
;
711 psdGetAttrs(PGA_CONFIG
, pc
,
712 CA_InterfaceList
, &piflist
,
714 pif
= piflist
->lh_Head
;
717 psdGetAttrs(PGA_INTERFACE
, pif
,
719 IFA_SubClass
, &ifsubclass
,
720 IFA_Protocol
, &ifproto
,
727 devsubclass
= ifsubclass
;
730 if(devclass
!= ifclass
)
736 if(devsubclass
!= ifsubclass
)
741 if(devproto
!= ifproto
)
757 case STILLIMG_CLASSCODE
:
760 case BLUETOOTH_CLASSCODE
:
763 case FWUPGRADE_CLASSCODE
:
766 case VENDOR_CLASSCODE
:
768 case SECURITY_CLASSCODE
:
770 case SMARTCARD_CLASSCODE
:
772 case CDCDATA_CLASSCODE
:
776 case MASSSTORE_CLASSCODE
:
778 case PRINTER_CLASSCODE
:
780 case PHYSICAL_CLASSCODE
:
784 case CDCCTRL_CLASSCODE
:
786 case AUDIO_CLASSCODE
:
795 psdSafeRawDoFmt(buf2
, 32, "\33O[%08lx] %s",
796 data
->mimainlist
[clsimg
],
797 psdNumToStr(NTS_COMBOCLASS
,
798 (devclass
<<NTSCCS_CLASS
)|(devsubclass
<<NTSCCS_SUBCLASS
)|(devproto
<<NTSCCS_PROTO
)|
799 NTSCCF_CLASS
|NTSCCF_SUBCLASS
|NTSCCF_PROTO
,
802 psdSafeRawDoFmt(buf2
, 32, "\33O[%08lx] %s",
803 data
->mimainlist
[0], "Multiple");
810 psdGetAttrs(PGA_APPBINDING
, devbinding
,
811 ABA_Task
, &bindingtask
,
813 *strarr
= bindingtask
->tc_Node
.ln_Name
;
815 *strarr
= bindingcls
->lib_Node
.ln_Name
;
819 *strarr
= bufptr
= buf
;
821 pc
= pclist
->lh_Head
;
824 psdGetAttrs(PGA_CONFIG
, pc
,
825 CA_InterfaceList
, &piflist
,
827 pif
= piflist
->lh_Head
;
830 psdGetAttrs(PGA_INTERFACE
, pif
,
831 IFA_Binding
, &ifbinding
,
832 IFA_BindingClass
, &bindingcls
,
837 if((buflen
< 99) && ( buflen
> 3))
843 tmpcptr
= bindingcls
->lib_Node
.ln_Name
;
844 while((*bufptr
++ = *tmpcptr
++))
867 if(!goodbinding
&& (stateimg
== 18))
871 psdSafeRawDoFmt(buf3
, 32, "\33O[%08lx] %s",
872 data
->mimainlist
[stateimg
], statestr
);
874 *strarr
++ = _(MSG_PANEL_DEVICES_COLS_NAME
);
875 *strarr
++ = _(MSG_PANEL_DEVICES_COLS_SPEED
);
876 *strarr
++ = _(MSG_PANEL_DEVICES_COLS_STATE
);
877 *strarr
++ = _(MSG_PANEL_DEVICES_COLS_CLASS
);
878 *strarr
= _(MSG_PANEL_DEVICES_COLS_BINDINGS
);
885 /* /// "ClassListDisplayHook()" */
886 AROS_UFH3(LONG
, ClassListDisplayHook
,
887 AROS_UFHA(struct Hook
*, hook
, A0
),
888 AROS_UFHA(char **, strarr
, A2
),
889 AROS_UFHA(struct ClsListEntry
*, clnode
, A1
))
895 struct Library
*UsbClsBase
;
901 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
905 if(clnode
->puc
== puc
)
919 psdGetAttrs(PGA_USBCLASS
, clnode
->puc
,
920 UCA_ClassBase
, &UsbClsBase
,
921 UCA_ClassName
, strarr
++,
922 UCA_UseCount
, &usecnt
,
924 psdSafeRawDoFmt(buf
, 16, "%ld", usecnt
);
926 usbGetAttrs(UGA_CLASS
, NULL
,
927 UCCA_Description
, strarr
,
931 *strarr
++ = _(MSG_PANEL_CLASSES_COLS_NAME
);
932 *strarr
++ = _(MSG_PANEL_CLASSES_COLS_USE
);
933 *strarr
= _(MSG_PANEL_CLASSES_COLS_DESC
);
940 /* /// "ErrorListDisplayHook()" */
941 AROS_UFH3(LONG
, ErrorListDisplayHook
,
942 AROS_UFHA(struct Hook
*, hook
, A0
),
943 AROS_UFHA(char **, strarr
, A2
),
944 AROS_UFHA(struct ErrListEntry
*, elnode
, A1
))
949 struct DateStamp
*ds
;
951 static char strtime
[LEN_DATSTRING
];
956 psdGetAttrs(PGA_ERRORMSG
, elnode
->pem
,
958 EMA_Origin
, &strarr
[2],
965 dt
.dat_Stamp
.ds_Days
= ds
->ds_Days
;
966 dt
.dat_Stamp
.ds_Minute
= ds
->ds_Minute
;
967 dt
.dat_Stamp
.ds_Tick
= ds
->ds_Tick
;
968 dt
.dat_Format
= FORMAT_DEF
;
970 dt
.dat_StrDay
= NULL
;
971 dt
.dat_StrDate
= NULL
;
972 dt
.dat_StrTime
= strtime
;
978 strarr
[1] = ((level
== RETURN_OK
) ? _(MSG_LOGLEVEL_OK
) :
979 ((level
== RETURN_WARN
) ? _(MSG_LOGLEVEL_WARNING
) :
980 ((level
== RETURN_ERROR
) ? _(MSG_LOGLEVEL_ERROR
) :
981 ((level
== RETURN_FAIL
) ? _(MSG_LOGLEVEL_FAILURE
) : _(MSG_LOGLEVEL_OTHER
)))));
988 /* /// "IconListDisplayHook()" */
989 AROS_UFH3(LONG
, IconListDisplayHook
,
990 AROS_UFHA(struct Hook
*, hook
, A0
),
991 AROS_UFHA(char **, strarr
, A2
),
992 AROS_UFHA(STRPTR
, str
, A1
))
997 struct IconListData
*data
= (struct IconListData
*) INST_DATA(IconListClass
->mcc_Class
, ((struct ActionData
*) hook
->h_Data
)->cfgpagelv
);
1001 LONG pos
= ((IPTR
*) strarr
)[-1];
1005 pos
= 24; // fix for PoPo
1009 pos
= 16; // fix for Configure Management menu
1013 pos
= 23; // fix for Online menu
1016 psdSafeRawDoFmt(buf
, 32, "\33O[%08lx] %s",
1017 data
->mimainlist
[pos
],
1026 /* /// "AllocHWEntry()" */
1027 struct HWListEntry
* AllocHWEntry(struct ActionData
*data
, struct Node
*phw
)
1029 struct HWListEntry
*hlnode
;
1031 hlnode
= psdAllocVec(sizeof(struct HWListEntry
));
1036 psdGetAttrs(PGA_HARDWARE
, phw
,
1037 HA_DeviceName
, &str
,
1038 HA_DeviceUnit
, &hlnode
->unit
,
1039 HA_ProductName
, &hlnode
->prodname
,
1041 hlnode
->devname
= psdCopyStr(str
);
1044 AddTail(&data
->hwlist
, &hlnode
->node
);
1050 /* /// "FreeHWEntry()" */
1051 void FreeHWEntry(struct ActionData
*data
, struct HWListEntry
*hlnode
)
1056 Remove(&hlnode
->node
);
1059 psdLockWritePBase();
1060 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
1064 if(phw
== hlnode
->phw
)
1067 psdRemHardware(phw
);
1079 if(hlnode
->infowindow
)
1081 set(hlnode
->infowindow
, MUIA_Window_Open
, FALSE
);
1084 DoMethod(data
->appobj
, OM_REMMEMBER
, hlnode
->infowindow
);
1085 DoMethod(hlnode
->infowindow
, OM_DISPOSE
);
1087 hlnode
->infowindow
= NULL
;
1089 psdFreeVec(hlnode
->devname
);
1094 /* /// "AllocDevEntry()" */
1095 struct DevListEntry
* AllocDevEntry(struct ActionData
*data
, struct Node
*pd
)
1097 struct DevListEntry
*dlnode
;
1099 dlnode
= psdAllocVec(sizeof(struct DevListEntry
));
1103 dlnode
->adata
= data
;
1104 AddTail(&data
->devlist
, &dlnode
->node
);
1110 /* /// "FreeDevEntry()" */
1111 void FreeDevEntry(struct ActionData
*data
, struct DevListEntry
*dlnode
)
1113 if(dlnode
->infowindow
)
1115 set(dlnode
->infowindow
, MUIA_Window_Open
, FALSE
);
1118 DoMethod(data
->appobj
, OM_REMMEMBER
, dlnode
->infowindow
);
1119 DoMethod(dlnode
->infowindow
, OM_DISPOSE
);
1121 dlnode
->infowindow
= NULL
;
1124 dlnode
->devdata
->dlnode
= NULL
;
1127 Remove(&dlnode
->node
);
1132 /* /// "AllocClsEntry()" */
1133 struct ClsListEntry
* AllocClsEntry(struct ActionData
*data
, struct Node
*puc
)
1135 struct ClsListEntry
*clnode
;
1136 clnode
= psdAllocVec(sizeof(struct ClsListEntry
));
1141 AddTail(&data
->clslist
, &clnode
->node
);
1147 /* /// "FreeClsEntry()" */
1148 void FreeClsEntry(struct ActionData
*data
, struct ClsListEntry
*clnode
)
1150 Remove(&clnode
->node
);
1155 /* /// "FreeErrorList()" */
1156 void FreeErrorList(struct ActionData
*data
)
1159 node
= data
->errlist
.lh_Head
;
1160 while(node
->ln_Succ
)
1164 node
= data
->errlist
.lh_Head
;
1169 /* /// "CreateErrorList()" */
1170 void CreateErrorList(struct ActionData
*data
)
1174 struct ErrListEntry
*elnode
;
1177 set(data
->errlistobj
, MUIA_List_Quiet
, TRUE
);
1178 DoMethod(data
->errlistobj
, MUIM_List_Clear
);
1179 FreeErrorList(data
);
1180 psdGetAttrs(PGA_STACK
, NULL
, PA_ErrorMsgList
, &lst
, TAG_END
);
1185 psdGetAttrs(PGA_ERRORMSG
, pem
,
1188 if(level
>= data
->errorlevel
)
1190 if((elnode
= psdAllocVec(sizeof(struct ErrListEntry
))))
1193 AddTail(&data
->errlist
, &elnode
->node
);
1194 DoMethod(data
->errlistobj
, MUIM_List_InsertSingle
, elnode
, MUIV_List_Insert_Bottom
);
1200 set(data
->errlistobj
, MUIA_List_Quiet
, FALSE
);
1201 set(data
->errlistobj
, MUIA_List_Active
, MUIV_List_Active_Bottom
);
1205 /* /// "FreePrefsList()" */
1206 void FreePrefsList(struct ActionData
*data
)
1208 struct PrefsListEntry
*plnode
;
1209 plnode
= (struct PrefsListEntry
*) data
->prefslist
.lh_Head
;
1210 while(plnode
->node
.ln_Succ
)
1212 Remove(&plnode
->node
);
1213 psdFreeVec(plnode
->id
);
1214 psdFreeVec(plnode
->owner
);
1215 psdFreeVec(plnode
->devid
);
1216 psdFreeVec(plnode
->ifid
);
1218 plnode
= (struct PrefsListEntry
*) data
->prefslist
.lh_Head
;
1223 /* /// "AllocPrefsEntry()" */
1224 struct PrefsListEntry
* AllocPrefsEntry(struct ActionData
*data
, ULONG formid
, ULONG size
, STRPTR id
, STRPTR owner
)
1226 struct PrefsListEntry
*plnode
= NULL
;
1228 if((plnode
= psdAllocVec(sizeof(struct PrefsListEntry
))))
1238 plnode
->chunkid
= formid
;
1239 plnode
->size
= size
;
1242 case IFFFORM_STACKCFG
:
1243 plnode
->type
= "Core Cfg";
1244 plnode
->node
.ln_Pri
= 100;
1247 case IFFFORM_DEVICECFG
:
1248 plnode
->type
= "USB Device";
1251 case IFFFORM_CLASSCFG
:
1252 plnode
->type
= "Class Cfg";
1253 plnode
->node
.ln_Pri
= 20;
1256 case IFFFORM_DEVCFGDATA
:
1257 plnode
->type
= " Device Cfg";
1260 case IFFFORM_IFCFGDATA
:
1261 plnode
->type
= " Interface Cfg";
1264 case MAKE_ID('P','S','D','L'):
1265 plnode
->type
= "Licence";
1266 plnode
->node
.ln_Pri
= 50;
1273 plnode
->type
= "Unknown";
1274 plnode
->node
.ln_Pri
= -100;
1279 plnode
->devid
= psdCopyStr(data
->devidstr
);
1282 plnode
->ifid
= psdCopyStr(data
->ifidstr
);
1285 plnode
->owner
= owner
;
1286 Enqueue(&data
->prefslist
, &plnode
->node
);
1292 /* /// "FindCfgChunk()" */
1293 ULONG
* FindCfgChunk(ULONG
*form
, ULONG chnkid
)
1295 ULONG
*buf
= form
+ 3;
1296 ULONG len
= (AROS_LONG2BE(form
[1]) - 3) & ~1UL;
1301 if(AROS_LONG2BE(*buf
) == chnkid
)
1305 chlen
= (AROS_LONG2BE(buf
[1]) + 9) & ~1UL;
1307 buf
= (ULONG
*) (((UBYTE
*) buf
) + chlen
);
1313 /* /// "GetStringChunk()" */
1314 STRPTR
GetStringChunk(ULONG
*form
, ULONG chnkid
, STRPTR defstr
)
1318 if((chunkptr
= FindCfgChunk(form
, chnkid
)))
1320 if((str
= (STRPTR
) psdAllocVec(AROS_LONG2BE(chunkptr
[1]) + 1)))
1322 memcpy(str
, &chunkptr
[2], (size_t) AROS_LONG2BE(chunkptr
[1]));
1328 str
= psdCopyStr(defstr
);
1334 /* /// "RecursePrefsForm()" */
1335 void RecursePrefsForm(struct ActionData
*data
, ULONG
*form
, ULONG depth
, STRPTR stack
)
1337 struct PrefsListEntry
*plnode
;
1342 ULONG formid
= AROS_LONG2BE(form
[2]);
1347 ULONG formsize
= AROS_LONG2BE(form
[1]) + 8;
1348 BOOL allocdevid
= FALSE
;
1349 BOOL allocifid
= FALSE
;
1351 newstack
= (STRPTR
) psdAllocVec((ULONG
) strlen(stack
) + 5);
1356 strcpy(newstack
, stack
);
1357 *((ULONG
*) &newstack
[strlen(stack
)]) = AROS_LONG2BE(formid
);
1359 if(AROS_LONG2BE(*((ULONG
*) newstack
)) != IFFFORM_PSDCFG
)
1361 owner
= GetStringChunk(form
, IFFCHNK_OWNER
, "Unknown");
1362 id
= psdCopyStr("This is not a poseidon config!");
1363 plnode
= AllocPrefsEntry(data
, formid
, formsize
, id
, owner
);
1365 else if(!strcmp(newstack
+ 4, "STKC"))
1367 plnode
= AllocPrefsEntry(data
, formid
, formsize
, psdCopyStr("Global Stack Configuration"), psdCopyStr("Trident"));
1369 else if(!strcmp(newstack
+ 4, "DEVC"))
1371 id
= GetStringChunk(form
, IFFCHNK_DEVID
, "Unknown");
1372 data
->devidstr
= psdCopyStr(id
);
1374 plnode
= AllocPrefsEntry(data
, formid
, formsize
, id
, psdCopyStr("Trident"));
1376 else if(!strcmp(newstack
+ 4, "DEVCDCFG"))
1378 owner
= GetStringChunk(form
, IFFCHNK_OWNER
, "Unknown");
1379 if(!strcmp(owner
, "Trident"))
1381 id
= psdCopyStr("Generic Prefs");
1383 id
= psdCopyStrFmt("%s Prefs", owner
);
1385 plnode
= AllocPrefsEntry(data
, formid
, formsize
, id
, owner
);
1387 else if(!strcmp(newstack
+ 4, "DEVCICFG"))
1391 data
->ifidstr
= GetStringChunk(form
, IFFCHNK_IFID
, "Unknown");
1393 owner
= GetStringChunk(form
, IFFCHNK_OWNER
, "Unknown");
1394 plnode
= AllocPrefsEntry(data
, formid
, formsize
, psdCopyStrFmt("%s Prefs for %s", owner
, data
->ifidstr
), owner
);
1397 else if(!strcmp(newstack
+ 4, "CLSC"))
1401 owner
= GetStringChunk(form
, IFFCHNK_OWNER
, "Unknown");
1402 id
= psdCopyStrFmt("(Default) Prefs for %s", owner
);
1403 plnode
= AllocPrefsEntry(data
, formid
, formsize
, id
, owner
);
1406 else if(!strcmp(newstack
+ 4, "PSDL"))
1408 owner
= GetStringChunk(form
, IFFCHNK_OWNER
, "Unknown");
1409 chunkptr
= FindCfgChunk(form
, MAKE_ID('S','K','E','Y'));
1412 id
= psdCopyStrFmt("Keyfile Serial #%04ld", chunkptr
[3] & 0xffff);
1414 id
= psdCopyStr("Corrupted Keyfile?");
1416 plnode
= AllocPrefsEntry(data
, formid
, formsize
, id
, psdCopyStr("Secret"));
1420 owner
= GetStringChunk(form
, IFFCHNK_OWNER
, "Unknown");
1421 id
= psdCopyStr("Unknown prefs data (XXXX)");
1424 *((ULONG
*) &id
[20]) = AROS_LONG2BE(formid
);
1426 plnode
= AllocPrefsEntry(data
, formid
, formsize
, id
, owner
);
1431 endptr
= (ULONG
*) (((UBYTE
*) form
) + ((AROS_LONG2BE(form
[1]) + 9) & ~1UL));
1432 while(currptr
< endptr
)
1434 chunkid
= AROS_LONG2BE(currptr
[0]);
1435 chunklen
= (AROS_LONG2BE(currptr
[1]) + 9) & ~1UL;
1436 if((chunkid
== ID_FORM
) && (depth
< 3))
1438 RecursePrefsForm(data
, currptr
, depth
, newstack
);
1442 case IFFCHNK_FORCEDBIND
:
1443 if(!strcmp(newstack
+ 4, "DEVC"))
1445 owner
= GetStringChunk(form
, chunkid
, "Unknown");
1446 plnode
= AllocPrefsEntry(data
, chunkid
, chunklen
, psdCopyStrFmt("Forced Device Binding to %s", owner
), owner
);
1449 plnode
->type
= " Binding";
1452 else if(!strcmp(newstack
+ 4, "DEVCICFG"))
1454 owner
= GetStringChunk(form
, IFFCHNK_OWNER
, "Unknown");
1455 plnode
= AllocPrefsEntry(data
, chunkid
, chunklen
, psdCopyStrFmt("Forced IFace Binding to %s", owner
), owner
);
1458 plnode
->type
= " Binding";
1464 currptr
= (ULONG
*) (((UBYTE
*) currptr
) + chunklen
);
1468 psdFreeVec(data
->devidstr
);
1469 data
->devidstr
= NULL
;
1473 psdFreeVec(data
->ifidstr
);
1474 data
->ifidstr
= NULL
;
1476 psdFreeVec(newstack
);
1480 /* /// "CreatePrefsList()" */
1481 void CreatePrefsList(struct ActionData
*data
)
1483 struct PrefsListEntry
*plnode
;
1488 set(data
->prefslistobj
, MUIA_List_Quiet
, TRUE
);
1489 get(data
->prefslistobj
, MUIA_List_Active
, &oldpos
);
1490 DoMethod(data
->prefslistobj
, MUIM_List_Clear
);
1491 FreePrefsList(data
);
1492 data
->configroot
= psdWriteCfg(NULL
);
1493 if(data
->configroot
)
1495 RecursePrefsForm(data
, data
->configroot
, 0, "");
1496 psdFreeVec(data
->configroot
);
1497 data
->configroot
= NULL
;
1499 plnode
= (struct PrefsListEntry
*) data
->prefslist
.lh_Head
;
1500 while(plnode
->node
.ln_Succ
)
1502 DoMethod(data
->prefslistobj
, MUIM_List_InsertSingle
, plnode
, MUIV_List_Insert_Bottom
);
1503 plnode
= (struct PrefsListEntry
*) plnode
->node
.ln_Succ
;
1505 set(data
->prefslistobj
, MUIA_List_Active
, oldpos
);
1506 set(data
->prefslistobj
, MUIA_List_Quiet
, FALSE
);
1507 psdGetAttrs(PGA_STACK
, NULL
,
1508 PA_CurrConfigHash
, &currhash
,
1509 PA_SavedConfigHash
, &oldhash
,
1511 set(data
->saveobj
, MUIA_Disabled
, (oldhash
== currhash
));
1515 /* /// "FreeGUILists()" */
1516 void FreeGUILists(struct ActionData
*data
)
1518 struct HWListEntry
*hlnode
;
1519 struct DevListEntry
*dlnode
;
1520 struct ClsListEntry
*clnode
;
1522 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
1523 while(hlnode
->node
.ln_Succ
)
1525 //hlnode->infowindow = NULL;
1527 FreeHWEntry(data
, hlnode
);
1528 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
1530 dlnode
= (struct DevListEntry
*) data
->devlist
.lh_Head
;
1531 while(dlnode
->node
.ln_Succ
)
1533 //dlnode->infowindow = NULL;
1534 FreeDevEntry(data
, dlnode
);
1535 dlnode
= (struct DevListEntry
*) data
->devlist
.lh_Head
;
1537 clnode
= (struct ClsListEntry
*) data
->clslist
.lh_Head
;
1538 while(clnode
->node
.ln_Succ
)
1540 FreeClsEntry(data
, clnode
);
1541 clnode
= (struct ClsListEntry
*) data
->clslist
.lh_Head
;
1546 /* /// "CreateClassPopup()" */
1547 Object
* CreateClassPopup(void)
1556 mi_root
= MenustripObject
,
1557 Child
, mi_top
= MenuObjectT("Forced binding"),
1558 Child
, MenuitemObject
,
1559 MUIA_Menuitem_Title
, "None",
1567 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
1571 psdGetAttrs(PGA_USBCLASS
, puc
,
1572 UCA_ClassName
, &clname
,
1575 mi_sub
= MenuitemObject
,
1576 MUIA_Menuitem_Title
, clname
,
1580 DoMethod(mi_top
, OM_ADDMEMBER
, mi_sub
);
1590 /* /// "InternalCreateConfig()" */
1591 BOOL
InternalCreateConfig(void)
1602 pic
= psdFindCfgForm(NULL
, IFFFORM_STACKCFG
);
1605 tmpform
[0] = AROS_LONG2BE(ID_FORM
);
1606 tmpform
[1] = AROS_LONG2BE(4);
1607 tmpform
[2] = AROS_LONG2BE(IFFFORM_STACKCFG
);
1608 psdAddCfgEntry(NULL
, tmpform
);
1609 pic
= psdFindCfgForm(NULL
, IFFFORM_STACKCFG
);
1616 /* First mark all old hardware entries as offline */
1617 subpic
= psdFindCfgForm(pic
, IFFFORM_UHWDEVICE
);
1620 tmpform
[0] = AROS_LONG2BE(IFFCHNK_OFFLINE
);
1621 tmpform
[1] = AROS_LONG2BE(4);
1623 psdAddCfgEntry(subpic
, tmpform
);
1624 subpic
= psdNextCfgForm(subpic
);
1627 /* Add existing hardware entries */
1629 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
1633 psdGetAttrs(PGA_HARDWARE
, phw
,
1634 HA_DeviceName
, &name
,
1635 HA_DeviceUnit
, &unit
,
1638 // find corresponding form in config
1639 subpic
= psdFindCfgForm(pic
, IFFFORM_UHWDEVICE
);
1642 if(psdMatchStringChunk(subpic
, IFFCHNK_NAME
, name
))
1644 ULONG
*unitchk
= psdGetCfgChunk(subpic
, IFFCHNK_UNIT
);
1645 if(unitchk
&& unitchk
[2] == unit
)
1647 psdFreeVec(unitchk
);
1650 psdFreeVec(unitchk
);
1652 subpic
= psdNextCfgForm(subpic
);
1657 // not found, add it
1658 tmpform
[0] = AROS_LONG2BE(ID_FORM
);
1659 tmpform
[1] = AROS_LONG2BE(4);
1660 tmpform
[2] = AROS_LONG2BE(IFFFORM_UHWDEVICE
);
1661 subpic
= psdAddCfgEntry(pic
, tmpform
);
1666 psdAddStringChunk(subpic
, IFFCHNK_NAME
, name
);
1667 tmpform
[0] = AROS_LONG2BE(IFFCHNK_UNIT
);
1668 tmpform
[1] = AROS_LONG2BE(4);
1670 psdAddCfgEntry(subpic
, tmpform
);
1671 // remove offline chunk to make sure the thing is going online next time
1672 psdRemCfgChunk(subpic
, IFFCHNK_OFFLINE
);
1678 /* Add existing class entries */
1680 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
1684 tmpform
[0] = AROS_LONG2BE(ID_FORM
);
1685 tmpform
[1] = AROS_LONG2BE(4);
1686 tmpform
[2] = AROS_LONG2BE(IFFFORM_USBCLASS
);
1687 subpic
= psdAddCfgEntry(pic
, tmpform
);
1691 psdGetAttrs(PGA_USBCLASS
, puc
,
1692 UCA_FullPath
, &name
,
1696 psdGetAttrs(PGA_USBCLASS
, puc
,
1697 UCA_ClassName
, &name
,
1699 name
= psdCopyStrFmt("USB/%s", name
);
1702 psdAddStringChunk(subpic
, IFFCHNK_NAME
, name
);
1706 psdAddStringChunk(subpic
, IFFCHNK_NAME
, name
);
1716 /* /// "InternalCreateConfigGUI()" */
1717 BOOL
InternalCreateConfigGUI(struct ActionData
*data
)
1725 struct HWListEntry
*hlnode
;
1726 struct ClsListEntry
*clnode
;
1729 pic
= psdFindCfgForm(NULL
, IFFFORM_STACKCFG
);
1732 tmpform
[0] = AROS_LONG2BE(ID_FORM
);
1733 tmpform
[1] = AROS_LONG2BE(4);
1734 tmpform
[2] = AROS_LONG2BE(IFFFORM_STACKCFG
);
1735 psdAddCfgEntry(NULL
, tmpform
);
1736 pic
= psdFindCfgForm(NULL
, IFFFORM_STACKCFG
);
1746 /* First remove all old hardware entries */
1747 while((subpic
= psdFindCfgForm(pic
, IFFFORM_UHWDEVICE
)))
1749 psdRemCfgForm(subpic
);
1752 /* Add hardware entries from GUI, but mark them as offline */
1753 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
1754 while(hlnode
->node
.ln_Succ
)
1756 tmpform
[0] = AROS_LONG2BE(ID_FORM
);
1757 tmpform
[1] = AROS_LONG2BE(4);
1758 tmpform
[2] = AROS_LONG2BE(IFFFORM_UHWDEVICE
);
1759 subpic
= psdAddCfgEntry(pic
, tmpform
);
1762 psdAddStringChunk(subpic
, IFFCHNK_NAME
, hlnode
->devname
);
1763 tmpform
[0] = AROS_LONG2BE(IFFCHNK_UNIT
);
1764 tmpform
[1] = AROS_LONG2BE(4);
1765 tmpform
[2] = hlnode
->unit
;
1766 psdAddCfgEntry(subpic
, tmpform
);
1767 tmpform
[0] = AROS_LONG2BE(IFFCHNK_OFFLINE
);
1768 tmpform
[1] = AROS_LONG2BE(4);
1770 psdAddCfgEntry(subpic
, tmpform
);
1772 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
1775 /* Now find all hardware entries that are online and mark them as such */
1776 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
1780 psdGetAttrs(PGA_HARDWARE
, phw
,
1781 HA_DeviceName
, &name
,
1782 HA_DeviceUnit
, &unit
,
1785 // find corresponding form in config
1786 subpic
= psdFindCfgForm(pic
, IFFFORM_UHWDEVICE
);
1789 if(psdMatchStringChunk(subpic
, IFFCHNK_NAME
, name
))
1791 ULONG
*unitchk
= psdGetCfgChunk(subpic
, IFFCHNK_UNIT
);
1792 if(unitchk
&& unitchk
[2] == unit
)
1794 psdFreeVec(unitchk
);
1795 psdRemCfgChunk(subpic
, IFFCHNK_OFFLINE
);
1798 psdFreeVec(unitchk
);
1800 subpic
= psdNextCfgForm(subpic
);
1805 /* Delete all old class entries */
1806 while((subpic
= psdFindCfgForm(pic
, IFFFORM_USBCLASS
)))
1808 psdRemCfgForm(subpic
);
1810 /* Add existing class entries */
1811 clnode
= (struct ClsListEntry
*) data
->clslist
.lh_Head
;
1812 while(clnode
->node
.ln_Succ
)
1814 tmpform
[0] = AROS_LONG2BE(ID_FORM
);
1815 tmpform
[1] = AROS_LONG2BE(4);
1816 tmpform
[2] = AROS_LONG2BE(IFFFORM_USBCLASS
);
1817 subpic
= psdAddCfgEntry(pic
, tmpform
);
1821 psdGetAttrs(PGA_USBCLASS
, clnode
->puc
,
1822 UCA_FullPath
, &name
,
1826 psdGetAttrs(PGA_USBCLASS
, clnode
->puc
,
1827 UCA_ClassName
, &name
,
1829 name
= psdCopyStrFmt("USB/%s", name
);
1832 psdAddStringChunk(subpic
, IFFCHNK_NAME
, name
);
1836 psdAddStringChunk(subpic
, IFFCHNK_NAME
, name
);
1839 clnode
= (struct ClsListEntry
*) clnode
->node
.ln_Succ
;
1842 data
->swallowconfigevent
= TRUE
;
1847 /* /// "CleanupEventHandler()" */
1848 void CleanupEventHandler(struct ActionData
*data
)
1850 if(data
->eventhandler
)
1852 psdRemEventHandler(data
->eventhandler
);
1853 data
->eventhandler
= NULL
;
1855 if(data
->eventmsgport
)
1857 DeleteMsgPort(data
->eventmsgport
);
1858 data
->eventmsgport
= NULL
;
1863 /* /// "SetupEventHandler()" */
1864 BOOL
SetupEventHandler(struct ActionData
*data
)
1866 if((data
->eventmsgport
= CreateMsgPort()))
1868 data
->eventhandler
= psdAddEventHandler(data
->eventmsgport
, ~0);
1869 if(data
->eventhandler
)
1874 data
->eventhandler
= NULL
;
1880 /* /// "EventHandler()" */
1881 void EventHandler(struct ActionData
*data
)
1888 BOOL cfgchanged
= FALSE
;
1891 while((pen
= GetMsg(data
->eventmsgport
)))
1893 psdGetAttrs(PGA_EVENTNOTE
, pen
,
1894 ENA_EventID
, &penid
,
1895 ENA_Param1
, &penparam1
,
1896 ENA_Param2
, &penparam2
,
1898 eventmask
|= (1L<<penid
);
1899 /*printf("Event %ld, Param1 %ld\n", pen->pen_Event, pen->pen_Param1);*/
1902 case EHMB_ADDHARDWARE
:
1906 struct HWListEntry
*hlnode
;
1912 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
1916 if(phw
== (struct Node
*) penparam1
)
1924 psdGetAttrs(PGA_HARDWARE
, phw
,
1925 HA_DeviceName
, &devname
,
1926 HA_DeviceUnit
, &unit
,
1927 HA_ProductName
, &prodname
,
1930 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
1931 while(hlnode
->node
.ln_Succ
)
1933 if((!strcmp(devname
, hlnode
->devname
)) &&
1934 (unit
== hlnode
->unit
))
1939 hlnode
->prodname
= prodname
;
1943 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
1945 if(!hlnode
->node
.ln_Succ
)
1947 if((hlnode
= AllocHWEntry(data
, phw
)))
1949 DoMethod(data
->hwlistobj
, MUIM_List_InsertSingle
, hlnode
, MUIV_List_Insert_Bottom
);
1952 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
1959 case EHMB_REMHARDWARE
:
1961 struct HWListEntry
*hlnode
;
1963 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
1964 while(hlnode
->node
.ln_Succ
)
1966 if(hlnode
->phw
== (struct Node
*) penparam1
)
1969 hlnode
->prodname
= NULL
;
1972 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
1974 if(hlnode
->node
.ln_Succ
)
1976 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
1982 case EHMB_ADDDEVICE
:
1984 struct Node
*pd
= NULL
;
1985 struct DevListEntry
*dlnode
;
1987 while((pd
= psdGetNextDevice(pd
)))
1989 if(pd
== (struct Node
*) penparam1
)
1991 dlnode
= (struct DevListEntry
*) data
->devlist
.lh_Head
;
1992 while(dlnode
->node
.ln_Succ
)
1994 if(dlnode
->pd
== pd
)
1996 // ignore existing entry!
1999 dlnode
= (struct DevListEntry
*) dlnode
->node
.ln_Succ
;
2001 if(!dlnode
->node
.ln_Succ
)
2003 dlnode
= AllocDevEntry(data
, pd
);
2006 DoMethod(data
->devlistobj
, MUIM_List_InsertSingle
, dlnode
, MUIV_List_Insert_Bottom
);
2016 case EHMB_REMDEVICE
:
2018 struct DevListEntry
*dlnode
;
2019 struct DevListEntry
*tmpnode
;
2021 set(data
->devlistobj
, MUIA_List_Quiet
, TRUE
);
2022 dlnode
= (struct DevListEntry
*) data
->devlist
.lh_Head
;
2023 while(dlnode
->node
.ln_Succ
)
2025 if((dlnode
->pd
== (struct Node
*) penparam1
) || (!dlnode
->pd
))
2030 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, pos
, &tmpnode
);
2033 if(tmpnode
== dlnode
)
2035 DoMethod(data
->devlistobj
, MUIM_List_Remove
, pos
);
2040 FreeDevEntry(data
, dlnode
);
2043 dlnode
= (struct DevListEntry
*) dlnode
->node
.ln_Succ
;
2050 struct ClsListEntry
*clnode
;
2051 clnode
= (struct ClsListEntry
*) data
->clslist
.lh_Head
;
2052 while(clnode
->node
.ln_Succ
)
2054 if(clnode
->puc
== (struct Node
*) penparam1
)
2058 clnode
= (struct ClsListEntry
*) clnode
->node
.ln_Succ
;
2060 if(!clnode
->node
.ln_Succ
)
2062 if((clnode
= AllocClsEntry(data
, (struct Node
*) penparam1
)))
2064 DoMethod(data
->clslistobj
, MUIM_List_InsertSingle
, clnode
, MUIV_List_Insert_Bottom
);
2072 struct ClsListEntry
*clnode
;
2073 struct ClsListEntry
*tmpnode
;
2075 set(data
->clslistobj
, MUIA_List_Quiet
, TRUE
);
2076 clnode
= (struct ClsListEntry
*) data
->clslist
.lh_Head
;
2077 while(clnode
->node
.ln_Succ
)
2079 if((clnode
->puc
== (struct Node
*) penparam1
) || (!clnode
->puc
))
2084 DoMethod(data
->clslistobj
, MUIM_List_GetEntry
, pos
, &tmpnode
);
2087 if(tmpnode
== clnode
)
2089 DoMethod(data
->clslistobj
, MUIM_List_Remove
, pos
);
2094 tmpnode
= (struct ClsListEntry
*) clnode
->node
.ln_Succ
;
2095 FreeClsEntry(data
, clnode
);
2098 clnode
= (struct ClsListEntry
*) clnode
->node
.ln_Succ
;
2104 case EHMB_ADDERRORMSG
:
2106 struct ErrListEntry
*elnode
;
2109 psdGetAttrs(PGA_ERRORMSG
, (APTR
) penparam1
,
2112 if(level
>= data
->errorlevel
)
2114 if((elnode
= psdAllocVec(sizeof(struct ErrListEntry
))))
2116 elnode
->pem
= (struct Node
*) penparam1
;
2117 AddTail(&data
->errlist
, &elnode
->node
);
2118 DoMethod(data
->errlistobj
, MUIM_List_InsertSingle
, elnode
, MUIV_List_Insert_Bottom
);
2124 case EHMB_CONFIGCHG
:
2135 if(eventmask
& EHMF_REMERRORMSG
)
2137 CreateErrorList(data
);
2139 if(eventmask
& EHMF_ADDERRORMSG
)
2141 set(data
->errlistobj
, MUIA_List_Active
, MUIV_List_Active_Bottom
);
2143 if(eventmask
& (EHMF_ADDBINDING
|EHMF_REMBINDING
|EHMF_DEVICEDEAD
|EHMF_DEVICELOWPW
|EHMF_DEVSUSPENDED
|EHMF_DEVRESUMED
))
2145 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
2146 DoMethod(data
->clslistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
2147 DoMethod(data
->selfobj
, MUIM_Action_Dev_Activate
);
2149 if(eventmask
& EHMF_REMDEVICE
)
2151 set(data
->devlistobj
, MUIA_List_Quiet
, FALSE
);
2153 if(eventmask
& EHMF_REMCLASS
)
2155 set(data
->clslistobj
, MUIA_List_Quiet
, FALSE
);
2157 if(eventmask
& (EHMF_ADDCLASS
|EHMF_REMCLASS
))
2159 set(data
->devlistobj
, MUIA_ContextMenu
, NULL
);
2160 MUI_DisposeObject(data
->mi_classpopup
);
2161 data
->mi_classpopup
= CreateClassPopup();
2162 set(data
->devlistobj
, MUIA_ContextMenu
, data
->mi_classpopup
);
2166 if(!data
->swallowconfigevent
)
2168 UpdateConfigToGUI(data
);
2172 psdGetAttrs(PGA_STACK
, NULL
,
2173 PA_CurrConfigHash
, &currhash
,
2174 PA_SavedConfigHash
, &oldhash
,
2176 set(data
->saveobj
, MUIA_Disabled
, (oldhash
== currhash
));
2178 data
->swallowconfigevent
= FALSE
;
2183 /* /// "UpdateConfigToGUI()" */
2184 void UpdateConfigToGUI(struct ActionData
*data
)
2188 struct HWListEntry
*hlnode
;
2190 struct ClsListEntry
*clnode
;
2199 IPTR popupgone
= FALSE
;
2200 IPTR popupdeath
= FALSE
;
2201 IPTR popupdelay
= 0;
2202 IPTR popupactivate
= FALSE
;
2203 IPTR popuptofront
= TRUE
;
2204 IPTR autodisablelp
= FALSE
;
2205 IPTR autodisabledead
= TRUE
;
2206 IPTR powersaving
= FALSE
;
2207 IPTR forcesuspend
= FALSE
;
2208 IPTR suspendtimeout
= 30;
2209 STRPTR devdtxsoundfile
= "";
2210 STRPTR devremsoundfile
= "";
2211 IPTR prefsversion
= 0;
2212 IPTR relversion
= 0;
2214 ULONG numclasses
= 0;
2219 IPTR selpos
= MUIV_List_Active_Off
;
2220 IPTR clsselpos
= MUIV_List_Active_Off
;
2222 get(data
->hwlistobj
, MUIA_List_Active
, &selpos
);
2223 get(data
->clslistobj
, MUIA_List_Active
, &clsselpos
);
2225 set(data
->hwlistobj
, MUIA_List_Quiet
, TRUE
);
2226 DoMethod(data
->hwlistobj
, MUIM_List_Clear
);
2227 set(data
->clslistobj
, MUIA_List_Quiet
, TRUE
);
2228 DoMethod(data
->clslistobj
, MUIM_List_Clear
);
2230 oldphw
= data
->acthlnode
? data
->acthlnode
->phw
: NULL
;
2232 // remove all GUI entries first
2233 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
2234 while(hlnode
->node
.ln_Succ
)
2237 FreeHWEntry(data
, hlnode
);
2238 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
2241 clnode
= (struct ClsListEntry
*) data
->clslist
.lh_Head
;
2242 while(clnode
->node
.ln_Succ
)
2244 FreeClsEntry(data
, clnode
);
2245 clnode
= (struct ClsListEntry
*) data
->clslist
.lh_Head
;
2248 /* get stuff that's online first */
2249 psdGetAttrs(PGA_STACK
, NULL
,
2250 PA_HardwareList
, &lst
,
2251 PA_ReleaseVersion
, &relversion
,
2252 PA_GlobalConfig
, &stackcfg
,
2257 if((hlnode
= AllocHWEntry(data
, phw
)))
2263 DoMethod(data
->hwlistobj
, MUIM_List_InsertSingle
, hlnode
, MUIV_List_Insert_Bottom
);
2270 pic
= psdFindCfgForm(NULL
, IFFFORM_STACKCFG
);
2271 /* now check for additional entries that are offline */
2272 subpic
= pic
? psdFindCfgForm(pic
, IFFFORM_UHWDEVICE
) : NULL
;
2275 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
2276 while(hlnode
->node
.ln_Succ
)
2278 if(psdMatchStringChunk(subpic
, IFFCHNK_NAME
, hlnode
->devname
))
2280 ULONG
*unitchk
= psdGetCfgChunk(subpic
, IFFCHNK_UNIT
);
2281 if(unitchk
&& (unitchk
[2] == hlnode
->unit
))
2283 psdFreeVec(unitchk
);
2286 psdFreeVec(unitchk
);
2289 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
2291 if(!hlnode
->node
.ln_Succ
)
2293 if((hlnode
= AllocHWEntry(data
, NULL
)))
2295 ULONG
*unitchk
= psdGetCfgChunk(subpic
, IFFCHNK_UNIT
);
2298 hlnode
->unit
= unitchk
[2];
2299 psdFreeVec(unitchk
);
2301 hlnode
->devname
= psdGetStringChunk(subpic
, IFFCHNK_NAME
);
2302 DoMethod(data
->hwlistobj
, MUIM_List_InsertSingle
, hlnode
, MUIV_List_Insert_Bottom
);
2306 subpic
= psdNextCfgForm(subpic
);
2309 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
2313 if((clnode
= AllocClsEntry(data
, puc
)))
2316 DoMethod(data
->clslistobj
, MUIM_List_InsertSingle
, clnode
, MUIV_List_Insert_Bottom
);
2323 psdGetAttrs(PGA_STACKCFG
, stackcfg
, GCA_PrefsVersion
, &prefsversion
, TAG_END
);
2327 if(relversion
> prefsversion
)
2329 psdAddErrorMsg(RETURN_WARN
, "Trident", "Forcing a DirScan for (new) classes, as you probably updated to a newer version.");
2330 psdSetAttrs(PGA_STACKCFG
, stackcfg
, GCA_PrefsVersion
, relversion
, TAG_END
);
2331 DoMethod(data
->selfobj
, MUIM_Action_Cls_Scan
);
2333 else if(!(numclasses
|| data
->autoclassesadded
))
2335 psdAddErrorMsg(RETURN_WARN
, "Trident", "Doing a DirScan for classes, because none were in config.");
2336 DoMethod(data
->selfobj
, MUIM_Action_Cls_Scan
);
2338 data
->autoclassesadded
= TRUE
;
2340 set(data
->hwlistobj
, MUIA_List_Active
, selpos
);
2341 set(data
->clslistobj
, MUIA_List_Active
, clsselpos
);
2342 set(data
->hwlistobj
, MUIA_List_Quiet
, FALSE
);
2343 set(data
->devlistobj
, MUIA_List_Quiet
, FALSE
);
2344 set(data
->clslistobj
, MUIA_List_Quiet
, FALSE
);
2345 CreatePrefsList(data
);
2349 psdGetAttrs(PGA_STACKCFG
, stackcfg
,
2350 GCA_SubTaskPri
, &subtaskpri
,
2351 GCA_BootDelay
, &bootdelay
,
2352 GCA_LogInfo
, &loginfo
,
2353 GCA_LogWarning
, &logwarn
,
2354 GCA_LogError
, &logerr
,
2355 GCA_LogFailure
, &logfail
,
2356 GCA_PopupDeviceNew
, &popupnew
,
2357 GCA_PopupDeviceGone
, &popupgone
,
2358 GCA_PopupDeviceDeath
, &popupdeath
,
2359 GCA_PopupCloseDelay
, &popupdelay
,
2360 GCA_PopupActivateWin
, &popupactivate
,
2361 GCA_PopupWinToFront
, &popuptofront
,
2362 GCA_InsertionSound
, &devdtxsoundfile
,
2363 GCA_RemovalSound
, &devremsoundfile
,
2364 GCA_AutoDisableLP
, &autodisablelp
,
2365 GCA_AutoDisableDead
, &autodisabledead
,
2366 GCA_PowerSaving
, &powersaving
,
2367 GCA_ForceSuspend
, &forcesuspend
,
2368 GCA_SuspendTimeout
, &suspendtimeout
,
2370 nnset(data
->cfgtaskpriobj
, MUIA_Numeric_Value
, subtaskpri
);
2371 nnset(data
->cfgbootdelayobj
, MUIA_Numeric_Value
, bootdelay
);
2372 nnset(data
->cfgloginfoobj
, MUIA_Selected
, loginfo
);
2373 nnset(data
->cfglogwarnobj
, MUIA_Selected
, logwarn
);
2374 nnset(data
->cfglogerrobj
, MUIA_Selected
, logerr
);
2375 nnset(data
->cfglogfailobj
, MUIA_Selected
, logfail
);
2376 nnset(data
->cfgpopupnewobj
, MUIA_Cycle_Active
, popupnew
);
2377 nnset(data
->cfgpopupgoneobj
, MUIA_Selected
, popupgone
);
2378 nnset(data
->cfgpopupdeathobj
, MUIA_Selected
, popupdeath
);
2379 nnset(data
->cfgpopupdelayobj
, MUIA_Numeric_Value
, popupdelay
);
2380 nnset(data
->cfgpopupactivateobj
, MUIA_Selected
, popupactivate
);
2381 nnset(data
->cfgpopuptofrontobj
, MUIA_Selected
, popuptofront
);
2382 nnset(data
->cfgdevdtxsoundobj
, MUIA_String_Contents
, devdtxsoundfile
);
2383 nnset(data
->cfgdevremsoundobj
, MUIA_String_Contents
, devremsoundfile
);
2384 nnset(data
->cfgautolpobj
, MUIA_Selected
, autodisablelp
);
2385 nnset(data
->cfgautodeadobj
, MUIA_Selected
, autodisabledead
);
2386 nnset(data
->cfgpowersavingobj
, MUIA_Selected
, powersaving
);
2387 nnset(data
->cfgforcesuspendobj
, MUIA_Selected
, forcesuspend
);
2388 nnset(data
->cfgsuspendtimeoutobj
, MUIA_Numeric_Value
, suspendtimeout
);
2393 Object
*MyTextObject(char *Text
,char *Help
)
2397 MUIA_ShortHelp
, Help
,
2399 MUIA_Background
, MUII_ButtonBack
,
2401 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2402 MUIA_Text_Contents
, Text
,
2408 Object
*MyTextObjectDisabled(char *Text
,char *Help
)
2412 MUIA_ShortHelp
, Help
,
2414 MUIA_Background
, MUII_ButtonBack
,
2416 MUIA_InputMode
, MUIV_InputMode_RelVerify
,
2417 MUIA_Text_Contents
, Text
,
2418 MUIA_Disabled
, TRUE
,
2424 /* /// "Action_OM_NEW()" */
2425 Object
* Action_OM_NEW(struct IClass
*cl
, Object
*obj
, Msg msg
)
2427 struct ActionData
*data
;
2430 IPTR subtaskpri
= 5;
2431 IPTR loginfo
= TRUE
;
2432 IPTR logwarn
= TRUE
;
2434 IPTR logfail
= TRUE
;
2436 IPTR popupgone
= FALSE
;
2437 IPTR popupdeath
= FALSE
;
2438 IPTR popupdelay
= 0;
2439 IPTR popupactivate
= FALSE
;
2440 IPTR popuptofront
= TRUE
;
2441 IPTR autodisablelp
= FALSE
;
2442 IPTR autodisabledead
= FALSE
;
2443 IPTR autorestartdead
= TRUE
;
2444 IPTR powersaving
= FALSE
;
2445 IPTR forcesuspend
= FALSE
;
2446 IPTR suspendtimeout
= 30;
2447 STRPTR devdtxsoundfile
= "";
2448 STRPTR devremsoundfile
= "";
2449 APTR stackcfg
= NULL
;
2452 struct DevListEntry
*dlnode
;
2454 mainpanels
[0] = _(MSG_MAINPANEL_GENERAL
);
2455 mainpanels
[1] = _(MSG_MAINPANEL_CONTROLLERS
);
2456 mainpanels
[2] = _(MSG_MAINPANEL_DEVICES
);
2457 mainpanels
[3] = _(MSG_MAINPANEL_CLASSES
);
2458 mainpanels
[4] = _(MSG_MAINPANEL_OPTIONS
);
2459 mainpanels
[5] = _(MSG_MAINPANEL_POPUPS
);
2460 mainpanels
[6] = _(MSG_MAINPANEL_CONFIG
);
2462 errlvlstrings
[0] = _(MSG_ERRLVL_ALL
);
2463 errlvlstrings
[1] = _(MSG_ERRLVL_WARNINGS
);
2464 errlvlstrings
[2] = _(MSG_ERRLVL_ERRORS
);
2465 errlvlstrings
[3] = _(MSG_ERRLVL_FAILURES
);
2467 popupnewdevicestrings
[0] = _(MSG_POPUP_NEVER
);
2468 popupnewdevicestrings
[1] = _(MSG_POPUP_ERROR
);
2469 popupnewdevicestrings
[2] = _(MSG_POPUP_UNKNOWN
);
2470 popupnewdevicestrings
[3] = _(MSG_POPUP_NOBINDING
);
2471 popupnewdevicestrings
[4] = _(MSG_POPUP_NOCONFIG
);
2472 popupnewdevicestrings
[5] = _(MSG_POPUP_CONFIGCLASS
);
2473 popupnewdevicestrings
[6] = _(MSG_POPUP_BINDING
);
2474 popupnewdevicestrings
[7] = _(MSG_POPUP_ALWAYS
);
2476 if(!(obj
= (Object
*) DoSuperMethodA(cl
, obj
, msg
)))
2479 data
= INST_DATA(cl
, obj
);
2480 data
->selfobj
= obj
;
2481 NewList(&data
->hwlist
);
2482 NewList(&data
->devlist
);
2483 NewList(&data
->clslist
);
2484 NewList(&data
->errlist
);
2485 NewList(&data
->prefslist
);
2487 data
->acthlnode
= NULL
;
2488 data
->errorlevel
= 0;
2489 data
->HardwareDisplayHook
.h_Data
= data
;
2490 data
->DeviceDisplayHook
.h_Data
= data
;
2491 data
->ClassDisplayHook
.h_Data
= data
;
2492 data
->ErrorDisplayHook
.h_Data
= data
;
2493 data
->IconDisplayHook
.h_Data
= data
;
2494 data
->PrefsDisplayHook
.h_Data
= data
;
2496 data
->HardwareDisplayHook
.h_Entry
= (APTR
) HardwareListDisplayHook
;
2497 data
->DeviceDisplayHook
.h_Entry
= (APTR
) DeviceListDisplayHook
;
2498 data
->ClassDisplayHook
.h_Entry
= (APTR
) ClassListDisplayHook
;
2499 data
->ErrorDisplayHook
.h_Entry
= (APTR
) ErrorListDisplayHook
;
2500 data
->IconDisplayHook
.h_Entry
= (APTR
) IconListDisplayHook
;
2501 data
->PrefsDisplayHook
.h_Entry
= (APTR
) PrefsListDisplayHook
;
2503 aimeemsg
= aimeelyrics
[(((IPTR
) aimeelyrics
) / 333) & 31];
2505 /* get current global config */
2506 psdGetAttrs(PGA_STACK
, NULL
, PA_GlobalConfig
, &stackcfg
, TAG_END
);
2509 psdGetAttrs(PGA_STACKCFG
, stackcfg
,
2510 GCA_SubTaskPri
, &subtaskpri
,
2511 GCA_BootDelay
, &bootdelay
,
2512 GCA_LogInfo
, &loginfo
,
2513 GCA_LogWarning
, &logwarn
,
2514 GCA_LogError
, &logerr
,
2515 GCA_LogFailure
, &logfail
,
2516 GCA_PopupDeviceNew
, &popupnew
,
2517 GCA_PopupDeviceGone
, &popupgone
,
2518 GCA_PopupDeviceDeath
, &popupdeath
,
2519 GCA_PopupCloseDelay
, &popupdelay
,
2520 GCA_PopupActivateWin
, &popupactivate
,
2521 GCA_PopupWinToFront
, &popuptofront
,
2522 GCA_InsertionSound
, &devdtxsoundfile
,
2523 GCA_RemovalSound
, &devremsoundfile
,
2524 GCA_AutoDisableLP
, &autodisablelp
,
2525 GCA_AutoDisableDead
, &autodisabledead
,
2526 GCA_AutoRestartDead
, &autorestartdead
,
2527 GCA_PowerSaving
, &powersaving
,
2528 GCA_ForceSuspend
, &forcesuspend
,
2529 GCA_SuspendTimeout
, &suspendtimeout
,
2534 data
->cfgcntobj
[0] = ScrollgroupObject
,
2535 MUIA_HelpNode
, "tridentgeneral",
2536 MUIA_Scrollgroup_Contents
, VirtgroupObject
,
2543 Child
, BodychunkObject
,
2544 MUIA_ShortHelp
, __(MSG_POSEIDON_SHORTHELP
),
2545 MUIA_Bitmap_SourceColors
, neptune8_colors
,
2546 MUIA_FixWidth
, NEPTUNE8_WIDTH
,
2547 MUIA_FixHeight
, NEPTUNE8_HEIGHT
,
2548 MUIA_Bitmap_Width
, NEPTUNE8_WIDTH
,
2549 MUIA_Bitmap_Height
, NEPTUNE8_HEIGHT
,
2550 MUIA_Bodychunk_Depth
, NEPTUNE8_DEPTH
,
2551 MUIA_Bodychunk_Body
, neptune8_body
,
2552 MUIA_Bodychunk_Compression
, NEPTUNE8_COMPRESSION
,
2553 MUIA_Bodychunk_Masking
, NEPTUNE8_MASKING
,
2554 MUIA_Bitmap_Transparent
, 0,
2555 MUIA_Bitmap_UseFriend
, TRUE
,
2556 MUIA_Bitmap_Precision
, PRECISION_ICON
,
2562 Child
, Label(__(MSG_PANEL_GENERAL_LABEL1
)),
2563 Child
, Label(__(MSG_PANEL_GENERAL_LABEL2
)),
2565 Child
, Label(__(MSG_PANEL_GENERAL_LABEL3
)),
2566 Child
, Label(__(MSG_PANEL_GENERAL_LABEL4
)),
2568 Child
, Label(__(MSG_PANEL_GENERAL_LABEL5
)),
2577 Child
, Label(aimeemsg
),
2585 /* Hardware panel */
2586 data
->cfgcntobj
[1] = VGroup
,
2587 MUIA_HelpNode
, "tridenthardware",
2588 Child
, Label(__(MSG_PANEL_HARDWARE_LABEL1
)),
2589 Child
, ListviewObject
,
2591 MUIA_ShortHelp
, __(MSG_PANEL_HARDWARE_CONTROLLER_HELP
),
2592 MUIA_Listview_List
, data
->hwlistobj
=
2593 NewObject(IconListClass
->mcc_Class
, 0, InputListFrame
, MUIA_List_MinLineHeight
, 16, MUIA_List_Format
, "BAR,BAR,BAR,", MUIA_List_Title
, TRUE
, MUIA_List_DisplayHook
, &data
->HardwareDisplayHook
, TAG_END
),
2595 Child
, data
->hwdevgrpobj
= HGroup
,
2596 MUIA_Disabled
, TRUE
,
2597 Child
, Label(__(MSG_PANEL_HARDWARE_LABEL2
)),
2598 Child
, data
->hwdevaslobj
= PopaslObject
,
2600 MUIA_ShortHelp
, __(MSG_PANEL_HARDWARE_DEVICE_HELP
),
2601 MUIA_Popstring_String
, data
->hwdevobj
= StringObject
,
2604 MUIA_String_AdvanceOnCR
, TRUE
,
2606 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
2607 ASLFR_TitleText
, __(MSG_PANEL_HARDWARE_SELECT
),
2609 Child
, Label(__(MSG_PANEL_HARDWARE_UNIT
)),
2610 Child
, data
->hwunitobj
= StringObject
,
2611 MUIA_ShortHelp
, __(MSG_PANEL_HARDWARE_UNIT_HELP
),
2613 MUIA_HorizWeight
, 10,
2615 MUIA_String_AdvanceOnCR
, TRUE
,
2616 MUIA_String_Integer
, 0,
2617 MUIA_String_Accept
, "0123456789",
2621 MUIA_Group_SameWidth
, TRUE
,
2622 Child
, data
->hwnewobj
= MyTextObject(_(MSG_PANEL_HARDWARE_DRIVER_NEW
),_(MSG_PANEL_HARDWARE_DRIVER_NEW_HELP
)),
2623 Child
, data
->hwcopyobj
= MyTextObject(_(MSG_PANEL_HARDWARE_DRIVER_COPY
),_(MSG_PANEL_HARDWARE_DRIVER_COPY_HELP
)),
2624 Child
, data
->hwdelobj
= MyTextObject(_(MSG_PANEL_HARDWARE_DRIVER_DELETE
),_(MSG_PANEL_HARDWARE_DRIVER_DELETE_HELP
)),
2625 Child
, data
->hwonlineobj
= MyTextObject(_(MSG_PANEL_HARDWARE_DRIVER_ONLINE
),_(MSG_PANEL_HARDWARE_DRIVER_ONLINE_HELP
)),
2626 Child
, data
->hwofflineobj
= MyTextObject(_(MSG_PANEL_HARDWARE_DRIVER_OFFLINE
),_(MSG_PANEL_HARDWARE_DRIVER_OFFLINE_HELP
)),
2627 Child
, data
->hwinfoobj
= MyTextObject(_(MSG_PANEL_HARDWARE_DRIVER_INFO
),_(MSG_PANEL_HARDWARE_DRIVER_INFO_HELP
)),
2632 data
->cfgcntobj
[2] = VGroup
,
2633 MUIA_HelpNode
, "tridentdevices",
2634 Child
, Label(__(MSG_PANEL_DEVICES_LABEL
)),
2635 Child
, ListviewObject
,
2637 MUIA_Listview_List
, data
->devlistobj
=
2638 NewObject(IconListClass
->mcc_Class
, 0, MUIA_ShortHelp
, __(MSG_PANEL_DEVICES_HELP
), InputListFrame
, MUIA_List_MinLineHeight
, 16, MUIA_List_Format
, "BAR,BAR,BAR,BAR,", MUIA_List_Title
, TRUE
, MUIA_List_DisplayHook
, &data
->DeviceDisplayHook
, TAG_END
),
2641 MUIA_Group_SameWidth
, TRUE
,
2642 Child
, data
->devbindobj
= MyTextObject(_(MSG_PANEL_DEVICES_SCAN
),_(MSG_PANEL_DEVICES_SCAN_HELP
)),
2643 Child
, data
->devunbindobj
= MyTextObjectDisabled(_(MSG_PANEL_DEVICES_UNBIND
),_(MSG_PANEL_DEVICES_UNBIND_HELP
)),
2644 Child
, data
->devinfoobj
= MyTextObject(_(MSG_PANEL_DEVICES_INFO
),_(MSG_PANEL_DEVICES_INFO_HELP
)),
2645 Child
, data
->devcfgobj
= MyTextObjectDisabled(_(MSG_PANEL_DEVICES_SETTINGS
),_(MSG_PANEL_DEVICES_SETTINGS_HELP
)),
2646 Child
, data
->devsuspendobj
= MyTextObjectDisabled(_(MSG_PANEL_DEVICES_SUSPEND
),_(MSG_PANEL_DEVICES_SUSPEND_HELP
)),
2647 Child
, data
->devresumeobj
= MyTextObjectDisabled(_(MSG_PANEL_DEVICES_RESUME
),_(MSG_PANEL_DEVICES_RESUME_HELP
)),
2648 Child
, data
->devpowercycleobj
= MyTextObjectDisabled(_(MSG_PANEL_DEVICES_POWERCYCLE
),_(MSG_PANEL_DEVICES_POWERCYCLE_HELP
)),
2649 Child
, data
->devdisableobj
= MyTextObjectDisabled(_(MSG_PANEL_DEVICES_DISABLE
),_(MSG_PANEL_DEVICES_DISABLE_HELP
)),
2654 data
->cfgcntobj
[3] = VGroup
,
2655 MUIA_HelpNode
, "tridentclasses",
2656 Child
, Label(__(MSG_PANEL_CLASSES
)),
2657 Child
, data
->clslistobj
= ListviewObject
,
2659 MUIA_Listview_List
, ListObject
,
2660 MUIA_ShortHelp
, __(MSG_PANEL_CLASSES_HELP
),
2662 MUIA_List_Format
, "BAR,BAR,",
2663 MUIA_List_Title
, TRUE
,
2664 MUIA_List_DisplayHook
, &data
->ClassDisplayHook
,
2668 Child
, Label(__(MSG_PANEL_CLASSES_LABEL
)),
2669 Child
, PopaslObject
,
2671 MUIA_ShortHelp
, __(MSG_PANEL_CLASSES_LABEL_HELP
),
2672 MUIA_Popstring_String
, data
->clsnameobj
= StringObject
,
2675 MUIA_String_AdvanceOnCR
, TRUE
,
2676 MUIA_String_Contents
, CLASSPATH
"/",
2678 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
2679 ASLFR_TitleText
, __(MSG_PANEL_CLASSES_SELECT
),
2683 MUIA_Group_SameWidth
, TRUE
,
2684 Child
, data
->clsaddobj
= MyTextObject(_(MSG_PANEL_CLASSES_ADD
),_(MSG_PANEL_CLASSES_ADD_HELP
)),
2685 Child
, data
->clsremobj
= MyTextObjectDisabled(_(MSG_PANEL_CLASSES_REMOVE
),_(MSG_PANEL_CLASSES_REMOVE_HELP
)),
2686 Child
, data
->clscfgobj
= MyTextObjectDisabled(_(MSG_PANEL_CLASSES_CONFIG
),_(MSG_PANEL_CLASSES_CONFIG_HELP
)),
2687 Child
, data
->clsscanobj
= MyTextObject(_(MSG_PANEL_CLASSES_SCAN
),_(MSG_PANEL_CLASSES_SCAN_HELP
)),
2692 data
->cfgcntobj
[4] = VGroup
,
2693 MUIA_HelpNode
, "tridentoptions",
2694 Child
, Label(__(MSG_PANEL_OPTIONS
)),
2696 Child
, VGroup
, GroupFrameT(__(MSG_PANEL_OPTIONS_STACK
)),
2699 Child
, Label(__(MSG_PANEL_OPTIONS_PRIORITY
)),
2700 Child
, data
->cfgtaskpriobj
= SliderObject
, SliderFrame
,
2701 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_PRIORITY_HELP
),
2703 MUIA_Numeric_Min
, 0,
2704 MUIA_Numeric_Max
, 127,
2705 MUIA_Numeric_Value
, subtaskpri
,
2707 Child
, Label(__(MSG_PANEL_OPTIONS_BOOT
)),
2708 Child
, data
->cfgbootdelayobj
= SliderObject
, SliderFrame
,
2709 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_BOOT_HELP
),
2711 MUIA_Numeric_Min
, 0,
2712 MUIA_Numeric_Max
, 15,
2713 MUIA_Numeric_Value
, bootdelay
,
2714 MUIA_Numeric_Format
,__(MSG_PANEL_OPTIONS_BOOT_FORMAT
),
2720 Child
, Label(__(MSG_PANEL_OPTIONS_DISABLELOW
)),
2722 Child
, data
->cfgautolpobj
= ImageObject
, ImageButtonFrame
,
2723 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_DISABLELOW_HELP
),
2724 MUIA_Background
, MUII_ButtonBack
,
2726 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2727 MUIA_Image_Spec
, MUII_CheckMark
,
2728 MUIA_Image_FreeVert
, TRUE
,
2729 MUIA_Selected
, autodisablelp
,
2730 MUIA_ShowSelState
, FALSE
,
2734 Child
, Label(__(MSG_PANEL_OPTIONS_DISABLEDEAD
)),
2736 Child
, data
->cfgautodeadobj
= ImageObject
, ImageButtonFrame
,
2737 MUIA_ShortHelp
,__(MSG_PANEL_OPTIONS_DISABLEDEAD_HELP
),
2738 MUIA_Background
, MUII_ButtonBack
,
2740 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2741 MUIA_Image_Spec
, MUII_CheckMark
,
2742 MUIA_Image_FreeVert
, TRUE
,
2743 MUIA_Selected
, autodisabledead
,
2744 MUIA_Disabled
, autorestartdead
,
2745 MUIA_ShowSelState
, FALSE
,
2749 Child
, Label(__(MSG_PANEL_OPTIONS_POWERCYCLE
)),
2751 Child
, data
->cfgautopcobj
= ImageObject
, ImageButtonFrame
,
2752 MUIA_ShortHelp
,__(MSG_PANEL_OPTIONS_POWERCYCLE_HELP
),
2753 MUIA_Background
, MUII_ButtonBack
,
2755 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2756 MUIA_Image_Spec
, MUII_CheckMark
,
2757 MUIA_Image_FreeVert
, TRUE
,
2758 MUIA_Selected
, autorestartdead
,
2759 MUIA_ShowSelState
, FALSE
,
2763 Child
, Label(__(MSG_PANEL_OPTIONS_POWERSAVE
)),
2765 Child
, data
->cfgpowersavingobj
= ImageObject
, ImageButtonFrame
,
2766 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_POWERSAVE_HELP
),
2767 MUIA_Background
, MUII_ButtonBack
,
2769 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2770 MUIA_Image_Spec
, MUII_CheckMark
,
2771 MUIA_Image_FreeVert
, TRUE
,
2772 MUIA_Selected
, powersaving
,
2773 MUIA_ShowSelState
, FALSE
,
2777 Child
, Label(__(MSG_PANEL_OPTIONS_FORCESUSPEND
)),
2779 Child
, data
->cfgforcesuspendobj
= ImageObject
, ImageButtonFrame
,
2780 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_FORCESUSPEND_HELP
),
2781 MUIA_Background
, MUII_ButtonBack
,
2783 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2784 MUIA_Image_Spec
, MUII_CheckMark
,
2785 MUIA_Image_FreeVert
, TRUE
,
2786 MUIA_Selected
, forcesuspend
,
2787 MUIA_ShowSelState
, FALSE
,
2791 Child
, Label(__(MSG_PANEL_OPTIONS_INACTIVITY
)),
2792 Child
, data
->cfgsuspendtimeoutobj
= SliderObject
, SliderFrame
,
2793 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_INACTIVITY_HELP
),
2795 MUIA_Numeric_Min
, 5,
2796 MUIA_Numeric_Max
, 600,
2797 MUIA_Numeric_Value
, suspendtimeout
,
2798 MUIA_Numeric_Format
, __(MSG_PANEL_OPTIONS_INACTIVITY_FORMAT
),
2804 Child
, VGroup
, GroupFrameT(__(MSG_PANEL_OPTIONS_LOGGING
)),
2811 Child
, Label(__(MSG_PANEL_OPTIONS_LOGGING_LABEL
)),
2813 Child
, data
->cfgloginfoobj
= ImageObject
, ImageButtonFrame
,
2814 MUIA_ShortHelp
,__(MSG_PANEL_OPTIONS_LOGGING_LABEL_HELP
),
2815 MUIA_Background
, MUII_ButtonBack
,
2817 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2818 MUIA_Image_Spec
, MUII_CheckMark
,
2819 MUIA_Image_FreeVert
, TRUE
,
2820 MUIA_Selected
, loginfo
,
2821 MUIA_ShowSelState
, FALSE
,
2825 Child
, Label(__(MSG_PANEL_OPTIONS_LOGGING_WARN
)),
2827 Child
, data
->cfglogwarnobj
= ImageObject
, ImageButtonFrame
,
2828 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_LOGGING_WARN_HELP
),
2829 MUIA_Background
, MUII_ButtonBack
,
2831 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2832 MUIA_Image_Spec
, MUII_CheckMark
,
2833 MUIA_Image_FreeVert
, TRUE
,
2834 MUIA_Selected
, logwarn
,
2835 MUIA_ShowSelState
, FALSE
,
2839 Child
, Label(__(MSG_PANEL_OPTIONS_LOGGING_ERR
)),
2841 Child
, data
->cfglogerrobj
= ImageObject
, ImageButtonFrame
,
2842 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_LOGGING_ERR_HELP
),
2843 MUIA_Background
, MUII_ButtonBack
,
2845 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2846 MUIA_Image_Spec
, MUII_CheckMark
,
2847 MUIA_Image_FreeVert
, TRUE
,
2848 MUIA_Selected
, logerr
,
2849 MUIA_ShowSelState
, FALSE
,
2853 Child
, Label(__(MSG_PANEL_OPTIONS_LOGGING_FAIL
)),
2855 Child
, data
->cfglogfailobj
= ImageObject
, ImageButtonFrame
,
2856 MUIA_ShortHelp
, __(MSG_PANEL_OPTIONS_LOGGING_FAIL_HELP
),
2857 MUIA_Background
, MUII_ButtonBack
,
2859 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2860 MUIA_Image_Spec
, MUII_CheckMark
,
2861 MUIA_Image_FreeVert
, TRUE
,
2862 MUIA_Selected
, logfail
,
2863 MUIA_ShowSelState
, FALSE
,
2873 Child
, Label(__(MSG_PANEL_OPTIONS_MEMORY
)),
2874 Child
, data
->mempoolobj
= TextObject
,
2875 MUIA_Text_Contents
, "?",
2882 data
->cfgcntobj
[5] = VGroup
,
2883 MUIA_HelpNode
, "tridentpopups",
2884 Child
, Label(__(MSG_PANEL_POPO
)),
2886 Child
, VGroup
, GroupFrameT(__(MSG_PANEL_POPO_LABEL
)),
2889 Child
, Label(__(MSG_PANEL_POPO_CONNECT
)),
2891 Child
, data
->cfgpopupnewobj
= CycleObject
,
2892 MUIA_ShortHelp
, __(MSG_PANEL_POPO_CONNECT_HELP
),
2894 MUIA_Cycle_Entries
, popupnewdevicestrings
,
2895 MUIA_Cycle_Active
, popupnew
,
2898 Child
, Label(__(MSG_PANEL_POPO_DISCONNECT
)),
2900 Child
, data
->cfgpopupgoneobj
= ImageObject
, ImageButtonFrame
,
2901 MUIA_ShortHelp
, _(MSG_PANEL_POPO_DISCONNECT_HELP
),
2902 MUIA_Background
, MUII_ButtonBack
,
2904 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2905 MUIA_Image_Spec
, MUII_CheckMark
,
2906 MUIA_Image_FreeVert
, TRUE
,
2907 MUIA_Selected
, popupgone
,
2908 MUIA_ShowSelState
, FALSE
,
2911 Child
, Label(__(MSG_PANEL_POPO_DEATH
)),
2912 Child
, data
->cfgpopupdeathobj
= ImageObject
, ImageButtonFrame
,
2913 MUIA_ShortHelp
, __(MSG_PANEL_POPO_DEATH_HELP
),
2914 MUIA_Background
, MUII_ButtonBack
,
2916 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2917 MUIA_Image_Spec
, MUII_CheckMark
,
2918 MUIA_Image_FreeVert
, TRUE
,
2919 MUIA_Selected
, popupdeath
,
2920 MUIA_ShowSelState
, FALSE
,
2923 Child
, Label(__(MSG_PANEL_POPO_DELAY
)),
2924 Child
, data
->cfgpopupdelayobj
= SliderObject
, SliderFrame
,
2925 MUIA_ShortHelp
, __(MSG_PANEL_POPO_DELAY_HELP
),
2927 MUIA_Numeric_Min
, 0,
2928 MUIA_Numeric_Max
, 25,
2929 MUIA_Numeric_Value
, popupdelay
,
2930 MUIA_Numeric_Format
, __(MSG_PANEL_POPO_DELAY_FORMAT
),
2932 Child
, Label(__(MSG_PANEL_POPO_ACTIVATE
)),
2934 Child
, data
->cfgpopupactivateobj
= ImageObject
, ImageButtonFrame
,
2935 MUIA_ShortHelp
, __(MSG_PANEL_POPO_ACTIVATE_HELP
),
2936 MUIA_Background
, MUII_ButtonBack
,
2938 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2939 MUIA_Image_Spec
, MUII_CheckMark
,
2940 MUIA_Image_FreeVert
, TRUE
,
2941 MUIA_Selected
, popupactivate
,
2942 MUIA_ShowSelState
, FALSE
,
2945 Child
, Label(__(MSG_PANEL_POPO_TOFRONT
)),
2946 Child
, data
->cfgpopuptofrontobj
= ImageObject
, ImageButtonFrame
,
2947 MUIA_ShortHelp
, __(MSG_PANEL_POPO_TOFRONT_HELP
),
2948 MUIA_Background
, MUII_ButtonBack
,
2950 MUIA_InputMode
, MUIV_InputMode_Toggle
,
2951 MUIA_Image_Spec
, MUII_CheckMark
,
2952 MUIA_Image_FreeVert
, TRUE
,
2953 MUIA_Selected
, popuptofront
,
2954 MUIA_ShowSelState
, FALSE
,
2957 Child
, Label(__(MSG_PANEL_POPO_CONSOUND
)),
2958 Child
, PopaslObject
,
2960 MUIA_ShortHelp
, __(MSG_PANEL_POPO_CONSOUND_HELP
),
2961 MUIA_Popstring_String
, data
->cfgdevdtxsoundobj
= StringObject
,
2964 MUIA_String_AdvanceOnCR
, TRUE
,
2965 MUIA_String_Contents
, devdtxsoundfile
,
2967 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
2968 ASLFR_TitleText
, __(MSG_PANEL_POPO_CONSOUND_SELECT
),
2970 Child
, Label(__(MSG_PANEL_POPO_DISCONSOUND
)),
2971 Child
, PopaslObject
,
2973 MUIA_ShortHelp
, __(MSG_PANEL_POPO_DISCONSOUND_HELP
),
2974 MUIA_Popstring_String
, data
->cfgdevremsoundobj
= StringObject
,
2977 MUIA_String_AdvanceOnCR
, TRUE
,
2978 MUIA_String_Contents
, devremsoundfile
,
2980 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
2981 ASLFR_TitleText
, __(MSG_PANEL_POPO_DISCONSOUND_SELECT
),
2989 /* Configuration panel */
2990 data
->cfgcntobj
[6] = VGroup
,
2991 MUIA_HelpNode
, "tridentconfig",
2992 Child
, Label(__(MSG_PANEL_CONFIG
)),
2993 Child
, data
->prefslistobj
= ListviewObject
,
2995 MUIA_ShortHelp
, __(MSG_PANEL_CONFIG_HELP
),
2996 MUIA_Listview_DragType
, MUIV_Listview_DragType_Immediate
,
2998 NewObject(CfgListClass
->mcc_Class
, 0, InputListFrame
, MUIA_List_Format
, "BAR,BAR,BAR,", MUIA_List_Title
, TRUE
, MUIA_List_DisplayHook
, &data
->PrefsDisplayHook
, MUIA_List_ShowDropMarks
, TRUE
, MUIA_List_AutoVisible
, TRUE
, TAG_END
),
3001 MUIA_Group_SameWidth
, TRUE
,
3002 Child
, data
->prefssaveasobj
= MyTextObject(_(MSG_PANEL_CONFIG_SAVEAS
),_(MSG_PANEL_CONFIG_SAVEAS_HELP
)),
3003 Child
, data
->prefsexportobj
= MyTextObjectDisabled(_(MSG_PANEL_CONFIG_EXPORT
),_(MSG_PANEL_CONFIG_EXPORT_HELP
)),
3004 Child
, data
->prefsimportobj
= MyTextObject(_(MSG_PANEL_CONFIG_IMPORT
),_(MSG_PANEL_CONFIG_IMPORT_HELP
)),
3005 Child
, data
->prefsremoveobj
= MyTextObjectDisabled(_(MSG_PANEL_CONFIG_REMOVE
),_(MSG_PANEL_CONFIG_REMOVE_HELP
)),
3009 data
->mainobj
= VGroup
,
3011 Child
, ListviewObject
,
3013 MUIA_ShowMe
, !registermode
,
3014 MUIA_Listview_MultiSelect
, MUIV_Listview_MultiSelect_None
,
3015 MUIA_Listview_List
, data
->cfgpagelv
=
3016 NewObject(IconListClass
->mcc_Class
, 0, InputListFrame
, MUIA_List_MinLineHeight
, 16, MUIA_List_SourceArray
, mainpanels
, MUIA_List_AdjustWidth
, TRUE
, MUIA_List_Active
, 0, MUIA_List_DisplayHook
, &data
->IconDisplayHook
, TAG_END
),
3020 /*MUIA_Background, MUII_GroupBack,*/
3021 Child
, data
->cfgpagegrp
= (registermode
?
3022 (RegisterGroup(mainpanels
),
3024 MUIA_Register_Frame
, TRUE
,
3025 Child
, data
->cfgcntobj
[0],
3026 Child
, data
->cfgcntobj
[1],
3027 Child
, data
->cfgcntobj
[2],
3028 Child
, data
->cfgcntobj
[3],
3029 Child
, data
->cfgcntobj
[4],
3030 Child
, data
->cfgcntobj
[5],
3031 Child
, data
->cfgcntobj
[6],
3034 MUIA_Group_PageMode
, TRUE
,
3035 MUIA_Group_ActivePage
, MUIV_Group_ActivePage_First
,
3036 Child
, data
->cfgcntobj
[0],
3037 Child
, data
->cfgcntobj
[1],
3038 Child
, data
->cfgcntobj
[2],
3039 Child
, data
->cfgcntobj
[3],
3040 Child
, data
->cfgcntobj
[4],
3041 Child
, data
->cfgcntobj
[5],
3042 Child
, data
->cfgcntobj
[6],
3046 Child
, BalanceObject
,
3047 MUIA_ObjectID
, MAKE_ID('I','L','B','P'),
3049 Child
, VGroup
, GroupFrameT(__(MSG_PANEL_CONFIG_MSGLOG
)),
3050 MUIA_VertWeight
, 20,
3052 Child
, Label(__(MSG_PANEL_CONFIG_INFLVL
)),
3053 Child
, data
->errlvlobj
= CycleObject
,
3055 MUIA_ShortHelp
, __(MSG_PANEL_CONFIG_INFLVL_HELP
),
3056 MUIA_Cycle_Entries
, errlvlstrings
,
3060 MUIA_Group_SameWidth
, TRUE
,
3061 Child
, data
->errsaveobj
= MyTextObject(_(MSG_PANEL_CONFIG_LOGSAVE
),_(MSG_PANEL_CONFIG_LOGSAVE_HELP
)),
3062 Child
, data
->errflushobj
= MyTextObject(_(MSG_PANEL_CONFIG_LOGFLUSH
),_(MSG_PANEL_CONFIG_LOGFLUSH_HELP
)),
3065 Child
, data
->errlistobj
= ListviewObject
,
3067 MUIA_Listview_Input
, FALSE
,
3068 MUIA_Listview_List
, ListObject
,
3069 MUIA_ShortHelp
, __(MSG_PANEL_CONFIG_LOGHELP
),
3071 MUIA_List_Format
, "BAR,BAR,BAR,",
3072 MUIA_List_DisplayHook
, &data
->ErrorDisplayHook
,
3077 MUIA_Group_SameWidth
, TRUE
,
3078 Child
, data
->onlineobj
= MyTextObject( _(MSG_PANEL_CONFIG_ALLONLINE
),_(MSG_PANEL_CONFIG_ALLONLINE_HELP
)),
3079 Child
, data
->offlineobj
= MyTextObject(_(MSG_PANEL_CONFIG_ALLOFFLINE
),_(MSG_PANEL_CONFIG_ALLOFFLINE_HELP
)),
3080 Child
, data
->restartobj
= MyTextObject(_(MSG_PANEL_CONFIG_RESTART
),_(MSG_PANEL_CONFIG_RESTART_HELP
)),
3082 Child
, data
->saveobj
= MyTextObject(_(MSG_PANEL_CONFIG_SAVE
),_(MSG_PANEL_CONFIG_SAVE_HELP
)),
3083 Child
, data
->useobj
= MyTextObject(_(MSG_PANEL_CONFIG_USE
),_(MSG_PANEL_CONFIG_USE_HELP
)),
3087 DoMethod(obj
, OM_ADDMEMBER
, data
->mainobj
);
3089 DoMethod(data
->cfgpagelv
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
3090 data
->cfgpagegrp
, 3, MUIM_Set
, MUIA_Group_ActivePage
, MUIV_TriggerValue
);
3091 DoMethod(data
->cfgpagelv
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
3092 obj
, 1, MUIM_Action_Info_MemPool
);
3094 DoMethod(data
->hwnewobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3095 obj
, 1, MUIM_Action_HW_New
);
3096 DoMethod(data
->hwcopyobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3097 obj
, 1, MUIM_Action_HW_Copy
);
3098 DoMethod(data
->hwdelobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3099 obj
, 1, MUIM_Action_HW_Del
);
3100 DoMethod(data
->hwinfoobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3101 obj
, 1, MUIM_Action_HW_Info
);
3102 DoMethod(data
->hwonlineobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3103 obj
, 1, MUIM_Action_HW_Online
);
3104 DoMethod(data
->hwofflineobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3105 obj
, 1, MUIM_Action_HW_Offline
);
3107 DoMethod(data
->hwlistobj
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
3108 obj
, 1, MUIM_Action_HW_Info
);
3109 DoMethod(data
->hwlistobj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
3110 obj
, 1, MUIM_Action_HW_Activate
);
3111 DoMethod(data
->hwdevobj
, MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
3112 obj
, 2, MUIM_Action_HW_Update
, NULL
);
3113 DoMethod(data
->hwunitobj
, MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
3114 obj
, 2, MUIM_Action_HW_Update
, NULL
);
3116 DoMethod(data
->errsaveobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3117 obj
, 1, MUIM_Action_SaveErrors
);
3118 DoMethod(data
->errflushobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3119 obj
, 1, MUIM_Action_FlushErrors
);
3120 DoMethod(data
->errlvlobj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
3121 obj
, 1, MUIM_Action_ChgErrLevel
);
3123 DoMethod(data
->onlineobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3124 obj
, 1, MUIM_Action_Online
);
3125 DoMethod(data
->offlineobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3126 obj
, 1, MUIM_Action_Offline
);
3127 DoMethod(data
->restartobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3128 obj
, 1, MUIM_Action_Restart
);
3130 DoMethod(data
->saveobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3131 obj
, 1, MUIM_Action_SaveQuit
);
3132 DoMethod(data
->useobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3133 obj
, 1, MUIM_Action_UseQuit
);
3135 DoMethod(data
->devlistobj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
3136 obj
, 1, MUIM_Action_Dev_Activate
);
3137 DoMethod(data
->devbindobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3138 obj
, 1, MUIM_Action_Dev_Bind
);
3139 DoMethod(data
->devinfoobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3140 obj
, 1, MUIM_Action_Dev_Info
);
3141 DoMethod(data
->devunbindobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3142 obj
, 1, MUIM_Action_Dev_Unbind
);
3143 DoMethod(data
->devsuspendobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3144 obj
, 1, MUIM_Action_Dev_Suspend
);
3145 DoMethod(data
->devresumeobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3146 obj
, 1, MUIM_Action_Dev_Resume
);
3147 DoMethod(data
->devpowercycleobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3148 obj
, 1, MUIM_Action_Dev_PowerCycle
);
3149 DoMethod(data
->devdisableobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3150 obj
, 1, MUIM_Action_Dev_Disable
);
3151 DoMethod(data
->devlistobj
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
3152 obj
, 1, MUIM_Action_Dev_Info
);
3153 DoMethod(data
->devlistobj
, MUIM_Notify
, MUIA_ContextMenuTrigger
, MUIV_EveryTime
,
3154 obj
, 2, MUIM_Action_Dev_ForceBind
, MUIV_TriggerValue
);
3156 DoMethod(data
->devcfgobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3157 obj
, 1, MUIM_Action_Dev_Configure
);
3159 DoMethod(data
->clslistobj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
3160 obj
, 1, MUIM_Action_Cls_Activate
);
3161 DoMethod(data
->clsaddobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3162 obj
, 1, MUIM_Action_Cls_Add
);
3163 DoMethod(data
->clsnameobj
, MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
3164 obj
, 1, MUIM_Action_Cls_Add
);
3165 DoMethod(data
->clsremobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3166 obj
, 1, MUIM_Action_Cls_Remove
);
3167 DoMethod(data
->clscfgobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3168 obj
, 1, MUIM_Action_Cls_Configure
);
3169 DoMethod(data
->clsscanobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3170 obj
, 1, MUIM_Action_Cls_Scan
);
3171 DoMethod(data
->clslistobj
, MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
,
3172 obj
, 1, MUIM_Action_Cls_Configure
);
3174 DoMethod(data
->cfgtaskpriobj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
3175 obj
, 1, MUIM_Action_Cfg_Changed
);
3176 DoMethod(data
->cfgbootdelayobj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
3177 obj
, 1, MUIM_Action_Cfg_Changed
);
3178 DoMethod(data
->cfgloginfoobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3179 obj
, 1, MUIM_Action_Cfg_Changed
);
3180 DoMethod(data
->cfglogwarnobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3181 obj
, 1, MUIM_Action_Cfg_Changed
);
3182 DoMethod(data
->cfglogerrobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3183 obj
, 1, MUIM_Action_Cfg_Changed
);
3184 DoMethod(data
->cfglogfailobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3185 obj
, 1, MUIM_Action_Cfg_Changed
);
3187 DoMethod(data
->cfgpopupnewobj
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
3188 obj
, 1, MUIM_Action_Cfg_Changed
);
3189 DoMethod(data
->cfgpopupgoneobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3190 obj
, 1, MUIM_Action_Cfg_Changed
);
3191 DoMethod(data
->cfgpopupdeathobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3192 obj
, 1, MUIM_Action_Cfg_Changed
);
3193 DoMethod(data
->cfgpopupdelayobj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
3194 obj
, 1, MUIM_Action_Cfg_Changed
);
3195 DoMethod(data
->cfgpopupactivateobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3196 obj
, 1, MUIM_Action_Cfg_Changed
);
3197 DoMethod(data
->cfgpopuptofrontobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3198 obj
, 1, MUIM_Action_Cfg_Changed
);
3199 DoMethod(data
->cfgdevdtxsoundobj
, MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
3200 obj
, 1, MUIM_Action_Cfg_Snd_Changed
);
3201 DoMethod(data
->cfgdevremsoundobj
, MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
3202 obj
, 1, MUIM_Action_Cfg_Snd_Changed
);
3204 DoMethod(data
->cfgautolpobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3205 obj
, 1, MUIM_Action_Cfg_Changed
);
3206 DoMethod(data
->cfgautodeadobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3207 obj
, 1, MUIM_Action_Cfg_Changed
);
3208 DoMethod(data
->cfgautopcobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3209 obj
, 1, MUIM_Action_Cfg_Changed
);
3211 DoMethod(data
->cfgpowersavingobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3212 obj
, 1, MUIM_Action_Cfg_Changed
);
3213 DoMethod(data
->cfgforcesuspendobj
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
3214 obj
, 1, MUIM_Action_Cfg_Changed
);
3215 DoMethod(data
->cfgsuspendtimeoutobj
, MUIM_Notify
, MUIA_Numeric_Value
, MUIV_EveryTime
,
3216 obj
, 1, MUIM_Action_Cfg_Changed
);
3218 DoMethod(data
->prefslistobj
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
3219 obj
, 1, MUIM_Action_Cfg_Activate
);
3220 DoMethod(data
->prefssaveasobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3221 obj
, 1, MUIM_Action_SavePrefsAs
);
3222 DoMethod(data
->prefsexportobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3223 obj
, 1, MUIM_Action_Cfg_Export
);
3224 DoMethod(data
->prefsimportobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3225 obj
, 1, MUIM_Action_Cfg_Import
);
3226 DoMethod(data
->prefsremoveobj
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
3227 obj
, 1, MUIM_Action_Cfg_Remove
);
3229 data
->mi_classpopup
= CreateClassPopup();
3230 set(data
->devlistobj
, MUIA_ContextMenu
, data
->mi_classpopup
);
3232 Action_HW_Activate(cl
, obj
, msg
);
3234 CreateErrorList(data
);
3235 SetupEventHandler(data
);
3236 while((pd
= psdGetNextDevice(pd
)))
3238 dlnode
= AllocDevEntry(data
, pd
);
3241 DoMethod(data
->devlistobj
, MUIM_List_InsertSingle
, dlnode
, MUIV_List_Insert_Bottom
);
3244 UpdateConfigToGUI(data
);
3249 /* /// "Action_OM_DISPOSE()" */
3250 IPTR
Action_OM_DISPOSE(struct IClass
*cl
, Object
*obj
, Msg msg
)
3252 struct ActionData
*data
= INST_DATA(cl
, obj
);
3253 FreeErrorList(data
);
3254 FreePrefsList(data
);
3256 if(data
->mi_classpopup
)
3258 MUI_DisposeObject(data
->mi_classpopup
);
3259 data
->mi_classpopup
= NULL
;
3261 CleanupEventHandler(data
);
3266 /* /// "Action_Setup()" */
3267 IPTR
Action_Setup(struct IClass
*cl
, Object
*obj
, Msg msg
)
3269 struct ActionData
*data
= INST_DATA(cl
, obj
);
3271 data
->appobj
= _app(obj
);
3272 data
->winobj
= _win(obj
);
3273 if(!DoSuperMethodA(cl
,obj
,msg
)) return(FALSE
);
3275 data
->eventihn
.ihn_Object
= obj
;
3276 data
->eventihn
.ihn_Signals
= 1UL<<data
->eventmsgport
->mp_SigBit
;
3277 data
->eventihn
.ihn_Flags
= 0;
3278 data
->eventihn
.ihn_Method
= MUIM_Action_HandlePsdEvents
;
3279 DoMethod(data
->appobj
, MUIM_Application_AddInputHandler
, &data
->eventihn
);
3280 //MUI_RequestIDCMP(obj, IDCMP_INTUITICKS);
3285 /* /// "Action_HW_New()" */
3286 IPTR
Action_HW_New(struct IClass
*cl
, Object
*obj
, Msg msg
)
3288 struct ActionData
*data
= INST_DATA(cl
, obj
);
3289 struct HWListEntry
*hlnode
;
3290 hlnode
= AllocHWEntry(data
, NULL
);
3293 hlnode
->devname
= psdCopyStr("DEVS:USBHardware/");
3294 DoMethod(data
->hwlistobj
, MUIM_List_InsertSingle
, hlnode
, MUIV_List_Insert_Bottom
);
3295 set(data
->hwlistobj
, MUIA_List_Active
, MUIV_List_Active_Bottom
);
3296 DoMethod(data
->hwdevaslobj
, MUIM_Popstring_Open
);
3297 InternalCreateConfigGUI(data
);
3303 /* /// "Action_HW_Copy()" */
3304 IPTR
Action_HW_Copy(struct IClass
*cl
, Object
*obj
, Msg msg
)
3306 struct ActionData
*data
= INST_DATA(cl
, obj
);
3307 struct HWListEntry
*hlnode
;
3310 hlnode
= AllocHWEntry(data
, NULL
);
3313 hlnode
->devname
= psdCopyStr(data
->acthlnode
->devname
);
3314 hlnode
->unit
= data
->acthlnode
->unit
+ 1;
3315 DoMethod(data
->hwlistobj
, MUIM_List_InsertSingle
, hlnode
, MUIV_List_Insert_Bottom
);
3316 set(data
->hwlistobj
, MUIA_List_Active
, MUIV_List_Active_Bottom
);
3317 InternalCreateConfigGUI(data
);
3324 /* /// "Action_HW_Del()" */
3325 IPTR
Action_HW_Del(struct IClass
*cl
, Object
*obj
, Msg msg
)
3327 struct ActionData
*data
= INST_DATA(cl
, obj
);
3328 struct HWListEntry
*hlnode
;
3331 hlnode
= data
->acthlnode
;
3332 DoMethod(data
->hwlistobj
, MUIM_List_Remove
, MUIV_List_Remove_Active
);
3333 FreeHWEntry(data
, hlnode
);
3334 InternalCreateConfigGUI(data
);
3340 /* /// "Action_HW_Update()" */
3341 IPTR
Action_HW_Update(struct IClass
*cl
, Object
*obj
, Msg msg
)
3343 struct ActionData
*data
= INST_DATA(cl
, obj
);
3344 struct HWListEntry
*hlnode
;
3345 hlnode
= (struct HWListEntry
*) ((struct opSet
*) msg
)->ops_AttrList
;
3348 hlnode
= data
->acthlnode
;
3353 psdFreeVec(hlnode
->devname
);
3354 get(data
->hwdevobj
, MUIA_String_Contents
, &str
);
3355 hlnode
->devname
= psdCopyStr(str
);
3356 get(data
->hwunitobj
, MUIA_String_Integer
, &hlnode
->unit
);
3357 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3358 InternalCreateConfigGUI(data
);
3364 /* /// "Action_HW_Activate()" */
3365 IPTR
Action_HW_Activate(struct IClass
*cl
, Object
*obj
, Msg msg
)
3367 struct ActionData
*data
= INST_DATA(cl
, obj
);
3368 struct HWListEntry
*hlnode
;
3371 DoMethod(obj
, MUIM_Action_HW_Update
, data
->acthlnode
);
3373 DoMethod(data
->hwlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &hlnode
);
3374 if((data
->acthlnode
= hlnode
))
3376 set(data
->hwdevgrpobj
, MUIA_Disabled
, FALSE
);
3377 set(data
->hwcopyobj
, MUIA_Disabled
, FALSE
);
3378 set(data
->hwdelobj
, MUIA_Disabled
, FALSE
);
3379 set(data
->hwinfoobj
, MUIA_Disabled
, !hlnode
->phw
);
3380 set(data
->hwofflineobj
, MUIA_Disabled
, !hlnode
->phw
);
3381 set(data
->hwonlineobj
, MUIA_Disabled
, hlnode
->phw
);
3382 set(data
->hwdevobj
, MUIA_String_Contents
, hlnode
->devname
);
3383 set(data
->hwunitobj
, MUIA_String_Integer
, hlnode
->unit
);
3385 set(data
->hwdevgrpobj
, MUIA_Disabled
, TRUE
);
3386 set(data
->hwcopyobj
, MUIA_Disabled
, TRUE
);
3387 set(data
->hwdelobj
, MUIA_Disabled
, TRUE
);
3388 set(data
->hwinfoobj
, MUIA_Disabled
, TRUE
);
3389 set(data
->hwofflineobj
, MUIA_Disabled
, TRUE
);
3390 set(data
->hwonlineobj
, MUIA_Disabled
, TRUE
);
3396 /* /// "Action_HW_Info()" */
3397 IPTR
Action_HW_Info(struct IClass
*cl
, Object
*obj
, Msg msg
)
3399 struct ActionData
*data
= INST_DATA(cl
, obj
);
3400 struct HWListEntry
*hlnode
;
3404 STRPTR devname
= _(MSG_UNKNOWN
);
3405 STRPTR manufacturer
= _(MSG_UNKNOWN
);
3406 STRPTR prodname
= _(MSG_UNKNOWN
);
3407 STRPTR description
= _(MSG_UNKNOWN
);
3408 STRPTR copyright
= _(MSG_UNKNOWN
);
3411 DoMethod(data
->hwlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &hlnode
);
3414 if(hlnode
->infowindow
|| (!hlnode
->phw
))
3418 psdGetAttrs(PGA_HARDWARE
, hlnode
->phw
,
3419 HA_DeviceName
, &devname
,
3420 HA_DeviceUnit
, &unitnr
,
3421 HA_Version
, &version
,
3422 HA_Revision
, &revision
,
3423 HA_ProductName
, &prodname
,
3424 HA_Manufacturer
, &manufacturer
,
3425 HA_Description
, &description
,
3426 HA_Copyright
, ©right
,
3429 textbuf1
= psdCopyStrFmt("%s\n%ld\n%V%ld.%ld\n%s\n%s\n%s\n%s",
3430 devname
, unitnr
, version
, revision
, prodname
,
3431 manufacturer
, description
, copyright
);
3432 hlnode
->infowindow
= WindowObject
,
3433 MUIA_Window_ID
, MAKE_ID('H','I','N','F'),
3434 MUIA_Window_Title
, __(MSG_HARDWARE_WINDOW
),
3435 MUIA_Window_IsSubWindow
, FALSE
,
3436 WindowContents
, HGroup
,
3437 MUIA_ShortHelp
, __(MSG_HARDWARE_WINDOW_HELP
),
3438 MUIA_FrameTitle
, __(MSG_HARDWARE_WINDOW_FRAME
),
3439 Child
, LabelB(__(MSG_HARDWARE_WINDOW_LABEL
)),
3442 MUIA_Background
, MUII_TextBack
,
3443 MUIA_Text_Contents
, textbuf1
,
3447 if(hlnode
->infowindow
)
3449 DoMethod(data
->appobj
, OM_ADDMEMBER
, hlnode
->infowindow
);
3450 DoMethod(hlnode
->infowindow
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
3451 data
->appobj
, 5, MUIM_Application_PushMethod
, obj
, 2, MUIM_Action_CloseSubWinReq
, hlnode
);
3453 set(hlnode
->infowindow
, MUIA_Window_Open
, TRUE
);
3455 psdFreeVec(textbuf1
);
3461 /* /// "Action_HW_Online()" */
3462 IPTR
Action_HW_Online(struct IClass
*cl
, Object
*obj
, Msg msg
)
3464 struct ActionData
*data
= INST_DATA(cl
, obj
);
3465 struct HWListEntry
*hlnode
= data
->acthlnode
;
3466 if((!hlnode
) || hlnode
->phw
)
3471 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3472 if((hlnode
->phw
= psdAddHardware(hlnode
->devname
, hlnode
->unit
)))
3474 psdGetAttrs(PGA_HARDWARE
, hlnode
->phw
,
3475 HA_ProductName
, &hlnode
->prodname
,
3477 #ifdef AROS_USB30_CODE
3478 if(psdEnumerateHardware(hlnode
->phw
) == NULL
) {
3479 psdRemHardware(hlnode
->phw
);
3481 hlnode
->prodname
= NULL
;
3484 psdEnumerateHardware(hlnode
->phw
);
3488 DoMethod(obj
, MUIM_Action_HW_Activate
);
3489 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3491 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3492 // update the online status to the config
3493 InternalCreateConfigGUI(data
);
3498 /* /// "Action_HW_Offline()" */
3499 IPTR
Action_HW_Offline(struct IClass
*cl
, Object
*obj
, Msg msg
)
3501 struct ActionData
*data
= INST_DATA(cl
, obj
);
3502 struct HWListEntry
*hlnode
= data
->acthlnode
;
3506 if((!hlnode
) || (!hlnode
->phw
))
3511 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3513 psdLockWritePBase();
3514 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
3518 if(phw
== hlnode
->phw
)
3521 psdRemHardware(phw
);
3532 hlnode
->prodname
= NULL
;
3534 DoMethod(obj
, MUIM_Action_HW_Activate
);
3535 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3536 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3537 // update the online status to the config
3538 // NOTE! This means that the hardware will not come online on next loading.
3539 InternalCreateConfigGUI(data
);
3544 /* /// "Action_Online()" */
3545 IPTR
Action_Online(struct IClass
*cl
, Object
*obj
, Msg msg
)
3547 struct ActionData
*data
= INST_DATA(cl
, obj
);
3548 struct HWListEntry
*hlnode
;
3549 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3550 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3551 while(hlnode
->node
.ln_Succ
)
3555 if((hlnode
->phw
= psdAddHardware(hlnode
->devname
, hlnode
->unit
)))
3557 psdGetAttrs(PGA_HARDWARE
, hlnode
->phw
,
3558 HA_ProductName
, &hlnode
->prodname
,
3560 psdEnumerateHardware(hlnode
->phw
);
3563 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3565 DoMethod(obj
, MUIM_Action_HW_Activate
);
3566 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3568 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3569 // update the online status to the config
3570 InternalCreateConfigGUI(data
);
3575 /* /// "Action_Offline()" */
3576 IPTR
Action_Offline(struct IClass
*cl
, Object
*obj
, Msg msg
)
3578 struct ActionData
*data
= INST_DATA(cl
, obj
);
3579 struct HWListEntry
*hlnode
;
3580 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3581 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3582 while(hlnode
->node
.ln_Succ
)
3588 psdLockWritePBase();
3589 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
3593 if(phw
== hlnode
->phw
)
3596 psdRemHardware(phw
);
3607 hlnode
->prodname
= NULL
;
3609 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3611 DoMethod(obj
, MUIM_Action_HW_Activate
);
3612 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3613 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3614 // update the online status to the config
3615 // NOTE! This means that the hardware will not come online on next loading.
3616 InternalCreateConfigGUI(data
);
3621 /* /// "Action_Restart()" */
3622 IPTR
Action_Restart(struct IClass
*cl
, Object
*obj
, Msg msg
)
3624 struct ActionData
*data
= INST_DATA(cl
, obj
);
3625 struct HWListEntry
*hlnode
;
3626 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3627 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3628 while(hlnode
->node
.ln_Succ
)
3634 psdLockWritePBase();
3635 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
3639 if(phw
== hlnode
->phw
)
3642 psdRemHardware(phw
);
3653 hlnode
->prodname
= NULL
;
3655 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3657 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3658 while(hlnode
->node
.ln_Succ
)
3662 if((hlnode
->phw
= psdAddHardware(hlnode
->devname
, hlnode
->unit
)))
3664 psdGetAttrs(PGA_HARDWARE
, hlnode
->phw
,
3665 HA_ProductName
, &hlnode
->prodname
,
3667 psdEnumerateHardware(hlnode
->phw
);
3670 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3672 DoMethod(obj
, MUIM_Action_HW_Activate
);
3673 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3675 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3680 /* /// "Action_ChgErrLevel()" */
3681 IPTR
Action_ChgErrLevel(struct IClass
*cl
, Object
*obj
, Msg msg
)
3683 struct ActionData
*data
= INST_DATA(cl
, obj
);
3685 get(data
->errlvlobj
, MUIA_Cycle_Active
, &lev
);
3689 data
->errorlevel
= RETURN_OK
;
3692 data
->errorlevel
= RETURN_WARN
;
3695 data
->errorlevel
= RETURN_ERROR
;
3698 data
->errorlevel
= RETURN_FAIL
;
3701 CreateErrorList(data
);
3706 /* /// "WriteErrorLogFile()" */
3707 void WriteErrorLogFile(BPTR fh
)
3714 struct DateStamp
*ds
;
3716 struct DateStamp currdate
;
3717 UBYTE strdate
[LEN_DATSTRING
];
3718 UBYTE strtime
[LEN_DATSTRING
];
3720 DateStamp(&currdate
);
3722 psdGetAttrs(PGA_STACK
, NULL
, PA_ErrorMsgList
, &lst
, TAG_END
);
3727 psdGetAttrs(PGA_ERRORMSG
, pem
,
3729 EMA_Origin
, &origin
,
3735 dt
.dat_Stamp
.ds_Days
= ds
->ds_Days
;
3736 dt
.dat_Stamp
.ds_Minute
= ds
->ds_Minute
;
3737 dt
.dat_Stamp
.ds_Tick
= ds
->ds_Tick
;
3738 dt
.dat_Format
= FORMAT_DEF
;
3740 dt
.dat_StrDay
= NULL
;
3741 dt
.dat_StrDate
= strdate
;
3742 dt
.dat_StrTime
= strtime
;
3744 if(currdate
.ds_Days
== ds
->ds_Days
)
3746 FPrintf(fh
, "%s| %2ld-%s: %s\n", strtime
, level
, origin
, errstr
);
3748 FPrintf(fh
, "%s %s| %2ld-%s: %s\n", strdate
, strtime
, level
, origin
, errstr
);
3751 FPrintf(fh
, "%2ld-%s: %s\n", level
, origin
, errstr
);
3759 /* /// "Action_SaveErrors()" */
3760 IPTR
Action_SaveErrors(struct IClass
*cl
, Object
*obj
, Msg msg
)
3762 struct FileRequester
*aslreq
;
3764 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "RAM:" },
3765 { ASLFR_InitialFile
, __(MSG_ACTION_SAVE_ERR_FILE
) },
3766 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
3767 { ASLFR_TitleText
, __(MSG_ACTION_SAVE_ERR
) },
3768 { TAG_END
, (IPTR
) NULL
} };
3771 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3773 if(MUI_AslRequest(aslreq
, TAG_END
))
3775 strcpy(path
, aslreq
->fr_Drawer
);
3776 AddPart(path
, aslreq
->fr_File
, 256);
3777 if((fh
= Open(path
, MODE_NEWFILE
)))
3779 WriteErrorLogFile(fh
);
3781 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_ERR_SAVED
), path
);
3783 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_ERR_SAVED_ERRWRITE
), path
);
3785 MUI_FreeAslRequest(aslreq
);
3792 /* /// "Action_FlushErrors()" */
3793 IPTR
Action_FlushErrors(struct IClass
*cl
, Object
*obj
, Msg msg
)
3795 struct ActionData
*data
= INST_DATA(cl
, obj
);
3797 psdGetAttrs(PGA_STACK
, NULL
, PA_ErrorMsgList
, &lst
, TAG_END
);
3799 while(lst
->lh_Head
->ln_Succ
)
3801 psdRemErrorMsg(lst
->lh_Head
);
3804 CreateErrorList(data
);
3809 /* /// "Action_SaveDeviceList()" */
3810 IPTR
Action_SaveDeviceList(struct IClass
*cl
, Object
*obj
, Msg msg
)
3812 struct FileRequester
*aslreq
;
3814 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "RAM:" },
3815 { ASLFR_InitialFile
, __(MSG_ACTION_SAVE_DEV_FILE
) },
3816 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
3817 { ASLFR_TitleText
, __(MSG_ACTION_SAVE_DEV
) },
3818 { TAG_END
, (IPTR
) NULL
} };
3821 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3823 if(MUI_AslRequest(aslreq
, TAG_END
))
3825 strcpy(path
, aslreq
->fr_Drawer
);
3826 AddPart(path
, aslreq
->fr_File
, 256);
3827 if((fh
= Open(path
, MODE_NEWFILE
)))
3829 if(SystemTags("PsdDevLister", SYS_Output
, fh
, TAG_END
))
3831 psdAddErrorMsg(RETURN_ERROR
,_(MSG_APP_TITLE
), _(MSG_ACTION_SAVE_DEV_ERREXE
));
3833 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_DEV_SAVED
), path
);
3837 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_ERR_SAVED_ERRWRITE
), path
);
3839 MUI_FreeAslRequest(aslreq
);
3846 /* /// "Action_LoadPrefs()" */
3847 IPTR
Action_LoadPrefs(struct IClass
*cl
, Object
*obj
, Msg msg
)
3849 //struct ActionData *data = INST_DATA(cl, obj);
3850 struct FileRequester
*aslreq
;
3852 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "ENVARC:Sys" },
3853 { ASLFR_InitialFile
, (IPTR
) "Poseidon.prefs" },
3854 { ASLFR_TitleText
, __(MSG_ACTION_PREFS_LOAD
) },
3855 { TAG_END
, (IPTR
) NULL
} };
3857 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3859 if(MUI_AslRequest(aslreq
, TAG_END
))
3861 strcpy(path
, aslreq
->fr_Drawer
);
3862 AddPart(path
, aslreq
->fr_File
, 256);
3863 if(psdLoadCfgFromDisk(path
))
3865 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_LOADED
), path
);
3866 //UpdateConfigToGUI(data);
3869 MUI_FreeAslRequest(aslreq
);
3875 /* /// "Action_SavePrefsAs()" */
3876 IPTR
Action_SavePrefsAs(struct IClass
*cl
, Object
*obj
, Msg msg
)
3878 struct ActionData
*data
= INST_DATA(cl
, obj
);
3879 struct FileRequester
*aslreq
;
3881 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "ENVARC:Sys" },
3882 { ASLFR_InitialFile
, (IPTR
) "Poseidon.prefs" },
3883 { ASLFR_TitleText
, __(MSG_ACTION_PREFS_SAVEAS
) },
3884 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
3885 { TAG_END
, (IPTR
) NULL
} };
3887 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3889 if(MUI_AslRequest(aslreq
, TAG_END
))
3891 strcpy(path
, aslreq
->fr_Drawer
);
3892 AddPart(path
, aslreq
->fr_File
, 256);
3893 InternalCreateConfigGUI(data
);
3894 if(psdSaveCfgToDisk(path
, FALSE
))
3896 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVED
), path
);
3899 psdGetAttrs(PGA_STACK
, NULL
, PA_CurrConfigHash
, &hash
, TAG_END
);
3900 psdSetAttrs(PGA_STACK
, NULL
, PA_SavedConfigHash
, hash
, TAG_END
);
3903 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVEDERR
), path
);
3905 MUI_FreeAslRequest(aslreq
);
3912 /* /// "Action_SavePrefs()" */
3913 IPTR
Action_SavePrefs(struct IClass
*cl
, Object
*obj
, Msg msg
)
3915 struct ActionData
*data
= INST_DATA(cl
, obj
);
3917 DoMethod(obj
, MUIM_Action_Cfg_Snd_Changed
);
3918 InternalCreateConfigGUI(data
);
3920 if(!psdSaveCfgToDisk(NULL
, FALSE
))
3922 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_NOTSAVED
));
3924 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVEDSUCCESS
));
3931 /* /// "Action_Prefs_Changed()" */
3932 IPTR
Action_Prefs_Changed(struct IClass
*cl
, Object
*obj
, Msg msg
)
3936 DoMethod(obj
, MUIM_Action_Cfg_Snd_Changed
);
3937 psdGetAttrs(PGA_STACK
, NULL
,
3938 PA_CurrConfigHash
, &currhash
,
3939 PA_SavedConfigHash
, &oldhash
,
3941 return((IPTR
) (currhash
!= oldhash
));
3945 /* /// "Action_UseQuit()" */
3946 IPTR
Action_UseQuit(struct IClass
*cl
, Object
*obj
, Msg msg
)
3948 struct ActionData
*data
= INST_DATA(cl
, obj
);
3950 //DoMethod(obj, MUIM_Action_Cfg_Snd_Changed);
3951 DoMethod(obj
, MUIM_Action_Use
);
3952 if(DoMethod(obj
, MUIM_Action_Prefs_Changed
))
3954 res
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_USEQUIT
), _(MSG_ACTION_CONFIGCHANGED
), NULL
);
3961 DoMethod(obj
, MUIM_Action_SavePrefs
);
3964 DoMethod(data
->appobj
, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
3969 /* /// "Action_SaveQuit()" */
3970 IPTR
Action_SaveQuit(struct IClass
*cl
, Object
*obj
, Msg msg
)
3972 struct ActionData
*data
= INST_DATA(cl
, obj
);
3973 DoMethod(obj
, MUIM_Action_Cfg_Snd_Changed
);
3974 DoMethod(obj
, MUIM_Action_Use
);
3975 if(!(psdSaveCfgToDisk(NULL
, FALSE
)))
3977 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_SAVEQUIT
));
3979 DoMethod(data
->appobj
, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
3985 /* /// "Action_LoadPrefsFrom()" */
3986 IPTR
Action_LoadPrefsFrom(struct IClass
*cl
, Object
*obj
, Msg msg
)
3988 //struct ActionData *data = INST_DATA(cl, obj);
3989 STRPTR path
= (STRPTR
) ((struct opSet
*) msg
)->ops_AttrList
;
3990 if(psdLoadCfgFromDisk(path
))
3992 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_LOADED
), path
);
3999 /* /// "Action_SavePrefsTo()" */
4000 IPTR
Action_SavePrefsTo(struct IClass
*cl
, Object
*obj
, Msg msg
)
4002 struct ActionData
*data
= INST_DATA(cl
, obj
);
4003 STRPTR path
= (STRPTR
) ((struct opSet
*) msg
)->ops_AttrList
;
4004 InternalCreateConfigGUI(data
);
4005 if(psdSaveCfgToDisk(path
, FALSE
))
4007 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVED
), path
);
4014 /* /// "Action_Dev_Activate()" */
4015 IPTR
Action_Dev_Activate(struct IClass
*cl
, Object
*obj
, Msg msg
)
4017 struct ActionData
*data
= INST_DATA(cl
, obj
);
4018 struct DevListEntry
*dlnode
;
4021 struct List
*pclist
;
4022 struct List
*piflist
;
4026 IPTR hascfggui
= FALSE
;
4027 IPTR issuspended
= FALSE
;
4028 struct Library
*UsbClsBase
;
4030 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4031 if(CheckDeviceValid(dlnode
))
4033 psdLockReadDevice(dlnode
->pd
);
4034 set(data
->devinfoobj
, MUIA_Disabled
, FALSE
);
4035 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4036 DA_Binding
, &binding
,
4037 DA_BindingClass
, &puc
,
4038 DA_ConfigList
, &pclist
,
4039 DA_IsSuspended
, &issuspended
,
4043 psdGetAttrs(PGA_USBCLASS
, puc
,
4044 UCA_ClassBase
, &UsbClsBase
,
4046 usbGetAttrs(UGA_CLASS
, NULL
,
4047 UCCA_HasBindingCfgGUI
, &hascfggui
,
4050 pc
= pclist
->lh_Head
;
4051 while((!binding
) && pc
->ln_Succ
)
4053 psdGetAttrs(PGA_CONFIG
, pc
,
4054 CA_InterfaceList
, &piflist
,
4056 pif
= piflist
->lh_Head
;
4059 psdGetAttrs(PGA_INTERFACE
, pif
,
4060 IFA_Binding
, &cbind
,
4061 IFA_BindingClass
, &puc
,
4067 if(cbind
&& puc
&& !hascfggui
)
4069 psdGetAttrs(PGA_USBCLASS
, puc
,
4070 UCA_ClassBase
, &UsbClsBase
,
4072 usbGetAttrs(UGA_CLASS
, NULL
,
4073 UCCA_HasBindingCfgGUI
, &hascfggui
,
4080 psdUnlockDevice(dlnode
->pd
);
4081 set(data
->devunbindobj
, MUIA_Disabled
, !binding
);
4082 set(data
->devcfgobj
, MUIA_Disabled
, !hascfggui
);
4083 /*if(dlnode->infowindow) FIXME
4085 DoMethod(obj, MUIM_Action_Dev_If_Activate, dlnode);
4087 set(data
->devsuspendobj
, MUIA_Disabled
, issuspended
);
4088 set(data
->devresumeobj
, MUIA_Disabled
, !issuspended
);
4089 set(data
->devpowercycleobj
, MUIA_Disabled
, FALSE
);
4090 set(data
->devdisableobj
, MUIA_Disabled
, FALSE
);
4091 set(data
->devlistobj
, MUIA_ContextMenu
, data
->mi_classpopup
);
4093 set(data
->devunbindobj
, MUIA_Disabled
, TRUE
);
4094 set(data
->devinfoobj
, MUIA_Disabled
, TRUE
);
4095 set(data
->devcfgobj
, MUIA_Disabled
, TRUE
);
4096 set(data
->devsuspendobj
, MUIA_Disabled
, TRUE
);
4097 set(data
->devresumeobj
, MUIA_Disabled
, TRUE
);
4098 set(data
->devpowercycleobj
, MUIA_Disabled
, TRUE
);
4099 set(data
->devdisableobj
, MUIA_Disabled
, TRUE
);
4100 set(data
->devlistobj
, MUIA_ContextMenu
, NULL
);
4106 /* /// "Action_Dev_Info()" */
4107 IPTR
Action_Dev_Info(struct IClass
*cl
, Object
*obj
, Msg msg
)
4109 struct ActionData
*data
= INST_DATA(cl
, obj
);
4110 struct DevListEntry
*dlnode
;
4112 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4115 if(dlnode
->infowindow
)
4119 dlnode
->infowindow
= NewObject(DevWinClass
->mcc_Class
, 0, MUIA_DevWin_DevEntry
, dlnode
, WindowContents
, VGroup
, End
, TAG_END
);
4120 if(dlnode
->infowindow
)
4122 DoMethod(data
->appobj
, OM_ADDMEMBER
, dlnode
->infowindow
);
4123 DoMethod(dlnode
->infowindow
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
4124 data
->appobj
, 5, MUIM_Application_PushMethod
, obj
, 2, MUIM_Action_CloseSubWinReq
, dlnode
);
4125 set(dlnode
->infowindow
, MUIA_Window_Open
, TRUE
);
4132 /* /// "Action_Dev_Bind()" */
4133 IPTR
Action_Dev_Bind(struct IClass
*cl
, Object
*obj
, Msg msg
)
4135 struct ActionData
*data
= INST_DATA(cl
, obj
);
4137 DoMethod(obj
, MUIM_Action_Dev_Activate
);
4138 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4143 /* /// "Action_Dev_Unbind()" */
4144 IPTR
Action_Dev_Unbind(struct IClass
*cl
, Object
*obj
, Msg msg
)
4146 struct ActionData
*data
= INST_DATA(cl
, obj
);
4147 struct DevListEntry
*dlnode
;
4149 struct List
*pclist
;
4150 struct List
*piflist
;
4154 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4155 if(CheckDeviceValid(dlnode
))
4157 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4158 DA_Binding
, &binding
,
4159 DA_ConfigList
, &pclist
,
4163 psdReleaseDevBinding(dlnode
->pd
);
4165 pc
= pclist
->lh_Head
;
4168 psdGetAttrs(PGA_CONFIG
, pc
,
4169 CA_InterfaceList
, &piflist
,
4171 pif
= piflist
->lh_Head
;
4174 psdGetAttrs(PGA_INTERFACE
, pif
,
4175 IFA_Binding
, &binding
,
4179 psdReleaseIfBinding(pif
);
4186 set(data
->devunbindobj
, MUIA_Disabled
, TRUE
);
4187 set(data
->devcfgobj
, MUIA_Disabled
, TRUE
);
4188 /*if(dlnode->infowindow) FIXME
4190 DoMethod(obj, MUIM_Action_Dev_If_Activate, dlnode);
4191 DoMethod(dlnode->iflvobj, MUIM_List_Redraw, MUIV_List_Redraw_All);
4194 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4199 /* /// "Action_Dev_Suspend()" */
4200 IPTR
Action_Dev_Suspend(struct IClass
*cl
, Object
*obj
, Msg msg
)
4202 struct ActionData
*data
= INST_DATA(cl
, obj
);
4203 struct DevListEntry
*dlnode
;
4205 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4206 if(CheckDeviceValid(dlnode
))
4208 psdSuspendDevice(dlnode
->pd
);
4210 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4215 /* /// "Action_Dev_Resume()" */
4216 IPTR
Action_Dev_Resume(struct IClass
*cl
, Object
*obj
, Msg msg
)
4218 struct ActionData
*data
= INST_DATA(cl
, obj
);
4219 struct DevListEntry
*dlnode
;
4221 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4222 if(CheckDeviceValid(dlnode
))
4224 psdResumeDevice(dlnode
->pd
);
4226 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4231 /* /// "Action_Dev_PowerCycle()" */
4232 IPTR
Action_Dev_PowerCycle(struct IClass
*cl
, Object
*obj
, Msg msg
)
4234 struct ActionData
*data
= INST_DATA(cl
, obj
);
4235 struct DevListEntry
*dlnode
;
4237 struct Node
*hubpd
= NULL
;
4238 struct Node
*puc
= NULL
;
4239 struct Library
*UsbClsBase
;
4241 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4242 if(CheckDeviceValid(dlnode
))
4244 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4245 DA_HubDevice
, &hubpd
,
4246 DA_AtHubPortNumber
, &hubport
,
4250 psdGetAttrs(PGA_DEVICE
, hubpd
,
4251 DA_BindingClass
, &puc
,
4256 psdGetAttrs(PGA_USBCLASS
, puc
,
4257 UCA_ClassBase
, &UsbClsBase
,
4259 usbDoMethod(UCM_HubPowerCyclePort
, hubpd
, hubport
);
4262 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4267 /* /// "Action_Dev_Disable()" */
4268 IPTR
Action_Dev_Disable(struct IClass
*cl
, Object
*obj
, Msg msg
)
4270 struct ActionData
*data
= INST_DATA(cl
, obj
);
4271 struct DevListEntry
*dlnode
;
4273 struct Node
*hubpd
= NULL
;
4274 struct Node
*puc
= NULL
;
4275 struct Library
*UsbClsBase
;
4277 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4278 if(CheckDeviceValid(dlnode
))
4280 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4281 DA_HubDevice
, &hubpd
,
4282 DA_AtHubPortNumber
, &hubport
,
4286 psdGetAttrs(PGA_DEVICE
, hubpd
,
4287 DA_BindingClass
, &puc
,
4292 psdGetAttrs(PGA_USBCLASS
, puc
,
4293 UCA_ClassBase
, &UsbClsBase
,
4295 usbDoMethod(UCM_HubDisablePort
, hubpd
, hubport
);
4299 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4304 /* /// "Action_Dev_Configure()" */
4305 IPTR
Action_Dev_Configure(struct IClass
*cl
, Object
*obj
, Msg msg
)
4307 struct ActionData
*data
= INST_DATA(cl
, obj
);
4308 struct DevListEntry
*dlnode
;
4310 struct List
*pclist
;
4311 struct List
*piflist
;
4315 struct Library
*UsbClsBase
;
4317 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4318 if(CheckDeviceValid(dlnode
))
4320 psdLockReadDevice(dlnode
->pd
);
4321 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4322 DA_Binding
, &binding
,
4323 DA_BindingClass
, &puc
,
4324 DA_ConfigList
, &pclist
,
4329 psdGetAttrs(PGA_USBCLASS
, puc
,
4330 UCA_ClassBase
, &UsbClsBase
,
4333 if(binding
&& UsbClsBase
)
4335 usbDoMethod(UCM_OpenBindingCfgWindow
, binding
);
4337 pc
= pclist
->lh_Head
;
4340 psdGetAttrs(PGA_CONFIG
, pc
,
4341 CA_InterfaceList
, &piflist
,
4343 pif
= piflist
->lh_Head
;
4346 psdGetAttrs(PGA_INTERFACE
, pif
,
4347 IFA_Binding
, &binding
,
4348 IFA_BindingClass
, &puc
,
4353 psdGetAttrs(PGA_USBCLASS
, puc
,
4354 UCA_ClassBase
, &UsbClsBase
,
4357 if(binding
&& UsbClsBase
)
4359 usbDoMethod(UCM_OpenBindingCfgWindow
, binding
);
4366 psdUnlockDevice(dlnode
->pd
);
4373 /* /// "Action_Dev_ForceBind()" */
4374 IPTR
Action_Dev_ForceBind(struct IClass
*cl
, Object
*obj
, Msg msg
)
4376 struct ActionData
*data
= INST_DATA(cl
, obj
);
4377 struct DevListEntry
*dlnode
;
4378 Object
*mi
= (Object
*) ((IPTR
*) msg
)[1];
4380 STRPTR devid
= NULL
;
4381 STRPTR devname
= NULL
;
4384 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4385 if(CheckDeviceValid(dlnode
))
4387 get(mi
, MUIA_Menuitem_Title
, &name
);
4388 if(!strcmp(name
, _(MSG_ACTION_DEV_FORCEBIND_NONE
)))
4392 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4393 DA_ProductName
, &devname
,
4394 DA_IDString
, &devid
,
4398 clever
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_DEV_FORCE_REQ
),_(MSG_ACTION_DEV_FORCE_REQ_TXT
), NULL
);
4404 if(psdSetForcedBinding(name
, devid
, NULL
))
4408 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_DEV_FORCE
), devname
, name
);
4410 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_DEV_FORCE_REMOVE
), devname
);
4418 /* /// "Action_Cfg_Changed()" */
4419 IPTR
Action_Cfg_Changed(struct IClass
*cl
, Object
*obj
, Msg msg
)
4421 struct ActionData
*data
= INST_DATA(cl
, obj
);
4423 IPTR subtaskpri
= 0;
4430 IPTR popupdeath
= 0;
4431 IPTR popupdelay
= 0;
4432 IPTR popupactivate
= 0;
4433 IPTR popuptofront
= 0;
4434 IPTR autodisablelp
= 0;
4435 IPTR autodisabledead
= 0;
4436 IPTR autorestartdead
= 0;
4437 IPTR powersaving
= 0;
4438 IPTR forcesuspend
= 0;
4439 IPTR suspendtimeout
= 0;
4440 APTR stackcfg
= NULL
;
4442 psdGetAttrs(PGA_STACK
, NULL
, PA_GlobalConfig
, &stackcfg
, TAG_END
);
4443 get(data
->cfgtaskpriobj
, MUIA_Numeric_Value
, &subtaskpri
);
4444 get(data
->cfgbootdelayobj
, MUIA_Numeric_Value
, &bootdelay
);
4445 get(data
->cfgloginfoobj
, MUIA_Selected
, &loginfo
);
4446 get(data
->cfglogwarnobj
, MUIA_Selected
, &logwarn
);
4447 get(data
->cfglogerrobj
, MUIA_Selected
, &logerr
);
4448 get(data
->cfglogfailobj
, MUIA_Selected
, &logfail
);
4449 get(data
->cfgpopupnewobj
, MUIA_Cycle_Active
, &popupnew
);
4450 get(data
->cfgpopupgoneobj
, MUIA_Selected
, &popupgone
);
4451 get(data
->cfgpopupdeathobj
, MUIA_Selected
, &popupdeath
);
4452 get(data
->cfgpopupdelayobj
, MUIA_Numeric_Value
, &popupdelay
);
4453 get(data
->cfgpopupactivateobj
, MUIA_Selected
, &popupactivate
);
4454 get(data
->cfgpopuptofrontobj
, MUIA_Selected
, &popuptofront
);
4455 get(data
->cfgautolpobj
, MUIA_Selected
, &autodisablelp
);
4456 get(data
->cfgautodeadobj
, MUIA_Selected
, &autodisabledead
);
4457 get(data
->cfgautopcobj
, MUIA_Selected
, &autorestartdead
);
4458 get(data
->cfgpowersavingobj
, MUIA_Selected
, &powersaving
);
4459 get(data
->cfgforcesuspendobj
, MUIA_Selected
, &forcesuspend
);
4460 get(data
->cfgsuspendtimeoutobj
, MUIA_Numeric_Value
, &suspendtimeout
);
4462 if(autorestartdead
&& autodisabledead
)
4464 autodisabledead
= FALSE
;
4465 nnset(data
->cfgautodeadobj
, MUIA_Selected
, FALSE
);
4469 nnset(data
->cfgautodeadobj
, MUIA_Disabled
, TRUE
);
4471 nnset(data
->cfgautodeadobj
, MUIA_Disabled
, FALSE
);
4475 psdSetAttrs(PGA_STACKCFG
, stackcfg
,
4476 GCA_SubTaskPri
, subtaskpri
,
4477 GCA_BootDelay
, bootdelay
,
4478 GCA_LogInfo
, loginfo
,
4479 GCA_LogWarning
, logwarn
,
4480 GCA_LogError
, logerr
,
4481 GCA_LogFailure
, logfail
,
4482 GCA_PopupDeviceNew
, popupnew
,
4483 GCA_PopupDeviceGone
, popupgone
,
4484 GCA_PopupDeviceDeath
, popupdeath
,
4485 GCA_PopupCloseDelay
, popupdelay
,
4486 GCA_PopupActivateWin
, popupactivate
,
4487 GCA_PopupWinToFront
, popuptofront
,
4488 GCA_AutoDisableLP
, autodisablelp
,
4489 GCA_AutoDisableDead
, autodisabledead
,
4490 GCA_AutoRestartDead
, autorestartdead
,
4491 GCA_PowerSaving
, powersaving
,
4492 GCA_ForceSuspend
, forcesuspend
,
4493 GCA_SuspendTimeout
, suspendtimeout
,
4500 /* /// "Action_Cfg_Snd_Changed()" */
4501 IPTR
Action_Cfg_Snd_Changed(struct IClass
*cl
, Object
*obj
, Msg msg
)
4503 struct ActionData
*data
= INST_DATA(cl
, obj
);
4504 STRPTR dtxsndfile
= "";
4505 STRPTR remsndfile
= "";
4506 APTR stackcfg
= NULL
;
4508 psdGetAttrs(PGA_STACK
, NULL
, PA_GlobalConfig
, &stackcfg
, TAG_END
);
4509 get(data
->cfgdevdtxsoundobj
, MUIA_String_Contents
, &dtxsndfile
);
4510 get(data
->cfgdevremsoundobj
, MUIA_String_Contents
, &remsndfile
);
4513 psdSetAttrs(PGA_STACKCFG
, stackcfg
,
4514 GCA_InsertionSound
, dtxsndfile
,
4515 GCA_RemovalSound
, remsndfile
,
4522 /* /// "Action_Cls_Activate()" */
4523 IPTR
Action_Cls_Activate(struct IClass
*cl
, Object
*obj
, Msg msg
)
4525 struct ActionData
*data
= INST_DATA(cl
, obj
);
4526 struct ClsListEntry
*clnode
;
4527 DoMethod(data
->clslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &clnode
);
4532 IPTR hascfggui
= FALSE
;
4533 struct Library
*UsbClsBase
;
4535 set(data
->clsremobj
, MUIA_Disabled
, FALSE
);
4538 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
4542 if(puc
== clnode
->puc
)
4544 psdGetAttrs(PGA_USBCLASS
, clnode
->puc
,
4545 UCA_ClassBase
, &UsbClsBase
,
4547 usbGetAttrs(UGA_CLASS
, NULL
,
4548 UCCA_HasClassCfgGUI
, &hascfggui
,
4550 set(data
->clscfgobj
, MUIA_Disabled
, !hascfggui
);
4557 set(data
->clsremobj
, MUIA_Disabled
, TRUE
);
4558 set(data
->clscfgobj
, MUIA_Disabled
, TRUE
);
4564 /* /// "Action_Cls_Add()" */
4565 IPTR
Action_Cls_Add(struct IClass
*cl
, Object
*obj
, Msg msg
)
4567 struct ActionData
*data
= INST_DATA(cl
, obj
);
4568 STRPTR clsname
= "";
4569 get(data
->clsnameobj
, MUIA_String_Contents
, &clsname
);
4570 psdAddClass(clsname
, 0);
4571 InternalCreateConfigGUI(data
);
4576 /* /// "Action_Cls_Remove()" */
4577 IPTR
Action_Cls_Remove(struct IClass
*cl
, Object
*obj
, Msg msg
)
4579 struct ActionData
*data
= INST_DATA(cl
, obj
);
4580 struct ClsListEntry
*clnode
;
4581 DoMethod(data
->clslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &clnode
);
4587 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
4591 if(puc
== clnode
->puc
)
4594 DoMethod(data
->clslistobj
, MUIM_List_Remove
, MUIV_List_Remove_Active
);
4595 FreeClsEntry(data
, clnode
);
4608 InternalCreateConfigGUI(data
);
4613 /* /// "Action_Cls_Scan()" */
4614 IPTR
Action_Cls_Scan(struct IClass
*cl
, Object
*obj
, Msg msg
)
4616 struct ActionData
*data
= INST_DATA(cl
, obj
);
4617 struct ExAllControl
*exall
;
4619 struct ExAllData
*exdata
;
4621 struct List
*puclist
;
4626 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &puclist
, TAG_END
);
4627 if((exall
= AllocDosObject(DOS_EXALLCONTROL
, NULL
)))
4629 if((lock
= Lock(CLASSPATH
, ACCESS_READ
)))
4631 exall
->eac_LastKey
= 0;
4632 exall
->eac_MatchString
= NULL
;
4633 exall
->eac_MatchFunc
= NULL
;
4636 exready
= ExAll(lock
, (struct ExAllData
*) buf
, 1024, ED_NAME
, exall
);
4637 exdata
= (struct ExAllData
*) buf
;
4638 ents
= exall
->eac_Entries
;
4641 psdSafeRawDoFmt(sbuf
, 128, CLASSPATH
"/%s", exdata
->ed_Name
);
4643 if(!FindName(puclist
, exdata
->ed_Name
))
4645 psdAddClass(sbuf
, 0);
4647 exdata
= exdata
->ed_Next
;
4651 InternalCreateConfigGUI(data
);
4654 /*errmsg = "Could not lock on SYS:Classes/USB.\n";*/
4656 FreeDosObject(DOS_EXALLCONTROL
, exall
);
4662 /* /// "Action_Cls_Configure()" */
4663 IPTR
Action_Cls_Configure(struct IClass
*cl
, Object
*obj
, Msg msg
)
4665 struct ActionData
*data
= INST_DATA(cl
, obj
);
4666 struct ClsListEntry
*clnode
;
4667 DoMethod(data
->clslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &clnode
);
4672 struct Library
*UsbClsBase
;
4675 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
4679 if(puc
== clnode
->puc
)
4681 psdGetAttrs(PGA_USBCLASS
, clnode
->puc
,
4682 UCA_ClassBase
, &UsbClsBase
,
4684 usbDoMethod(UCM_OpenCfgWindow
);
4697 /* /// "Action_Info_MemPool()" */
4698 IPTR
Action_Info_MemPool(struct IClass
*cl
, Object
*obj
, Msg msg
)
4700 struct ActionData
*data
= INST_DATA(cl
, obj
);
4703 psdGetAttrs(PGA_STACK
, NULL
, PA_MemPoolUsage
, &mem
, TAG_END
);
4704 psdSafeRawDoFmt(buf
, 32, _(MSG_ACTION_MEMPOOL_FORMAT
), (mem
+512)>>10);
4705 set(data
->mempoolobj
, MUIA_Text_Contents
, buf
);
4710 /* /// "Action_Cfg_Activate()" */
4711 IPTR
Action_Cfg_Activate(struct IClass
*cl
, Object
*obj
, Msg msg
)
4713 struct ActionData
*data
= INST_DATA(cl
, obj
);
4714 struct PrefsListEntry
*plnode
;
4715 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
4718 BOOL noexport
= FALSE
;
4719 switch(plnode
->chunkid
)
4721 case IFFCHNK_FORCEDBIND
:
4722 case MAKE_ID('P','S','D','L'):
4726 set(data
->prefsremoveobj
, MUIA_Disabled
, plnode
->chunkid
== IFFFORM_STACKCFG
);
4727 set(data
->prefsexportobj
, MUIA_Disabled
, noexport
);
4729 set(data
->prefsremoveobj
, MUIA_Disabled
, TRUE
);
4730 set(data
->prefsexportobj
, MUIA_Disabled
, TRUE
);
4736 /* /// "Action_Cfg_Remove()" */
4737 IPTR
Action_Cfg_Remove(struct IClass
*cl
, Object
*obj
, Msg msg
)
4739 struct ActionData
*data
= INST_DATA(cl
, obj
);
4740 struct PrefsListEntry
*plnode
;
4741 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
4746 switch(plnode
->chunkid
)
4748 case IFFFORM_STACKCFG
:
4751 case IFFFORM_DEVICECFG
:
4752 result
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_HELP
), &plnode
->devid
);
4755 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4758 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4763 pic
= psdNextCfgForm(pic
);
4768 case IFFFORM_CLASSCFG
:
4769 result
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_DEFAULT
), &plnode
->owner
);
4772 pic
= psdFindCfgForm(NULL
, IFFFORM_CLASSCFG
);
4775 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4780 pic
= psdNextCfgForm(pic
);
4785 case IFFFORM_DEVCFGDATA
:
4786 result
= MUI_Request(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_CLASS
), plnode
->owner
, plnode
->devid
);
4789 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4792 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4794 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4797 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4802 pic
= psdNextCfgForm(pic
);
4806 pic
= psdNextCfgForm(pic
);
4811 case IFFFORM_IFCFGDATA
:
4812 result
= MUI_Request(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_CLASS_DEF
),
4813 plnode
->owner
, plnode
->ifid
, plnode
->devid
);
4816 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4819 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4821 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4824 if(psdMatchStringChunk(pic
, IFFCHNK_IFID
, plnode
->ifid
))
4826 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4832 pic
= psdNextCfgForm(pic
);
4836 pic
= psdNextCfgForm(pic
);
4841 case IFFCHNK_FORCEDBIND
:
4842 psdSetForcedBinding(NULL
, plnode
->devid
, plnode
->ifid
);
4848 result
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_UNKNOWN
), NULL
);
4851 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4865 /* /// "Action_Cfg_Export()" */
4866 IPTR
Action_Cfg_Export(struct IClass
*cl
, Object
*obj
, Msg msg
)
4868 struct ActionData
*data
= INST_DATA(cl
, obj
);
4869 struct PrefsListEntry
*plnode
;
4870 struct FileRequester
*aslreq
;
4872 struct TagItem asltags
[] = { { ASLFR_InitialFile
, __(MSG_ACTION_CFG_PREFS_FILE
) },
4873 { ASLFR_InitialDrawer
, (IPTR
) "SYS:Prefs/Presets/Poseidon" },
4874 { ASLFR_TitleText
, __(MSG_ACTION_CFG_EXPORT
) },
4875 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
4876 { TAG_END
, (IPTR
) NULL
} };
4880 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
4884 switch(plnode
->chunkid
)
4886 case IFFFORM_STACKCFG
:
4887 asltags
[0].ti_Data
= __(MSG_ACTION_STACKCFG_FILE
);
4888 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4891 case IFFFORM_DEVICECFG
:
4892 asltags
[0].ti_Data
= __(MSG_ACTION_DEVICECFG_FILE
);
4893 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4896 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4900 pic
= psdNextCfgForm(pic
);
4904 case IFFFORM_CLASSCFG
:
4905 asltags
[0].ti_Data
= __(MSG_ACTION_CLASSCFG_FILE
);
4906 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4909 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4913 pic
= psdNextCfgForm(pic
);
4917 case IFFFORM_DEVCFGDATA
:
4918 asltags
[0].ti_Data
= __(MSG_ACTION_DEVCFGDATA_FILE
);
4919 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4922 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4924 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4927 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4931 pic
= psdNextCfgForm(pic
);
4935 pic
= psdNextCfgForm(pic
);
4939 case IFFFORM_IFCFGDATA
:
4940 asltags
[0].ti_Data
= __(MSG_ACTION_IFCFGDATA_FILE
);
4941 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4944 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4946 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4949 if(psdMatchStringChunk(pic
, IFFCHNK_IFID
, plnode
->ifid
))
4951 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4956 pic
= psdNextCfgForm(pic
);
4960 pic
= psdNextCfgForm(pic
);
4964 case IFFCHNK_FORCEDBIND
:
4970 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4978 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
4980 if(MUI_AslRequest(aslreq
, TAG_END
))
4982 strcpy(path
, aslreq
->fr_Drawer
);
4983 AddPart(path
, aslreq
->fr_File
, 256);
4984 fh
= Open(path
, MODE_NEWFILE
);
4987 form
= psdWriteCfg(pic
);
4990 Write(fh
, form
, form
[1]+8);
4995 psdAddErrorMsg(RETURN_FAIL
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFG_FAIL
), path
);
4998 MUI_FreeAslRequest(aslreq
);
5006 /* /// "Action_Cfg_Import()" */
5007 IPTR
Action_Cfg_Import(struct IClass
*cl
, Object
*obj
, Msg msg
)
5009 struct ActionData
*data
= INST_DATA(cl
, obj
);
5010 struct PrefsListEntry
*plnode
;
5011 struct FileRequester
*aslreq
;
5018 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "SYS:Prefs/Presets/Poseidon" },
5019 { ASLFR_TitleText
, __(MSG_ACTION_CFG_IMPORT
) },
5020 { TAG_END
, (IPTR
) NULL
} };
5022 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
5024 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
5026 if(MUI_AslRequest(aslreq
, TAG_END
))
5028 strcpy(path
, aslreq
->fr_Drawer
);
5029 AddPart(path
, aslreq
->fr_File
, 256);
5030 fh
= Open(path
, MODE_OLDFILE
);
5033 Read(fh
, iffhead
, 12);
5034 if(AROS_LONG2BE(iffhead
[0]) == ID_FORM
)
5036 buff
= psdAllocVec(AROS_LONG2BE(iffhead
[1])+8);
5039 buff
[0] = iffhead
[0];
5040 buff
[1] = iffhead
[1];
5041 buff
[2] = iffhead
[2];
5042 if(Read(fh
, &buff
[3], AROS_LONG2BE(iffhead
[1])-4) == AROS_LONG2BE(iffhead
[1])-4)
5046 case IFFFORM_STACKCFG
:
5047 pic
= psdFindCfgForm(NULL
, AROS_LONG2BE(buff
[2]));
5050 psdReadCfg(pic
, buff
);
5052 psdAddCfgEntry(NULL
, buff
);
5056 case IFFFORM_DEVICECFG
:
5057 case IFFFORM_CLASSCFG
:
5058 psdAddCfgEntry(NULL
, buff
);
5061 case IFFFORM_DEVCFGDATA
:
5062 case IFFFORM_IFCFGDATA
:
5065 if((plnode
->chunkid
== AROS_LONG2BE(buff
[2])) ||
5066 (plnode
->chunkid
== IFFFORM_DEVICECFG
) ||
5067 (plnode
->chunkid
== IFFFORM_IFCFGDATA
))
5069 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
5072 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
5074 psdAddCfgEntry(pic
, buff
);
5077 pic
= psdNextCfgForm(pic
);
5082 MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFGDATA_OOPS
),_(MSG_ACTION_CFGDATA_OOPS_HELP
), NULL
);
5085 case IFFFORM_PSDCFG
:
5086 psdLoadCfgFromDisk(path
);
5090 MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFGDATA_OOPS
),_(MSG_ACTION_CFGDATA_ERR
), NULL
);
5094 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_READ
), path
);
5098 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_ALLOC
), path
);
5101 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_IFF
), path
);
5105 psdAddErrorMsg(RETURN_FAIL
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_OPEN
), path
);
5108 MUI_FreeAslRequest(aslreq
);
5114 /* /// "ActionDispatcher()" */
5115 AROS_UFH3(IPTR
, ActionDispatcher
,
5116 AROS_UFHA(struct IClass
*, cl
, A0
),
5117 AROS_UFHA(Object
*, obj
, A2
),
5118 AROS_UFHA(Msg
, msg
, A1
))
5121 // There should never be an uninitialized pointer, but just in case, try to get an mungwall hit if so.
5122 struct ActionData
*data
= (struct ActionData
*) 0xABADCAFE;
5124 // on OM_NEW the obj pointer will be void, so don't try to get the data base in this case.
5125 if(msg
->MethodID
!= OM_NEW
) data
= INST_DATA(cl
, obj
);
5127 switch(msg
->MethodID
)
5130 return((IPTR
) Action_OM_NEW(cl
, obj
, msg
));
5133 return(Action_Setup(cl
, obj
, msg
));
5136 //MUI_RejectIDCMP(obj, IDCMP_INTUITICKS);
5137 while(data
->OnlUpdTask
)
5141 DoMethod(data
->appobj
, MUIM_Application_RemInputHandler
, &data
->eventihn
);
5142 data
->appobj
= NULL
;
5143 data
->winobj
= NULL
;
5144 return(DoSuperMethodA(cl
,obj
,msg
));
5147 Action_OM_DISPOSE(cl
, obj
, msg
);
5150 case MUIM_Action_HandlePsdEvents
:
5154 case MUIM_Action_CloseSubWinReq
:
5156 struct DefListEntry
*winnode
;
5157 winnode
= (struct DefListEntry
*) ((struct opSet
*) msg
)->ops_AttrList
;
5158 if(winnode
->infowindow
)
5160 set(winnode
->infowindow
, MUIA_Window_Open
, FALSE
);
5161 DoMethod(data
->appobj
, OM_REMMEMBER
, winnode
->infowindow
);
5162 DoMethod(winnode
->infowindow
, OM_DISPOSE
);
5163 winnode
->infowindow
= NULL
;
5168 case MUIM_Action_Cfg_Changed
:
5169 return(Action_Cfg_Changed(cl
, obj
, msg
));
5171 case MUIM_Action_Cfg_Snd_Changed
:
5172 return(Action_Cfg_Snd_Changed(cl
, obj
, msg
));
5174 case MUIM_Action_HW_New
:
5175 return(Action_HW_New(cl
, obj
, msg
));
5177 case MUIM_Action_HW_Copy
:
5178 return(Action_HW_Copy(cl
, obj
, msg
));
5180 case MUIM_Action_HW_Del
:
5181 return(Action_HW_Del(cl
, obj
, msg
));
5183 case MUIM_Action_HW_Update
:
5184 return(Action_HW_Update(cl
, obj
, msg
));
5186 case MUIM_Action_HW_Activate
:
5187 return(Action_HW_Activate(cl
, obj
, msg
));
5189 case MUIM_Action_HW_Info
:
5190 return(Action_HW_Info(cl
, obj
, msg
));
5192 case MUIM_Action_HW_Online
:
5193 return(Action_HW_Online(cl
, obj
, msg
));
5195 case MUIM_Action_HW_Offline
:
5196 return(Action_HW_Offline(cl
, obj
, msg
));
5198 case MUIM_Action_Online
:
5199 return(Action_Online(cl
, obj
, msg
));
5201 case MUIM_Action_Offline
:
5202 return(Action_Offline(cl
, obj
, msg
));
5204 case MUIM_Action_Restart
:
5205 return(Action_Restart(cl
, obj
, msg
));
5207 case MUIM_Action_ChgErrLevel
:
5208 return(Action_ChgErrLevel(cl
, obj
, msg
));
5210 case MUIM_Action_SaveErrors
:
5211 return(Action_SaveErrors(cl
, obj
, msg
));
5213 case MUIM_Action_FlushErrors
:
5214 return(Action_FlushErrors(cl
, obj
, msg
));
5216 case MUIM_Action_SaveDeviceList
:
5217 return(Action_SaveDeviceList(cl
, obj
, msg
));
5219 case MUIM_Action_Use
:
5220 InternalCreateConfigGUI(data
);
5221 psdSaveCfgToDisk("ENV:PsdStackloader", TRUE
);
5222 psdSaveCfgToDisk("ENV:Sys/poseidon.prefs", FALSE
);
5225 case MUIM_Action_LoadPrefs
:
5226 return(Action_LoadPrefs(cl
, obj
, msg
));
5228 case MUIM_Action_SavePrefsAs
:
5229 return(Action_SavePrefsAs(cl
, obj
, msg
));
5231 case MUIM_Action_SavePrefs
:
5232 return(Action_SavePrefs(cl
, obj
, msg
));
5234 case MUIM_Action_Prefs_Changed
:
5235 return(Action_Prefs_Changed(cl
, obj
, msg
));
5237 case MUIM_Action_UseQuit
:
5238 return(Action_UseQuit(cl
, obj
, msg
));
5240 case MUIM_Action_SaveQuit
:
5241 return(Action_SaveQuit(cl
, obj
, msg
));
5243 case MUIM_Action_LoadPrefsFrom
:
5244 return(Action_LoadPrefsFrom(cl
, obj
, msg
));
5246 case MUIM_Action_SavePrefsTo
:
5247 return(Action_SavePrefsTo(cl
, obj
, msg
));
5249 case MUIM_Action_Dev_Activate
:
5250 return(Action_Dev_Activate(cl
, obj
, msg
));
5252 case MUIM_Action_Dev_Bind
:
5253 return(Action_Dev_Bind(cl
, obj
, msg
));
5255 case MUIM_Action_Dev_Unbind
:
5256 return(Action_Dev_Unbind(cl
, obj
, msg
));
5258 case MUIM_Action_Dev_Suspend
:
5259 return(Action_Dev_Suspend(cl
, obj
, msg
));
5261 case MUIM_Action_Dev_Resume
:
5262 return(Action_Dev_Resume(cl
, obj
, msg
));
5264 case MUIM_Action_Dev_PowerCycle
:
5265 return(Action_Dev_PowerCycle(cl
, obj
, msg
));
5267 case MUIM_Action_Dev_Disable
:
5268 return(Action_Dev_Disable(cl
, obj
, msg
));
5270 case MUIM_Action_Dev_ForceBind
:
5271 return(Action_Dev_ForceBind(cl
, obj
, msg
));
5273 case MUIM_Action_Dev_Info
:
5274 return(Action_Dev_Info(cl
, obj
, msg
));
5276 case MUIM_Action_Dev_Configure
:
5277 return(Action_Dev_Configure(cl
, obj
, msg
));
5279 case MUIM_Action_Cls_Activate
:
5280 return(Action_Cls_Activate(cl
, obj
, msg
));
5282 case MUIM_Action_Cls_Add
:
5283 return(Action_Cls_Add(cl
, obj
, msg
));
5285 case MUIM_Action_Cls_Remove
:
5286 return(Action_Cls_Remove(cl
, obj
, msg
));
5288 case MUIM_Action_Cls_Scan
:
5289 return(Action_Cls_Scan(cl
, obj
, msg
));
5291 case MUIM_Action_Cls_Configure
:
5292 return(Action_Cls_Configure(cl
, obj
, msg
));
5294 case MUIM_Action_Info_MemPool
:
5295 return(Action_Info_MemPool(cl
, obj
, msg
));
5297 case MUIM_Action_About
:
5298 DoMethod(data
->cfgpagelv
, MUIM_Set
, MUIA_List_Active
, 0);
5301 case MUIM_Action_WakeUp
:
5302 set(data
->appobj
, MUIA_Application_Iconified
, FALSE
);
5303 DoMethod(data
->winobj
, MUIM_Window_ToFront
);
5304 set(data
->winobj
, MUIA_Window_Activate
, TRUE
);
5307 case MUIM_Action_Cfg_Activate
:
5308 return(Action_Cfg_Activate(cl
, obj
, msg
));
5310 case MUIM_Action_Cfg_Remove
:
5311 return(Action_Cfg_Remove(cl
, obj
, msg
));
5313 case MUIM_Action_Cfg_Export
:
5314 return(Action_Cfg_Export(cl
, obj
, msg
));
5316 case MUIM_Action_Cfg_Import
:
5317 return(Action_Cfg_Import(cl
, obj
, msg
));
5320 return(DoSuperMethodA(cl
,obj
,msg
));