improved program:
- date selecter now preselects current date - added button to open scanned file with external program
This commit is contained in:
117
Belegscanner.lps
117
Belegscanner.lps
@@ -3,13 +3,13 @@
|
|||||||
<ProjectSession>
|
<ProjectSession>
|
||||||
<Version Value="10"/>
|
<Version Value="10"/>
|
||||||
<BuildModes Active="Default"/>
|
<BuildModes Active="Default"/>
|
||||||
<Units Count="9">
|
<Units Count="15">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="Belegscanner.lpr"/>
|
<Filename Value="Belegscanner.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
<CursorPos X="11" Y="8"/>
|
<CursorPos X="17" Y="10"/>
|
||||||
<UsageCount Value="29"/>
|
<UsageCount Value="31"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
@@ -18,9 +18,9 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<TopLine Value="205"/>
|
<TopLine Value="301"/>
|
||||||
<CursorPos X="53" Y="234"/>
|
<CursorPos Y="340"/>
|
||||||
<UsageCount Value="29"/>
|
<UsageCount Value="31"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
@@ -77,127 +77,172 @@
|
|||||||
<CursorPos Y="141"/>
|
<CursorPos Y="141"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit8>
|
</Unit8>
|
||||||
|
<Unit9>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/3.0.4/rtl/objpas/classes/classesh.inc"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="1834"/>
|
||||||
|
<CursorPos X="14" Y="1873"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit9>
|
||||||
|
<Unit10>
|
||||||
|
<Filename Value="/usr/lib/lazarus/1.8.2/lcl/calendar.pp"/>
|
||||||
|
<UnitName Value="Calendar"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="64"/>
|
||||||
|
<CursorPos X="14" Y="104"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit10>
|
||||||
|
<Unit11>
|
||||||
|
<Filename Value="scanner.lfm"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<CursorPos X="20" Y="22"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<DefaultSyntaxHighlighter Value="LFM"/>
|
||||||
|
</Unit11>
|
||||||
|
<Unit12>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/3.0.4/rtl/objpas/sysutils/filutilh.inc"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="110"/>
|
||||||
|
<CursorPos X="10" Y="155"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit12>
|
||||||
|
<Unit13>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/3.0.4/rtl/unix/unix.pp"/>
|
||||||
|
<UnitName Value="Unix"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="58"/>
|
||||||
|
<CursorPos X="6" Y="98"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit13>
|
||||||
|
<Unit14>
|
||||||
|
<Filename Value="/usr/lib/lazarus/1.8.2/lcl/controls.pp"/>
|
||||||
|
<UnitName Value="Controls"/>
|
||||||
|
<EditorIndex Value="-1"/>
|
||||||
|
<TopLine Value="1663"/>
|
||||||
|
<CursorPos X="14" Y="1696"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit14>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="102" TopLine="46"/>
|
<Caret Line="327" Column="53" TopLine="295"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="104" TopLine="48"/>
|
<Caret Line="334" Column="6" TopLine="240"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="229" Column="112" TopLine="209"/>
|
<Caret Line="235" Column="3" TopLine="228"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="23" Column="29" TopLine="4"/>
|
<Caret Line="109" Column="11" TopLine="70"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="29" Column="80"/>
|
<Caret Line="110" Column="134" TopLine="70"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="75" Column="128"/>
|
<Caret Line="333" Column="10" TopLine="295"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="106" Column="12" TopLine="66"/>
|
<Caret Line="334" Column="3" TopLine="295"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="108" Column="26" TopLine="68"/>
|
<Caret Line="342" Column="13" TopLine="295"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="305" Column="38" TopLine="252"/>
|
<Caret Line="23" Column="119"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="306" Column="6" TopLine="252"/>
|
<Caret Line="30" Column="15"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="268" Column="157" TopLine="253"/>
|
<Caret Line="48" Column="25"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="316" Column="106" TopLine="254"/>
|
<Caret Line="83" Column="126" TopLine="22"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="75" Column="30" TopLine="50"/>
|
<Caret Line="86" Column="21" TopLine="25"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="233" Column="73" TopLine="112"/>
|
<Caret Line="246" Column="120" TopLine="185"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="235" Column="73" TopLine="155"/>
|
<Caret Line="334" Column="33" TopLine="273"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="340" TopLine="261"/>
|
<Caret Line="335" Column="44" TopLine="274"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="48" Column="25" TopLine="18"/>
|
<Caret Line="338" Column="31" TopLine="277"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="143" Column="45" TopLine="102"/>
|
<Caret Line="340" Column="24" TopLine="279"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="284" Column="33" TopLine="235"/>
|
<Caret Line="342" Column="13" TopLine="281"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="193" TopLine="153"/>
|
<Caret Line="340" Column="3" TopLine="297"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="192" Column="3" TopLine="190"/>
|
<Caret Line="30" Column="15" TopLine="12"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="58" Column="27" TopLine="18"/>
|
<Caret Line="23" Column="119" TopLine="12"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="187" Column="15" TopLine="114"/>
|
<Caret Line="30" Column="15" TopLine="12"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="194" Column="15" TopLine="121"/>
|
<Caret Line="48" Column="25" TopLine="12"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="200" Column="15" TopLine="127"/>
|
<Caret Line="83" Column="126" TopLine="22"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="240" Column="15" TopLine="167"/>
|
<Caret Line="86" Column="21" TopLine="25"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="250" Column="15" TopLine="177"/>
|
<Caret Line="83" Column="141" TopLine="125"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="256" Column="15" TopLine="183"/>
|
<Caret Line="23" Column="149" TopLine="25"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="262" Column="15" TopLine="189"/>
|
<Caret Line="224" Column="51" TopLine="213"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="scanner.pas"/>
|
<Filename Value="scanner.pas"/>
|
||||||
<Caret Line="331" Column="10" TopLine="265"/>
|
<Caret Line="338" Column="39" TopLine="302"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
|
|||||||
36
scanner.lfm
36
scanner.lfm
@@ -1,7 +1,7 @@
|
|||||||
object ScanForm: TScanForm
|
object ScanForm: TScanForm
|
||||||
Left = 1534
|
Left = 2222
|
||||||
Height = 869
|
Height = 869
|
||||||
Top = 299
|
Top = 198
|
||||||
Width = 1188
|
Width = 1188
|
||||||
Caption = 'Belegscanner'
|
Caption = 'Belegscanner'
|
||||||
ClientHeight = 869
|
ClientHeight = 869
|
||||||
@@ -10,7 +10,7 @@ object ScanForm: TScanForm
|
|||||||
LCLVersion = '1.8.2.0'
|
LCLVersion = '1.8.2.0'
|
||||||
object TypeSelector: TComboBox
|
object TypeSelector: TComboBox
|
||||||
Left = 904
|
Left = 904
|
||||||
Height = 29
|
Height = 28
|
||||||
Top = 208
|
Top = 208
|
||||||
Width = 276
|
Width = 276
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@@ -21,7 +21,7 @@ object ScanForm: TScanForm
|
|||||||
end
|
end
|
||||||
object Origin: TComboBox
|
object Origin: TComboBox
|
||||||
Left = 904
|
Left = 904
|
||||||
Height = 29
|
Height = 28
|
||||||
Top = 240
|
Top = 240
|
||||||
Width = 272
|
Width = 272
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@@ -32,7 +32,7 @@ object ScanForm: TScanForm
|
|||||||
end
|
end
|
||||||
object Destination: TComboBox
|
object Destination: TComboBox
|
||||||
Left = 904
|
Left = 904
|
||||||
Height = 29
|
Height = 28
|
||||||
Top = 304
|
Top = 304
|
||||||
Width = 272
|
Width = 272
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@@ -54,7 +54,7 @@ object ScanForm: TScanForm
|
|||||||
end
|
end
|
||||||
object Product: TComboBox
|
object Product: TComboBox
|
||||||
Left = 904
|
Left = 904
|
||||||
Height = 29
|
Height = 28
|
||||||
Top = 240
|
Top = 240
|
||||||
Width = 276
|
Width = 276
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@@ -76,7 +76,7 @@ object ScanForm: TScanForm
|
|||||||
end
|
end
|
||||||
object Resolution: TComboBox
|
object Resolution: TComboBox
|
||||||
Left = 904
|
Left = 904
|
||||||
Height = 29
|
Height = 28
|
||||||
Top = 368
|
Top = 368
|
||||||
Width = 72
|
Width = 72
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
@@ -90,9 +90,9 @@ object ScanForm: TScanForm
|
|||||||
end
|
end
|
||||||
object DPI: TLabel
|
object DPI: TLabel
|
||||||
Left = 984
|
Left = 984
|
||||||
Height = 17
|
Height = 16
|
||||||
Top = 376
|
Top = 376
|
||||||
Width = 17
|
Width = 19
|
||||||
Caption = 'dpi'
|
Caption = 'dpi'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
@@ -110,7 +110,7 @@ object ScanForm: TScanForm
|
|||||||
end
|
end
|
||||||
object Stop: TComboBox
|
object Stop: TComboBox
|
||||||
Left = 904
|
Left = 904
|
||||||
Height = 29
|
Height = 28
|
||||||
Top = 272
|
Top = 272
|
||||||
Width = 272
|
Width = 272
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@@ -132,13 +132,13 @@ object ScanForm: TScanForm
|
|||||||
Height = 190
|
Height = 190
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 276
|
Width = 276
|
||||||
DateTime = 43775
|
DateTime = 0
|
||||||
OnChange = CalendarChange
|
OnChange = CalendarChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object PicSize: TComboBox
|
object PicSize: TComboBox
|
||||||
Left = 904
|
Left = 904
|
||||||
Height = 29
|
Height = 28
|
||||||
Top = 336
|
Top = 336
|
||||||
Width = 272
|
Width = 272
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
@@ -153,6 +153,8 @@ object ScanForm: TScanForm
|
|||||||
Caption = 'Löschen'
|
Caption = 'Löschen'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
OnClick = DropButtonClick
|
OnClick = DropButtonClick
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
object Swap: TButton
|
object Swap: TButton
|
||||||
@@ -164,6 +166,16 @@ object ScanForm: TScanForm
|
|||||||
OnClick = SwapClick
|
OnClick = SwapClick
|
||||||
TabOrder = 10
|
TabOrder = 10
|
||||||
end
|
end
|
||||||
|
object extButton: TButton
|
||||||
|
Left = 904
|
||||||
|
Height = 49
|
||||||
|
Top = 456
|
||||||
|
Width = 272
|
||||||
|
Caption = 'extern öffnen'
|
||||||
|
Enabled = False
|
||||||
|
OnClick = extButtonClick
|
||||||
|
TabOrder = 11
|
||||||
|
end
|
||||||
object BaseFolderDialog: TSelectDirectoryDialog
|
object BaseFolderDialog: TSelectDirectoryDialog
|
||||||
left = 520
|
left = 520
|
||||||
top = 128
|
top = 128
|
||||||
|
|||||||
31
scanner.pas
31
scanner.pas
@@ -13,18 +13,19 @@ type
|
|||||||
{ ScanThread }
|
{ ScanThread }
|
||||||
ScanThread = class(TThread)
|
ScanThread = class(TThread)
|
||||||
private
|
private
|
||||||
dbtn, sbtn : TButton;
|
dbtn, obtn, sbtn : TButton;
|
||||||
folder,r :String;
|
folder,r :String;
|
||||||
s:TPoint;
|
s:TPoint;
|
||||||
p:TImage;
|
p:TImage;
|
||||||
protected
|
protected
|
||||||
procedure Execute; override;
|
procedure Execute; override;
|
||||||
public
|
public
|
||||||
constructor Create(scanButton: TButton; dir: String; size: TPoint; resolution: String; preview: TImage; dropButton: TButton);
|
constructor Create(scanButton: TButton; dir: String; size: TPoint; resolution: String; preview: TImage; dropButton: TButton; openButton: TButton);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TScanForm }
|
{ TScanForm }
|
||||||
TScanForm = class(TForm)
|
TScanForm = class(TForm)
|
||||||
|
extButton: TButton;
|
||||||
Swap: TButton;
|
Swap: TButton;
|
||||||
DropButton: TButton;
|
DropButton: TButton;
|
||||||
Calendar: TCalendar;
|
Calendar: TCalendar;
|
||||||
@@ -43,6 +44,7 @@ type
|
|||||||
TypeSelector: TComboBox;
|
TypeSelector: TComboBox;
|
||||||
|
|
||||||
procedure BaseFolderClick(Sender: TObject);
|
procedure BaseFolderClick(Sender: TObject);
|
||||||
|
procedure extButtonClick(Sender: TObject);
|
||||||
procedure DropButtonClick(Sender: TObject);
|
procedure DropButtonClick(Sender: TObject);
|
||||||
procedure CalendarChange(Sender: TObject);
|
procedure CalendarChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
@@ -60,8 +62,11 @@ type
|
|||||||
private
|
private
|
||||||
date: TDateTime;
|
date: TDateTime;
|
||||||
function getSize(): TPoint;
|
function getSize(): TPoint;
|
||||||
public
|
|
||||||
|
|
||||||
|
public
|
||||||
|
const
|
||||||
|
SCANNING : Integer = 1;
|
||||||
|
IDLE: Integer = 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@@ -73,9 +78,10 @@ implementation
|
|||||||
|
|
||||||
{ ScanThread }
|
{ ScanThread }
|
||||||
|
|
||||||
constructor ScanThread.Create(scanButton: TButton; dir: String; size: TPoint; resolution: String; preview: TImage; dropButton: TButton );
|
constructor ScanThread.Create(scanButton: TButton; dir: String; size: TPoint; resolution: String; preview: TImage; dropButton: TButton; openButton: TButton );
|
||||||
begin
|
begin
|
||||||
sbtn := scanButton;
|
sbtn := scanButton;
|
||||||
|
obtn := openButton;
|
||||||
dbtn := dropButton;
|
dbtn := dropButton;
|
||||||
folder:=dir;
|
folder:=dir;
|
||||||
s:=size;
|
s:=size;
|
||||||
@@ -111,7 +117,9 @@ begin
|
|||||||
dbtn.Hint:=folder+fname;
|
dbtn.Hint:=folder+fname;
|
||||||
dbtn.Caption:=fname+' löschen';
|
dbtn.Caption:=fname+' löschen';
|
||||||
dbtn.Enabled:=true;
|
dbtn.Enabled:=true;
|
||||||
|
obtn.Enabled:=true;
|
||||||
sbtn.Enabled:=true;
|
sbtn.Enabled:=true;
|
||||||
|
sbtn.Tag := TScanForm.IDLE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function allowed(s: String): boolean;
|
function allowed(s: String): boolean;
|
||||||
@@ -186,7 +194,7 @@ begin
|
|||||||
Swap.Enabled:=state;
|
Swap.Enabled:=state;
|
||||||
Product.Enabled := not state;
|
Product.Enabled := not state;
|
||||||
Product.Visible := not state;
|
Product.Visible := not state;
|
||||||
ScanButton.Enabled:=true;
|
if (ScanButton.Tag <> TScanForm.SCANNING) then ScanButton.Enabled:=true;
|
||||||
UpdateFolder();
|
UpdateFolder();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -225,6 +233,7 @@ var
|
|||||||
size: TPoint;
|
size: TPoint;
|
||||||
begin
|
begin
|
||||||
ScanButton.Enabled:=false;
|
ScanButton.Enabled:=false;
|
||||||
|
ScanButton.Tag:=TScanForm.SCANNING;
|
||||||
filename := GetEnvironmentVariable('HOME') + '/.config/belegscanner.conf';
|
filename := GetEnvironmentVariable('HOME') + '/.config/belegscanner.conf';
|
||||||
size := getSize();
|
size := getSize();
|
||||||
json := ExportConfig();
|
json := ExportConfig();
|
||||||
@@ -234,7 +243,7 @@ begin
|
|||||||
finally
|
finally
|
||||||
config.Free;
|
config.Free;
|
||||||
end;
|
end;
|
||||||
ScanThread.Create(ScanButton,BaseFolder.Caption+'/'+FolderName.Caption+'/',size,Resolution.Caption,Preview,DropButton);
|
ScanThread.Create(ScanButton,BaseFolder.Caption+'/'+FolderName.Caption+'/',size,Resolution.Caption,Preview,DropButton,extButton);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TScanForm.StopChange(Sender: TObject);
|
procedure TScanForm.StopChange(Sender: TObject);
|
||||||
@@ -275,6 +284,7 @@ begin
|
|||||||
BaseFolder.Caption:=GetEnvironmentVariable('HOME');
|
BaseFolder.Caption:=GetEnvironmentVariable('HOME');
|
||||||
filename := GetEnvironmentVariable('HOME') + '/.config/belegscanner.conf';
|
filename := GetEnvironmentVariable('HOME') + '/.config/belegscanner.conf';
|
||||||
lines := TStringList.Create;
|
lines := TStringList.Create;
|
||||||
|
Calendar.DateTime:=Now;
|
||||||
try
|
try
|
||||||
lines.LoadFromFile(filename);
|
lines.LoadFromFile(filename);
|
||||||
for index := 0 to lines.Count-1 do
|
for index := 0 to lines.Count-1 do
|
||||||
@@ -319,11 +329,20 @@ begin
|
|||||||
BaseFolder.Caption := BaseFolderDialog.FileName;
|
BaseFolder.Caption := BaseFolderDialog.FileName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TScanForm.extButtonClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
cmd: string;
|
||||||
|
begin
|
||||||
|
cmd := 'gvfs-open "'+DropButton.Hint+'"';
|
||||||
|
fpSystem(cmd);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TScanForm.DropButtonClick(Sender: TObject);
|
procedure TScanForm.DropButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DeleteFile(DropButton.Hint);
|
DeleteFile(DropButton.Hint);
|
||||||
Preview.Picture:=nil;
|
Preview.Picture:=nil;
|
||||||
DropButton.Enabled:=false;
|
DropButton.Enabled:=false;
|
||||||
|
extButton.Enabled:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user