4 This small application removes GEOS disk write protection tag.
5 e.g. boot disk is always protected after boot-up
7 Maciej 'YTM/Elysium' Witkowiak
16 char diskName[17] = "";
18 static const graphicStr clearScreen = {
21 RECTANGLETO(SC_PIX_WIDTH-1, SC_PIX_HEIGHT-1),
25 static const dlgBoxStr mainDialog = {
27 DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y,
28 CBOLDON "Remove protection on:" CPLAINTEXT),
29 DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, diskName),
30 DB_ICON(OK, DBI_X_0, DBI_Y_2),
31 DB_ICON(DISK, DBI_X_1, DBI_Y_2),
32 DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
36 static const dlgBoxStr changeDiskDlg = {
38 DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y, CBOLDON "Insert new disk"),
39 DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, "into drive." CPLAINTEXT),
40 DB_ICON(OK, DBI_X_0, DBI_Y_2),
41 DB_ICON(CANCEL, DBI_X_2, DBI_Y_2),
45 static const dlgBoxStr errorDialog = {
47 DB_TXTSTR(TXT_LN_X, TXT_LN_2_Y, CBOLDON "Error happened..."),
48 DB_TXTSTR(TXT_LN_X, TXT_LN_3_Y, "exiting..." CPLAINTEXT),
49 DB_ICON(OK, DBI_X_0, DBI_Y_2),
55 DoDlgBox(&errorDialog);
61 // Here we clear the screen. Not really needed anyway...
62 GraphicsString(&clearScreen);
64 // Get the name of current disk to show it in dialog box
65 GetPtrCurDkNm(diskName);
68 switch (DoDlgBox(&mainDialog)) {
70 // What's the result of dialog box? which icon was pressed?
74 curDirHead[OFF_GS_DTYPE] = 0;
79 DoDlgBox(&changeDiskDlg);
80 GetPtrCurDkNm(diskName);
82 default: // CANCEL is the third option