--- oup/rewrite/Settings.pas 2007/01/18 17:15:59 93 +++ oup/current/Settings.pas 2007/11/26 11:02:28 248 @@ -6,7 +6,6 @@ uses type TForm_Settings = class(TForm) - check_filesashex: TCheckBox; btn_ok: TButton; btn_cancel: TButton; label_charset: TLabel; @@ -15,6 +14,7 @@ type check_reg_dat: TCheckBox; check_reg_oldb: TCheckBox; check_reg_opf: TCheckBox; + check_reg_oni: TCheckBox; procedure btn_cancelClick(Sender: TObject); procedure btn_okClick(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); @@ -40,6 +40,7 @@ function ExtensionRegistered(ext: String var ftr: TFileTypeRegistration; begin + Result := True; ftr := TFileTypeRegistration.Create; if (ftr <> nil) then begin @@ -61,7 +62,6 @@ function TForm_Settings.RegisterExtensio var ftr: TFileTypeRegistration; temps: String; - warnmsg: String; begin Result := -1; ftr := TFileTypeRegistration.Create; @@ -97,7 +97,6 @@ procedure TForm_Settings.btn_okClick(Sen var temps: String; begin - AppSettings.FilenumbersAsHex := check_filesashex.Checked; AppSettings.CharSet := StrToInt( MidStr(combo_charset.Items.Strings[combo_charset.ItemIndex], Pos( ' ', combo_charset.Items.Strings[combo_charset.ItemIndex]) + 3, Length( @@ -119,6 +118,20 @@ begin end else RegisterExtension('.dat', 2, False); + if check_reg_oni.Checked then + begin + if ExtensionRegistered('.oni', temps) then + begin + if temps <> 'ONI.oni' then + if MessageBox(Self.Handle, PChar('.oni-files already registered to "' + + temps+'". Reregister?'), PChar('Reregister?'), + MB_YESNO + MB_ICONQUESTION) = ID_YES then + RegisterExtension('.oni', 2, True); + end else + RegisterExtension('.oni', 2, True); + end else + RegisterExtension('.oni', 2, False); + if check_reg_oldb.Checked then begin if ExtensionRegistered('.oldb', temps) then @@ -172,6 +185,11 @@ begin else check_reg_dat.Checked := False; + if ExtensionRegistered('.oni', temps) then + check_reg_dat.Checked := temps = 'ONI.oni' + else + check_reg_dat.Checked := False; + if ExtensionRegistered('.oldb', temps) then check_reg_oldb.Checked := temps = 'ONI.oldb' else @@ -182,7 +200,6 @@ begin else check_reg_opf.Checked := False; - check_filesashex.Checked := AppSettings.FilenumbersAsHex; check_hideunused.Checked := AppSettings.HideUnusedData; for i := 0 to combo_charset.Items.Count - 1 do