write protect fixes

This commit is contained in:
April Ayres-Griffiths 2019-04-13 10:53:29 +10:00
parent d25ff669cb
commit 2af364c09a
8 changed files with 115 additions and 10 deletions

View File

@ -5571,6 +5571,7 @@ object GUIForm: TGUIForm
end
object MenuItem4: TMenuItem
Caption = 'Drive 1'
OnClick = MenuItem4Click
object miD1Blank: TMenuItem
Caption = 'Eject'
OnClick = miD1BlankClick
@ -5583,9 +5584,14 @@ object GUIForm: TGUIForm
Caption = 'Insert Blank'
OnClick = MenuItem17Click
end
object miDisk1WPToggle: TMenuItem
Caption = 'Write Protected'
OnClick = miDisk1WPToggleClick
end
end
object MenuItem5: TMenuItem
Caption = 'Drive 2'
OnClick = MenuItem5Click
object miD2Blank: TMenuItem
Caption = 'Eject'
OnClick = miD2BlankClick
@ -5598,6 +5604,10 @@ object GUIForm: TGUIForm
Caption = 'Insert Blank'
OnClick = MenuItem18Click
end
object miDisk2WPToggle: TMenuItem
Caption = 'Write Protected'
OnClick = miDisk2WPToggleClick
end
end
object MenuItem8: TMenuItem
Caption = 'SmartPort'
@ -10293,9 +10303,10 @@ object GUIForm: TGUIForm
object MenuItem12: TMenuItem
Caption = 'Eject'
end
object MenuItem13: TMenuItem
object miDiskMenuWP: TMenuItem
Caption = 'Write Protected'
Checked = True
OnClick = miDiskMenuWPClick
end
end
object CheckTimer: TTimer

View File

@ -21,6 +21,8 @@ type
{ TGUIForm }
TGUIForm = class(TForm)
miDisk2WPToggle: TMenuItem;
miDisk1WPToggle: TMenuItem;
MenuItem14: TMenuItem;
MenuItem17: TMenuItem;
MenuItem18: TMenuItem;
@ -213,7 +215,7 @@ type
MenuItem10: TMenuItem;
MenuItem11: TMenuItem;
MenuItem12: TMenuItem;
MenuItem13: TMenuItem;
miDiskMenuWP: TMenuItem;
miDHGREN: TMenuItem;
Input: TMenuItem;
miINPMMOff: TMenuItem;
@ -332,6 +334,8 @@ type
// procedure MenuItem1Click(Sender: TObject);
procedure MenuItem2Click(Sender: TObject);
procedure Freeze;
procedure MenuItem4Click(Sender: TObject);
procedure MenuItem5Click(Sender: TObject);
procedure miApps816PaintClick(Sender: TObject);
procedure miAppsPrintShopClick(Sender: TObject);
procedure miAppsTerminalClick(Sender: TObject);
@ -358,6 +362,9 @@ type
procedure miDHRMonoDotsClick(Sender: TObject);
procedure miDHRMonoRasterClick(Sender: TObject);
procedure miDHRMonoVoxelsClick(Sender: TObject);
procedure miDisk1WPToggleClick(Sender: TObject);
procedure miDisk2WPToggleClick(Sender: TObject);
procedure miDiskMenuWPClick(Sender: TObject);
procedure miDisksClick(Sender: TObject);
procedure miDisksConvertWOZClick(Sender: TObject);
procedure miDisksDisableWarpClick(Sender: TObject);
@ -710,6 +717,16 @@ begin
SimpleGet(baseUrl + '/api/control/window/freeze');
end;
procedure TGUIForm.MenuItem4Click(Sender: TObject);
begin
miDisk1WPToggle.Checked := (SimpleGet( baseUrl + '/api/control/hardware/disk/wp/0') = '1');
end;
procedure TGUIForm.MenuItem5Click(Sender: TObject);
begin
miDisk2WPToggle.Checked := (SimpleGet( baseUrl + '/api/control/hardware/disk/wp/1') = '1');
end;
procedure TGUIForm.miApps816PaintClick(Sender: TObject);
begin
LaunchSP( '/appleii/disk images/2mg_hdv/816paint.po' );
@ -890,6 +907,21 @@ begin
UpdateConfig( 'video/init.video.dhgrmode', '4', true );
end;
procedure TGUIForm.miDisk1WPToggleClick(Sender: TObject);
begin
SimpleGet( baseUrl + '/api/control/hardware/disk/wp/0/toggle' );
end;
procedure TGUIForm.miDisk2WPToggleClick(Sender: TObject);
begin
end;
procedure TGUIForm.miDiskMenuWPClick(Sender: TObject);
begin
SimpleGet( baseUrl + '/api/control/hardware/disk/wp/'+IntToStr(DiskMenu.Tag)+'/toggle' );
end;
procedure TGUIForm.miDisksClick(Sender: TObject);
begin
{ disk menu }
@ -2277,6 +2309,10 @@ end;
procedure TGUIForm.DiskMenuPopup(Sender: TObject);
begin
inPopup := true;
case SimpleGet(baseUrl+'/api/control/hardware/disk/wp/'+IntToStr(TMenuItem(sender).Tag)) of
'0': miDiskMenuWP.Checked := false;
'1': miDiskMenuWP.Checked := true;
end;
end;
{$IFDEF WINDOWS}
@ -2409,7 +2445,7 @@ begin
begin
if (ssCtrl in Shift) and (ssShift in Shift) then
begin
StatusBar1.SimpleText := 'Shift+Ctrl+'+char(Key);
//StatusBar1.SimpleText := 'Shift+Ctrl+'+char(Key);
Result := (Integer(Key) - 65) + SHIFT_CTRL_A;
end
else if ssShift in Shift then

View File

@ -1,7 +1,7 @@
object GUIForm: TGUIForm
Left = 2260
Left = 2255
Height = 668
Top = 311
Top = 312
Width = 1014
AlphaBlendValue = 128
Caption = 'microM8 GUI'
@ -5571,6 +5571,7 @@ object GUIForm: TGUIForm
end
object MenuItem4: TMenuItem
Caption = 'Drive 1'
OnClick = MenuItem4Click
object miD1Blank: TMenuItem
Caption = 'Eject'
OnClick = miD1BlankClick
@ -5583,9 +5584,14 @@ object GUIForm: TGUIForm
Caption = 'Insert Blank'
OnClick = MenuItem17Click
end
object miDisk1WPToggle: TMenuItem
Caption = 'Write Protected'
OnClick = miDisk1WPToggleClick
end
end
object MenuItem5: TMenuItem
Caption = 'Drive 2'
OnClick = MenuItem5Click
object miD2Blank: TMenuItem
Caption = 'Eject'
OnClick = miD2BlankClick
@ -5598,6 +5604,10 @@ object GUIForm: TGUIForm
Caption = 'Insert Blank'
OnClick = MenuItem18Click
end
object miDisk2WPToggle: TMenuItem
Caption = 'Write Protected'
OnClick = miDisk2WPToggleClick
end
end
object MenuItem8: TMenuItem
Caption = 'SmartPort'
@ -10293,9 +10303,10 @@ object GUIForm: TGUIForm
object MenuItem12: TMenuItem
Caption = 'Eject'
end
object MenuItem13: TMenuItem
object miDiskMenuWP: TMenuItem
Caption = 'Write Protected'
Checked = True
OnClick = miDiskMenuWPClick
end
end
object CheckTimer: TTimer

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
object GUIForm: TGUIForm
Left = 2260
Left = 2255
Height = 668
Top = 311
Top = 312
Width = 1014
AlphaBlendValue = 128
Caption = 'microM8 GUI'
@ -5571,6 +5571,7 @@ object GUIForm: TGUIForm
end
object MenuItem4: TMenuItem
Caption = 'Drive 1'
OnClick = MenuItem4Click
object miD1Blank: TMenuItem
Caption = 'Eject'
OnClick = miD1BlankClick
@ -5583,9 +5584,14 @@ object GUIForm: TGUIForm
Caption = 'Insert Blank'
OnClick = MenuItem17Click
end
object miDisk1WPToggle: TMenuItem
Caption = 'Write Protected'
OnClick = miDisk1WPToggleClick
end
end
object MenuItem5: TMenuItem
Caption = 'Drive 2'
OnClick = MenuItem5Click
object miD2Blank: TMenuItem
Caption = 'Eject'
OnClick = miD2BlankClick
@ -5598,6 +5604,10 @@ object GUIForm: TGUIForm
Caption = 'Insert Blank'
OnClick = MenuItem18Click
end
object miDisk2WPToggle: TMenuItem
Caption = 'Write Protected'
OnClick = miDisk2WPToggleClick
end
end
object MenuItem8: TMenuItem
Caption = 'SmartPort'
@ -10293,9 +10303,10 @@ object GUIForm: TGUIForm
object MenuItem12: TMenuItem
Caption = 'Eject'
end
object MenuItem13: TMenuItem
object miDiskMenuWP: TMenuItem
Caption = 'Write Protected'
Checked = True
OnClick = miDiskMenuWPClick
end
end
object CheckTimer: TTimer

View File

@ -21,6 +21,8 @@ type
{ TGUIForm }
TGUIForm = class(TForm)
miDisk2WPToggle: TMenuItem;
miDisk1WPToggle: TMenuItem;
MenuItem14: TMenuItem;
MenuItem17: TMenuItem;
MenuItem18: TMenuItem;
@ -213,7 +215,7 @@ type
MenuItem10: TMenuItem;
MenuItem11: TMenuItem;
MenuItem12: TMenuItem;
MenuItem13: TMenuItem;
miDiskMenuWP: TMenuItem;
miDHGREN: TMenuItem;
Input: TMenuItem;
miINPMMOff: TMenuItem;
@ -332,6 +334,8 @@ type
// procedure MenuItem1Click(Sender: TObject);
procedure MenuItem2Click(Sender: TObject);
procedure Freeze;
procedure MenuItem4Click(Sender: TObject);
procedure MenuItem5Click(Sender: TObject);
procedure miApps816PaintClick(Sender: TObject);
procedure miAppsPrintShopClick(Sender: TObject);
procedure miAppsTerminalClick(Sender: TObject);
@ -358,6 +362,9 @@ type
procedure miDHRMonoDotsClick(Sender: TObject);
procedure miDHRMonoRasterClick(Sender: TObject);
procedure miDHRMonoVoxelsClick(Sender: TObject);
procedure miDisk1WPToggleClick(Sender: TObject);
procedure miDisk2WPToggleClick(Sender: TObject);
procedure miDiskMenuWPClick(Sender: TObject);
procedure miDisksClick(Sender: TObject);
procedure miDisksConvertWOZClick(Sender: TObject);
procedure miDisksDisableWarpClick(Sender: TObject);
@ -710,6 +717,16 @@ begin
SimpleGet(baseUrl + '/api/control/window/freeze');
end;
procedure TGUIForm.MenuItem4Click(Sender: TObject);
begin
miDisk1WPToggle.Checked := (SimpleGet( baseUrl + '/api/control/hardware/disk/wp/0') = '1');
end;
procedure TGUIForm.MenuItem5Click(Sender: TObject);
begin
miDisk2WPToggle.Checked := (SimpleGet( baseUrl + '/api/control/hardware/disk/wp/1') = '1');
end;
procedure TGUIForm.miApps816PaintClick(Sender: TObject);
begin
LaunchSP( '/appleii/disk images/2mg_hdv/816paint.po' );
@ -890,6 +907,21 @@ begin
UpdateConfig( 'video/init.video.dhgrmode', '4', true );
end;
procedure TGUIForm.miDisk1WPToggleClick(Sender: TObject);
begin
SimpleGet( baseUrl + '/api/control/hardware/disk/wp/0/toggle' );
end;
procedure TGUIForm.miDisk2WPToggleClick(Sender: TObject);
begin
SimpleGet( baseUrl + '/api/control/hardware/disk/wp/1/toggle' );
end;
procedure TGUIForm.miDiskMenuWPClick(Sender: TObject);
begin
SimpleGet( baseUrl + '/api/control/hardware/disk/wp/'+IntToStr(DiskMenu.Tag)+'/toggle' );
end;
procedure TGUIForm.miDisksClick(Sender: TObject);
begin
{ disk menu }
@ -2277,6 +2309,10 @@ end;
procedure TGUIForm.DiskMenuPopup(Sender: TObject);
begin
inPopup := true;
case SimpleGet(baseUrl+'/api/control/hardware/disk/wp/'+IntToStr(TMenuItem(sender).Tag)) of
'0': miDiskMenuWP.Checked := false;
'1': miDiskMenuWP.Checked := true;
end;
end;
{$IFDEF WINDOWS}