Index: oup/current/DataAccess/Access_OUP_ADB.pas
===================================================================
--- oup/current/DataAccess/Access_OUP_ADB.pas	(revision 109)
+++ oup/current/DataAccess/Access_OUP_ADB.pas	(revision 112)
@@ -262,4 +262,10 @@
       extension := fields.Strings[0];
     end;
+    if SortType in [ST_ExtNameAsc, ST_ExtNameDesc] then
+    begin
+      id := fields.Strings[2];
+      name := fields.Strings[1];
+      extension := fields.Strings[0];
+    end;
   end;
 
@@ -275,8 +281,5 @@
       if (NoEmptyFiles = False) or ((Fdat_files[i].FileType and $02) = 0) then
       begin
-        if AppSettings.FilenumbersAsHex then
-          id := IntToHex(Fdat_files[i].ID, 4)
-        else
-          id := FormatNumber(Fdat_files[i].ID, 5, '0');
+        id := FormatNumber(Fdat_files[i].ID, 5, '0');
         name := Fdat_files[i].Name;
         extension := Fdat_files[i].Extension;
@@ -286,4 +289,5 @@
           ST_NameAsc, ST_NameDesc: list.Add(name + ';' + id + ';' + extension);
           ST_ExtAsc, ST_ExtDesc:   list.Add(extension + ';' + id + ';' + name);
+          ST_ExtNameAsc, ST_ExtNameDesc: list.Add(name + ';' + extension + ';' + id);
         end;
       end;
@@ -294,5 +298,5 @@
   begin
     fields := TStringList.Create;
-    if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc] then
+    if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc, ST_ExtNameAsc] then
       for i := 0 to list.Count - 1 do
       begin
Index: oup/current/DataAccess/Access_OniArchive.pas
===================================================================
--- oup/current/DataAccess/Access_OniArchive.pas	(revision 109)
+++ oup/current/DataAccess/Access_OniArchive.pas	(revision 112)
@@ -60,27 +60,4 @@
 
 constructor TAccess_OniArchive.Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages);
-type
-  THeader = packed record
-    Ident:      array[0..$13] of Byte;
-    Files:      Integer;
-    NamedFiles: Integer;
-    Extensions: Integer;
-    DataAddr:   Integer;
-    DataSize:   Integer;
-    NamesAddr:  Integer;
-    NamesSize:  Integer;
-    Ident2:     array[0..$F] of Byte;
-  end;
-  TFilesMap = array of packed record
-    Extension: array[0..$3] of Char;
-    DataAddr:  Integer;
-    NameAddr:  Integer;
-    FileSize:  Integer;
-    FileType:  LongWord;
-  end;
-  TNamedFilesMap = array of packed record
-    FileNumber: Integer;
-    blubb:      Integer;
-  end;
 const
   header_ident1_pc: array[0..$13] of Byte =
@@ -250,4 +227,10 @@
       extension := fields.Strings[0];
     end;
+    if SortType in [ST_ExtNameAsc, ST_ExtNameDesc] then
+    begin
+      id := fields.Strings[2];
+      name := fields.Strings[1];
+      extension := fields.Strings[0];
+    end;
   end;
 
@@ -263,8 +246,5 @@
       if (NoEmptyFiles = False) or ((Fdat_files[i].FileType and $02) = 0) then
       begin
-        if AppSettings.FilenumbersAsHex then
-          id := IntToHex(Fdat_files[i].ID, 4)
-        else
-          id := FormatNumber(Fdat_files[i].ID, 5, '0');
+        id := FormatNumber(Fdat_files[i].ID, 5, '0');
         name := Fdat_files[i].Name;
         extension := Fdat_files[i].Extension;
@@ -274,4 +254,5 @@
           ST_NameAsc, ST_NameDesc: list.Add(name + ';' + id + ';' + extension);
           ST_ExtAsc, ST_ExtDesc:   list.Add(extension + ';' + id + ';' + name);
+          ST_ExtNameAsc, ST_ExtNameDesc: list.Add(name + ';' + extension + ';' + id);
         end;
       end;
@@ -282,5 +263,5 @@
   begin
     fields := TStringList.Create;
-    if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc] then
+    if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc, ST_ExtNameAsc] then
       for i := 0 to list.Count - 1 do
       begin
Index: oup/current/DataAccess/ConnectionManager.pas
===================================================================
--- oup/current/DataAccess/ConnectionManager.pas	(revision 109)
+++ oup/current/DataAccess/ConnectionManager.pas	(revision 112)
@@ -35,4 +35,5 @@
     function CloseConnection(ID: Integer; var Msg: TStatusMessages): Boolean; overload;
     function CloseConnection(FileName: String; var Msg: TStatusMessages): Boolean; overload;
+    function FileOpened(FileName: String): Integer;
   published
   end;
@@ -261,4 +262,19 @@
 
 
+function TConnectionManager.FileOpened(FileName: String): Integer;
+var
+  i: Integer;
+begin
+  Result := -1;
+  if Length(FConnections) > 0 then
+    for i := 0 to High(FConnections) do
+      if FConnections[i].FileName = FileName then
+      begin
+        Result := FConnections[i].ConnectionID;
+        Exit;
+      end;
+end;
+
+
 initialization
   ConManager := TConnectionManager.Create;
