Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Fix - card readers with identical drives like Kingston MobileLite G4 -
now setting 1 as a card reader sets them both. Previously it would break
once it found 1 drive with those properties.
Fix - VirtualTree complaints about updating from child rather than main
thread
Fix - Escape to minimize now works if its just normal minimize rather
than minimizetotray
  • Loading branch information
bgbennyboy committed May 30, 2017
1 parent 2ffdbd8 commit e368055
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
10 changes: 10 additions & 0 deletions USBDiskEject.stat
@@ -0,0 +1,10 @@
[Stats]
EditorSecs=15
DesignerSecs=4
InspectorSecs=1
CompileSecs=479
OtherSecs=63
StartTime=30/05/2017 12:29:28
RealKeys=0
EffectiveKeys=0
DebugSecs=1
21 changes: 18 additions & 3 deletions USB_Disk_Eject.cfg
Expand Up @@ -18,18 +18,18 @@ WindowWidth=345
WindowLeftPos=200
WindowTopPos=200
SnapTo=1
HideCardReadersWithNoMedia=1
HideCardReadersWithNoMedia=0
CardPollingInterval=5000
ShowCardReaders=1
ShowPartitionsAsOne=0
MaxWidth=0
MinimizeWithEsc=1

[Hotkeys]
NumHotkeys=6
NumHotkeys=7

[Cardreaders]
NumCardreaders=0
NumCardreaders=2

[Hotkey0]
Hotkey=117
Expand Down Expand Up @@ -61,3 +61,18 @@ Hotkey=114
HotKeyType=4
HotKeyParam=USB DISK Pro
[Hotkey6]
Hotkey=115
HotKeyType=0
HotKeyParam=
[Cardreader0]
VendorID=Generic-
ProductID=USB3.0 CRW -SD
ProductRevision=1.00
[Cardreader1]
VendorID=Generic
ProductID=STORAGE DEVICE
ProductRevision=9407
4 changes: 3 additions & 1 deletion formMain.pas
Expand Up @@ -241,7 +241,9 @@ procedure TMainfrm.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #27 then
if Options.MinimizeToTray then
Self.MinimizeClick(self);
Self.MinimizeClick(self)
else
application.Minimize;
end;

procedure TMainfrm.FormShow(Sender: TObject);
Expand Down
2 changes: 1 addition & 1 deletion uDiskEjectUtils.pas
Expand Up @@ -133,7 +133,7 @@ procedure AddCustomCardReaders(CardReaders: TCardReaderManager; Ejector: TDrive
(Trim(Ejector.RemovableDrives[J].ProductRevision) = CardReaders.CardReaders[i].ProductRevision) then
begin
Ejector.SetDriveAsCardReader(J, true);
break;
//break; //Removed break - some card readers have 2 identical drives so need both identifying as card reader - if we break here then only 1 gets identified as a card reader. Eg Kingston card reader MobileLite G4
end;
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions uDriveEjector.pas
Expand Up @@ -150,7 +150,7 @@ procedure TEventsThread.Execute;
EnterCriticalSection(CriticalSection);
fChangeMessageCount:=0; //set it back to 0 because we're about to scan
LeaveCriticalSection(CriticalSection);
fEjector.RescanAllDrives;
Synchronize( fEjector.RescanAllDrives); //Synchronise because changes will cause FOnDrivesChanged to be called which will cause main thread to update the form - but to be thread safe gui updating shouldnt be done from another thread - so synchronise makes it call it from main thead.
//messagebeep(0);
end
else
Expand Down Expand Up @@ -260,7 +260,7 @@ procedure TDriveEjector.FindRemovableDrives;
{--------------------------------------------------------------------------------------}


//NEW remove drives that have no pointpoint at all - they dont show up in the normal windows eject dialog and we cant eject them here - so dont show them.
//NEW remove drives that have no mountpoint at all - they dont show up in the normal windows eject dialog and we cant eject them here - so dont show them.
for i := DrivesCount - 1 downto 0 do
begin
if RemovableDrives[i].DriveMountPoint = '' then
Expand Down

0 comments on commit e368055

Please sign in to comment.