From 4ed4dc594e676f84f4e9f8c3c19a0f55049c3af8 Mon Sep 17 00:00:00 2001 From: "meffi@lab313.ru" Date: Wed, 7 May 2014 13:47:51 +0000 Subject: [PATCH] Fixed file associations with russian paths. Stable. --- tim2view.lpi | 5 +- tim2view.lps | 408 +++++++++++++++++++++++++------------------------- tim2view.res | Bin 16796 -> 16796 bytes ucommon.pas | 2 +- umain.lfm | 68 ++++----- umain.pas | 33 +--- usettings.pas | 46 +++++- 7 files changed, 285 insertions(+), 277 deletions(-) diff --git a/tim2view.lpi b/tim2view.lpi index de0a553..f89d45a 100644 --- a/tim2view.lpi +++ b/tim2view.lpi @@ -23,8 +23,7 @@ - - + @@ -397,4 +396,4 @@ - \ No newline at end of file + diff --git a/tim2view.lps b/tim2view.lps index e88720b..48babc1 100644 --- a/tim2view.lps +++ b/tim2view.lps @@ -1,204 +1,204 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tim2view.res b/tim2view.res index 38d297e14c810dfa1b611cf0ed3ad62c8c0ce8a4..936de879d84001054c363036cb11ba9fe0389a09 100644 GIT binary patch delta 37 tcmbQ!%s8i+al;yBW(J0k&Fh)X85ubzKW9;AH(}6YFkoQVEXvw$0|3o632XoW delta 37 tcmbQ!%s8i+al;yBW-f++&Fh)X85y}IKW9;AH(=0XFk~>;EXvw$0|3tH37`M~ diff --git a/ucommon.pas b/ucommon.pas index f72ced9..bdb182a 100644 --- a/ucommon.pas +++ b/ucommon.pas @@ -3,7 +3,7 @@ unit ucommon; interface const - cProgramName = 'Tim2View SVN.r80 by [Lab 313] (for ' + + cProgramName = 'Tim2View SVN.r84 by [Lab 313] (for ' + {$IFDEF Linux}'Linux' + {$IFEND} {$IFDEF Darwin}'Mac OS X' + {$IFEND} {$IFDEF Windows}'Windows' + {$IFEND} diff --git a/umain.lfm b/umain.lfm index b146469..4bc7159 100644 --- a/umain.lfm +++ b/umain.lfm @@ -9,7 +9,7 @@ object frmMain: TfrmMain VertScrollBar.Range = 344 ActiveControl = pnlList AllowDropFiles = True - ClientHeight = 643 + ClientHeight = 648 ClientWidth = 790 Color = clBtnFace Font.Color = clWindowText @@ -498,7 +498,7 @@ object frmMain: TfrmMain object pnlStatus: TPanel Left = 0 Height = 30 - Top = 613 + Top = 618 Width = 790 Align = alBottom BevelOuter = bvLowered @@ -538,13 +538,13 @@ object frmMain: TfrmMain end object cbbFiles: TComboBox Left = 0 - Height = 28 + Height = 21 Top = 0 Width = 790 Align = alTop DropDownCount = 30 Enabled = False - ItemHeight = 0 + ItemHeight = 13 OnChange = actChangeFileExecute OnCloseUp = actReturnFocusExecute Style = csDropDownList @@ -552,33 +552,33 @@ object frmMain: TfrmMain end object pnlMain: TPanel Left = 0 - Height = 585 - Top = 28 + Height = 597 + Top = 21 Width = 790 Align = alClient BevelOuter = bvNone - ClientHeight = 585 + ClientHeight = 597 ClientWidth = 790 TabOrder = 1 object splMain: TSplitter Left = 253 - Height = 585 + Height = 597 Top = 0 Width = 5 end object pnlList: TPanel Left = 0 - Height = 585 + Height = 597 Top = 0 Width = 253 Align = alLeft BevelOuter = bvNone - ClientHeight = 585 + ClientHeight = 597 ClientWidth = 253 TabOrder = 0 object lvList: TListView Left = 0 - Height = 372 + Height = 384 Top = 28 Width = 253 Align = alClient @@ -586,25 +586,25 @@ object frmMain: TfrmMain item AutoSize = True Caption = '# / 0' - Width = 41 + Width = 249 end item Alignment = taCenter AutoSize = True Caption = 'BPP' - Width = 35 + Width = 30 end item Alignment = taCenter AutoSize = True Caption = 'CLUTs' - Width = 47 + Width = 42 end item Alignment = taCenter AutoSize = True Caption = 'W x H' - Width = 128 + Width = 41 end> ColumnClick = False GridLines = True @@ -651,7 +651,7 @@ object frmMain: TfrmMain object tblTimInfo: TStringGrid Left = 0 Height = 185 - Top = 400 + Top = 412 Width = 253 Align = alBottom AutoEdit = False @@ -708,32 +708,32 @@ object frmMain: TfrmMain end object pnlImage: TPanel Left = 258 - Height = 585 + Height = 597 Top = 0 Width = 532 Align = alClient BevelOuter = bvLowered - ClientHeight = 585 + ClientHeight = 597 ClientWidth = 532 Color = clBtnFace ParentColor = False TabOrder = 1 object pnlImageOptions: TPanel Left = 1 - Height = 32 - Top = 552 + Height = 27 + Top = 569 Width = 530 Align = alBottom AutoSize = True BevelOuter = bvLowered - ClientHeight = 32 + ClientHeight = 27 ClientWidth = 530 Color = clBtnFace ParentColor = False TabOrder = 0 object btnShowClut: TButton Left = 476 - Height = 28 + Height = 23 Top = 2 Width = 52 Align = alRight @@ -744,12 +744,12 @@ object frmMain: TfrmMain end object cbbBitMode: TComboBox Left = 2 - Height = 28 + Height = 21 Top = 2 Width = 159 Align = alLeft BorderSpacing.Around = 1 - ItemHeight = 0 + ItemHeight = 13 ItemIndex = 0 Items.Strings = ( 'Real' @@ -768,12 +768,12 @@ object frmMain: TfrmMain end object cbbTranspMode: TComboBox Left = 162 - Height = 28 + Height = 21 Top = 2 Width = 150 Align = alLeft BorderSpacing.Around = 1 - ItemHeight = 0 + ItemHeight = 13 ItemIndex = 1 Items.Strings = ( 'Full transparence' @@ -789,13 +789,13 @@ object frmMain: TfrmMain end object cbbCLUT: TComboBox Left = 366 - Height = 28 + Height = 21 Top = 2 Width = 109 Align = alRight BorderSpacing.Around = 1 DropDownCount = 16 - ItemHeight = 0 + ItemHeight = 13 OnChange = actChangeClutIdxExecute Style = csDropDownList TabOrder = 3 @@ -804,7 +804,7 @@ object frmMain: TfrmMain object pnlClut: TPanel Left = 1 Height = 192 - Top = 360 + Top = 377 Width = 530 Align = alBottom BevelOuter = bvLowered @@ -816,7 +816,7 @@ object frmMain: TfrmMain Visible = False object grdClut: TDrawGrid Left = 1 - Height = 125 + Height = 138 Top = 1 Width = 528 Align = alClient @@ -841,8 +841,8 @@ object frmMain: TfrmMain end object lblClutHint: TLabel Left = 1 - Height = 65 - Top = 126 + Height = 52 + Top = 139 Width = 528 Align = alBottom Alignment = taCenter @@ -854,7 +854,7 @@ object frmMain: TfrmMain end object imgTim: TImage Left = 1 - Height = 359 + Height = 376 Top = 1 Width = 530 AntialiasingMode = amOff @@ -1153,4 +1153,4 @@ object frmMain: TfrmMain left = 640 top = 112 end -end \ No newline at end of file +end diff --git a/umain.pas b/umain.pas index d75c300..0e24730 100644 --- a/umain.pas +++ b/umain.pas @@ -193,10 +193,6 @@ implementation uses ucdimage, ucpucount, lcltype, ucommon, LCLIntf, uexportimport, FPimage -{$IFDEF windows} -,registry -{$IFEND} - {$IFDEF Linux} ,BaseUnix {$IFEND} @@ -320,33 +316,8 @@ begin end; procedure TfrmMain.actAssocTimsExecute(Sender: TObject); -{$IFDEF windows} -var - reg: TRegistry; begin - reg := TRegistry.Create; - - try - reg.RootKey := HKEY_CURRENT_USER; - reg.OpenKey('Software\Classes\.tim', True); - reg.WriteString('', 'TimFile'); - reg.CloseKey; - - reg.OpenKey('Software\Classes\TimFile', True); - reg.WriteString('', 'Tim File Format'); - reg.CloseKey; - reg.OpenKey('Software\Classes\TimFile\DefaultIcon', True); - reg.WriteString('', '"' + ParamStrUTF8(0) +'",0'); - reg.CloseKey; - reg.OpenKey('Software\Classes\TimFile\shell\Open\Command', True); - reg.WriteString('', '"' + ParamStrUTF8(0) + '" "%1"'); - reg.CloseKey; - finally - reg.Free; - end; -{$ELSE} -begin -{$ENDIF} + Settings.AssociateWithTims; end; procedure TfrmMain.actChangeBackColorExecute(Sender: TObject); @@ -1082,4 +1053,4 @@ begin end; end. - \ No newline at end of file + diff --git a/usettings.pas b/usettings.pas index dcf2f95..405b0d7 100644 --- a/usettings.pas +++ b/usettings.pas @@ -29,6 +29,9 @@ type public constructor Create(const DirPath: string); destructor Destroy; override; + + procedure AssociateWithTims; + property TranspMode: Integer read FTranspModeRead write FTranspModeWrite; property StretchMode: Boolean read FStretchModeRead write FStretchModeWrite; property LastDir: string read FLastDirRead write FLastDirWrite; @@ -39,12 +42,47 @@ type implementation -uses FileUtil; +uses FileUtil + +{$IFDEF windows} +,registry +{$IFEND} +; const sMain = 'main'; { TSettings } +procedure TSettings.AssociateWithTims; +{$IFDEF windows} +var + reg: TRegistry; +begin + reg := TRegistry.Create; + + try + reg.RootKey := HKEY_CURRENT_USER; + reg.OpenKey('Software\Classes\.tim', True); + reg.WriteString('', 'TimFile'); + reg.CloseKey; + + reg.OpenKey('Software\Classes\TimFile', True); + reg.WriteString('', 'Tim File Format'); + reg.CloseKey; + reg.OpenKey('Software\Classes\TimFile\DefaultIcon', True); + reg.WriteString('', '"' + ParamStr(0) +'",0'); + reg.CloseKey; + reg.OpenKey('Software\Classes\TimFile\shell\Open\Command', True); + reg.WriteString('', '"' + ParamStr(0) + '" "%1"'); + reg.CloseKey; + finally + reg.Free; + end; +{$ELSE} +begin +{$ENDIF} +end; + procedure TSettings.FTranspModeWrite(Value: Integer); begin FIniFile.WriteInteger(sMain, 'TranspMode', Value); @@ -82,7 +120,7 @@ end; function TSettings.FBackColorRead: TColor; begin - Result := FIniFile.ReadInteger(sMain, 'BackColor', clFuchsia); + Result := FIniFile.ReadInteger(sMain, 'BackColor', clBtnFace); end; procedure TSettings.FBitModeWrite(Mode: Integer); @@ -102,7 +140,7 @@ end; function TSettings.FInfoVisibleRead: Boolean; begin - Result := FIniFile.ReadBool(sMain, 'InfoVisible', False); + Result := FIniFile.ReadBool(sMain, 'InfoVisible', True); end; constructor TSettings.Create(const DirPath: string); @@ -120,4 +158,4 @@ begin end; end. - \ No newline at end of file +