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 psdEnumerateHardware(hlnode
->phw
);
3480 DoMethod(obj
, MUIM_Action_HW_Activate
);
3481 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3483 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3484 // update the online status to the config
3485 InternalCreateConfigGUI(data
);
3490 /* /// "Action_HW_Offline()" */
3491 IPTR
Action_HW_Offline(struct IClass
*cl
, Object
*obj
, Msg msg
)
3493 struct ActionData
*data
= INST_DATA(cl
, obj
);
3494 struct HWListEntry
*hlnode
= data
->acthlnode
;
3498 if((!hlnode
) || (!hlnode
->phw
))
3503 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3505 psdLockWritePBase();
3506 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
3510 if(phw
== hlnode
->phw
)
3513 psdRemHardware(phw
);
3524 hlnode
->prodname
= NULL
;
3526 DoMethod(obj
, MUIM_Action_HW_Activate
);
3527 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3528 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3529 // update the online status to the config
3530 // NOTE! This means that the hardware will not come online on next loading.
3531 InternalCreateConfigGUI(data
);
3536 /* /// "Action_Online()" */
3537 IPTR
Action_Online(struct IClass
*cl
, Object
*obj
, Msg msg
)
3539 struct ActionData
*data
= INST_DATA(cl
, obj
);
3540 struct HWListEntry
*hlnode
;
3541 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3542 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3543 while(hlnode
->node
.ln_Succ
)
3547 if((hlnode
->phw
= psdAddHardware(hlnode
->devname
, hlnode
->unit
)))
3549 psdGetAttrs(PGA_HARDWARE
, hlnode
->phw
,
3550 HA_ProductName
, &hlnode
->prodname
,
3552 psdEnumerateHardware(hlnode
->phw
);
3555 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3557 DoMethod(obj
, MUIM_Action_HW_Activate
);
3558 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3560 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3561 // update the online status to the config
3562 InternalCreateConfigGUI(data
);
3567 /* /// "Action_Offline()" */
3568 IPTR
Action_Offline(struct IClass
*cl
, Object
*obj
, Msg msg
)
3570 struct ActionData
*data
= INST_DATA(cl
, obj
);
3571 struct HWListEntry
*hlnode
;
3572 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3573 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3574 while(hlnode
->node
.ln_Succ
)
3580 psdLockWritePBase();
3581 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
3585 if(phw
== hlnode
->phw
)
3588 psdRemHardware(phw
);
3599 hlnode
->prodname
= NULL
;
3601 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3603 DoMethod(obj
, MUIM_Action_HW_Activate
);
3604 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3605 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3606 // update the online status to the config
3607 // NOTE! This means that the hardware will not come online on next loading.
3608 InternalCreateConfigGUI(data
);
3613 /* /// "Action_Restart()" */
3614 IPTR
Action_Restart(struct IClass
*cl
, Object
*obj
, Msg msg
)
3616 struct ActionData
*data
= INST_DATA(cl
, obj
);
3617 struct HWListEntry
*hlnode
;
3618 set(data
->appobj
, MUIA_Application_Sleep
, TRUE
);
3619 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3620 while(hlnode
->node
.ln_Succ
)
3626 psdLockWritePBase();
3627 psdGetAttrs(PGA_STACK
, NULL
, PA_HardwareList
, &lst
, TAG_END
);
3631 if(phw
== hlnode
->phw
)
3634 psdRemHardware(phw
);
3645 hlnode
->prodname
= NULL
;
3647 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3649 hlnode
= (struct HWListEntry
*) data
->hwlist
.lh_Head
;
3650 while(hlnode
->node
.ln_Succ
)
3654 if((hlnode
->phw
= psdAddHardware(hlnode
->devname
, hlnode
->unit
)))
3656 psdGetAttrs(PGA_HARDWARE
, hlnode
->phw
,
3657 HA_ProductName
, &hlnode
->prodname
,
3659 psdEnumerateHardware(hlnode
->phw
);
3662 hlnode
= (struct HWListEntry
*) hlnode
->node
.ln_Succ
;
3664 DoMethod(obj
, MUIM_Action_HW_Activate
);
3665 DoMethod(data
->hwlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
3667 set(data
->appobj
, MUIA_Application_Sleep
, FALSE
);
3672 /* /// "Action_ChgErrLevel()" */
3673 IPTR
Action_ChgErrLevel(struct IClass
*cl
, Object
*obj
, Msg msg
)
3675 struct ActionData
*data
= INST_DATA(cl
, obj
);
3677 get(data
->errlvlobj
, MUIA_Cycle_Active
, &lev
);
3681 data
->errorlevel
= RETURN_OK
;
3684 data
->errorlevel
= RETURN_WARN
;
3687 data
->errorlevel
= RETURN_ERROR
;
3690 data
->errorlevel
= RETURN_FAIL
;
3693 CreateErrorList(data
);
3698 /* /// "WriteErrorLogFile()" */
3699 void WriteErrorLogFile(BPTR fh
)
3706 struct DateStamp
*ds
;
3708 struct DateStamp currdate
;
3709 UBYTE strdate
[LEN_DATSTRING
];
3710 UBYTE strtime
[LEN_DATSTRING
];
3712 DateStamp(&currdate
);
3714 psdGetAttrs(PGA_STACK
, NULL
, PA_ErrorMsgList
, &lst
, TAG_END
);
3719 psdGetAttrs(PGA_ERRORMSG
, pem
,
3721 EMA_Origin
, &origin
,
3727 dt
.dat_Stamp
.ds_Days
= ds
->ds_Days
;
3728 dt
.dat_Stamp
.ds_Minute
= ds
->ds_Minute
;
3729 dt
.dat_Stamp
.ds_Tick
= ds
->ds_Tick
;
3730 dt
.dat_Format
= FORMAT_DEF
;
3732 dt
.dat_StrDay
= NULL
;
3733 dt
.dat_StrDate
= strdate
;
3734 dt
.dat_StrTime
= strtime
;
3736 if(currdate
.ds_Days
== ds
->ds_Days
)
3738 FPrintf(fh
, "%s| %2ld-%s: %s\n", strtime
, level
, origin
, errstr
);
3740 FPrintf(fh
, "%s %s| %2ld-%s: %s\n", strdate
, strtime
, level
, origin
, errstr
);
3743 FPrintf(fh
, "%2ld-%s: %s\n", level
, origin
, errstr
);
3751 /* /// "Action_SaveErrors()" */
3752 IPTR
Action_SaveErrors(struct IClass
*cl
, Object
*obj
, Msg msg
)
3754 struct FileRequester
*aslreq
;
3756 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "RAM:" },
3757 { ASLFR_InitialFile
, __(MSG_ACTION_SAVE_ERR_FILE
) },
3758 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
3759 { ASLFR_TitleText
, __(MSG_ACTION_SAVE_ERR
) },
3760 { TAG_END
, (IPTR
) NULL
} };
3763 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3765 if(MUI_AslRequest(aslreq
, TAG_END
))
3767 strcpy(path
, aslreq
->fr_Drawer
);
3768 AddPart(path
, aslreq
->fr_File
, 256);
3769 if((fh
= Open(path
, MODE_NEWFILE
)))
3771 WriteErrorLogFile(fh
);
3773 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_ERR_SAVED
), path
);
3775 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_ERR_SAVED_ERRWRITE
), path
);
3777 MUI_FreeAslRequest(aslreq
);
3784 /* /// "Action_FlushErrors()" */
3785 IPTR
Action_FlushErrors(struct IClass
*cl
, Object
*obj
, Msg msg
)
3787 struct ActionData
*data
= INST_DATA(cl
, obj
);
3789 psdGetAttrs(PGA_STACK
, NULL
, PA_ErrorMsgList
, &lst
, TAG_END
);
3791 while(lst
->lh_Head
->ln_Succ
)
3793 psdRemErrorMsg(lst
->lh_Head
);
3796 CreateErrorList(data
);
3801 /* /// "Action_SaveDeviceList()" */
3802 IPTR
Action_SaveDeviceList(struct IClass
*cl
, Object
*obj
, Msg msg
)
3804 struct FileRequester
*aslreq
;
3806 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "RAM:" },
3807 { ASLFR_InitialFile
, __(MSG_ACTION_SAVE_DEV_FILE
) },
3808 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
3809 { ASLFR_TitleText
, __(MSG_ACTION_SAVE_DEV
) },
3810 { TAG_END
, (IPTR
) NULL
} };
3813 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3815 if(MUI_AslRequest(aslreq
, TAG_END
))
3817 strcpy(path
, aslreq
->fr_Drawer
);
3818 AddPart(path
, aslreq
->fr_File
, 256);
3819 if((fh
= Open(path
, MODE_NEWFILE
)))
3821 if(SystemTags("PsdDevLister", SYS_Output
, fh
, TAG_END
))
3823 psdAddErrorMsg(RETURN_ERROR
,_(MSG_APP_TITLE
), _(MSG_ACTION_SAVE_DEV_ERREXE
));
3825 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_DEV_SAVED
), path
);
3829 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_ERR_SAVED_ERRWRITE
), path
);
3831 MUI_FreeAslRequest(aslreq
);
3838 /* /// "Action_LoadPrefs()" */
3839 IPTR
Action_LoadPrefs(struct IClass
*cl
, Object
*obj
, Msg msg
)
3841 //struct ActionData *data = INST_DATA(cl, obj);
3842 struct FileRequester
*aslreq
;
3844 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "ENVARC:Sys" },
3845 { ASLFR_InitialFile
, (IPTR
) "Poseidon.prefs" },
3846 { ASLFR_TitleText
, __(MSG_ACTION_PREFS_LOAD
) },
3847 { TAG_END
, (IPTR
) NULL
} };
3849 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3851 if(MUI_AslRequest(aslreq
, TAG_END
))
3853 strcpy(path
, aslreq
->fr_Drawer
);
3854 AddPart(path
, aslreq
->fr_File
, 256);
3855 if(psdLoadCfgFromDisk(path
))
3857 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_LOADED
), path
);
3858 //UpdateConfigToGUI(data);
3861 MUI_FreeAslRequest(aslreq
);
3867 /* /// "Action_SavePrefsAs()" */
3868 IPTR
Action_SavePrefsAs(struct IClass
*cl
, Object
*obj
, Msg msg
)
3870 struct ActionData
*data
= INST_DATA(cl
, obj
);
3871 struct FileRequester
*aslreq
;
3873 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "ENVARC:Sys" },
3874 { ASLFR_InitialFile
, (IPTR
) "Poseidon.prefs" },
3875 { ASLFR_TitleText
, __(MSG_ACTION_PREFS_SAVEAS
) },
3876 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
3877 { TAG_END
, (IPTR
) NULL
} };
3879 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
3881 if(MUI_AslRequest(aslreq
, TAG_END
))
3883 strcpy(path
, aslreq
->fr_Drawer
);
3884 AddPart(path
, aslreq
->fr_File
, 256);
3885 InternalCreateConfigGUI(data
);
3886 if(psdSaveCfgToDisk(path
, FALSE
))
3888 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVED
), path
);
3891 psdGetAttrs(PGA_STACK
, NULL
, PA_CurrConfigHash
, &hash
, TAG_END
);
3892 psdSetAttrs(PGA_STACK
, NULL
, PA_SavedConfigHash
, hash
, TAG_END
);
3895 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVEDERR
), path
);
3897 MUI_FreeAslRequest(aslreq
);
3904 /* /// "Action_SavePrefs()" */
3905 IPTR
Action_SavePrefs(struct IClass
*cl
, Object
*obj
, Msg msg
)
3907 struct ActionData
*data
= INST_DATA(cl
, obj
);
3909 DoMethod(obj
, MUIM_Action_Cfg_Snd_Changed
);
3910 InternalCreateConfigGUI(data
);
3912 if(!psdSaveCfgToDisk(NULL
, FALSE
))
3914 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_NOTSAVED
));
3916 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVEDSUCCESS
));
3923 /* /// "Action_Prefs_Changed()" */
3924 IPTR
Action_Prefs_Changed(struct IClass
*cl
, Object
*obj
, Msg msg
)
3928 DoMethod(obj
, MUIM_Action_Cfg_Snd_Changed
);
3929 psdGetAttrs(PGA_STACK
, NULL
,
3930 PA_CurrConfigHash
, &currhash
,
3931 PA_SavedConfigHash
, &oldhash
,
3933 return((IPTR
) (currhash
!= oldhash
));
3937 /* /// "Action_UseQuit()" */
3938 IPTR
Action_UseQuit(struct IClass
*cl
, Object
*obj
, Msg msg
)
3940 struct ActionData
*data
= INST_DATA(cl
, obj
);
3942 //DoMethod(obj, MUIM_Action_Cfg_Snd_Changed);
3943 DoMethod(obj
, MUIM_Action_Use
);
3944 if(DoMethod(obj
, MUIM_Action_Prefs_Changed
))
3946 res
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_USEQUIT
), _(MSG_ACTION_CONFIGCHANGED
), NULL
);
3953 DoMethod(obj
, MUIM_Action_SavePrefs
);
3956 DoMethod(data
->appobj
, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
3961 /* /// "Action_SaveQuit()" */
3962 IPTR
Action_SaveQuit(struct IClass
*cl
, Object
*obj
, Msg msg
)
3964 struct ActionData
*data
= INST_DATA(cl
, obj
);
3965 DoMethod(obj
, MUIM_Action_Cfg_Snd_Changed
);
3966 DoMethod(obj
, MUIM_Action_Use
);
3967 if(!(psdSaveCfgToDisk(NULL
, FALSE
)))
3969 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_SAVEQUIT
));
3971 DoMethod(data
->appobj
, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
3977 /* /// "Action_LoadPrefsFrom()" */
3978 IPTR
Action_LoadPrefsFrom(struct IClass
*cl
, Object
*obj
, Msg msg
)
3980 //struct ActionData *data = INST_DATA(cl, obj);
3981 STRPTR path
= (STRPTR
) ((struct opSet
*) msg
)->ops_AttrList
;
3982 if(psdLoadCfgFromDisk(path
))
3984 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_LOADED
), path
);
3991 /* /// "Action_SavePrefsTo()" */
3992 IPTR
Action_SavePrefsTo(struct IClass
*cl
, Object
*obj
, Msg msg
)
3994 struct ActionData
*data
= INST_DATA(cl
, obj
);
3995 STRPTR path
= (STRPTR
) ((struct opSet
*) msg
)->ops_AttrList
;
3996 InternalCreateConfigGUI(data
);
3997 if(psdSaveCfgToDisk(path
, FALSE
))
3999 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_PREFS_SAVED
), path
);
4006 /* /// "Action_Dev_Activate()" */
4007 IPTR
Action_Dev_Activate(struct IClass
*cl
, Object
*obj
, Msg msg
)
4009 struct ActionData
*data
= INST_DATA(cl
, obj
);
4010 struct DevListEntry
*dlnode
;
4013 struct List
*pclist
;
4014 struct List
*piflist
;
4018 IPTR hascfggui
= FALSE
;
4019 IPTR issuspended
= FALSE
;
4020 struct Library
*UsbClsBase
;
4022 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4023 if(CheckDeviceValid(dlnode
))
4025 psdLockReadDevice(dlnode
->pd
);
4026 set(data
->devinfoobj
, MUIA_Disabled
, FALSE
);
4027 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4028 DA_Binding
, &binding
,
4029 DA_BindingClass
, &puc
,
4030 DA_ConfigList
, &pclist
,
4031 DA_IsSuspended
, &issuspended
,
4035 psdGetAttrs(PGA_USBCLASS
, puc
,
4036 UCA_ClassBase
, &UsbClsBase
,
4038 usbGetAttrs(UGA_CLASS
, NULL
,
4039 UCCA_HasBindingCfgGUI
, &hascfggui
,
4042 pc
= pclist
->lh_Head
;
4043 while((!binding
) && pc
->ln_Succ
)
4045 psdGetAttrs(PGA_CONFIG
, pc
,
4046 CA_InterfaceList
, &piflist
,
4048 pif
= piflist
->lh_Head
;
4051 psdGetAttrs(PGA_INTERFACE
, pif
,
4052 IFA_Binding
, &cbind
,
4053 IFA_BindingClass
, &puc
,
4059 if(cbind
&& puc
&& !hascfggui
)
4061 psdGetAttrs(PGA_USBCLASS
, puc
,
4062 UCA_ClassBase
, &UsbClsBase
,
4064 usbGetAttrs(UGA_CLASS
, NULL
,
4065 UCCA_HasBindingCfgGUI
, &hascfggui
,
4072 psdUnlockDevice(dlnode
->pd
);
4073 set(data
->devunbindobj
, MUIA_Disabled
, !binding
);
4074 set(data
->devcfgobj
, MUIA_Disabled
, !hascfggui
);
4075 /*if(dlnode->infowindow) FIXME
4077 DoMethod(obj, MUIM_Action_Dev_If_Activate, dlnode);
4079 set(data
->devsuspendobj
, MUIA_Disabled
, issuspended
);
4080 set(data
->devresumeobj
, MUIA_Disabled
, !issuspended
);
4081 set(data
->devpowercycleobj
, MUIA_Disabled
, FALSE
);
4082 set(data
->devdisableobj
, MUIA_Disabled
, FALSE
);
4083 set(data
->devlistobj
, MUIA_ContextMenu
, data
->mi_classpopup
);
4085 set(data
->devunbindobj
, MUIA_Disabled
, TRUE
);
4086 set(data
->devinfoobj
, MUIA_Disabled
, TRUE
);
4087 set(data
->devcfgobj
, MUIA_Disabled
, TRUE
);
4088 set(data
->devsuspendobj
, MUIA_Disabled
, TRUE
);
4089 set(data
->devresumeobj
, MUIA_Disabled
, TRUE
);
4090 set(data
->devpowercycleobj
, MUIA_Disabled
, TRUE
);
4091 set(data
->devdisableobj
, MUIA_Disabled
, TRUE
);
4092 set(data
->devlistobj
, MUIA_ContextMenu
, NULL
);
4098 /* /// "Action_Dev_Info()" */
4099 IPTR
Action_Dev_Info(struct IClass
*cl
, Object
*obj
, Msg msg
)
4101 struct ActionData
*data
= INST_DATA(cl
, obj
);
4102 struct DevListEntry
*dlnode
;
4104 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4107 if(dlnode
->infowindow
)
4111 dlnode
->infowindow
= NewObject(DevWinClass
->mcc_Class
, 0, MUIA_DevWin_DevEntry
, dlnode
, WindowContents
, VGroup
, End
, TAG_END
);
4112 if(dlnode
->infowindow
)
4114 DoMethod(data
->appobj
, OM_ADDMEMBER
, dlnode
->infowindow
);
4115 DoMethod(dlnode
->infowindow
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
4116 data
->appobj
, 5, MUIM_Application_PushMethod
, obj
, 2, MUIM_Action_CloseSubWinReq
, dlnode
);
4117 set(dlnode
->infowindow
, MUIA_Window_Open
, TRUE
);
4124 /* /// "Action_Dev_Bind()" */
4125 IPTR
Action_Dev_Bind(struct IClass
*cl
, Object
*obj
, Msg msg
)
4127 struct ActionData
*data
= INST_DATA(cl
, obj
);
4129 DoMethod(obj
, MUIM_Action_Dev_Activate
);
4130 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4135 /* /// "Action_Dev_Unbind()" */
4136 IPTR
Action_Dev_Unbind(struct IClass
*cl
, Object
*obj
, Msg msg
)
4138 struct ActionData
*data
= INST_DATA(cl
, obj
);
4139 struct DevListEntry
*dlnode
;
4141 struct List
*pclist
;
4142 struct List
*piflist
;
4146 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4147 if(CheckDeviceValid(dlnode
))
4149 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4150 DA_Binding
, &binding
,
4151 DA_ConfigList
, &pclist
,
4155 psdReleaseDevBinding(dlnode
->pd
);
4157 pc
= pclist
->lh_Head
;
4160 psdGetAttrs(PGA_CONFIG
, pc
,
4161 CA_InterfaceList
, &piflist
,
4163 pif
= piflist
->lh_Head
;
4166 psdGetAttrs(PGA_INTERFACE
, pif
,
4167 IFA_Binding
, &binding
,
4171 psdReleaseIfBinding(pif
);
4178 set(data
->devunbindobj
, MUIA_Disabled
, TRUE
);
4179 set(data
->devcfgobj
, MUIA_Disabled
, TRUE
);
4180 /*if(dlnode->infowindow) FIXME
4182 DoMethod(obj, MUIM_Action_Dev_If_Activate, dlnode);
4183 DoMethod(dlnode->iflvobj, MUIM_List_Redraw, MUIV_List_Redraw_All);
4186 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4191 /* /// "Action_Dev_Suspend()" */
4192 IPTR
Action_Dev_Suspend(struct IClass
*cl
, Object
*obj
, Msg msg
)
4194 struct ActionData
*data
= INST_DATA(cl
, obj
);
4195 struct DevListEntry
*dlnode
;
4197 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4198 if(CheckDeviceValid(dlnode
))
4200 psdSuspendDevice(dlnode
->pd
);
4202 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4207 /* /// "Action_Dev_Resume()" */
4208 IPTR
Action_Dev_Resume(struct IClass
*cl
, Object
*obj
, Msg msg
)
4210 struct ActionData
*data
= INST_DATA(cl
, obj
);
4211 struct DevListEntry
*dlnode
;
4213 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4214 if(CheckDeviceValid(dlnode
))
4216 psdResumeDevice(dlnode
->pd
);
4218 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4223 /* /// "Action_Dev_PowerCycle()" */
4224 IPTR
Action_Dev_PowerCycle(struct IClass
*cl
, Object
*obj
, Msg msg
)
4226 struct ActionData
*data
= INST_DATA(cl
, obj
);
4227 struct DevListEntry
*dlnode
;
4229 struct Node
*hubpd
= NULL
;
4230 struct Node
*puc
= NULL
;
4231 struct Library
*UsbClsBase
;
4233 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4234 if(CheckDeviceValid(dlnode
))
4236 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4237 DA_HubDevice
, &hubpd
,
4238 DA_AtHubPortNumber
, &hubport
,
4242 psdGetAttrs(PGA_DEVICE
, hubpd
,
4243 DA_BindingClass
, &puc
,
4248 psdGetAttrs(PGA_USBCLASS
, puc
,
4249 UCA_ClassBase
, &UsbClsBase
,
4251 usbDoMethod(UCM_HubPowerCyclePort
, hubpd
, hubport
);
4254 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4259 /* /// "Action_Dev_Disable()" */
4260 IPTR
Action_Dev_Disable(struct IClass
*cl
, Object
*obj
, Msg msg
)
4262 struct ActionData
*data
= INST_DATA(cl
, obj
);
4263 struct DevListEntry
*dlnode
;
4265 struct Node
*hubpd
= NULL
;
4266 struct Node
*puc
= NULL
;
4267 struct Library
*UsbClsBase
;
4269 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4270 if(CheckDeviceValid(dlnode
))
4272 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4273 DA_HubDevice
, &hubpd
,
4274 DA_AtHubPortNumber
, &hubport
,
4278 psdGetAttrs(PGA_DEVICE
, hubpd
,
4279 DA_BindingClass
, &puc
,
4284 psdGetAttrs(PGA_USBCLASS
, puc
,
4285 UCA_ClassBase
, &UsbClsBase
,
4287 usbDoMethod(UCM_HubDisablePort
, hubpd
, hubport
);
4291 DoMethod(data
->devlistobj
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
4296 /* /// "Action_Dev_Configure()" */
4297 IPTR
Action_Dev_Configure(struct IClass
*cl
, Object
*obj
, Msg msg
)
4299 struct ActionData
*data
= INST_DATA(cl
, obj
);
4300 struct DevListEntry
*dlnode
;
4302 struct List
*pclist
;
4303 struct List
*piflist
;
4307 struct Library
*UsbClsBase
;
4309 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4310 if(CheckDeviceValid(dlnode
))
4312 psdLockReadDevice(dlnode
->pd
);
4313 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4314 DA_Binding
, &binding
,
4315 DA_BindingClass
, &puc
,
4316 DA_ConfigList
, &pclist
,
4321 psdGetAttrs(PGA_USBCLASS
, puc
,
4322 UCA_ClassBase
, &UsbClsBase
,
4325 if(binding
&& UsbClsBase
)
4327 usbDoMethod(UCM_OpenBindingCfgWindow
, binding
);
4329 pc
= pclist
->lh_Head
;
4332 psdGetAttrs(PGA_CONFIG
, pc
,
4333 CA_InterfaceList
, &piflist
,
4335 pif
= piflist
->lh_Head
;
4338 psdGetAttrs(PGA_INTERFACE
, pif
,
4339 IFA_Binding
, &binding
,
4340 IFA_BindingClass
, &puc
,
4345 psdGetAttrs(PGA_USBCLASS
, puc
,
4346 UCA_ClassBase
, &UsbClsBase
,
4349 if(binding
&& UsbClsBase
)
4351 usbDoMethod(UCM_OpenBindingCfgWindow
, binding
);
4358 psdUnlockDevice(dlnode
->pd
);
4365 /* /// "Action_Dev_ForceBind()" */
4366 IPTR
Action_Dev_ForceBind(struct IClass
*cl
, Object
*obj
, Msg msg
)
4368 struct ActionData
*data
= INST_DATA(cl
, obj
);
4369 struct DevListEntry
*dlnode
;
4370 Object
*mi
= (Object
*) ((IPTR
*) msg
)[1];
4372 STRPTR devid
= NULL
;
4373 STRPTR devname
= NULL
;
4376 DoMethod(data
->devlistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &dlnode
);
4377 if(CheckDeviceValid(dlnode
))
4379 get(mi
, MUIA_Menuitem_Title
, &name
);
4380 if(!strcmp(name
, _(MSG_ACTION_DEV_FORCEBIND_NONE
)))
4384 psdGetAttrs(PGA_DEVICE
, dlnode
->pd
,
4385 DA_ProductName
, &devname
,
4386 DA_IDString
, &devid
,
4390 clever
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_DEV_FORCE_REQ
),_(MSG_ACTION_DEV_FORCE_REQ_TXT
), NULL
);
4396 if(psdSetForcedBinding(name
, devid
, NULL
))
4400 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_DEV_FORCE
), devname
, name
);
4402 psdAddErrorMsg(RETURN_OK
, _(MSG_APP_TITLE
), _(MSG_ACTION_DEV_FORCE_REMOVE
), devname
);
4410 /* /// "Action_Cfg_Changed()" */
4411 IPTR
Action_Cfg_Changed(struct IClass
*cl
, Object
*obj
, Msg msg
)
4413 struct ActionData
*data
= INST_DATA(cl
, obj
);
4415 IPTR subtaskpri
= 0;
4422 IPTR popupdeath
= 0;
4423 IPTR popupdelay
= 0;
4424 IPTR popupactivate
= 0;
4425 IPTR popuptofront
= 0;
4426 IPTR autodisablelp
= 0;
4427 IPTR autodisabledead
= 0;
4428 IPTR autorestartdead
= 0;
4429 IPTR powersaving
= 0;
4430 IPTR forcesuspend
= 0;
4431 IPTR suspendtimeout
= 0;
4432 APTR stackcfg
= NULL
;
4434 psdGetAttrs(PGA_STACK
, NULL
, PA_GlobalConfig
, &stackcfg
, TAG_END
);
4435 get(data
->cfgtaskpriobj
, MUIA_Numeric_Value
, &subtaskpri
);
4436 get(data
->cfgbootdelayobj
, MUIA_Numeric_Value
, &bootdelay
);
4437 get(data
->cfgloginfoobj
, MUIA_Selected
, &loginfo
);
4438 get(data
->cfglogwarnobj
, MUIA_Selected
, &logwarn
);
4439 get(data
->cfglogerrobj
, MUIA_Selected
, &logerr
);
4440 get(data
->cfglogfailobj
, MUIA_Selected
, &logfail
);
4441 get(data
->cfgpopupnewobj
, MUIA_Cycle_Active
, &popupnew
);
4442 get(data
->cfgpopupgoneobj
, MUIA_Selected
, &popupgone
);
4443 get(data
->cfgpopupdeathobj
, MUIA_Selected
, &popupdeath
);
4444 get(data
->cfgpopupdelayobj
, MUIA_Numeric_Value
, &popupdelay
);
4445 get(data
->cfgpopupactivateobj
, MUIA_Selected
, &popupactivate
);
4446 get(data
->cfgpopuptofrontobj
, MUIA_Selected
, &popuptofront
);
4447 get(data
->cfgautolpobj
, MUIA_Selected
, &autodisablelp
);
4448 get(data
->cfgautodeadobj
, MUIA_Selected
, &autodisabledead
);
4449 get(data
->cfgautopcobj
, MUIA_Selected
, &autorestartdead
);
4450 get(data
->cfgpowersavingobj
, MUIA_Selected
, &powersaving
);
4451 get(data
->cfgforcesuspendobj
, MUIA_Selected
, &forcesuspend
);
4452 get(data
->cfgsuspendtimeoutobj
, MUIA_Numeric_Value
, &suspendtimeout
);
4454 if(autorestartdead
&& autodisabledead
)
4456 autodisabledead
= FALSE
;
4457 nnset(data
->cfgautodeadobj
, MUIA_Selected
, FALSE
);
4461 nnset(data
->cfgautodeadobj
, MUIA_Disabled
, TRUE
);
4463 nnset(data
->cfgautodeadobj
, MUIA_Disabled
, FALSE
);
4467 psdSetAttrs(PGA_STACKCFG
, stackcfg
,
4468 GCA_SubTaskPri
, subtaskpri
,
4469 GCA_BootDelay
, bootdelay
,
4470 GCA_LogInfo
, loginfo
,
4471 GCA_LogWarning
, logwarn
,
4472 GCA_LogError
, logerr
,
4473 GCA_LogFailure
, logfail
,
4474 GCA_PopupDeviceNew
, popupnew
,
4475 GCA_PopupDeviceGone
, popupgone
,
4476 GCA_PopupDeviceDeath
, popupdeath
,
4477 GCA_PopupCloseDelay
, popupdelay
,
4478 GCA_PopupActivateWin
, popupactivate
,
4479 GCA_PopupWinToFront
, popuptofront
,
4480 GCA_AutoDisableLP
, autodisablelp
,
4481 GCA_AutoDisableDead
, autodisabledead
,
4482 GCA_AutoRestartDead
, autorestartdead
,
4483 GCA_PowerSaving
, powersaving
,
4484 GCA_ForceSuspend
, forcesuspend
,
4485 GCA_SuspendTimeout
, suspendtimeout
,
4492 /* /// "Action_Cfg_Snd_Changed()" */
4493 IPTR
Action_Cfg_Snd_Changed(struct IClass
*cl
, Object
*obj
, Msg msg
)
4495 struct ActionData
*data
= INST_DATA(cl
, obj
);
4496 STRPTR dtxsndfile
= "";
4497 STRPTR remsndfile
= "";
4498 APTR stackcfg
= NULL
;
4500 psdGetAttrs(PGA_STACK
, NULL
, PA_GlobalConfig
, &stackcfg
, TAG_END
);
4501 get(data
->cfgdevdtxsoundobj
, MUIA_String_Contents
, &dtxsndfile
);
4502 get(data
->cfgdevremsoundobj
, MUIA_String_Contents
, &remsndfile
);
4505 psdSetAttrs(PGA_STACKCFG
, stackcfg
,
4506 GCA_InsertionSound
, dtxsndfile
,
4507 GCA_RemovalSound
, remsndfile
,
4514 /* /// "Action_Cls_Activate()" */
4515 IPTR
Action_Cls_Activate(struct IClass
*cl
, Object
*obj
, Msg msg
)
4517 struct ActionData
*data
= INST_DATA(cl
, obj
);
4518 struct ClsListEntry
*clnode
;
4519 DoMethod(data
->clslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &clnode
);
4524 IPTR hascfggui
= FALSE
;
4525 struct Library
*UsbClsBase
;
4527 set(data
->clsremobj
, MUIA_Disabled
, FALSE
);
4530 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
4534 if(puc
== clnode
->puc
)
4536 psdGetAttrs(PGA_USBCLASS
, clnode
->puc
,
4537 UCA_ClassBase
, &UsbClsBase
,
4539 usbGetAttrs(UGA_CLASS
, NULL
,
4540 UCCA_HasClassCfgGUI
, &hascfggui
,
4542 set(data
->clscfgobj
, MUIA_Disabled
, !hascfggui
);
4549 set(data
->clsremobj
, MUIA_Disabled
, TRUE
);
4550 set(data
->clscfgobj
, MUIA_Disabled
, TRUE
);
4556 /* /// "Action_Cls_Add()" */
4557 IPTR
Action_Cls_Add(struct IClass
*cl
, Object
*obj
, Msg msg
)
4559 struct ActionData
*data
= INST_DATA(cl
, obj
);
4560 STRPTR clsname
= "";
4561 get(data
->clsnameobj
, MUIA_String_Contents
, &clsname
);
4562 psdAddClass(clsname
, 0);
4563 InternalCreateConfigGUI(data
);
4568 /* /// "Action_Cls_Remove()" */
4569 IPTR
Action_Cls_Remove(struct IClass
*cl
, Object
*obj
, Msg msg
)
4571 struct ActionData
*data
= INST_DATA(cl
, obj
);
4572 struct ClsListEntry
*clnode
;
4573 DoMethod(data
->clslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &clnode
);
4579 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
4583 if(puc
== clnode
->puc
)
4586 DoMethod(data
->clslistobj
, MUIM_List_Remove
, MUIV_List_Remove_Active
);
4587 FreeClsEntry(data
, clnode
);
4600 InternalCreateConfigGUI(data
);
4605 /* /// "Action_Cls_Scan()" */
4606 IPTR
Action_Cls_Scan(struct IClass
*cl
, Object
*obj
, Msg msg
)
4608 struct ActionData
*data
= INST_DATA(cl
, obj
);
4609 struct ExAllControl
*exall
;
4611 struct ExAllData
*exdata
;
4613 struct List
*puclist
;
4618 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &puclist
, TAG_END
);
4619 if((exall
= AllocDosObject(DOS_EXALLCONTROL
, NULL
)))
4621 if((lock
= Lock(CLASSPATH
, ACCESS_READ
)))
4623 exall
->eac_LastKey
= 0;
4624 exall
->eac_MatchString
= NULL
;
4625 exall
->eac_MatchFunc
= NULL
;
4628 exready
= ExAll(lock
, (struct ExAllData
*) buf
, 1024, ED_NAME
, exall
);
4629 exdata
= (struct ExAllData
*) buf
;
4630 ents
= exall
->eac_Entries
;
4633 psdSafeRawDoFmt(sbuf
, 128, CLASSPATH
"/%s", exdata
->ed_Name
);
4635 if(!FindName(puclist
, exdata
->ed_Name
))
4637 psdAddClass(sbuf
, 0);
4639 exdata
= exdata
->ed_Next
;
4643 InternalCreateConfigGUI(data
);
4646 /*errmsg = "Could not lock on SYS:Classes/USB.\n";*/
4648 FreeDosObject(DOS_EXALLCONTROL
, exall
);
4654 /* /// "Action_Cls_Configure()" */
4655 IPTR
Action_Cls_Configure(struct IClass
*cl
, Object
*obj
, Msg msg
)
4657 struct ActionData
*data
= INST_DATA(cl
, obj
);
4658 struct ClsListEntry
*clnode
;
4659 DoMethod(data
->clslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &clnode
);
4664 struct Library
*UsbClsBase
;
4667 psdGetAttrs(PGA_STACK
, NULL
, PA_ClassList
, &lst
, TAG_END
);
4671 if(puc
== clnode
->puc
)
4673 psdGetAttrs(PGA_USBCLASS
, clnode
->puc
,
4674 UCA_ClassBase
, &UsbClsBase
,
4676 usbDoMethod(UCM_OpenCfgWindow
);
4689 /* /// "Action_Info_MemPool()" */
4690 IPTR
Action_Info_MemPool(struct IClass
*cl
, Object
*obj
, Msg msg
)
4692 struct ActionData
*data
= INST_DATA(cl
, obj
);
4695 psdGetAttrs(PGA_STACK
, NULL
, PA_MemPoolUsage
, &mem
, TAG_END
);
4696 psdSafeRawDoFmt(buf
, 32, _(MSG_ACTION_MEMPOOL_FORMAT
), (mem
+512)>>10);
4697 set(data
->mempoolobj
, MUIA_Text_Contents
, buf
);
4702 /* /// "Action_Cfg_Activate()" */
4703 IPTR
Action_Cfg_Activate(struct IClass
*cl
, Object
*obj
, Msg msg
)
4705 struct ActionData
*data
= INST_DATA(cl
, obj
);
4706 struct PrefsListEntry
*plnode
;
4707 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
4710 BOOL noexport
= FALSE
;
4711 switch(plnode
->chunkid
)
4713 case IFFCHNK_FORCEDBIND
:
4714 case MAKE_ID('P','S','D','L'):
4718 set(data
->prefsremoveobj
, MUIA_Disabled
, plnode
->chunkid
== IFFFORM_STACKCFG
);
4719 set(data
->prefsexportobj
, MUIA_Disabled
, noexport
);
4721 set(data
->prefsremoveobj
, MUIA_Disabled
, TRUE
);
4722 set(data
->prefsexportobj
, MUIA_Disabled
, TRUE
);
4728 /* /// "Action_Cfg_Remove()" */
4729 IPTR
Action_Cfg_Remove(struct IClass
*cl
, Object
*obj
, Msg msg
)
4731 struct ActionData
*data
= INST_DATA(cl
, obj
);
4732 struct PrefsListEntry
*plnode
;
4733 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
4738 switch(plnode
->chunkid
)
4740 case IFFFORM_STACKCFG
:
4743 case IFFFORM_DEVICECFG
:
4744 result
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_HELP
), &plnode
->devid
);
4747 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4750 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4755 pic
= psdNextCfgForm(pic
);
4760 case IFFFORM_CLASSCFG
:
4761 result
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_DEFAULT
), &plnode
->owner
);
4764 pic
= psdFindCfgForm(NULL
, IFFFORM_CLASSCFG
);
4767 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4772 pic
= psdNextCfgForm(pic
);
4777 case IFFFORM_DEVCFGDATA
:
4778 result
= MUI_Request(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_CLASS
), plnode
->owner
, plnode
->devid
);
4781 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4784 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4786 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4789 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4794 pic
= psdNextCfgForm(pic
);
4798 pic
= psdNextCfgForm(pic
);
4803 case IFFFORM_IFCFGDATA
:
4804 result
= MUI_Request(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_CLASS_DEF
),
4805 plnode
->owner
, plnode
->ifid
, plnode
->devid
);
4808 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4811 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4813 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4816 if(psdMatchStringChunk(pic
, IFFCHNK_IFID
, plnode
->ifid
))
4818 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4824 pic
= psdNextCfgForm(pic
);
4828 pic
= psdNextCfgForm(pic
);
4833 case IFFCHNK_FORCEDBIND
:
4834 psdSetForcedBinding(NULL
, plnode
->devid
, plnode
->ifid
);
4840 result
= MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFG_REMOVE
),_(MSG_ACTION_CFG_REMOVE_UNKNOWN
), NULL
);
4843 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4857 /* /// "Action_Cfg_Export()" */
4858 IPTR
Action_Cfg_Export(struct IClass
*cl
, Object
*obj
, Msg msg
)
4860 struct ActionData
*data
= INST_DATA(cl
, obj
);
4861 struct PrefsListEntry
*plnode
;
4862 struct FileRequester
*aslreq
;
4864 struct TagItem asltags
[] = { { ASLFR_InitialFile
, __(MSG_ACTION_CFG_PREFS_FILE
) },
4865 { ASLFR_InitialDrawer
, (IPTR
) "SYS:Prefs/Presets/Poseidon" },
4866 { ASLFR_TitleText
, __(MSG_ACTION_CFG_EXPORT
) },
4867 { ASLFR_DoSaveMode
, (IPTR
) TRUE
},
4868 { TAG_END
, (IPTR
) NULL
} };
4872 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
4876 switch(plnode
->chunkid
)
4878 case IFFFORM_STACKCFG
:
4879 asltags
[0].ti_Data
= __(MSG_ACTION_STACKCFG_FILE
);
4880 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4883 case IFFFORM_DEVICECFG
:
4884 asltags
[0].ti_Data
= __(MSG_ACTION_DEVICECFG_FILE
);
4885 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4888 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4892 pic
= psdNextCfgForm(pic
);
4896 case IFFFORM_CLASSCFG
:
4897 asltags
[0].ti_Data
= __(MSG_ACTION_CLASSCFG_FILE
);
4898 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4901 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4905 pic
= psdNextCfgForm(pic
);
4909 case IFFFORM_DEVCFGDATA
:
4910 asltags
[0].ti_Data
= __(MSG_ACTION_DEVCFGDATA_FILE
);
4911 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4914 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4916 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4919 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4923 pic
= psdNextCfgForm(pic
);
4927 pic
= psdNextCfgForm(pic
);
4931 case IFFFORM_IFCFGDATA
:
4932 asltags
[0].ti_Data
= __(MSG_ACTION_IFCFGDATA_FILE
);
4933 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
4936 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
4938 pic
= psdFindCfgForm(pic
, plnode
->chunkid
);
4941 if(psdMatchStringChunk(pic
, IFFCHNK_IFID
, plnode
->ifid
))
4943 if(psdMatchStringChunk(pic
, IFFCHNK_OWNER
, plnode
->owner
))
4948 pic
= psdNextCfgForm(pic
);
4952 pic
= psdNextCfgForm(pic
);
4956 case IFFCHNK_FORCEDBIND
:
4962 pic
= psdFindCfgForm(NULL
, plnode
->chunkid
);
4970 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
4972 if(MUI_AslRequest(aslreq
, TAG_END
))
4974 strcpy(path
, aslreq
->fr_Drawer
);
4975 AddPart(path
, aslreq
->fr_File
, 256);
4976 fh
= Open(path
, MODE_NEWFILE
);
4979 form
= psdWriteCfg(pic
);
4982 Write(fh
, form
, form
[1]+8);
4987 psdAddErrorMsg(RETURN_FAIL
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFG_FAIL
), path
);
4990 MUI_FreeAslRequest(aslreq
);
4998 /* /// "Action_Cfg_Import()" */
4999 IPTR
Action_Cfg_Import(struct IClass
*cl
, Object
*obj
, Msg msg
)
5001 struct ActionData
*data
= INST_DATA(cl
, obj
);
5002 struct PrefsListEntry
*plnode
;
5003 struct FileRequester
*aslreq
;
5010 struct TagItem asltags
[] = { { ASLFR_InitialDrawer
, (IPTR
) "SYS:Prefs/Presets/Poseidon" },
5011 { ASLFR_TitleText
, __(MSG_ACTION_CFG_IMPORT
) },
5012 { TAG_END
, (IPTR
) NULL
} };
5014 DoMethod(data
->prefslistobj
, MUIM_List_GetEntry
, MUIV_List_GetEntry_Active
, &plnode
);
5016 if((aslreq
= MUI_AllocAslRequest(ASL_FileRequest
, asltags
)))
5018 if(MUI_AslRequest(aslreq
, TAG_END
))
5020 strcpy(path
, aslreq
->fr_Drawer
);
5021 AddPart(path
, aslreq
->fr_File
, 256);
5022 fh
= Open(path
, MODE_OLDFILE
);
5025 Read(fh
, iffhead
, 12);
5026 if(AROS_LONG2BE(iffhead
[0]) == ID_FORM
)
5028 buff
= psdAllocVec(AROS_LONG2BE(iffhead
[1])+8);
5031 buff
[0] = iffhead
[0];
5032 buff
[1] = iffhead
[1];
5033 buff
[2] = iffhead
[2];
5034 if(Read(fh
, &buff
[3], AROS_LONG2BE(iffhead
[1])-4) == AROS_LONG2BE(iffhead
[1])-4)
5038 case IFFFORM_STACKCFG
:
5039 pic
= psdFindCfgForm(NULL
, AROS_LONG2BE(buff
[2]));
5042 psdReadCfg(pic
, buff
);
5044 psdAddCfgEntry(NULL
, buff
);
5048 case IFFFORM_DEVICECFG
:
5049 case IFFFORM_CLASSCFG
:
5050 psdAddCfgEntry(NULL
, buff
);
5053 case IFFFORM_DEVCFGDATA
:
5054 case IFFFORM_IFCFGDATA
:
5057 if((plnode
->chunkid
== AROS_LONG2BE(buff
[2])) ||
5058 (plnode
->chunkid
== IFFFORM_DEVICECFG
) ||
5059 (plnode
->chunkid
== IFFFORM_IFCFGDATA
))
5061 pic
= psdFindCfgForm(NULL
, IFFFORM_DEVICECFG
);
5064 if(psdMatchStringChunk(pic
, IFFCHNK_DEVID
, plnode
->devid
))
5066 psdAddCfgEntry(pic
, buff
);
5069 pic
= psdNextCfgForm(pic
);
5074 MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFGDATA_OOPS
),_(MSG_ACTION_CFGDATA_OOPS_HELP
), NULL
);
5077 case IFFFORM_PSDCFG
:
5078 psdLoadCfgFromDisk(path
);
5082 MUI_RequestA(data
->appobj
, data
->winobj
, 0, NULL
, _(MSG_ACTION_CFGDATA_OOPS
),_(MSG_ACTION_CFGDATA_ERR
), NULL
);
5086 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_READ
), path
);
5090 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_ALLOC
), path
);
5093 psdAddErrorMsg(RETURN_ERROR
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_IFF
), path
);
5097 psdAddErrorMsg(RETURN_FAIL
, _(MSG_APP_TITLE
), _(MSG_ACTION_CFGDATA_ERR_OPEN
), path
);
5100 MUI_FreeAslRequest(aslreq
);
5106 /* /// "ActionDispatcher()" */
5107 AROS_UFH3(IPTR
, ActionDispatcher
,
5108 AROS_UFHA(struct IClass
*, cl
, A0
),
5109 AROS_UFHA(Object
*, obj
, A2
),
5110 AROS_UFHA(Msg
, msg
, A1
))
5113 // There should never be an uninitialized pointer, but just in case, try to get an mungwall hit if so.
5114 struct ActionData
*data
= (struct ActionData
*) 0xABADCAFE;
5116 // on OM_NEW the obj pointer will be void, so don't try to get the data base in this case.
5117 if(msg
->MethodID
!= OM_NEW
) data
= INST_DATA(cl
, obj
);
5119 switch(msg
->MethodID
)
5122 return((IPTR
) Action_OM_NEW(cl
, obj
, msg
));
5125 return(Action_Setup(cl
, obj
, msg
));
5128 //MUI_RejectIDCMP(obj, IDCMP_INTUITICKS);
5129 while(data
->OnlUpdTask
)
5133 DoMethod(data
->appobj
, MUIM_Application_RemInputHandler
, &data
->eventihn
);
5134 data
->appobj
= NULL
;
5135 data
->winobj
= NULL
;
5136 return(DoSuperMethodA(cl
,obj
,msg
));
5139 Action_OM_DISPOSE(cl
, obj
, msg
);
5142 case MUIM_Action_HandlePsdEvents
:
5146 case MUIM_Action_CloseSubWinReq
:
5148 struct DefListEntry
*winnode
;
5149 winnode
= (struct DefListEntry
*) ((struct opSet
*) msg
)->ops_AttrList
;
5150 if(winnode
->infowindow
)
5152 set(winnode
->infowindow
, MUIA_Window_Open
, FALSE
);
5153 DoMethod(data
->appobj
, OM_REMMEMBER
, winnode
->infowindow
);
5154 DoMethod(winnode
->infowindow
, OM_DISPOSE
);
5155 winnode
->infowindow
= NULL
;
5160 case MUIM_Action_Cfg_Changed
:
5161 return(Action_Cfg_Changed(cl
, obj
, msg
));
5163 case MUIM_Action_Cfg_Snd_Changed
:
5164 return(Action_Cfg_Snd_Changed(cl
, obj
, msg
));
5166 case MUIM_Action_HW_New
:
5167 return(Action_HW_New(cl
, obj
, msg
));
5169 case MUIM_Action_HW_Copy
:
5170 return(Action_HW_Copy(cl
, obj
, msg
));
5172 case MUIM_Action_HW_Del
:
5173 return(Action_HW_Del(cl
, obj
, msg
));
5175 case MUIM_Action_HW_Update
:
5176 return(Action_HW_Update(cl
, obj
, msg
));
5178 case MUIM_Action_HW_Activate
:
5179 return(Action_HW_Activate(cl
, obj
, msg
));
5181 case MUIM_Action_HW_Info
:
5182 return(Action_HW_Info(cl
, obj
, msg
));
5184 case MUIM_Action_HW_Online
:
5185 return(Action_HW_Online(cl
, obj
, msg
));
5187 case MUIM_Action_HW_Offline
:
5188 return(Action_HW_Offline(cl
, obj
, msg
));
5190 case MUIM_Action_Online
:
5191 return(Action_Online(cl
, obj
, msg
));
5193 case MUIM_Action_Offline
:
5194 return(Action_Offline(cl
, obj
, msg
));
5196 case MUIM_Action_Restart
:
5197 return(Action_Restart(cl
, obj
, msg
));
5199 case MUIM_Action_ChgErrLevel
:
5200 return(Action_ChgErrLevel(cl
, obj
, msg
));
5202 case MUIM_Action_SaveErrors
:
5203 return(Action_SaveErrors(cl
, obj
, msg
));
5205 case MUIM_Action_FlushErrors
:
5206 return(Action_FlushErrors(cl
, obj
, msg
));
5208 case MUIM_Action_SaveDeviceList
:
5209 return(Action_SaveDeviceList(cl
, obj
, msg
));
5211 case MUIM_Action_Use
:
5212 InternalCreateConfigGUI(data
);
5213 psdSaveCfgToDisk("ENV:PsdStackloader", TRUE
);
5214 psdSaveCfgToDisk("ENV:Sys/poseidon.prefs", FALSE
);
5217 case MUIM_Action_LoadPrefs
:
5218 return(Action_LoadPrefs(cl
, obj
, msg
));
5220 case MUIM_Action_SavePrefsAs
:
5221 return(Action_SavePrefsAs(cl
, obj
, msg
));
5223 case MUIM_Action_SavePrefs
:
5224 return(Action_SavePrefs(cl
, obj
, msg
));
5226 case MUIM_Action_Prefs_Changed
:
5227 return(Action_Prefs_Changed(cl
, obj
, msg
));
5229 case MUIM_Action_UseQuit
:
5230 return(Action_UseQuit(cl
, obj
, msg
));
5232 case MUIM_Action_SaveQuit
:
5233 return(Action_SaveQuit(cl
, obj
, msg
));
5235 case MUIM_Action_LoadPrefsFrom
:
5236 return(Action_LoadPrefsFrom(cl
, obj
, msg
));
5238 case MUIM_Action_SavePrefsTo
:
5239 return(Action_SavePrefsTo(cl
, obj
, msg
));
5241 case MUIM_Action_Dev_Activate
:
5242 return(Action_Dev_Activate(cl
, obj
, msg
));
5244 case MUIM_Action_Dev_Bind
:
5245 return(Action_Dev_Bind(cl
, obj
, msg
));
5247 case MUIM_Action_Dev_Unbind
:
5248 return(Action_Dev_Unbind(cl
, obj
, msg
));
5250 case MUIM_Action_Dev_Suspend
:
5251 return(Action_Dev_Suspend(cl
, obj
, msg
));
5253 case MUIM_Action_Dev_Resume
:
5254 return(Action_Dev_Resume(cl
, obj
, msg
));
5256 case MUIM_Action_Dev_PowerCycle
:
5257 return(Action_Dev_PowerCycle(cl
, obj
, msg
));
5259 case MUIM_Action_Dev_Disable
:
5260 return(Action_Dev_Disable(cl
, obj
, msg
));
5262 case MUIM_Action_Dev_ForceBind
:
5263 return(Action_Dev_ForceBind(cl
, obj
, msg
));
5265 case MUIM_Action_Dev_Info
:
5266 return(Action_Dev_Info(cl
, obj
, msg
));
5268 case MUIM_Action_Dev_Configure
:
5269 return(Action_Dev_Configure(cl
, obj
, msg
));
5271 case MUIM_Action_Cls_Activate
:
5272 return(Action_Cls_Activate(cl
, obj
, msg
));
5274 case MUIM_Action_Cls_Add
:
5275 return(Action_Cls_Add(cl
, obj
, msg
));
5277 case MUIM_Action_Cls_Remove
:
5278 return(Action_Cls_Remove(cl
, obj
, msg
));
5280 case MUIM_Action_Cls_Scan
:
5281 return(Action_Cls_Scan(cl
, obj
, msg
));
5283 case MUIM_Action_Cls_Configure
:
5284 return(Action_Cls_Configure(cl
, obj
, msg
));
5286 case MUIM_Action_Info_MemPool
:
5287 return(Action_Info_MemPool(cl
, obj
, msg
));
5289 case MUIM_Action_About
:
5290 DoMethod(data
->cfgpagelv
, MUIM_Set
, MUIA_List_Active
, 0);
5293 case MUIM_Action_WakeUp
:
5294 set(data
->appobj
, MUIA_Application_Iconified
, FALSE
);
5295 DoMethod(data
->winobj
, MUIM_Window_ToFront
);
5296 set(data
->winobj
, MUIA_Window_Activate
, TRUE
);
5299 case MUIM_Action_Cfg_Activate
:
5300 return(Action_Cfg_Activate(cl
, obj
, msg
));
5302 case MUIM_Action_Cfg_Remove
:
5303 return(Action_Cfg_Remove(cl
, obj
, msg
));
5305 case MUIM_Action_Cfg_Export
:
5306 return(Action_Cfg_Export(cl
, obj
, msg
));
5308 case MUIM_Action_Cfg_Import
:
5309 return(Action_Cfg_Import(cl
, obj
, msg
));
5312 return(DoSuperMethodA(cl
,obj
,msg
));