[GB.SCANNER]
* BUG: Test if the scanner exist just on an option call. git-svn-id: svn://localhost/gambas/trunk@6766 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
027c1b60f1
commit
be0dc2ea33
5 changed files with 14 additions and 6 deletions
comp/src/gb.scanner
|
@ -1,7 +1,7 @@
|
|||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 3.6.90
|
||||
Title=gb.scanner
|
||||
Startup=MTest2
|
||||
Startup=Module2
|
||||
Version=3.6.90
|
||||
Component=gb.image
|
||||
Component=gb.gui
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
' Gambas module file
|
||||
|
||||
Public Sub Main()
|
||||
|
||||
Dim s As String
|
||||
|
||||
Print Split("preview[=(yes|no)] [no]", " ", "()").join()
|
||||
For Each s In Scanners
|
||||
Print s
|
||||
Print Scanners[s].IsAvailable()
|
||||
Next
|
||||
|
||||
End
|
||||
|
|
|
@ -40,9 +40,9 @@ Public Sub _New(sDevice As String)
|
|||
|
||||
$sDeviceName = "--device-name='" & sDevice & "'"
|
||||
$sName = sDevice
|
||||
If Not IsAvailable() Then
|
||||
Error.Raise("Unknown Device")
|
||||
Endif
|
||||
'If Not IsAvailable() Then
|
||||
' Error.Raise("Unknown Device")
|
||||
'Endif
|
||||
|
||||
End
|
||||
|
||||
|
@ -99,6 +99,8 @@ Private Sub GetOptions()
|
|||
Dim iStartOptions As Integer
|
||||
Dim iEndOptions As Integer
|
||||
|
||||
If Not IsAvailable() Then Error.Raise("Unknown device or device not available")
|
||||
|
||||
$aOptionsNames = New String[]
|
||||
$aOptions = New _Option[]
|
||||
Shell "scanimage " & $sDeviceName & " -A" To sRet
|
||||
|
|
|
@ -38,6 +38,7 @@ Static Private Function IsScanner() As Boolean
|
|||
|
||||
End
|
||||
|
||||
|
||||
Static Private Sub GetList(Optional BackGround As Boolean) As String
|
||||
|
||||
Dim sRet As String
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
MTest2
|
||||
Module2
|
||||
gb.scanner
|
||||
0
|
||||
0
|
||||
|
|
Loading…
Reference in a new issue