2 Copyright © 1995-2009, The AROS Development Team. All rights reserved.
6 #warning "TODO: fs support"
7 //#error "Continue: clean (disable other windows) + check mount"
9 #include <proto/alib.h>
10 #include <proto/exec.h>
11 #include <proto/intuition.h>
12 #include <proto/muimaster.h>
14 #include <exec/memory.h>
15 #include <intuition/gadgetclass.h>
16 #include <intuition/icclass.h>
17 #include <intuition/intuition.h>
18 #include <intuition/sghooks.h>
19 #include <libraries/locale.h>
20 #include <libraries/mui.h>
21 #ifdef HAVE_COOLIMAGES
22 #include <libraries/coolimages.h>
35 #include "harddisks.h"
36 #include "hdtoolbox_support.h"
42 #undef CATCOMP_STRINGS
43 #undef CATCOMP_NUMBERS
44 #define CATCOMP_NUMBERS
47 #define SIMPLEBUTTON(text) SimpleButton(MSG(text))
49 #ifdef HAVE_COOLIMAGES
50 #define IMAGEBUTTON(text,imgid) CoolImageIDButton(MSG(text),imgid)
52 #define IMAGEBUTTON(text,imgid) SIMPLEBUTTON(text)
55 struct Library
*MUIMasterBase
= NULL
;
61 struct GUIGadgets gadgets
;
63 struct Hook hook_display
;
64 struct Hook hook_buttons
;
65 struct Hook hook_lv_doubleclick
;
66 struct Hook hook_lv_click
;
68 struct AddDeviceGadgets
{
78 struct AddPartitionGadgets
{
83 } addpartitiongadgets
;
85 struct PartitionTypeGadgets
{
87 struct TableTypeNode
*ttn
;
90 struct Hook hook_hexidedit
;
92 struct PartitionType type
;
96 } partitiontypegadgets
;
98 struct PartitionTableTypeGadgets
{
101 struct ListNode
*iln
;
104 } partitiontabletypegadgets
;
106 struct ResizeMoveGadgets
{
117 struct RenameGadgets
{
120 struct ListNode
*iln
;
125 struct DosEnvecGadgets
{
131 Object
*reservedblocksstart
;
132 Object
*reservedblocksend
;
135 struct ListNode
*iln
;
140 struct MountBootGadgets
{
146 struct ListNode
*iln
;
151 char *editcycleentries
[] = {"0x", NULL
};
152 char *blocksizecycleentries
[] = {"512","1024","2048","4096", NULL
};
154 void setChanged(struct ListNode
*iln
)
156 struct ListNode
*parent
= iln
;
158 D(bug("[HDToolBox] setChanged()\n"));
162 parent
->change_count
++;
163 parent
= parent
->parent
;
165 DoMethod(gadgets
.leftlv
, MUIM_List_Redraw
, MUIV_List_Redraw_All
);
166 set(gadgets
.leftlv
, MUIA_Listview_SelectChange
, TRUE
);
169 void unsetChanged(struct ListNode
*iln
)
171 struct ListNode
*sub
= iln
;
172 struct ListNode
*parent
;
174 D(bug("[HDToolBox] unsetChanged()\n"));
176 /* remove changed from all first generation child partitions */
177 sub
= (struct ListNode
*)iln
->list
.lh_Head
;
178 while (sub
->ln
.ln_Succ
)
180 if (sub
->change_count
)
182 parent
= sub
->parent
;
185 parent
->change_count
-= sub
->change_count
;
186 parent
= parent
->parent
;
188 sub
->change_count
= 0;
190 sub
= (struct ListNode
*)sub
->ln
.ln_Succ
;
192 if (iln
->flags
& LNF_ToSave
)
194 iln
->flags
&= ~LNF_ToSave
;
195 /* we saved it so there can't be a change_count */
196 if (iln
->change_count
)
198 parent
= iln
->parent
;
201 parent
->change_count
-= iln
->change_count
;
202 parent
= parent
->parent
;
204 iln
->change_count
= 0;
207 DoMethod(gadgets
.leftlv
, MUIM_List_Redraw
, MUIV_List_Redraw_Active
);
210 AROS_UFH3(void, hexidedit_function
,
211 AROS_UFHA(struct Hook
*, h
, A0
),
212 AROS_UFHA(struct SGWork
*, sgwork
, A2
),
213 AROS_UFHA(ULONG
*, msg
, A1
))
217 D(bug("[HDToolBox] hexidedit_function()\n"));
221 D(bug("[HDToolBox] hexidedit_function: KEY PRESS\n"));
227 AROS_UFH3(void, display_function
,
228 AROS_UFHA(struct Hook
*, h
, A0
),
229 AROS_UFHA(char **, strings
, A2
),
230 AROS_UFHA(struct ListNode
*, entry
, A1
))
237 D(bug("[HDToolBox] display_function()\n"));
242 if (entry
->change_count
)
244 if (entry
->flags
& LNF_ToSave
)
248 if ((entry
->flags
& LNF_Listable
) || (entry
->ln
.ln_Type
== LNT_Parent
))
250 sprintf(bu2
,"\0333%s",entry
->ln
.ln_Name
);
254 strings
[1] = entry
->ln
.ln_Name
;
258 strings
[0] = MSG(WORD_Changed
);
259 strings
[1] = MSG(WORD_Name
);
265 void setTypeString(struct PartitionType
*type
, Object
*strgad
)
271 D(bug("[HDToolBox] setTypeString()\n"));
273 while (len
!=type
->id_len
)
275 sprintf(cur
, "%02x ", type
->id
[len
]);
280 set(strgad
, MUIA_String_Contents
, str
);
283 LONG
askSave(STRPTR name
)
285 struct EasyStruct es
=
287 sizeof(struct EasyStruct
), 0,
294 D(bug("[HDToolBox] askSave('%s')\n", name
));
296 sprintf(yesno
, "%s|%s|%s", MSG_STD(YESSTR
), MSG(WORD_All
), MSG_STD(NOSTR
));
297 es
.es_GadgetFormat
= yesno
;
298 return EasyRequestArgs(0, &es
, 0, &name
);
302 LONG
saveChanges(struct ListNode
*iln
, LONG asksave
)
304 struct ListNode
*sub
;
306 D(bug("[HDToolBox] saveChanges()\n"));
308 if (iln
->change_count
)
310 sub
= (struct ListNode
*)iln
->list
.lh_Head
;
311 while (sub
->ln
.ln_Succ
)
313 asksave
= saveChanges(sub
, asksave
);
314 sub
= (struct ListNode
*)sub
->ln
.ln_Succ
;
316 if (iln
->flags
& LNF_ToSave
)
318 struct HDTBPartition
*partition
;
319 partition
= (struct HDTBPartition
*)iln
;
320 if (partition
->table
)
324 result
= askSave(iln
->ln
.ln_Name
);
329 if (WritePartitionTable(partition
->ph
) == 0)
332 set(gadgets
.text
, MUIA_Text_Contents
, MSG(MSG_WriteTableError
));
340 AROS_UFH3(void, buttons_function
,
341 AROS_UFHA(struct Hook
*, h
, A0
),
342 AROS_UFHA(Object
*, object
, A2
),
343 AROS_UFHA(ULONG
*, arg
, A1
))
348 struct ListNode
*iln
;
351 D(bug("[HDToolBox] buttons_function()\n"));
353 for (i
=GB_FIRST
;i
<=GB_LAST
;i
++)
354 if (object
== gadgets
.buttons
[i
])
359 if (object
== gadgets
.leftlv
)
362 else if (object
== adddevicegadgets
.ok
)
365 struct HDTBDevice
*dn
;
366 get(adddevicegadgets
.file
, MUIA_String_Contents
, &str
);
368 dn
= addDeviceName(str
);
370 else if (object
== addpartitiongadgets
.ok
)
373 get(addpartitiongadgets
.pt
, PTCT_ActivePartition
, &de
);
376 struct HDTBPartition
*table
;
377 struct HDTBPartition
*partition
;
378 get(addpartitiongadgets
.pt
, PTCT_PartitionTable
, &iln
);
379 table
= (struct HDTBPartition
*)iln
;
380 partition
= addPartition(table
, de
);
383 setChanged(&partition
->listnode
);
384 partition
->listnode
.parent
->flags
|= LNF_ToSave
;
385 InsertList(gadgets
.leftlv
, &partition
->listnode
);
388 set(gadgets
.text
, MUIA_Text_Contents
, MSG(MSG_NO_MEMORY
));
391 else if (object
== addpartitiongadgets
.pt
);
392 else if (object
== partitiontypegadgets
.hexid
)
395 struct HDTBPartition
*partition
;
396 partition
= (struct HDTBPartition
*)partitiontypegadgets
.iln
;
397 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, active
, (IPTR
)&iln
);
398 get(object
, MUIA_String_Contents
, &str
);
399 partitiontypegadgets
.type
.id_len
=strcpyESC(partitiontypegadgets
.type
.id
, str
);
401 else if (object
== partitiontypegadgets
.lv
)
403 get(partitiontypegadgets
.lv
, MUIA_List_Active
, &active
);
404 if (active
!= MUIV_List_Active_Off
)
408 DoMethod(partitiontypegadgets
.lv
, MUIM_List_GetEntry
, active
, (IPTR
)&name
);
409 tn
= (struct TypeNode
*)FindName(partitiontypegadgets
.ttn
->typelist
, name
);
410 setTypeString(&tn
->type
, partitiontypegadgets
.hexid
);
411 CopyMem(&tn
->type
, &partitiontypegadgets
.type
, sizeof(struct PartitionType
));
414 else if (object
== partitiontypegadgets
.ok
)
416 struct HDTBPartition
*partition
;
417 partition
= (struct HDTBPartition
*)partitiontypegadgets
.iln
;
418 CopyMem(&partitiontypegadgets
.type
, &partition
->type
, sizeof(struct PartitionType
));
419 SetPartitionAttrsA(partition
->ph
, PT_TYPE
, &partition
->type
, TAG_DONE
);
420 GetPartitionAttrsA(partition
->ph
, PT_DOSENVEC
, &partition
->de
, TAG_DONE
);
421 partitiontypegadgets
.iln
->parent
->flags
|= LNF_ToSave
;
422 setChanged(partitiontypegadgets
.iln
);
424 else if (object
== partitiontabletypegadgets
.ok
)
426 get(partitiontabletypegadgets
.lv
, MUIA_List_Active
, &active
);
427 if (active
!= MUIV_List_Active_Off
)
429 struct TableTypeNode
*ttn
;
430 struct HDTBPartition
*table
;
432 DoMethod(partitiontabletypegadgets
.lv
, MUIM_List_GetEntry
, active
, (IPTR
)&name
);
433 ttn
= findTableTypeNodeName(name
);
434 table
= (struct HDTBPartition
*)partitiontabletypegadgets
.iln
;
436 (table
->table
== NULL
) ||
437 (ttn
->pti
->pti_Type
!= table
->table
->type
)
440 if (makePartitionTable(table
, ttn
->pti
->pti_Type
))
442 table
->listnode
.flags
|= LNF_Listable
;
443 table
->listnode
.flags
|= LNF_ToSave
;
444 setChanged(partitiontabletypegadgets
.iln
);
447 set(gadgets
.text
, MUIA_Text_Contents
, MSG(MSG_CreateTableError
));
451 else if (object
== resizemovegadgets
.ok
)
453 struct HDTBPartition
*table
;
454 struct HDTBPartition
*partition
;
455 get(resizemovegadgets
.pt
, PTCT_PartitionTable
, &table
);
456 partition
= (struct HDTBPartition
*)table
->listnode
.list
.lh_Head
;
457 table
->listnode
.flags
|= LNF_ToSave
;
458 while (partition
->listnode
.ln
.ln_Succ
)
460 if (partition
->listnode
.flags
& LNF_IntermedChange
)
462 partition
->listnode
.flags
&= ~LNF_IntermedChange
;
463 setChanged(&partition
->listnode
);
464 SetPartitionAttrsA(partition
->ph
, PT_DOSENVEC
, &partition
->de
, TAG_DONE
);
466 partition
= (struct HDTBPartition
*)partition
->listnode
.ln
.ln_Succ
;
469 else if (object
== resizemovegadgets
.cancel
)
471 struct HDTBPartition
*table
;
472 struct HDTBPartition
*partition
;
473 get(resizemovegadgets
.pt
, PTCT_PartitionTable
, &table
);
474 partition
= (struct HDTBPartition
*)table
->listnode
.list
.lh_Head
;
475 while (partition
->listnode
.ln
.ln_Succ
)
477 if (partition
->listnode
.flags
& LNF_IntermedChange
)
479 partition
->listnode
.flags
&= ~LNF_IntermedChange
;
480 GetPartitionAttrsA(partition
->ph
, PT_DOSENVEC
, &partition
->de
, TAG_DONE
);
482 partition
= (struct HDTBPartition
*)partition
->listnode
.ln
.ln_Succ
;
485 else if (object
== resizemovegadgets
.pt
)
490 D(bug("[HDToolBox] buttons_function() - Resize/Move Partition Display:\n"));
491 get(resizemovegadgets
.pt
, PTCT_ActiveType
, &type
);
492 if (type
== PTS_EMPTY_AREA
)
494 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &de
);
498 struct HDTBPartition
*partition
;
499 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &partition
);
501 if (*arg
== PTCT_PartitionMove
)
503 partition
->listnode
.flags
|= LNF_IntermedChange
;
506 nnset(resizemovegadgets
.lowcyl
, MUIA_String_Integer
, de
->de_LowCyl
);
507 nnset(resizemovegadgets
.highcyl
, MUIA_String_Integer
, de
->de_HighCyl
);
508 nnset(resizemovegadgets
.totalcyl
, MUIA_String_Integer
, de
->de_HighCyl
-de
->de_LowCyl
+1);
509 getSizeStr(str
, (((de
->de_HighCyl
- de
->de_LowCyl
+ 1) * de
->de_Surfaces
* de
->de_BlocksPerTrack
)-1)/2);
510 nnset(resizemovegadgets
.size
, MUIA_String_Contents
, str
);
511 D(bug("[HDToolBox] buttons_function() - Resize/Move Partition Display successful\n"));
513 else if (object
== resizemovegadgets
.lowcyl
)
517 D(bug("[HDToolBox] buttons_function() - Resize/Move Lowcyl:\n"));
518 get(object
, MUIA_String_Integer
, &value
);
519 get(resizemovegadgets
.pt
, PTCT_ActiveType
, &type
);
520 if (type
== PTS_PARTITION
)
522 struct HDTBPartition
*table
;
523 struct HDTBPartition
*partition
;
525 get(resizemovegadgets
.pt
, PTCT_PartitionTable
, &table
);
526 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &partition
);
527 D(bug("[HDToolBox] - Type : Partition\n"));
528 D(bug("[HDToolBox] - Old value : %ld\n", partition
->de
.de_LowCyl
));
529 D(bug("[HDToolBox] - New value : %ld\n", value
));
530 D(bug("[HDToolBox] - Partition table : %p\n", table
));
531 D(bug("[HDToolBox] - Active partition : %p\n", partition
));
532 if (value
!= partition
->de
.de_LowCyl
)
535 value
*partition
->de
.de_Surfaces
*partition
->de
.de_BlocksPerTrack
;
536 if (validValue(table
, partition
, block
))
539 partition
->listnode
.flags
|= LNF_IntermedChange
;
540 partition
->de
.de_LowCyl
= value
;
541 set(resizemovegadgets
.totalcyl
, MUIA_String_Integer
, partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1);
542 set(resizemovegadgets
.pt
, PTCT_PartitionTable
, table
);
548 (partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1)*
549 partition
->de
.de_Surfaces
*partition
->de
.de_BlocksPerTrack
553 set(resizemovegadgets
.size
, MUIA_String_Contents
, str
);
556 set(object
, MUIA_String_Integer
, partition
->de
.de_LowCyl
);
559 else if (type
== PTS_EMPTY_AREA
)
562 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &de
);
563 if (value
!= de
->de_LowCyl
)
564 set(object
, MUIA_String_Integer
, de
->de_LowCyl
);
567 set(object
, MUIA_String_Integer
, 0);
569 else if (object
== resizemovegadgets
.highcyl
)
573 D(bug("[HDToolBox] buttons_function() - Resize/Move Highcyl:\n"));
574 get(object
, MUIA_String_Integer
, &value
);
575 get(resizemovegadgets
.pt
, PTCT_ActiveType
, &type
);
576 if (type
== PTS_PARTITION
)
578 struct HDTBPartition
*table
;
579 struct HDTBPartition
*partition
;
581 get(resizemovegadgets
.pt
, PTCT_PartitionTable
, &table
);
582 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &partition
);
583 D(bug("[HDToolBox] - Type : Partition\n"));
584 D(bug("[HDToolBox] - Old value : %ld\n", partition
->de
.de_HighCyl
));
585 D(bug("[HDToolBox] - New value : %ld\n", value
));
586 D(bug("[HDToolBox] - Partition table : %p\n", table
));
587 D(bug("[HDToolBox] - Active partition : %p\n", partition
));
588 if (value
!= partition
->de
.de_HighCyl
)
593 partition
->de
.de_Surfaces
*partition
->de
.de_BlocksPerTrack
595 if (validValue(table
, partition
, block
))
598 partition
->listnode
.flags
|= LNF_IntermedChange
;
599 partition
->de
.de_HighCyl
= value
;
600 nnset(resizemovegadgets
.totalcyl
, MUIA_String_Integer
, partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1);
601 nnset(resizemovegadgets
.pt
, PTCT_PartitionTable
, table
);
607 (partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1)*
608 partition
->de
.de_Surfaces
*partition
->de
.de_BlocksPerTrack
612 nnset(resizemovegadgets
.size
, MUIA_String_Contents
, str
);
615 nnset(object
, MUIA_String_Integer
, partition
->de
.de_HighCyl
);
618 else if (type
== PTS_EMPTY_AREA
)
621 D(bug("[HDToolBox] - Type : Empty Area\n"));
622 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &de
);
623 if (value
!= de
->de_HighCyl
)
624 set(object
, MUIA_String_Integer
, de
->de_HighCyl
);
627 nnset(object
, MUIA_String_Integer
, 0);
629 else if (object
== resizemovegadgets
.totalcyl
)
633 get(object
, MUIA_String_Integer
, &value
);
634 get(resizemovegadgets
.pt
, PTCT_ActiveType
, &type
);
635 if (type
== PTS_PARTITION
)
637 struct HDTBPartition
*table
;
638 struct HDTBPartition
*partition
;
640 get(resizemovegadgets
.pt
, PTCT_PartitionTable
, &table
);
641 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &partition
);
642 if (value
!= (partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1))
646 (partition
->de
.de_LowCyl
+value
)*
647 partition
->de
.de_Surfaces
*partition
->de
.de_BlocksPerTrack
649 if (validValue(table
, partition
, block
))
652 partition
->listnode
.flags
|= LNF_IntermedChange
;
653 partition
->de
.de_HighCyl
= partition
->de
.de_LowCyl
+value
-1;
654 set(resizemovegadgets
.highcyl
, MUIA_String_Integer
, partition
->de
.de_HighCyl
);
655 set(resizemovegadgets
.pt
, PTCT_PartitionTable
, table
);
661 (partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1)*
662 partition
->de
.de_Surfaces
*partition
->de
.de_BlocksPerTrack
666 set(resizemovegadgets
.size
, MUIA_String_Contents
, str
);
669 set(object
, MUIA_String_Integer
, partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1);
672 else if (type
== PTS_EMPTY_AREA
)
675 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &de
);
676 if (value
!= (de
->de_HighCyl
-de
->de_LowCyl
+1))
677 set(object
, MUIA_String_Integer
, de
->de_HighCyl
-de
->de_LowCyl
+1);
680 set(object
, MUIA_String_Integer
, 0);
682 else if (object
== resizemovegadgets
.size
)
689 get(resizemovegadgets
.pt
, PTCT_ActiveType
, &type
);
690 if (type
== PTS_PARTITION
)
692 struct HDTBPartition
*partition
;
693 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &partition
);
695 get(object
, MUIA_String_Contents
, &str
);
696 size
= sizeStrToUL((STRPTR
)str
);
697 size
= (size
*2+1)/partition
->de
.de_BlocksPerTrack
/partition
->de
.de_Surfaces
+1;
699 else if (type
== PTS_EMPTY_AREA
)
701 get(resizemovegadgets
.pt
, PTCT_ActivePartition
, &de
);
703 set(resizemovegadgets
.totalcyl
, MUIA_String_Integer
, size
);
704 set(resizemovegadgets
.totalcyl
, MUIA_String_Acknowledge
, TRUE
);
710 (de
->de_HighCyl
-de
->de_LowCyl
+1)*
711 de
->de_Surfaces
*de
->de_BlocksPerTrack
715 set(resizemovegadgets
.size
, MUIA_String_Contents
, val
);
717 else if (object
== renamegadgets
.ok
)
719 struct HDTBPartition
*partition
;
721 partition
= (struct HDTBPartition
*)renamegadgets
.iln
;
722 get(renamegadgets
.name
, MUIA_String_Contents
, &name
);
723 if (strcmp(name
, partition
->listnode
.ln
.ln_Name
) != 0)
725 SetPartitionAttrsA(partition
->ph
, PT_NAME
, name
, TAG_DONE
);
726 strcpy(partition
->listnode
.ln
.ln_Name
, name
);
727 renamegadgets
.iln
->parent
->flags
|= LNF_ToSave
;
728 setChanged(renamegadgets
.iln
);
731 else if (object
== dosenvecgadgets
.ok
)
733 BOOL changed
= FALSE
;
738 struct HDTBPartition
*partition
;
739 partition
= (struct HDTBPartition
*)dosenvecgadgets
.iln
;
740 get(dosenvecgadgets
.mask
, MUIA_String_Integer
, &value
);
741 if (value
!= partition
->de
.de_Mask
)
743 partition
->de
.de_Mask
= value
;
746 get(dosenvecgadgets
.maxtransfer
, MUIA_String_Contents
, &str
);
747 value
= strtoul(str
, &end
, 0);
750 if (value
!= partition
->de
.de_MaxTransfer
)
752 partition
->de
.de_MaxTransfer
= value
;
756 get(dosenvecgadgets
.custboot
, MUIA_Selected
, &check
);
759 if (partition
->de
.de_TableSize
<(DE_BOOTBLOCKS
+1))
761 partition
->de
.de_TableSize
= DE_BOOTBLOCKS
+1;
764 get(dosenvecgadgets
.numcustboot
, MUIA_String_Integer
, &value
);
765 if (value
!= partition
->de
.de_BootBlocks
)
767 partition
->de
.de_BootBlocks
= value
;
773 if (partition
->de
.de_TableSize
>=(DE_BOOTBLOCKS
+1))
775 partition
->de
.de_TableSize
= DE_BOOTBLOCKS
;
776 partition
->de
.de_BootBlocks
= 0;
780 get(dosenvecgadgets
.reservedblocksstart
, MUIA_String_Integer
, &value
);
781 if (value
!= partition
->de
.de_Reserved
)
783 partition
->de
.de_Reserved
= value
;
786 get(dosenvecgadgets
.reservedblocksend
, MUIA_String_Integer
, &value
);
787 if (value
!= partition
->de
.de_PreAlloc
)
789 partition
->de
.de_PreAlloc
= value
;
792 get(dosenvecgadgets
.blocksize
, MUIA_Cycle_Active
, &value
);
793 value
= 1<<(value
+7);
794 if (value
!= partition
->de
.de_SizeBlock
)
796 partition
->de
.de_SizeBlock
= value
;
799 get(dosenvecgadgets
.buffers
, MUIA_String_Integer
, &value
);
800 if (value
!= partition
->de
.de_NumBuffers
)
802 partition
->de
.de_NumBuffers
= value
;
807 SetPartitionAttrsA(partition
->ph
, PT_DOSENVEC
, &partition
->de
, TAG_DONE
);
808 dosenvecgadgets
.iln
->parent
->flags
|= LNF_ToSave
;
809 setChanged(dosenvecgadgets
.iln
);
812 else if (object
== mountbootgadgets
.ok
)
814 struct HDTBPartition
*partition
;
815 BOOL changeda
= FALSE
;
816 BOOL changed
= FALSE
;
819 partition
= (struct HDTBPartition
*)mountbootgadgets
.iln
;
820 get(mountbootgadgets
.active
, MUIA_Selected
, &check
);
823 if (!(partition
->flags
& PNF_ACTIVE
))
825 partition
->flags
|= PNF_ACTIVE
;
831 if (partition
->flags
& PNF_ACTIVE
)
833 partition
->flags
&= ~PNF_ACTIVE
;
839 if (partition
->flags
& PNF_ACTIVE
)
841 struct HDTBPartition
*other
;
842 other
= (struct HDTBPartition
*)partition
->listnode
.ln
.ln_Pred
;
843 while (other
->listnode
.ln
.ln_Pred
)
845 if (other
->listnode
.ln
.ln_Type
== LNT_Partition
)
847 if (other
->flags
& PNF_ACTIVE
)
849 other
->flags
&= ~PNF_ACTIVE
;
850 SetPartitionAttrsA(other
->ph
, PT_ACTIVE
, FALSE
, TAG_DONE
);
851 setChanged(&other
->listnode
);
854 other
= (struct HDTBPartition
*)other
->listnode
.ln
.ln_Pred
;
856 other
= (struct HDTBPartition
*)partition
->listnode
.ln
.ln_Succ
;
857 while (other
->listnode
.ln
.ln_Succ
)
859 if (other
->listnode
.ln
.ln_Type
== LNT_Partition
)
861 if (other
->flags
& PNF_ACTIVE
)
863 other
->flags
&= ~PNF_ACTIVE
;
864 SetPartitionAttrsA(other
->ph
, PT_ACTIVE
, FALSE
, TAG_DONE
);
865 setChanged(&other
->listnode
);
868 other
= (struct HDTBPartition
*)other
->listnode
.ln
.ln_Succ
;
871 SetPartitionAttrsA(partition
->ph
, PT_ACTIVE
, check
, TAG_DONE
);
875 get(mountbootgadgets
.automount
, MUIA_Selected
, &check
);
878 if (!(partition
->flags
& PNF_AUTOMOUNT
))
880 partition
->flags
|= PNF_AUTOMOUNT
;
886 if (partition
->flags
& PNF_AUTOMOUNT
)
888 partition
->flags
&= ~PNF_AUTOMOUNT
;
894 SetPartitionAttrsA(partition
->ph
, PT_AUTOMOUNT
, check
, TAG_DONE
);
898 get(mountbootgadgets
.bootable
, MUIA_Selected
, &check
);
901 if (!(partition
->flags
& PNF_BOOTABLE
))
903 partition
->flags
|= PNF_BOOTABLE
;
906 get(mountbootgadgets
.bootpri
, MUIA_String_Integer
, &value
);
907 if (value
!= partition
->de
.de_BootPri
)
909 partition
->de
.de_BootPri
= value
;
915 if (partition
->flags
& PNF_BOOTABLE
)
917 partition
->flags
&= ~PNF_BOOTABLE
;
918 partition
->de
.de_BootPri
= 0;
924 SetPartitionAttrsA(partition
->ph
, PT_BOOTABLE
, check
, PT_DOSENVEC
, &partition
->de
, TAG_DONE
);
929 mountbootgadgets
.iln
->parent
->flags
|= LNF_ToSave
;
930 setChanged(mountbootgadgets
.iln
);
939 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, 0, (IPTR
)&iln
);
942 ((iln
) && (iln
->parent
->parent
== NULL
))
945 set(adddevicegadgets
.win
, MUIA_Window_Open
, TRUE
);
947 else if ((iln
->parent
->ln
.ln_Type
== LNT_Harddisk
) || (iln
->parent
->ln
.ln_Type
== LNT_Partition
))
949 struct HDTBPartition
*table
;
950 table
= (struct HDTBPartition
*)iln
->parent
;
953 (table
->table
->max_partitions
) &&
954 (countNodes(&table
->listnode
.list
, LNT_Partition
)<table
->table
->max_partitions
)
956 (table
->table
->max_partitions
== 0)
961 addpartitiongadgets
.win
,
962 MUIM_Notify
, MUIA_Window_Open
, TRUE
, (IPTR
)addpartitiongadgets
.pt
, 3,
963 MUIM_Set
, PTCT_PartitionTable
, (IPTR
)table
965 set(addpartitiongadgets
.win
, MUIA_Window_Open
, TRUE
);
968 set(gadgets
.text
, MUIA_Text_Contents
, MSG(MSG_PARTITION_TABLE_FULL
));
971 case GB_REMOVE_ENTRY
:
972 get(gadgets
.leftlv
, MUIA_List_Active
, &active
);
973 if (active
!= MUIV_List_Active_Off
)
975 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, active
, (IPTR
)&iln
);
976 switch (iln
->ln
.ln_Type
)
979 DoMethod(gadgets
.leftlv
, MUIM_List_Remove
, active
);
981 freeDeviceNode((struct HDTBDevice
*)iln
);
985 struct HDTBPartition
*partition
;
986 partition
= (struct HDTBPartition
*)iln
;
987 iln
->parent
->flags
|= LNF_ToSave
;
989 DoMethod(gadgets
.leftlv
, MUIM_List_Remove
, active
);
991 DeletePartition(partition
->ph
);
992 freePartitionNode(partition
);
997 case GB_CREATE_TABLE
:
999 get(gadgets
.leftlv
, MUIA_List_Active
, &active
);
1000 if (active
!= MUIV_List_Active_Off
)
1002 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, active
, (IPTR
)&iln
);
1004 (iln
->ln
.ln_Type
== LNT_Harddisk
) ||
1005 ((i
==2) && (iln
->ln
.ln_Type
== LNT_Partition
))
1008 struct HDTBPartition
*table
;
1010 partitiontabletypegadgets
.iln
= iln
;
1011 table
= (struct HDTBPartition
*)iln
;
1013 type
= table
->table
->type
;
1014 DoMethod(partitiontabletypegadgets
.lv
, MUIM_List_Clear
);
1015 for (i
=0;PartitionBase
->tables
[i
] != NULL
;i
++)
1019 partitiontabletypegadgets
.lv
,
1020 MUIM_List_InsertSingle
, (IPTR
)PartitionBase
->tables
[i
]->pti_Name
, MUIV_List_Insert_Bottom
1022 if (type
== PartitionBase
->tables
[i
]->pti_Type
)
1023 set(partitiontabletypegadgets
.lv
, MUIA_List_Active
, i
);
1025 set(partitiontabletypegadgets
.win
, MUIA_Window_Open
, TRUE
);
1027 else if ((i
==3) && (iln
->ln
.ln_Type
== LNT_Partition
))
1029 struct TypeNode
*tn
;
1030 struct HDTBPartition
*partition
;
1031 partitiontypegadgets
.iln
= iln
;
1033 DoMethod(partitiontypegadgets
.lv
, MUIM_List_Clear
);
1034 partition
= (struct HDTBPartition
*)iln
;
1035 partitiontypegadgets
.ttn
= findTableTypeNode(partition
->root
->table
->type
);
1036 if (partitiontypegadgets
.ttn
)
1038 tn
= (struct TypeNode
*)partitiontypegadgets
.ttn
->typelist
->lh_Head
;
1039 while (tn
->ln
.ln_Succ
)
1043 partitiontypegadgets
.lv
,
1044 MUIM_List_InsertSingle
, (IPTR
)tn
->ln
.ln_Name
, MUIV_List_Insert_Bottom
1046 if (tn
->type
.id_len
== partition
->type
.id_len
)
1047 if (memcmp(tn
->type
.id
, partition
->type
.id
, tn
->type
.id_len
) == 0)
1048 set(partitiontypegadgets
.lv
, MUIA_List_Active
, i
);
1049 tn
= (struct TypeNode
*)tn
->ln
.ln_Succ
;
1053 setTypeString(&partition
->type
, partitiontypegadgets
.hexid
);
1054 set(partitiontypegadgets
.win
, MUIA_Window_Open
, TRUE
);
1058 case GB_RESIZE_MOVE
:
1061 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, 0, (IPTR
)&iln
);
1062 if (iln
->ln
.ln_Type
== LNT_Parent
)
1064 set(gadgets
.leftlv
, MUIA_List_Active
, 0);
1065 set(gadgets
.leftlv
, MUIA_Listview_DoubleClick
, TRUE
);
1069 get(gadgets
.leftlv
, MUIA_List_Active
, &active
);
1070 if (active
!= MUIV_List_Active_Off
)
1072 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, active
, (IPTR
)&iln
);
1073 if (iln
->ln
.ln_Type
== LNT_Partition
)
1075 struct HDTBPartition
*partition
;
1076 partition
= (struct HDTBPartition
*)iln
;
1077 if (getAttrInfo(partition
->root
->table
->pattrlist
, PTA_NAME
) & PLAM_READ
)
1079 renamegadgets
.iln
= iln
;
1080 set(renamegadgets
.name
, MUIA_String_Contents
, iln
->ln
.ln_Name
);
1081 set(renamegadgets
.win
, MUIA_Window_Open
, TRUE
);
1087 get(gadgets
.leftlv
, MUIA_List_Active
, &active
);
1088 if (active
!= MUIV_List_Active_Off
)
1090 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, active
, (IPTR
)&iln
);
1091 if (iln
->ln
.ln_Type
== LNT_Partition
)
1093 struct HDTBPartition
*partition
;
1094 partition
= (struct HDTBPartition
*)iln
;
1095 if (getAttrInfo(partition
->root
->table
->pattrlist
, PTA_DOSENVEC
) & PLAM_READ
)
1098 dosenvecgadgets
.iln
= iln
;
1099 set(dosenvecgadgets
.mask
, MUIA_String_Integer
, partition
->de
.de_Mask
);
1100 sprintf(str
, "0x%08lx", partition
->de
.de_MaxTransfer
);
1101 set(dosenvecgadgets
.maxtransfer
, MUIA_String_Contents
, str
);
1102 if (partition
->de
.de_TableSize
>=(DE_BOOTBLOCKS
+1))
1104 set(dosenvecgadgets
.custboot
, MUIA_Selected
, TRUE
);
1105 set(dosenvecgadgets
.numcustboot
, MUIA_String_Integer
, partition
->de
.de_BootBlocks
);
1108 set(dosenvecgadgets
.custboot
, MUIA_Selected
, FALSE
);
1109 set(dosenvecgadgets
.reservedblocksstart
, MUIA_String_Integer
, partition
->de
.de_Reserved
);
1110 set(dosenvecgadgets
.reservedblocksend
, MUIA_String_Integer
, partition
->de
.de_PreAlloc
);
1111 set(dosenvecgadgets
.blocksize
, MUIA_Cycle_Active
, getBitNum(partition
->de
.de_SizeBlock
>>7));
1112 set(dosenvecgadgets
.buffers
, MUIA_String_Integer
, partition
->de
.de_NumBuffers
);
1113 set(dosenvecgadgets
.win
, MUIA_Window_Open
, TRUE
);
1119 get(gadgets
.leftlv
, MUIA_List_Active
, &active
);
1120 if (active
!= MUIV_List_Active_Off
)
1122 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, active
, (IPTR
)&iln
);
1123 if (iln
->ln
.ln_Type
== LNT_Partition
)
1125 struct HDTBPartition
*partition
;
1129 partition
= (struct HDTBPartition
*)iln
;
1130 active
= getAttrInfo(partition
->root
->table
->pattrlist
, PTA_ACTIVE
);
1131 automount
= getAttrInfo(partition
->root
->table
->pattrlist
, PTA_AUTOMOUNT
);
1132 bootable
= getAttrInfo(partition
->root
->table
->pattrlist
, PTA_BOOTABLE
);
1133 if ((active
| automount
| bootable
) & PLAM_READ
)
1135 mountbootgadgets
.iln
= iln
;
1136 set(mountbootgadgets
.active
, MUIA_Disabled
, !(active
& PLAM_READ
));
1137 set(mountbootgadgets
.automount
, MUIA_Disabled
, !(automount
& PLAM_READ
));
1138 set(mountbootgadgets
.bootable
, MUIA_Disabled
, !(bootable
& PLAM_READ
));
1139 set(mountbootgadgets
.bootpri
, MUIA_Disabled
, !(bootable
& PLAM_READ
));
1140 set(mountbootgadgets
.active
, MUIA_Selected
, (partition
->flags
& PNF_ACTIVE
) ? TRUE
: FALSE
);
1141 set(mountbootgadgets
.automount
, MUIA_Selected
, (partition
->flags
& PNF_AUTOMOUNT
) ? TRUE
: FALSE
);
1142 if (partition
->flags
& PNF_BOOTABLE
)
1144 set(mountbootgadgets
.bootable
, MUIA_Selected
, TRUE
);
1145 set(mountbootgadgets
.bootpri
, MUIA_String_Integer
, partition
->de
.de_BootPri
);
1148 set(mountbootgadgets
.bootable
, MUIA_Selected
, FALSE
);
1149 set(mountbootgadgets
.win
, MUIA_Window_Open
, TRUE
);
1154 case GB_SAVE_CHANGES
:
1155 get(gadgets
.leftlv
, MUIA_List_Active
, &active
);
1156 if (active
!= MUIV_List_Active_Off
)
1158 DoMethod(gadgets
.leftlv
, MUIM_List_GetEntry
, active
, (IPTR
)&iln
);
1159 saveChanges(iln
, TRUE
);
1168 /************************* general List functions ***************************/
1170 LONG
InitListNode(struct ListNode
*node
, struct ListNode
*parent
)
1172 struct ListNode
*new;
1174 D(bug("[HDToolBox] InitListNode()\n"));
1176 NEWLIST(&node
->list
);
1177 new = AllocMem(sizeof(struct ListNode
), MEMF_PUBLIC
| MEMF_CLEAR
);
1180 node
->parent
= parent
;
1181 new->ln
.ln_Name
= "..";
1182 new->ln
.ln_Type
= LNT_Parent
;
1183 new->ln
.ln_Pri
= 127;
1185 AddTail(&node
->list
, &new->ln
);
1191 void UninitListNode(struct ListNode
*node
)
1193 struct ListNode
*parent
;
1195 D(bug("[HDToolBox] UninitListNode()\n"));
1197 /* free parent entry */
1198 parent
= (struct ListNode
*)node
->list
.lh_Head
;
1199 while (parent
->ln
.ln_Succ
)
1201 if (parent
->ln
.ln_Type
== LNT_Parent
)
1203 Remove(&parent
->ln
);
1204 FreeMem(parent
, sizeof(struct ListNode
));
1207 parent
= (struct ListNode
*)parent
->ln
.ln_Succ
;
1211 void InsertList(Object
*list
, struct ListNode
*node
)
1213 D(bug("[HDToolBox] InsertList()\n"));
1215 DoMethod(list
, MUIM_List_InsertSingle
, (IPTR
)node
, MUIV_List_Insert_Bottom
);
1218 void ShowList(Object
*list
, struct List
*lh
)
1220 struct ListNode
*lnode
;
1222 D(bug("[HDToolBox] ShowList()\n"));
1224 DoMethod(list
, MUIM_List_Clear
);
1225 lnode
= (struct ListNode
*)lh
->lh_Head
;
1226 while (lnode
->ln
.ln_Succ
)
1230 ((lnode
->ln
.ln_Type
== LNT_Parent
) && (lnode
->parent
->parent
!= NULL
)) ||
1231 (lnode
->ln
.ln_Type
!= LNT_Parent
)
1233 (!(lnode
->flags
& LNF_Invalid
))
1236 DoMethod(list
, MUIM_List_InsertSingle
, (IPTR
)lnode
, MUIV_List_Insert_Bottom
);
1238 lnode
= (struct ListNode
*)lnode
->ln
.ln_Succ
;
1242 void disableObject(Object
*object
)
1246 D(bug("[HDToolBox] disableObject()\n"));
1248 get(object
, MUIA_Disabled
, &disabled
);
1249 if (disabled
== FALSE
)
1251 set(object
, MUIA_Disabled
, TRUE
);
1255 void enableObject(Object
*object
)
1259 D(bug("[HDToolBox] enableObject()\n"));
1261 get(object
, MUIA_Disabled
, &disabled
);
1262 if (disabled
== TRUE
)
1264 set(object
, MUIA_Disabled
, FALSE
);
1269 /********************************** Left Listview ***************************/
1271 AROS_UFH3(void, lv_doubleclick
,
1272 AROS_UFHA(struct Hook
*, h
, A0
),
1273 AROS_UFHA(Object
*, object
, A2
),
1274 AROS_UFHA(void *, arg
, A1
))
1280 struct ListNode
*iln
;
1282 D(bug("[HDToolBox] lv_doubleclick()\n"));
1284 get(object
, MUIA_List_Active
, &active
);
1285 if (active
!= MUIV_List_Active_Off
)
1287 DoMethod(object
,MUIM_List_GetEntry
,active
, (IPTR
)&iln
);
1288 if (iln
->flags
& LNF_Listable
)
1290 ShowList(object
, &iln
->list
);
1291 type
= iln
->ln
.ln_Type
;
1293 else if (iln
->ln
.ln_Type
== LNT_Parent
)
1295 if (iln
->parent
->parent
)
1297 ShowList(object
, &iln
->parent
->parent
->list
);
1298 type
= iln
->parent
->parent
->ln
.ln_Type
;
1305 enableObject(gadgets
.buttons
[GB_ADD_ENTRY
]);
1306 disableObject(gadgets
.buttons
[GB_REMOVE_ENTRY
]);
1307 disableObject(gadgets
.buttons
[GB_CREATE_TABLE
]);
1308 disableObject(gadgets
.buttons
[GB_CHANGE_TYPE
]);
1309 disableObject(gadgets
.buttons
[GB_RESIZE_MOVE
]);
1310 disableObject(gadgets
.buttons
[GB_PARENT
]);
1311 disableObject(gadgets
.buttons
[GB_RENAME
]);
1312 disableObject(gadgets
.buttons
[GB_DOSENVEC
]);
1313 disableObject(gadgets
.buttons
[GB_SWITCHES
]);
1314 disableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1317 disableObject(gadgets
.buttons
[GB_ADD_ENTRY
]);
1318 disableObject(gadgets
.buttons
[GB_REMOVE_ENTRY
]);
1319 disableObject(gadgets
.buttons
[GB_CREATE_TABLE
]);
1320 disableObject(gadgets
.buttons
[GB_CHANGE_TYPE
]);
1321 disableObject(gadgets
.buttons
[GB_RESIZE_MOVE
]);
1322 enableObject(gadgets
.buttons
[GB_PARENT
]);
1323 disableObject(gadgets
.buttons
[GB_RENAME
]);
1324 disableObject(gadgets
.buttons
[GB_DOSENVEC
]);
1325 disableObject(gadgets
.buttons
[GB_SWITCHES
]);
1326 disableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1330 enableObject(gadgets
.buttons
[GB_ADD_ENTRY
]);
1331 disableObject(gadgets
.buttons
[GB_REMOVE_ENTRY
]);
1332 disableObject(gadgets
.buttons
[GB_CREATE_TABLE
]);
1333 disableObject(gadgets
.buttons
[GB_CHANGE_TYPE
]);
1334 enableObject(gadgets
.buttons
[GB_RESIZE_MOVE
]);
1335 enableObject(gadgets
.buttons
[GB_PARENT
]);
1336 disableObject(gadgets
.buttons
[GB_RENAME
]);
1337 disableObject(gadgets
.buttons
[GB_DOSENVEC
]);
1338 disableObject(gadgets
.buttons
[GB_SWITCHES
]);
1339 disableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1340 DoMethod(gadgets
.buttons
[GB_RESIZE_MOVE
], MUIM_KillNotify
, MUIA_Pressed
);
1343 gadgets
.buttons
[GB_RESIZE_MOVE
],
1344 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)resizemovegadgets
.win
, 3,
1345 MUIM_Set
, MUIA_Window_Open
, TRUE
1349 resizemovegadgets
.win
,
1350 MUIM_Notify
, MUIA_Window_Open
, TRUE
, (IPTR
)resizemovegadgets
.pt
, 3,
1351 MUIM_Set
, PTCT_PartitionTable
, (IPTR
)iln
1360 AROS_UFH3(void, lv_click
,
1361 AROS_UFHA(struct Hook
*, h
, A0
),
1362 AROS_UFHA(Object
*, object
, A2
),
1363 AROS_UFHA(void *, arg
, A1
))
1368 struct ListNode
*iln
;
1372 D(bug("[HDToolBox] lv_click()\n"));
1374 get(object
, MUIA_List_Active
, &active
);
1375 if (active
!= MUIV_List_Active_Off
)
1377 DoMethod(object
,MUIM_List_GetEntry
,active
, (IPTR
)&iln
);
1378 DoMethod(gadgets
.rightlv
, MUIM_List_Clear
);
1379 switch (iln
->ln
.ln_Type
)
1382 sprintf(str
, "%s: %ld", MSG(WORD_Units
),countNodes(&iln
->list
, LNT_Harddisk
));
1383 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1384 enableObject(gadgets
.buttons
[GB_REMOVE_ENTRY
]);
1385 if (iln
->change_count
> 0)
1386 enableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1388 disableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1393 struct HDTBPartition
*partition
;
1394 partition
= (struct HDTBPartition
*)iln
;
1400 (partition
->de
.de_HighCyl
-partition
->de
.de_LowCyl
+1)*
1401 partition
->de
.de_Surfaces
*partition
->de
.de_BlocksPerTrack
1405 sprintf(str
, "%s: %s", MSG(WORD_Size
), sizestr
);
1406 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1407 sprintf(str
, "%s: ", MSG(WORD_Partition_Table
));
1408 if (partition
->table
)
1410 struct TableTypeNode
*ttn
;
1411 ttn
= findTableTypeNode(partition
->table
->type
);
1412 strcat(str
, ttn
->pti
->pti_Name
);
1413 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1414 sprintf(str
, "%s: %ld", MSG(WORD_Partitions
), countNodes(&iln
->list
, LNT_Partition
));
1415 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1419 strcat(str
, MSG(WORD_Unknown
));
1420 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1422 if (iln
->ln
.ln_Type
== LNT_Partition
)
1424 struct TypeNode
*type
;
1425 type
= findPartitionType(&partition
->type
, partition
->root
->table
->type
);
1426 sprintf(str
, "%s: ", MSG(WORD_Partition_Type
));
1428 strcat(str
, type
->ln
.ln_Name
);
1430 strcat(str
, MSG(WORD_Unknown
));
1431 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1432 sprintf(str
, "%s: ", MSG(WORD_Active
));
1433 if (partition
->flags
& PNF_ACTIVE
)
1434 strcat(str
, MSG_STD(YESSTR
));
1436 strcat(str
, MSG_STD(NOSTR
));
1437 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1438 sprintf(str
, "%s: ", MSG(WORD_Bootable
));
1439 if (partition
->flags
& PNF_BOOTABLE
)
1440 strcat(str
, MSG_STD(YESSTR
));
1442 strcat(str
, MSG_STD(NOSTR
));
1443 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1444 sprintf(str
, "%s: ", MSG(WORD_Automount
));
1445 if (partition
->flags
& PNF_AUTOMOUNT
)
1446 strcat(str
, MSG_STD(YESSTR
));
1448 strcat(str
, MSG_STD(NOSTR
));
1449 DoMethod(gadgets
.rightlv
, MUIM_List_InsertSingle
, (IPTR
)str
, MUIV_List_Insert_Bottom
);
1450 enableObject(gadgets
.buttons
[GB_REMOVE_ENTRY
]);
1451 enableObject(gadgets
.buttons
[GB_RENAME
]);
1452 enableObject(gadgets
.buttons
[GB_DOSENVEC
]);
1453 enableObject(gadgets
.buttons
[GB_SWITCHES
]);
1455 else if (iln
->ln
.ln_Type
== LNT_Harddisk
)
1457 if (iln
->change_count
> 0)
1458 enableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1460 disableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1462 enableObject(gadgets
.buttons
[GB_CREATE_TABLE
]);
1463 enableObject(gadgets
.buttons
[GB_CHANGE_TYPE
]);
1467 disableObject(gadgets
.buttons
[GB_REMOVE_ENTRY
]);
1468 disableObject(gadgets
.buttons
[GB_RENAME
]);
1469 disableObject(gadgets
.buttons
[GB_DOSENVEC
]);
1470 disableObject(gadgets
.buttons
[GB_SWITCHES
]);
1471 disableObject(gadgets
.buttons
[GB_CREATE_TABLE
]);
1472 disableObject(gadgets
.buttons
[GB_CHANGE_TYPE
]);
1473 disableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1481 /**************************************** Main ******************************/
1487 D(bug("[HDToolBox] initGUI()\n"));
1489 MUIMasterBase
= OpenLibrary("muimaster.library", 0);
1491 return ERR_MUIMASTER
;
1493 ptclass
= makePTClass();
1494 if (ptclass
== NULL
)
1497 hook_display
.h_Entry
= (HOOKFUNC
)display_function
;
1498 hook_buttons
.h_Entry
= (HOOKFUNC
)buttons_function
;
1499 hook_lv_doubleclick
.h_Entry
= (HOOKFUNC
)lv_doubleclick
;
1500 hook_lv_click
.h_Entry
= (HOOKFUNC
)lv_click
;
1501 partitiontypegadgets
.hook_hexidedit
.h_Entry
= (HOOKFUNC
)hexidedit_function
;
1503 app
= ApplicationObject
,
1504 MUIA_Application_Title
, "HDToolBox",
1505 MUIA_Application_Version
, "$VER: HDToolbox 0.1 (09-Apr-2003)",
1506 MUIA_Application_Copyright
, "(c) 1995-2003 by the AROS Development Team",
1507 MUIA_Application_Author
, "Bearly, Ogun, Fats and others at AROS",
1508 MUIA_Application_Description
, "Partition your disks.",
1509 MUIA_Application_Base
, "HDTOOLBOX",
1510 MUIA_Application_Menustrip
, MenuitemObject
,
1511 MUIA_Family_Child
, MenuitemObject
,
1512 MUIA_Menuitem_Title
, MSG(WORD_MENU_Project
),
1514 about_item
= MenuitemObject
, MUIA_Menuitem_Title
, MSG(WORD_MENU_About
),
1517 quit_item
= MenuitemObject
, MUIA_Menuitem_Title
, MSG(WORD_MENU_Quit
),
1521 SubWindow
, mainwin
= WindowObject
,
1522 MUIA_Window_Title
, "HDToolBox",
1523 MUIA_Window_ID
, MAKE_ID('H','D','T','B'),
1524 MUIA_Window_Activate
, TRUE
,
1525 MUIA_Window_Height
, MUIV_Window_Height_Visible(50),
1526 MUIA_Window_Width
, MUIV_Window_Width_Visible(60),
1527 WindowContents
, VGroup
,
1530 Child
, gadgets
.text
= TextObject
,
1532 MUIA_Text_Contents
, MSG(MSG_Welcome
),
1535 Child
, ListviewObject
,
1536 MUIA_Listview_List
, (gadgets
.leftlv
= ListObject
,
1538 MUIA_List_DisplayHook
, &hook_display
,
1539 MUIA_List_Format
, ",",
1540 MUIA_List_Title
, TRUE
,
1543 Child
, ListviewObject
,
1544 MUIA_Listview_List
, (gadgets
.rightlv
= ListObject
,
1546 MUIA_Listview_Input
, FALSE
,
1547 MUIA_List_Title
, TRUE
,
1548 MUIA_List_ConstructHook
, MUIV_List_ConstructHook_String
,
1549 MUIA_List_DestructHook
, MUIV_List_DestructHook_String
,
1558 Child
, gadgets
.buttons
[GB_ADD_ENTRY
] = SIMPLEBUTTON(WORD_AddEntry
),
1559 Child
, gadgets
.buttons
[GB_REMOVE_ENTRY
] = SIMPLEBUTTON(WORD_RemoveEntry
),
1562 Child
, gadgets
.buttons
[GB_CREATE_TABLE
] = SIMPLEBUTTON(WORD_Create_Table
),
1563 Child
, gadgets
.buttons
[GB_CHANGE_TYPE
] = SIMPLEBUTTON(WORD_Change_Type
),
1566 Child
, gadgets
.buttons
[GB_RESIZE_MOVE
] = SIMPLEBUTTON(WORD_Resize_Move
),
1567 Child
, gadgets
.buttons
[GB_PARENT
] = SIMPLEBUTTON(WORD_Parent
),
1570 Child
, gadgets
.buttons
[GB_RENAME
] = SIMPLEBUTTON(WORD_Rename
),
1571 Child
, gadgets
.buttons
[GB_DOSENVEC
] = SIMPLEBUTTON(WORD_DosEnvec
),
1574 Child
, gadgets
.buttons
[GB_SWITCHES
] = SIMPLEBUTTON(WORD_Switches
),
1579 MUIA_Group_SameWidth
, TRUE
,
1581 Child
, gadgets
.buttons
[GB_SAVE_CHANGES
] = IMAGEBUTTON(WORD_Save_Changes
, COOL_SAVEIMAGE_ID
),
1582 Child
, gadgets
.buttons
[GB_EXIT
] = IMAGEBUTTON(WORD_Exit
, COOL_CANCELIMAGE_ID
),
1587 SubWindow
, adddevicegadgets
.win
= WindowObject
,
1588 MUIA_Window_Title
, MSG(WORD_Devices
),
1589 MUIA_Window_Activate
, TRUE
,
1590 WindowContents
, VGroup
,
1591 Child
, PopaslObject
,
1592 MUIA_Popstring_String
, adddevicegadgets
.file
= StringObject
,
1595 MUIA_Popstring_Button
, PopButton(MUII_PopFile
),
1598 MUIA_Group_SameWidth
, TRUE
,
1600 Child
, adddevicegadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1601 Child
, adddevicegadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1605 SubWindow
, addpartitiongadgets
.win
= WindowObject
,
1606 MUIA_Window_Title
, MSG(MSG_Select_Empty_Area
),
1607 MUIA_Window_Activate
, TRUE
,
1608 WindowContents
, VGroup
,
1609 Child
, addpartitiongadgets
.pt
= BoopsiObject
,
1611 MUIA_Boopsi_Class
, ptclass
,
1612 MUIA_Boopsi_MinWidth
, 600,
1613 MUIA_Boopsi_MinHeight
, 100,
1614 MUIA_Boopsi_TagDrawInfo
, GA_DrawInfo
,
1615 MUIA_Boopsi_Remember
, PTCT_PartitionTable
,
1616 MUIA_Boopsi_Remember
, PTCT_Flags
,
1617 PTCT_Flags
, PTCTF_NoPartitionMove
| PTCTF_EmptySelectOnly
,
1623 MUIA_VertWeight
, 10,
1624 ICA_TARGET
, ICTARGET_IDCMP
,
1627 MUIA_Group_SameWidth
, TRUE
,
1629 Child
, addpartitiongadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1630 Child
, addpartitiongadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1634 SubWindow
, partitiontypegadgets
.win
= WindowObject
,
1635 MUIA_Window_Title
, MSG(WORD_Partition_Type
),
1636 MUIA_Window_Activate
, TRUE
,
1637 WindowContents
, VGroup
,
1638 Child
, ListviewObject
,
1639 MUIA_Listview_List
, partitiontypegadgets
.lv
=ListObject
,
1641 MUIA_List_ConstructHook
, MUIV_List_ConstructHook_String
,
1642 MUIA_List_DestructHook
, MUIV_List_DestructHook_String
,
1643 MUIA_List_Title
, TRUE
,
1647 Child
, partitiontypegadgets
.base
= CycleObject
,
1649 MUIA_Cycle_Entries
, editcycleentries
,
1650 MUIA_HorizWeight
, 1,
1652 Child
, partitiontypegadgets
.hexid
= StringObject
,
1654 MUIA_String_EditHook
, &partitiontypegadgets
.hook_hexidedit
,
1658 MUIA_Group_SameWidth
, TRUE
,
1660 Child
, partitiontypegadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1661 Child
, partitiontypegadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1665 SubWindow
, partitiontabletypegadgets
.win
= WindowObject
,
1666 MUIA_Window_Title
, MSG(WORD_Partition_Table_Type
),
1667 MUIA_Window_Activate
, TRUE
,
1668 WindowContents
, VGroup
,
1669 Child
, ListviewObject
,
1670 MUIA_Listview_List
, partitiontabletypegadgets
.lv
=ListObject
,
1672 MUIA_List_ConstructHook
, MUIV_List_ConstructHook_String
,
1673 MUIA_List_DestructHook
, MUIV_List_DestructHook_String
,
1674 MUIA_List_Title
, TRUE
,
1678 MUIA_Group_SameWidth
, TRUE
,
1680 Child
, partitiontabletypegadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1681 Child
, partitiontabletypegadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1685 SubWindow
, resizemovegadgets
.win
= WindowObject
,
1686 MUIA_Window_Title
, MSG(MSG_Select_Partition_Resize_Move
),
1687 MUIA_Window_Activate
, TRUE
,
1688 WindowContents
, VGroup
,
1689 Child
, resizemovegadgets
.pt
= BoopsiObject
,
1691 MUIA_Boopsi_Class
, ptclass
,
1692 MUIA_Boopsi_MinWidth
, 600,
1693 MUIA_Boopsi_MinHeight
, 100,
1694 MUIA_Boopsi_TagDrawInfo
, GA_DrawInfo
,
1695 MUIA_Boopsi_Remember
, PTCT_PartitionTable
,
1696 MUIA_Boopsi_Remember
, PTCT_Flags
,
1703 MUIA_VertWeight
, 10,
1704 ICA_TARGET
, ICTARGET_IDCMP
,
1708 MUIA_FrameTitle
, MSG(WORD_Geometry
),
1712 Child
, Label2("Low Cyl"),
1713 Child
, resizemovegadgets
.lowcyl
=StringObject
,
1715 MUIA_String_Integer
, 0,
1716 MUIA_String_Accept
, "0123456789",
1720 Child
, Label2("High Cyl"),
1721 Child
, resizemovegadgets
.highcyl
=StringObject
,
1723 MUIA_String_Integer
, 0,
1724 MUIA_String_Accept
, "0123456789",
1728 Child
, Label2("Total Cyl"),
1729 Child
, resizemovegadgets
.totalcyl
=StringObject
,
1731 MUIA_String_Integer
, 0,
1732 MUIA_String_Accept
, "0123456789",
1735 MUIA_HorizWeight
, 10,
1737 Child
, Label2("Size"),
1738 Child
, resizemovegadgets
.size
=StringObject
,
1740 MUIA_String_Accept
, "0123456789GM.",
1741 MUIA_HorizWeight
, 3,
1746 MUIA_Group_SameWidth
, TRUE
,
1748 Child
, resizemovegadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1749 Child
, resizemovegadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1753 SubWindow
, renamegadgets
.win
= WindowObject
,
1754 MUIA_Window_Title
, MSG(WORD_Rename
),
1755 MUIA_Window_Activate
, TRUE
,
1756 WindowContents
, VGroup
,
1757 Child
, renamegadgets
.name
= StringObject
,
1761 MUIA_Group_SameWidth
, TRUE
,
1763 Child
, renamegadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1764 Child
, renamegadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1768 SubWindow
, dosenvecgadgets
.win
= WindowObject
,
1769 MUIA_Window_Title
, MSG(WORD_DosEnvec
),
1770 MUIA_Window_Activate
, TRUE
,
1771 WindowContents
, VGroup
,
1775 Child
, Label2("Mask"),
1776 Child
, dosenvecgadgets
.mask
=StringObject
,
1778 MUIA_String_Integer
, -2,
1779 MUIA_String_Accept
, "0123456789",
1783 Child
, Label2("MaxTransfer"),
1784 Child
, dosenvecgadgets
.maxtransfer
=StringObject
,
1786 MUIA_String_Contents
, "0x7FFFFF",
1787 MUIA_String_Accept
, "0123456789x",
1794 Child
, Label("_Custom Bootcode"),
1796 Child
, dosenvecgadgets
.custboot
=MUI_MakeObject
1799 (IPTR
)"_Custom Bootcode"
1803 Child
, Label2("Nr. of Custom Bootblocks"),
1804 Child
, dosenvecgadgets
.numcustboot
=StringObject
,
1806 MUIA_String_Integer
, 0,
1807 MUIA_String_Accept
, "0123456789",
1813 MUIA_FrameTitle
, "Reserved Blocks at",
1815 Child
, Label2("Beginning"),
1816 Child
, dosenvecgadgets
.reservedblocksstart
=StringObject
,
1818 MUIA_String_Integer
, 0,
1819 MUIA_String_Accept
, "0123456789",
1823 Child
, Label2("End"),
1824 Child
, dosenvecgadgets
.reservedblocksend
=StringObject
,
1826 MUIA_String_Integer
, 0,
1827 MUIA_String_Accept
, "0123456789",
1834 Child
, Label("BlockSize"),
1835 Child
, dosenvecgadgets
.blocksize
=CycleObject
,
1837 MUIA_Cycle_Entries
, blocksizecycleentries
,
1841 Child
, Label2("Buffers"),
1842 Child
, dosenvecgadgets
.buffers
=StringObject
,
1844 MUIA_String_Integer
, 20,
1845 MUIA_String_Accept
, "0123456789",
1850 MUIA_Group_SameWidth
, TRUE
,
1852 Child
, dosenvecgadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1853 Child
, dosenvecgadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1857 SubWindow
, mountbootgadgets
.win
= WindowObject
,
1858 MUIA_Window_Title
, MSG(WORD_Switches
),
1859 MUIA_Window_Activate
, TRUE
,
1860 WindowContents
, VGroup
,
1862 Child
, Label(MSG(WORD_Active
)),
1864 Child
, mountbootgadgets
.active
=MUI_MakeObject
1871 Child
, Label(MSG(WORD_Automount
)),
1873 Child
, mountbootgadgets
.automount
=MUI_MakeObject
1880 Child
, Label(MSG(WORD_Bootable
)),
1882 Child
, mountbootgadgets
.bootable
=MUI_MakeObject
1889 Child
, Label(MSG(WORD_BootPri
)),
1890 Child
, mountbootgadgets
.bootpri
=StringObject
,
1892 MUIA_String_Integer
, 0,
1893 MUIA_String_Accept
, "-0123456789",
1897 MUIA_Group_SameWidth
, TRUE
,
1899 Child
, mountbootgadgets
.ok
= IMAGEBUTTON(WORD_Ok
, COOL_USEIMAGE_ID
),
1900 Child
, mountbootgadgets
.cancel
= IMAGEBUTTON(WORD_Cancel
, COOL_CANCELIMAGE_ID
),
1912 mainwin
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)app
, 2,
1913 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
1917 gadgets
.buttons
[GB_EXIT
], MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)app
, 2,
1918 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
1923 MUIM_Notify
, MUIA_Listview_DoubleClick
, TRUE
, (IPTR
)gadgets
.leftlv
, 2,
1924 MUIM_CallHook
, (IPTR
)&hook_lv_doubleclick
1929 MUIM_Notify
, MUIA_Listview_SelectChange
, TRUE
, (IPTR
)gadgets
.leftlv
, 2,
1930 MUIM_CallHook
, (IPTR
)&hook_lv_click
1932 for (i
=GB_FIRST
;i
<GB_EXIT
;i
++)
1937 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)gadgets
.buttons
[i
], 2,
1938 MUIM_CallHook
, (IPTR
)&hook_buttons
1940 /* MUIM_CallHook, hook */
1942 disableObject(gadgets
.buttons
[GB_REMOVE_ENTRY
]);
1943 disableObject(gadgets
.buttons
[GB_CREATE_TABLE
]);
1944 disableObject(gadgets
.buttons
[GB_CHANGE_TYPE
]);
1945 disableObject(gadgets
.buttons
[GB_RESIZE_MOVE
]);
1946 disableObject(gadgets
.buttons
[GB_PARENT
]);
1947 disableObject(gadgets
.buttons
[GB_RENAME
]);
1948 disableObject(gadgets
.buttons
[GB_DOSENVEC
]);
1949 disableObject(gadgets
.buttons
[GB_SWITCHES
]);
1950 disableObject(gadgets
.buttons
[GB_SAVE_CHANGES
]);
1954 MUIM_Notify
, MUIA_Menuitem_Trigger
, MUIV_EveryTime
, (IPTR
)app
, 2,
1955 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
1957 /* add device window */
1960 adddevicegadgets
.win
,
1961 MUIM_Notify
, MUIA_Window_Open
, TRUE
, (IPTR
)mainwin
, 3,
1962 MUIM_Set
, MUIA_Window_Sleep
, TRUE
1966 adddevicegadgets
.win
,
1967 MUIM_Notify
, MUIA_Window_Open
, FALSE
, (IPTR
)mainwin
, 3,
1968 MUIM_Set
, MUIA_Window_Sleep
, FALSE
1972 adddevicegadgets
.win
,
1973 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)adddevicegadgets
.win
, 3,
1974 MUIM_Set
, MUIA_Window_Open
, FALSE
1978 adddevicegadgets
.ok
,
1979 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)adddevicegadgets
.ok
, 2,
1980 MUIM_CallHook
, (IPTR
)&hook_buttons
1984 adddevicegadgets
.ok
,
1985 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)adddevicegadgets
.win
, 3,
1986 MUIM_Set
, MUIA_Window_Open
, FALSE
1990 adddevicegadgets
.cancel
,
1991 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)adddevicegadgets
.win
, 3,
1992 MUIM_Set
, MUIA_Window_Open
, FALSE
1994 /* add partition window */
1997 addpartitiongadgets
.win
,
1998 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)addpartitiongadgets
.win
, 3,
1999 MUIM_Set
, MUIA_Window_Open
, FALSE
2003 addpartitiongadgets
.ok
,
2004 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)addpartitiongadgets
.ok
, 2,
2005 MUIM_CallHook
, (IPTR
)&hook_buttons
2009 addpartitiongadgets
.ok
,
2010 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)addpartitiongadgets
.win
, 3,
2011 MUIM_Set
, MUIA_Window_Open
, FALSE
2015 addpartitiongadgets
.cancel
,
2016 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)addpartitiongadgets
.win
, 3,
2017 MUIM_Set
, MUIA_Window_Open
, FALSE
2021 addpartitiongadgets
.pt
,
2022 MUIM_Notify
, PTCT_Selected
, TRUE
, (IPTR
)addpartitiongadgets
.pt
, 2,
2023 MUIM_CallHook
, (IPTR
)&hook_buttons
2025 /* partition type window */
2028 partitiontypegadgets
.win
,
2029 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)partitiontypegadgets
.win
, 3,
2030 MUIM_Set
, MUIA_Window_Open
, FALSE
2034 partitiontypegadgets
.hexid
,
2035 MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
2036 (IPTR
)partitiontypegadgets
.hexid
, 2,
2037 MUIM_CallHook
, (IPTR
)&hook_buttons
2039 #warning "FIXME: notify doesn't work"
2042 partitiontypegadgets
.ok
,
2043 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)partitiontypegadgets
.ok
, 2,
2044 MUIM_CallHook
, (IPTR
)&hook_buttons
2048 partitiontypegadgets
.ok
,
2049 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)partitiontypegadgets
.win
, 3,
2050 MUIM_Set
, MUIA_Window_Open
, FALSE
2054 partitiontypegadgets
.cancel
,
2055 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)partitiontypegadgets
.win
, 3,
2056 MUIM_Set
, MUIA_Window_Open
, FALSE
2060 partitiontypegadgets
.lv
,
2061 MUIM_Notify
, MUIA_Listview_SelectChange
, TRUE
, (IPTR
)partitiontypegadgets
.lv
, 2,
2062 MUIM_CallHook
, (IPTR
)&hook_buttons
2064 /* partition table type window */
2067 partitiontabletypegadgets
.win
,
2068 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)partitiontabletypegadgets
.win
, 3,
2069 MUIM_Set
, MUIA_Window_Open
, FALSE
2073 partitiontabletypegadgets
.ok
,
2074 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)partitiontabletypegadgets
.ok
, 2,
2075 MUIM_CallHook
, (IPTR
)&hook_buttons
2079 partitiontabletypegadgets
.ok
,
2080 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)partitiontabletypegadgets
.win
, 3,
2081 MUIM_Set
, MUIA_Window_Open
, FALSE
2085 partitiontabletypegadgets
.cancel
,
2086 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)partitiontabletypegadgets
.win
, 3,
2087 MUIM_Set
, MUIA_Window_Open
, FALSE
2089 /* resize/move window */
2092 resizemovegadgets
.win
,
2093 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)resizemovegadgets
.win
, 3,
2094 MUIM_Set
, MUIA_Window_Open
, FALSE
2098 resizemovegadgets
.ok
,
2099 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)resizemovegadgets
.ok
, 2,
2100 MUIM_CallHook
, (IPTR
)&hook_buttons
2104 resizemovegadgets
.ok
,
2105 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)resizemovegadgets
.win
, 3,
2106 MUIM_Set
, MUIA_Window_Open
, FALSE
2110 resizemovegadgets
.size
,
2111 MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
,
2112 (IPTR
)resizemovegadgets
.size
, 2,
2113 MUIM_CallHook
, (IPTR
)&hook_buttons
2117 resizemovegadgets
.cancel
,
2118 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)resizemovegadgets
.cancel
, 2,
2119 MUIM_CallHook
, (IPTR
)&hook_buttons
2123 resizemovegadgets
.cancel
,
2124 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)resizemovegadgets
.win
, 3,
2125 MUIM_Set
, MUIA_Window_Open
, FALSE
2129 resizemovegadgets
.pt
,
2130 MUIM_Notify
, PTCT_Selected
, TRUE
, (IPTR
)resizemovegadgets
.pt
, 3,
2131 MUIM_CallHook
, (IPTR
)&hook_buttons
, PTCT_Selected
2135 resizemovegadgets
.pt
,
2136 MUIM_Notify
, PTCT_PartitionMove
, TRUE
, (IPTR
)resizemovegadgets
.pt
, 3,
2137 MUIM_CallHook
, (IPTR
)&hook_buttons
, PTCT_PartitionMove
2141 resizemovegadgets
.highcyl
,
2142 MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
, (IPTR
)resizemovegadgets
.highcyl
, 2,
2143 MUIM_CallHook
, (IPTR
)&hook_buttons
2147 resizemovegadgets
.lowcyl
,
2148 MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
, (IPTR
)resizemovegadgets
.lowcyl
, 2,
2149 MUIM_CallHook
, (IPTR
)&hook_buttons
2153 resizemovegadgets
.totalcyl
,
2154 MUIM_Notify
, MUIA_String_Acknowledge
, MUIV_EveryTime
, (IPTR
)resizemovegadgets
.totalcyl
, 2,
2155 MUIM_CallHook
, (IPTR
)&hook_buttons
2161 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)renamegadgets
.win
, 3,
2162 MUIM_Set
, MUIA_Window_Open
, FALSE
2167 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)renamegadgets
.ok
, 2,
2168 MUIM_CallHook
, (IPTR
)&hook_buttons
2173 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)renamegadgets
.win
, 3,
2174 MUIM_Set
, MUIA_Window_Open
, FALSE
2178 renamegadgets
.cancel
,
2179 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)renamegadgets
.win
, 3,
2180 MUIM_Set
, MUIA_Window_Open
, FALSE
2182 /* dosenvec window */
2185 dosenvecgadgets
.win
,
2186 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)dosenvecgadgets
.win
, 3,
2187 MUIM_Set
, MUIA_Window_Open
, FALSE
2192 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)dosenvecgadgets
.ok
, 2,
2193 MUIM_CallHook
, (IPTR
)&hook_buttons
2198 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)dosenvecgadgets
.win
, 3,
2199 MUIM_Set
, MUIA_Window_Open
, FALSE
2203 dosenvecgadgets
.cancel
,
2204 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)dosenvecgadgets
.win
, 3,
2205 MUIM_Set
, MUIA_Window_Open
, FALSE
2207 /* automount/boot window */
2210 mountbootgadgets
.win
,
2211 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
)mountbootgadgets
.win
, 3,
2212 MUIM_Set
, MUIA_Window_Open
, FALSE
2216 mountbootgadgets
.ok
,
2217 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)mountbootgadgets
.ok
, 2,
2218 MUIM_CallHook
, (IPTR
)&hook_buttons
2222 mountbootgadgets
.ok
,
2223 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)mountbootgadgets
.win
, 3,
2224 MUIM_Set
, MUIA_Window_Open
, FALSE
2228 mountbootgadgets
.cancel
,
2229 MUIM_Notify
, MUIA_Pressed
, FALSE
, (IPTR
)mountbootgadgets
.win
, 3,
2230 MUIM_Set
, MUIA_Window_Open
, FALSE
2232 set(mainwin
, MUIA_Window_Open
, TRUE
);
2238 D(bug("[HDToolBox] deinitGUI()\n"));
2241 MUI_DisposeObject(app
);
2242 if (ptclass
!= NULL
)
2245 CloseLibrary(MUIMasterBase
);
2248 BOOL
QuitGUI(ULONG
*sigs
)
2250 // moved debug from this place because it produces too much garbage
2252 if ((IPTR
)DoMethod(app
, MUIM_Application_NewInput
, (IPTR
)sigs
) == MUIV_Application_ReturnID_Quit
)
2254 D(bug("[HDToolBox] QuitGUI()\n"));