fixes non-UTF8 windows OS bugs.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1770 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
yangjixian
2011-07-31 03:14:36 +00:00
parent 809bd337ed
commit d6576e78fc
3 changed files with 49 additions and 49 deletions

View File

@ -1,11 +1,11 @@
object Main: TMain object Main: TMain
Left = 39 Left = 129
Height = 624 Height = 624
Top = 0 Top = 126
Width = 893 Width = 893
ActiveControl = Panel4 ActiveControl = Panel4
Caption = 'titel' Caption = 'titel'
ClientHeight = 601 ClientHeight = 602
ClientWidth = 893 ClientWidth = 893
Icon.Data = { Icon.Data = {
3E42000000000100010040400000010020002842000016000000280000004000 3E42000000000100010040400000010020002842000016000000280000004000
@ -545,11 +545,10 @@ object Main: TMain
OnCreate = MainCreate OnCreate = MainCreate
ShowInTaskBar = stAlways ShowInTaskBar = stAlways
LCLVersion = '0.9.31' LCLVersion = '0.9.31'
WindowState = wsMaximized
object StatusBar1: TStatusBar object StatusBar1: TStatusBar
Left = 0 Left = 0
Height = 17 Height = 22
Top = 584 Top = 580
Width = 893 Width = 893
Panels = < Panels = <
item item
@ -563,7 +562,7 @@ object Main: TMain
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 288 Left = 288
Height = 584 Height = 580
Top = 0 Top = 0
Width = 8 Width = 8
AutoSnap = False AutoSnap = False
@ -573,19 +572,19 @@ object Main: TMain
end end
object Panel1: TPanel object Panel1: TPanel
Left = 296 Left = 296
Height = 584 Height = 580
Top = 0 Top = 0
Width = 597 Width = 597
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 584 ClientHeight = 580
ClientWidth = 597 ClientWidth = 597
TabOrder = 0 TabOrder = 0
OnClick = Panel1Click OnClick = Panel1Click
OnResize = Panel1Resize OnResize = Panel1Resize
object TitleTree: TListView object TitleTree: TListView
Left = 0 Left = 0
Height = 154 Height = 150
Top = 5 Top = 5
Width = 587 Width = 587
Align = alTop Align = alTop
@ -600,27 +599,23 @@ object Main: TMain
item item
AutoSize = True AutoSize = True
Caption = 'Artist' Caption = 'Artist'
Width = 40 Width = 567
end end
item item
AutoSize = True AutoSize = True
Caption = 'Title' Caption = 'Title'
Width = 34
end end
item item
AutoSize = True AutoSize = True
Caption = 'Album' Caption = 'Album'
Width = 45
end end
item item
AutoSize = True AutoSize = True
Caption = 'Track' Caption = 'Track'
Width = 39
end end
item item
AutoSize = True AutoSize = True
Caption = 'Genre' Caption = 'Genre'
Width = 45
end end
item item
AutoSize = True AutoSize = True
@ -632,7 +627,7 @@ object Main: TMain
AutoSize = True AutoSize = True
Caption = 'Length' Caption = 'Length'
MaxWidth = 60 MaxWidth = 60
Width = 349 Width = 57
end> end>
PopupMenu = titlelistmenu PopupMenu = titlelistmenu
ReadOnly = True ReadOnly = True
@ -655,7 +650,7 @@ object Main: TMain
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 10 Height = 10
Top = 159 Top = 155
Width = 597 Width = 597
Align = alTop Align = alTop
ResizeAnchor = akTop ResizeAnchor = akTop
@ -663,7 +658,7 @@ object Main: TMain
object Panel3: TPanel object Panel3: TPanel
Left = 0 Left = 0
Height = 415 Height = 415
Top = 169 Top = 165
Width = 597 Width = 597
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
@ -673,7 +668,7 @@ object Main: TMain
object PlayerControlsPanel: TPanel object PlayerControlsPanel: TPanel
Left = 4 Left = 4
Height = 285 Height = 285
Top = 86 Top = 80
Width = 224 Width = 224
BorderSpacing.Left = 20 BorderSpacing.Left = 20
BorderSpacing.Top = 20 BorderSpacing.Top = 20
@ -681,6 +676,7 @@ object Main: TMain
BorderSpacing.Bottom = 20 BorderSpacing.Bottom = 20
BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignHorizontal = ccaCenter
BorderSpacing.CellAlignVertical = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter
BevelOuter = bvNone
ClientHeight = 285 ClientHeight = 285
ClientWidth = 224 ClientWidth = 224
TabOrder = 0 TabOrder = 0
@ -793,7 +789,7 @@ object Main: TMain
Cursor = crSizeNWSE Cursor = crSizeNWSE
Left = 16 Left = 16
Height = 104 Height = 104
Top = 168 Top = 175
Width = 104 Width = 104
OnMouseUp = CoverImageMouseUp OnMouseUp = CoverImageMouseUp
Stretch = True Stretch = True
@ -848,7 +844,7 @@ object Main: TMain
object current_title_edit: TEdit object current_title_edit: TEdit
Left = 12 Left = 12
Height = 21 Height = 21
Top = 102 Top = 109
Width = 200 Width = 200
Color = clBtnFace Color = clBtnFace
ReadOnly = True ReadOnly = True
@ -857,7 +853,7 @@ object Main: TMain
object current_title_edit1: TEdit object current_title_edit1: TEdit
Left = 12 Left = 12
Height = 21 Height = 21
Top = 134 Top = 141
Width = 200 Width = 200
Color = clBtnFace Color = clBtnFace
ReadOnly = True ReadOnly = True
@ -865,9 +861,9 @@ object Main: TMain
end end
object randomcheck: TCheckBox object randomcheck: TCheckBox
Left = 135 Left = 135
Height = 21 Height = 19
Top = 250 Top = 257
Width = 69 Width = 62
Caption = 'Random' Caption = 'Random'
OnChange = randomcheckChange OnChange = randomcheckChange
TabOrder = 3 TabOrder = 3
@ -875,7 +871,7 @@ object Main: TMain
object Volumebar: TProgressBar object Volumebar: TProgressBar
Left = 176 Left = 176
Height = 77 Height = 77
Top = 171 Top = 178
Width = 12 Width = 12
OnMouseUp = VolumebarMouseUp OnMouseUp = VolumebarMouseUp
Orientation = pbVertical Orientation = pbVertical
@ -890,7 +886,6 @@ object Main: TMain
Width = 73 Width = 73
BevelOuter = bvNone BevelOuter = bvNone
BorderWidth = 1 BorderWidth = 1
BorderStyle = bsSingle
Caption = '00:00' Caption = '00:00'
TabOrder = 4 TabOrder = 4
OnClick = pnlPlaytimeClick OnClick = pnlPlaytimeClick
@ -898,7 +893,7 @@ object Main: TMain
object trackbar: TTrackBar object trackbar: TTrackBar
Left = 17 Left = 17
Height = 25 Height = 25
Top = 75 Top = 82
Width = 190 Width = 190
Max = 100 Max = 100
Position = 0 Position = 0
@ -920,7 +915,7 @@ object Main: TMain
item item
AutoSize = True AutoSize = True
Caption = 'Playlist' Caption = 'Playlist'
Width = 329 Width = 344
end> end>
PopupMenu = playlistmenu PopupMenu = playlistmenu
ReadOnly = True ReadOnly = True
@ -944,16 +939,17 @@ object Main: TMain
Height = 50 Height = 50
Top = 2 Top = 2
Width = 464 Width = 464
BevelOuter = bvNone
ClientHeight = 50 ClientHeight = 50
ClientWidth = 464 ClientWidth = 464
PopupMenu = SearchMenu PopupMenu = SearchMenu
TabOrder = 2 TabOrder = 2
object filetypebox: TComboBox object filetypebox: TComboBox
Left = 360 Left = 360
Height = 29 Height = 21
Top = 14 Top = 14
Width = 90 Width = 90
ItemHeight = 0 ItemHeight = 13
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'all types' 'all types'
@ -981,7 +977,7 @@ object Main: TMain
Left = 16 Left = 16
Height = 28 Height = 28
Hint = 'Search the library' Hint = 'Search the library'
Top = 8 Top = 10
Width = 90 Width = 90
BorderSpacing.InnerBorder = 4 BorderSpacing.InnerBorder = 4
Caption = 'Search' Caption = 'Search'
@ -991,7 +987,7 @@ object Main: TMain
TabOrder = 2 TabOrder = 2
end end
object Button1: TButton object Button1: TButton
Left = 120 Left = 136
Height = 25 Height = 25
Top = -2 Top = -2
Width = 75 Width = 75
@ -1013,11 +1009,11 @@ object Main: TMain
end end
object clear_list: TBitBtn object clear_list: TBitBtn
AnchorSideBottom.Side = asrCenter AnchorSideBottom.Side = asrCenter
Left = 517 Left = 501
Height = 34 Height = 30
Hint = 'Clear Playlist' Hint = 'Clear Playlist'
Top = 6 Top = 12
Width = 67 Width = 84
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
AutoSize = True AutoSize = True
Caption = 'Clear' Caption = 'Clear'
@ -1086,7 +1082,7 @@ object Main: TMain
Left = 8 Left = 8
Height = 14 Height = 14
Top = 56 Top = 56
Width = 39 Width = 50
Caption = 'lblPath' Caption = 'lblPath'
ParentColor = False ParentColor = False
end end
@ -1094,19 +1090,19 @@ object Main: TMain
end end
object Panel4: TPanel object Panel4: TPanel
Left = 0 Left = 0
Height = 584 Height = 580
Top = 0 Top = 0
Width = 288 Width = 288
Align = alLeft Align = alLeft
BorderSpacing.InnerBorder = 30 BorderSpacing.InnerBorder = 30
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 584 ClientHeight = 580
ClientWidth = 288 ClientWidth = 288
TabOrder = 1 TabOrder = 1
OnClick = Panel4Click OnClick = Panel4Click
object ArtistTree: TTreeView object ArtistTree: TTreeView
Left = 26 Left = 26
Height = 574 Height = 570
Top = 5 Top = 5
Width = 259 Width = 259
Align = alClient Align = alClient
@ -1149,7 +1145,7 @@ object Main: TMain
Left = 77 Left = 77
Height = 14 Height = 14
Top = 8 Top = 8
Width = 41 Width = 43
Caption = 'Search' Caption = 'Search'
ParentColor = False ParentColor = False
end end
@ -1210,7 +1206,7 @@ object Main: TMain
end end
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Height = 579 Height = 575
Top = 5 Top = 5
Width = 26 Width = 26
Align = alLeft Align = alLeft

View File

@ -2145,18 +2145,21 @@ End;
Function TMain.LoadFile(path: String): boolean; Function TMain.LoadFile(path: String): boolean;
Var z: integer; Var z: integer; aPath: string;
listitem: TListItem; listitem: TListItem;
Begin Begin
DebugOutLn('** Loadfile **', 2); DebugOutLn('** Loadfile **', 2);
Application.ProcessMessages; Application.ProcessMessages;
If FileExists(path) Then {$IFDEF WINDOWS}
aPath := UTF8Decode(path);
{$ENDIF}
If FileExists(aPath) Then
Begin Begin
z := MediaCollection.GetIndexByPath(path); z := MediaCollection.GetIndexByPath(path);
DebugOutLn(z, 3); DebugOutLn(z, 3);
If z<0 Then If z<0 Then
Begin Begin
z := MediaCollection.add(path); z := MediaCollection.add(apath);
End; End;
PlayerObj.playlist.add(MediaCollection.items[z]); PlayerObj.playlist.add(MediaCollection.items[z]);
ListItem := Playlist.Items.Add; ListItem := Playlist.Items.Add;
@ -3033,7 +3036,7 @@ Procedure TMain.TitleTreeSelectItem(Sender: TObject; Item: TListItem;
Begin Begin
// reanable the popupmenu in case ist was disabled in TMain.TitleTreeMouseDown // reanable the popupmenu in case ist was disabled in TMain.TitleTreeMouseDown
TitleTree.PopupMenu.AutoPopup := true; TitleTree.PopupMenu.AutoPopup := true;
lblPath.Caption:=TMediaFileClass(Item.data).Path; lblPath.Caption:=UTF8Encode(TMediaFileClass(Item.data).Path);
End; End;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -3577,7 +3580,7 @@ Begin
// reanable the popupmenu in case ist was disabled in TMain.playlistMouseDown // reanable the popupmenu in case ist was disabled in TMain.playlistMouseDown
playlist.PopupMenu.AutoPopup := true; playlist.PopupMenu.AutoPopup := true;
if (Item.Data<>nil) then begin if (Item.Data<>nil) then begin
lblPath.Caption := TMediaFileClass(Item.data).Path; lblPath.Caption := UTF8Encode(TMediaFileClass(Item.data).Path);
end; end;
End; End;

View File

@ -15,7 +15,8 @@
<AutoIncrementBuild Value="True"/> <AutoIncrementBuild Value="True"/>
<MinorVersionNr Value="3"/> <MinorVersionNr Value="3"/>
<RevisionNr Value="5"/> <RevisionNr Value="5"/>
<BuildNr Value="737"/> <BuildNr Value="738"/>
<StringTable ProductVersion="0.3.5.737"/>
</VersionInfo> </VersionInfo>
<BuildModes Count="1"> <BuildModes Count="1">
<Item1 Name="default" Default="True"/> <Item1 Name="default" Default="True"/>