diff --git a/Belegscanner.lps b/Belegscanner.lps
index a1d1ace..5610665 100644
--- a/Belegscanner.lps
+++ b/Belegscanner.lps
@@ -19,7 +19,7 @@
-
+
@@ -81,123 +81,123 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/scanner.pas b/scanner.pas
index aa0ccad..8f77f77 100644
--- a/scanner.pas
+++ b/scanner.pas
@@ -55,7 +55,6 @@ type
procedure TypeSelectorChange(Sender: TObject);
function ExportConfig(): string;
function ExportOptions(dropDown: TComboBox): string;
- procedure UpdateTypes();
procedure UpdateFolder();
procedure MixLocations(d1: TComboBox; d2: TComboBox; d3: TComboBox);
private
@@ -97,6 +96,8 @@ begin
num := num +1;
fname := 'scan_';
if (num<10) then fname:=fname+'0';
+ if (num<100) then fname:=fname+'0';
+ if (num<1000) then fname:=fname+'0';
fname := fname+IntToStr(num)+'.jpg';
until not FileExists(folder+fname);
fpSystem('scanimage -x '+IntToStr(s.x)+' -y '+IntToStr(s.y)+' --mode Color --resolution '+r+' --format jpeg > "'+folder+fname+'"');
@@ -141,7 +142,8 @@ end;
function TScanForm.ExportConfig(): string;
begin
- Result := 'types:' + ExportOptions(TypeSelector) + #13;
+ Result := 'folder:'+BaseFolder.Caption+#13;
+ Result := Result + 'types:' + ExportOptions(TypeSelector) + #13;
Result := Result + 'items:' + ExportOptions(Product) + #13;
MixLocations(Origin, Destination, Stop);
Result := Result + 'locations:' + ExportOPtions(Origin) + #13;
@@ -190,7 +192,6 @@ end;
procedure TScanForm.CalendarChange(Sender: TObject);
begin
date := Calendar.DateTime;
- UpdateTypes();
TypeSelector.Enabled := True;
UpdateFolder();
end;
@@ -232,7 +233,7 @@ begin
finally
config.Free;
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);
end;
procedure TScanForm.StopChange(Sender: TObject);
@@ -270,7 +271,7 @@ var
line: String;
index: integer;
begin
- BaseFolder.Caption:=GetEnvironmentVariable('HOME') + '/Documents/Quittungen/';
+ BaseFolder.Caption:=GetEnvironmentVariable('HOME');
filename := GetEnvironmentVariable('HOME') + '/.config/belegscanner.conf';
lines := TStringList.Create;
try
@@ -278,6 +279,11 @@ begin
for index := 0 to lines.Count-1 do
begin
line:=lines.Strings[index];
+ if line.StartsWith('folder:') then
+ begin
+ line:=line.Substring(7);
+ BaseFolder.Caption:=line;
+ end;
if line.StartsWith('types:') then
begin
line := line.Substring(6);
@@ -324,7 +330,7 @@ procedure TScanForm.UpdateFolder();
var
tx: string;
begin
- tx := FormatDateTime('YYYY', date) + '/' + FormatDateTime('YYYY-MM-DD', date) + ' - ';
+ tx := FormatDateTime('YYYY-MM-DD', date) + ' - ';
if (Product.Enabled and (Product.Tag > 0) and not( Product.Text = '') and not (Product.Text = 'Produkt')) then
tx := tx + Product.Text + ' von ';
if (TypeSelector.Tag > 0) then
@@ -338,9 +344,4 @@ begin
FolderName.Caption := tx;
end;
-procedure TScanForm.UpdateTypes();
-begin
-
-end;
-
end.