Commit MetaInfo

Revisionf0b538d47ce881be451bd4e6ee1fd0d58896bd43 (tree)
Zeit2019-02-21 18:23:48
Autorkentamaken <kentamaken@gmai...>
Commiterkentamaken

Log Message

リスト名変更

Ändern Zusammenfassung

Diff

--- a/textdefind.dproj
+++ b/textdefind.dproj
@@ -5,7 +5,7 @@
55 <FrameworkType>VCL</FrameworkType>
66 <MainSource>textdefind.dpr</MainSource>
77 <Base>True</Base>
8- <Config Condition="'$(Config)'==''">Release</Config>
8+ <Config Condition="'$(Config)'==''">Debug</Config>
99 <Platform Condition="'$(Platform)'==''">Win32</Platform>
1010 <TargetedPlatforms>1</TargetedPlatforms>
1111 <AppType>Application</AppType>
@@ -91,6 +91,7 @@
9191 <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
9292 <VerInfo_Locale>1033</VerInfo_Locale>
9393 <AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
94+ <BT_BuildType>Debug</BT_BuildType>
9495 </PropertyGroup>
9596 <ItemGroup>
9697 <DelphiCompile Include="$(MainSource)">
--- a/textdefindunit.dfm
+++ b/textdefindunit.dfm
@@ -20,18 +20,18 @@ object TextDeFindForm: TTextDeFindForm
2020 TextHeight = 16
2121 object Splitter1: TSplitter
2222 Left = 185
23- Top = 311
23+ Top = 328
2424 Width = 9
25- Height = 180
25+ Height = 163
2626 ExplicitLeft = 232
2727 ExplicitTop = 200
2828 ExplicitHeight = 65
2929 end
3030 object Web: TWebBrowser
3131 Left = 194
32- Top = 311
32+ Top = 328
3333 Width = 548
34- Height = 180
34+ Height = 163
3535 Align = alClient
3636 TabOrder = 7
3737 ExplicitLeft = 242
@@ -39,7 +39,7 @@ object TextDeFindForm: TTextDeFindForm
3939 ExplicitWidth = 300
4040 ExplicitHeight = 150
4141 ControlData = {
42- 4C000000A33800009B1200000000000000000000000000000000000000000000
42+ 4C000000A3380000D91000000000000000000000000000000000000000000000
4343 000000004C000000000000000000000001000000E0D057007335CF11AE690800
4444 2B2E126208000000000000004C0000000114020000000000C000000000000046
4545 8000000000000000000000000000000000000000000000000000000000000000
@@ -47,27 +47,22 @@ object TextDeFindForm: TTextDeFindForm
4747 end
4848 object Memo1: TMemo
4949 Left = 194
50- Top = 311
50+ Top = 328
5151 Width = 548
52- Height = 180
52+ Height = 163
5353 Align = alClient
5454 Lines.Strings = (
5555 'Memo1')
5656 TabOrder = 8
57- ExplicitTop = 294
58- ExplicitWidth = 541
59- ExplicitHeight = 198
6057 end
6158 object LeftPanel: TPanel
6259 Left = 0
63- Top = 311
60+ Top = 328
6461 Width = 185
65- Height = 180
62+ Height = 163
6663 Align = alLeft
6764 Caption = 'LeftPanel'
6865 TabOrder = 4
69- ExplicitTop = 294
70- ExplicitHeight = 198
7166 object ListName: TComboBox
7267 Left = 1
7368 Top = 1
@@ -86,7 +81,7 @@ object TextDeFindForm: TTextDeFindForm
8681 Left = 1
8782 Top = 51
8883 Width = 183
89- Height = 128
84+ Height = 111
9085 Align = alClient
9186 Font.Charset = SHIFTJIS_CHARSET
9287 Font.Color = clWindowText
@@ -101,7 +96,6 @@ object TextDeFindForm: TTextDeFindForm
10196 TabOrder = 1
10297 Zoom = 100
10398 OnMouseUp = TextMouseUp
104- ExplicitHeight = 146
10599 end
106100 object Tree: TTreeView
107101 Left = 1
@@ -122,7 +116,6 @@ object TextDeFindForm: TTextDeFindForm
122116 Height = 25
123117 Align = alTop
124118 TabOrder = 0
125- ExplicitWidth = 735
126119 object Path: TComboBox
127120 Left = 166
128121 Top = 1
@@ -135,7 +128,6 @@ object TextDeFindForm: TTextDeFindForm
135128 Items.Strings = (
136129 'D:\Music\'
137130 'D:\Music\%'#12522#12473#12488#21517'%')
138- ExplicitWidth = 460
139131 end
140132 object Find: TButton
141133 Left = 1
@@ -167,7 +159,6 @@ object TextDeFindForm: TTextDeFindForm
167159 Caption = #32232#38598
168160 TabOrder = 3
169161 OnClick = PathEditButtonClick
170- ExplicitLeft = 680
171162 end
172163 object PathSelButton: TButton
173164 Left = 633
@@ -178,14 +169,13 @@ object TextDeFindForm: TTextDeFindForm
178169 Caption = #36984#25246
179170 TabOrder = 4
180171 OnClick = PathSelButtonClick
181- ExplicitLeft = 626
182172 end
183173 end
184174 object GridFiles: TStringGrid
185175 Left = 194
186- Top = 311
176+ Top = 328
187177 Width = 548
188- Height = 180
178+ Height = 163
189179 Align = alClient
190180 Ctl3D = False
191181 DrawingStyle = gdsClassic
@@ -196,9 +186,6 @@ object TextDeFindForm: TTextDeFindForm
196186 OnMouseDown = GridFilesMouseDown
197187 OnSelectCell = GridFilesSelectCell
198188 OnSetEditText = GridFilesSetEditText
199- ExplicitTop = 294
200- ExplicitWidth = 541
201- ExplicitHeight = 198
202189 ColWidths = (
203190 64
204191 64
@@ -220,8 +207,6 @@ object TextDeFindForm: TTextDeFindForm
220207 Align = alBottom
221208 TabOrder = 2
222209 Visible = False
223- ExplicitTop = 516
224- ExplicitWidth = 735
225210 ColWidths = (
226211 64
227212 64
@@ -244,8 +229,6 @@ object TextDeFindForm: TTextDeFindForm
244229 TabOrder = 3
245230 Text = 'TMP'
246231 Visible = False
247- ExplicitTop = 492
248- ExplicitWidth = 735
249232 end
250233 object Panel3: TPanel
251234 Left = 0
@@ -254,7 +237,6 @@ object TextDeFindForm: TTextDeFindForm
254237 Height = 25
255238 Align = alTop
256239 TabOrder = 5
257- ExplicitWidth = 735
258240 object Url: TComboBox
259241 Left = 76
260242 Top = 1
@@ -266,35 +248,48 @@ object TextDeFindForm: TTextDeFindForm
266248 Items.Strings = (
267249
268250 '[itunes] itmss://itunes.apple.com/search?country=jp&limit=200&' +
269- 'attribute=songTerm&term=%'#26908#32034#25991#23383'%'
251+ 'term=%'#12522#12473#12488#21517'%+%'#26908#32034#25991#23383'% %'#12469#12502#26908#32034'%itmss://itunes.apple.com/search?country' +
252+ '=jp&limit=200&attribute=songTerm&term=%'#26908#32034#25991#23383'%'
253+
254+ '[itunes] itmss://itunes.apple.com/search?country=jp&limit=200&' +
255+ 'mediaType=apple_music&attribute=songTerm&term=%'#26908#32034#25991#23383'%'
270256
271257 '[itunes] itmss://itunes.apple.com/search?country=jp&limit=200&' +
272258 'term=%'#12522#12473#12488#21517'%+%'#26908#32034#25991#23383'%'
273259
260+ '[itunes] itmss://itunes.apple.com/search?country=jp&limit=200&' +
261+ 'attribute=songTerm&term=%'#26908#32034#25991#23383'%'
262+
274263 '[itunes'#12450#12523#12496#12512'] itmss://itunes.apple.com/search?country=jp&entity' +
275264 '=album&attribute=artistTerm&limit=200&term=%'#12522#12473#12488#21517'%'
265+ '[spotify] https://open.spotify.com/search/results/%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%'
266+ '[amazon] https://music.amazon.co.jp/search/%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%'
267+
268+ '[amazon] https://www.amazon.co.jp/s/ref=nb_sb_noss?url=search-' +
269+ 'alias%3Ddigital-music&field-keywords=%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%'
276270
277271 '[google] https://play.google.com/music/listen?hl=ja&pli=1#/sr/' +
278272 '%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%'
279- '[amazon] https://music.amazon.co.jp/search/%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%'
280273 '[google] https://www.google.com/search?q=%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%'
281274
275+ '[google] https://www.google.com/search?q=%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'% site:it' +
276+ 'unes.apple.com'
277+
282278 '[youtube] https://www.youtube.com/results?search_query=%'#12522#12473#12488#21517'% %' +
283279 #26908#32034#25991#23383'%'
284280
285281 '[DAM] https://www.clubdam.com/app/search/searchKaraokeKeywo' +
286282 'rdArtist.html?keyword=%'#12522#12473#12488#21517'%'
287-
288- '[google] https://www.google.com/search?q=%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'% site:it' +
289- 'unes.apple.com'
290283 '[apple] https://playapplemusic.com/search?q=%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%'
291284
292285 '[apple] https://linkmaker.itunes.apple.com/ja-jp?country=jp&m' +
293286 'ediaType=apple_music&term=%'#12522#12473#12488#21517'%+%'#26908#32034#25991#23383'%'
294287
295288 '[apple] https://itunes.apple.com/search?term=%'#12522#12473#12488#21517'% %'#26908#32034#25991#23383'%&co' +
296- 'untry=jp')
297- ExplicitWidth = 516
289+ 'untry=jp'
290+
291+ '[apple] https://freefielder.jp/itunes2/itsearch.php?searchKey' +
292+ '=music&str=%'#26908#32034#25991#23383'%')
298293 end
299294 object FindUrlButton: TButton
300295 Left = 1
@@ -315,7 +310,6 @@ object TextDeFindForm: TTextDeFindForm
315310 Caption = #32232#38598
316311 TabOrder = 2
317312 OnClick = UrlEditButtonClick
318- ExplicitLeft = 592
319313 end
320314 object OpURLButton: TButton
321315 Left = 653
@@ -326,14 +320,13 @@ object TextDeFindForm: TTextDeFindForm
326320 Caption = #12458#12503#12471#12519#12531
327321 TabOrder = 3
328322 OnClick = OpURLButtonClick
329- ExplicitLeft = 646
330323 end
331324 end
332325 object OpURLPanel: TPanel
333326 Left = 0
334327 Top = 50
335328 Width = 742
336- Height = 261
329+ Height = 278
337330 Align = alTop
338331 AutoSize = True
339332 TabOrder = 6
@@ -348,7 +341,6 @@ object TextDeFindForm: TTextDeFindForm
348341 Checked = True
349342 State = cbChecked
350343 TabOrder = 0
351- ExplicitTop = 60
352344 end
353345 object OpUrlSpace: TCheckBox
354346 Left = 1
@@ -360,7 +352,6 @@ object TextDeFindForm: TTextDeFindForm
360352 Checked = True
361353 State = cbChecked
362354 TabOrder = 1
363- ExplicitTop = 19
364355 end
365356 object OpURLZenkaku: TCheckBox
366357 Left = 1
@@ -370,7 +361,6 @@ object TextDeFindForm: TTextDeFindForm
370361 Align = alTop
371362 Caption = #20840#35282#21270
372363 TabOrder = 2
373- ExplicitTop = 101
374364 end
375365 object OpURLEscapeEdit: TEdit
376366 Left = 1
@@ -380,7 +370,6 @@ object TextDeFindForm: TTextDeFindForm
380370 Align = alTop
381371 TabOrder = 3
382372 Text = ':/?#[]@!$&'#39#39'()*+,;='
383- ExplicitTop = 77
384373 end
385374 object OpURLSpaceEdit: TEdit
386375 Left = 1
@@ -392,7 +381,6 @@ object TextDeFindForm: TTextDeFindForm
392381 Text =
393382 '!"#$%&'#39'()*+,-./:;<=>?@[\]^_`{|}~'#65295#65340#65374#8741#65372#8230#8229#8216#8217#8220#8221#65288#65289#12308#12309#65339#65341#65371#65373#12296#12297#12298#12299#12300#12301#12302#12303#12304#12305#65291#65293#177 +
394383 #215#247#65309#8800#65308#65310#8806#8807#8734#8756#9794#9792#176#8242#8243#8451#65509#65284#65504#65505#65285#65283#65286#65290#65312#167#9734#9733#9675#9679#9678#9671' '#9670#9633#9632#9651#9650#9661#9660#8251#12306#8594#8592#8593#8595
395- ExplicitTop = 36
396384 end
397385 object OptionUrlDQuote: TCheckBox
398386 Left = 1
@@ -402,7 +390,6 @@ object TextDeFindForm: TTextDeFindForm
402390 Align = alTop
403391 Caption = '""'#12391#22258#12416
404392 TabOrder = 5
405- ExplicitTop = 118
406393 end
407394 object OpURLComment: TCheckBox
408395 Left = 1
@@ -414,7 +401,6 @@ object TextDeFindForm: TTextDeFindForm
414401 Checked = True
415402 State = cbChecked
416403 TabOrder = 6
417- ExplicitTop = 2
418404 end
419405 object OpURLFile: TCheckBox
420406 Left = 1
@@ -424,7 +410,6 @@ object TextDeFindForm: TTextDeFindForm
424410 Align = alTop
425411 Caption = #12501#12449#12452#12523#21015#12395#29983#12487#12540#12479
426412 TabOrder = 7
427- ExplicitTop = 135
428413 end
429414 object OpURLituneNazo: TCheckBox
430415 Left = 1
@@ -432,11 +417,10 @@ object TextDeFindForm: TTextDeFindForm
432417 Width = 740
433418 Height = 17
434419 Align = alTop
435- Caption = #12450#12540#12486#12451#12473#12488'+'#12479#12452#12488#12523#12391#12399#20309#25925#12363#20986#12390#12371#12394#12356#12398#12391#12479#12452#12488#12523#12398#12415#12391#26908#32034#12375#12390#12522#12473#12488#21517#12391#32094#12427
420+ Caption = 'itmss:'#12522#12473#12488#21517#12391#32094#12427'('#12479#12452#12488#12523#12398#12415#12391#26908#32034#29992')'
436421 Checked = True
437422 State = cbChecked
438423 TabOrder = 8
439- ExplicitTop = 169
440424 end
441425 object OpURLWait: TMaskEdit
442426 Left = 1
@@ -448,7 +432,6 @@ object TextDeFindForm: TTextDeFindForm
448432 MaxLength = 9
449433 TabOrder = 9
450434 Text = #12454#12456#12452#12488'3000 '
451- ExplicitTop = 203
452435 end
453436 object OpURLLocal: TCheckBox
454437 Left = 1
@@ -457,10 +440,7 @@ object TextDeFindForm: TTextDeFindForm
457440 Height = 17
458441 Align = alTop
459442 Caption = #12525#12540#12459#12523#26908#32034#12418#23455#34892
460- Checked = True
461- State = cbChecked
462443 TabOrder = 10
463- ExplicitTop = 186
464444 end
465445 object OpURLitune: TCheckBox
466446 Left = 1
@@ -472,17 +452,15 @@ object TextDeFindForm: TTextDeFindForm
472452 Checked = True
473453 State = cbChecked
474454 TabOrder = 11
475- ExplicitTop = 152
476455 end
477- object OpURLReset: TCheckBox
456+ object OpURLNoSave: TCheckBox
478457 Left = 1
479- Top = 243
458+ Top = 260
480459 Width = 740
481460 Height = 17
482461 Align = alTop
483- Caption = #35373#23450#12434#21021#26399#21270#12375#12390#32066#20102
462+ Caption = #20445#23384#12379#12378#12395#32066#20102
484463 TabOrder = 12
485- ExplicitTop = 227
486464 end
487465 object OpURLOpenSave: TCheckBox
488466 Left = 1
@@ -492,13 +470,28 @@ object TextDeFindForm: TTextDeFindForm
492470 Align = alTop
493471 Caption = 'itmss:'#12506#12540#12472#12434#12501#12449#12452#12523#12395#20445#23384'('#23455#34892#12501#12457#12523#12480')'
494472 TabOrder = 13
495- ExplicitLeft = 0
496- ExplicitTop = 179
473+ end
474+ object OpURLReset: TCheckBox
475+ Left = 1
476+ Top = 243
477+ Width = 740
478+ Height = 17
479+ Align = alTop
480+ Caption = #35373#23450#12434#21021#26399#21270#12375#12390#32066#20102
481+ TabOrder = 14
497482 end
498483 end
499484 object PopupMenu2: TPopupMenu
500- Left = 208
485+ Left = 216
501486 Top = 360
487+ object PRowDel: TMenuItem
488+ Caption = #34892#21066#38500
489+ OnClick = PRowDelClick
490+ end
491+ object PRowAdd: TMenuItem
492+ Caption = #34892#36861#21152
493+ OnClick = PRowAddClick
494+ end
502495 object PFileCut: TMenuItem
503496 Caption = #12459#12483#12488
504497 OnClick = PFileCutClick
@@ -511,6 +504,9 @@ object TextDeFindForm: TTextDeFindForm
511504 Caption = #12506#12540#12473#12488
512505 OnClick = PFilePasteClick
513506 end
507+ object N2: TMenuItem
508+ Caption = '-'
509+ end
514510 object PFileSaveAs: TMenuItem
515511 Caption = #20445#23384
516512 OnClick = PFileSaveAsClick
@@ -535,14 +531,6 @@ object TextDeFindForm: TTextDeFindForm
535531 object N5: TMenuItem
536532 Caption = '-'
537533 end
538- object PRowDel: TMenuItem
539- Caption = #34892#21066#38500
540- OnClick = PRowDelClick
541- end
542- object PRowAdd: TMenuItem
543- Caption = #34892#36861#21152
544- OnClick = PRowAddClick
545- end
546534 object PColDel: TMenuItem
547535 Caption = #21015#21066#38500
548536 OnClick = PColDelClick
@@ -555,14 +543,21 @@ object TextDeFindForm: TTextDeFindForm
555543 Caption = #12463#12522#12450
556544 OnClick = PClearClick
557545 end
546+ object PReload: TMenuItem
547+ Caption = #20803#12395#25147#12377
548+ OnClick = PReloadClick
549+ end
550+ object N3: TMenuItem
551+ Caption = '-'
552+ end
558553 object PReFind: TMenuItem
559554 Caption = #20877#26908#32034
560- Visible = False
555+ OnClick = PReFindClick
561556 end
562557 end
563558 object PopupMenu1: TPopupMenu
564- Left = 104
565- Top = 288
559+ Left = 24
560+ Top = 360
566561 object PTextCut: TMenuItem
567562 Caption = #12459#12483#12488
568563 OnClick = PTextCutClick
@@ -583,6 +578,10 @@ object TextDeFindForm: TTextDeFindForm
583578 Caption = #35501#12415#36796#12415
584579 OnClick = PTextOpenClick
585580 end
581+ object PTextListName: TMenuItem
582+ Caption = #12522#12473#12488#21517#22793#26356
583+ OnClick = PTextListNameClick
584+ end
586585 object N1: TMenuItem
587586 Caption = '-'
588587 end
@@ -596,8 +595,8 @@ object TextDeFindForm: TTextDeFindForm
596595 end
597596 end
598597 object SaveDialog: TSaveDialog
599- Left = 24
600- Top = 344
598+ Left = 64
599+ Top = 304
601600 end
602601 object OpenDialog: TOpenDialog
603602 Left = 24
@@ -618,8 +617,8 @@ object TextDeFindForm: TTextDeFindForm
618617 Request.Ranges.Units = 'bytes'
619618 Request.Ranges = <>
620619 HTTPOptions = [hoForceEncodeParams]
621- Left = 96
622- Top = 360
620+ Left = 112
621+ Top = 400
623622 end
624623 object IdSSLIOHandlerSocketOpenSSL: TIdSSLIOHandlerSocketOpenSSL
625624 MaxLineAction = maException
@@ -628,7 +627,7 @@ object TextDeFindForm: TTextDeFindForm
628627 SSLOptions.Mode = sslmUnassigned
629628 SSLOptions.VerifyMode = []
630629 SSLOptions.VerifyDepth = 0
631- Left = 24
632- Top = 400
630+ Left = 48
631+ Top = 416
633632 end
634633 end
--- a/textdefindunit.pas
+++ b/textdefindunit.pas
@@ -158,9 +158,14 @@ type
158158 OpURLWait:TMaskEdit;
159159 OpURLLocal:TCheckBox;
160160 OpURLitune:TCheckBox;
161- OpURLReset:TCheckBox;
161+ OpURLNoSave: TCheckBox;
162162 PReFind: TMenuItem;
163163 OpURLOpenSave: TCheckBox;
164+ OpURLReset: TCheckBox;
165+ N2: TMenuItem;
166+ N3: TMenuItem;
167+ PReload: TMenuItem;
168+ PTextListName: TMenuItem;
164169 procedure FindClick(Sender:TObject);
165170 procedure FormCreate(Sender:TObject);
166171 procedure GridFilesMouseDown(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
@@ -198,10 +203,14 @@ type
198203 procedure PRowAddClick(Sender:TObject);
199204 procedure PColDelClick(Sender:TObject);
200205 procedure PClearClick(Sender:TObject);
206+ procedure PReFindClick(Sender: TObject);
207+ procedure PReloadClick(Sender: TObject);
208+ procedure PTextListNameClick(Sender: TObject);
201209 private
202210 function getpathtext:string;
203211 function localfind(var sa:TStringDynArray;ssss:string):boolean;
204212 function iddownload(Url: string): string;
213+ function getsearchtext(Url: String): String;
205214 { Private 宣言 }
206215 public
207216 { Public 宣言 }
@@ -395,6 +404,8 @@ procedure TTextDeFindForm.FormClose(Sender:TObject;var Action:TCloseAction);
395404 begin
396405 if Application.Terminated then
397406 exit;
407+ if OpURLNoSave.Checked then
408+ exit;
398409
399410 Ini.WriteInteger('','Width',Width);
400411 Ini.WriteInteger('','Height',Height);
@@ -453,12 +464,17 @@ var
453464 s:TStringStream;
454465 begin
455466 IdHTTP.HandleRedirects:=true;
467+ IdHTTP.IOHandler.DefStringEncoding := IndyTextEncoding_UTF8;
468+ IdHTTP.Request.ContentEncoding := 'UTF-8';
469+
456470 s:=TStringStream.Create('',TEncoding.UTF8);
457471 try
458472 Url:=TIdURI.ParamsEncode(Url,IndyTextEncoding_UTF8);
459473 IdHTTP.Get(Url,s);
460474 s.Position:=0;
461475 Result:=s.ReadString(s.Size);
476+// setLength(Result,s.Size);
477+// s.Read(Result[1],s.Size);
462478 finally
463479 FreeAndNil(s);
464480 end;
@@ -466,45 +482,59 @@ begin
466482 end;
467483
468484
469- procedure TTextDeFindForm.FindUrlButtonClick(Sender:TObject);
485+function TTextDeFindForm.getsearchtext(Url:String):String;
470486 var
471- urls,s,ss:string;
472- ls,le,i,count:Integer;
487+ C,cc:Char;
488+begin
473489
474- function getsearchtext(Url:String):String;
475- var
476- C,cc:Char;
477- begin
490+ if OpURLComment.Checked then begin
491+ if Url.IndexOf('//')>=0 then
492+ Url:=Url.Substring(0,Url.IndexOf('//'));
493+ end;
478494
479- if OpURLComment.Checked then begin
480- if Url.IndexOf('//')>=0 then
481- Url:=Url.Substring(0,Url.IndexOf('//'));
495+ if OpUrlSpace.Checked then begin
496+ for C in OpURLSpaceEdit.Text do begin
497+ Url:=Url.Replace(C,' ');
482498 end;
499+ end;
483500
484- if OpUrlSpace.Checked then begin
485- for C in OpURLSpaceEdit.Text do begin
486- Url:=Url.Replace(C,' ');
487- end;
501+ if OpURLEscape.Checked then begin
502+ for C in OpURLEscapeEdit.Text do begin
503+ Url:=Url.Replace(C,format('%%%x',[(Ord(C))]));
488504 end;
505+ end;
489506
490- if OpURLEscape.Checked then begin
491- for C in OpURLEscapeEdit.Text do begin
492- Url:=Url.Replace(C,format('%%%x',[(Ord(C))]));
493- end;
494- end;
507+ if OpURLZenkaku.Checked then begin
508+ Url:=zenkaku(Url);
509+ end;
510+ if OptionUrlDQuote.Checked then begin
511+ Url:='\"'+Url+'\"';
512+ end;
495513
496- if OpURLZenkaku.Checked then begin
497- Url:=zenkaku(Url);
498- end;
499- if OptionUrlDQuote.Checked then begin
500- Url:='\"'+Url+'\"';
501- end;
514+ Result:=trim(Url);
515+end;
502516
503- Result:=trim(Url);
504- end;
517+procedure TTextDeFindForm.FindUrlButtonClick(Sender:TObject);
518+var
519+ urls,urlss,s,ss:string;
520+ ls,le,i,count:Integer;
521+ row:integer;
522+ hit:Integer;
523+ hitl:boolean;
505524
506525
507- function jsontogrid(Url:string):string;
526+ function rowadd(row:integer):integer;
527+ begin
528+ if sender=PReFind then begin
529+ result:=Files.RowInsert(row+1,1);
530+ end else begin
531+ Files.RowCount:=Files.RowCount+1;
532+ result:=Files.RowCount-1;
533+ end;
534+ Files.Rows[result].clear;
535+ end;
536+
537+ function jsontogrid(Url:string):integer;
508538 var
509539 obj:TJSONObject;
510540 val:TJSONValue;
@@ -525,7 +555,9 @@ var
525555 end;
526556
527557 begin
558+ result:=0;
528559 data:=iddownload(Url);
560+
529561 if OpURLOpenSave.Checked then begin
530562 Memo1.Lines.text:=data;
531563 Memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+ss+'_'+inttostr(Files.RowCount)+'.txt');
@@ -536,47 +568,43 @@ var
536568 hit:=0;
537569 for i:=0 to vresults.count-1 do begin
538570 vitem:=vresults.Items[i] as TJSONObject;;
539- r:=Files.RowCount;
540571 artist:=getval('artistName');
541572 if OpURLituneNazo.Checked then
542- if not MatchesMask(artist,'*'+getsearchtext(ListName.Text)+'*') then continue;
573+ if not MatchesMask(artist,getsearchtext(ListName.Text)) then continue;
543574
544575 inc(hit);
545- Files.RowCount:=r+1;
546- Files.Rows[r].clear;
547- Files.cells[NTEXT,r]:=getsearchtext(ss);
548- Files.cells[NFILE,r]:=getval('trackName');
549- Files.cells[NPATH,r]:=getval('trackViewUrl').Replace('https:','itmss:');
550- Files.cells[NNAME,r]:=getval('artistName');
551- Files.cells[NALBAM,r]:=getval('collectionName');
576+ row:=rowadd(row);
577+ Files.cells[NTEXT,row]:=getsearchtext(ss);
578+ Files.cells[NFILE,row]:=getval('trackName');
579+ Files.cells[NPATH,row]:=getval('trackViewUrl').Replace('https:','itmss:');
580+ Files.cells[NNAME,row]:=getval('artistName');
581+ Files.cells[NALBAM,row]:=getval('collectionName');
552582 if getval('isStreamable')='true' then
553- Files.cells[NOPEN,r]:='M';
554- Files.cells[NOPEN2,r]:='S';
555- end;
556-
557- if not localfind(sa,ss) then begin
558- if hit=0 then begin
559- r:=Files.RowCount;
560- Files.RowCount:=r+1;
561- Files.Rows[r].clear;
562- Files.cells[NTEXT,r]:=getsearchtext(ss);
563- end;
583+ Files.cells[NOPEN,row]:='M';
584+ Files.cells[NOPEN2,row]:='S';
564585 end;
565586
566587 except
567588 end;
589+ result:=hit;
590+
568591 end;
569592
570- function datatogrid(Url:string):string;
593+
594+ function datatogrid(Url:string):integer;
571595 var
572596 data:string;
573597 i,r:Integer;
574598 begin
599+ result:=0;
575600 data:=iddownload(Url);
576- r:=Files.RowCount;
577- Files.RowCount:=r+1;
578- Files.cells[NTEXT,r]:=getsearchtext(ss);
579- Files.cells[NFILE,r]:=data;
601+ if data<>'' then begin
602+ row:=rowadd(row);
603+ Files.cells[NTEXT,row]:=getsearchtext(ss);
604+ Files.cells[NFILE,row]:=data;
605+ Files.cells[NPATH,row]:=url;
606+ result:=1;
607+ end;
580608 end;
581609 function datoi(const s:string;def:Integer):Integer;
582610 begin
@@ -630,34 +658,68 @@ begin
630658 PFileUpdateClick(Sender);
631659
632660 Screen.Cursor:=crHourGlass;
633- ls:=Text.Perform(EM_LINEFROMCHAR,Text.SelStart,0);
634- le:=Text.Perform(EM_LINEFROMCHAR,Text.SelStart+Text.SelLength-1*Integer(Text.SelLength>0),0);
661+
662+ if sender=PReFind then begin
663+ ls:=Files.Selection.Top;
664+ le:=Files.Selection.Bottom;
665+ row:=le+1;
666+ end else begin
667+ ls:=Text.Perform(EM_LINEFROMCHAR,Text.SelStart,0);
668+ le:=Text.Perform(EM_LINEFROMCHAR,Text.SelStart+Text.SelLength-1*Integer(Text.SelLength>0),0);
669+ end;
670+
635671 for i:=ls to le do begin
636672 FindUrlButton.Caption:='中止';
673+ row:=i;
637674 Caption:=Self.Name+format(' %d/%d',[i,le]);
638- ss:=Text.lines[i];
675+ if sender=PReFind then
676+ ss:=Files.Cells[NTEXT,i]
677+ else
678+ ss:=Text.lines[i];
679+
639680 if not urlrun then
640681 break;
641682 Application.ProcessMessages;
642683 urls:=geturltext(ss);
684+ urlss:=urls.Split(['%サブ検索%']).item(1);
685+ urls:=urls.Split(['%サブ検索%']).item(0);
686+
643687 if urls='' then
644688 continue;
645689
690+ hit:=0;
646691 if OpURLFile.Checked then
647- datatogrid(urls)
692+ hit:=datatogrid(urls)
648693 else if OpURLitune.Checked and(urls.IndexOf('itmss:')=0) then begin
694+ //曲名だけだとリミットを越えて見つからないことがあるので先にリスト名+検索文字で検索したい
649695 urls:=urls.Replace('itmss:','https:');
650- jsontogrid(urls);
651- end
652- else
696+ hit:=jsontogrid(urls);
697+ if hit=0 then begin
698+ if urlss<>'' then begin
699+ urlss:=urlss.Replace('itmss:','https:');
700+ hit:=jsontogrid(urlss);
701+ end;
702+ end;
703+ end else
653704 ShellExecute(Handle,'open',PChar(urls),'','',1);
654705
655- if Files.RowCount>(Files.VisibleRowCount+1) then
656- Files.TopRow:=Files.RowCount-Files.VisibleRowCount;
706+ hitl:=false;
707+ if OpURLLocal.Checked then
708+ hitl:=localfind(sa,ss);
709+
710+ if(hit=0)and(hitl=false) then begin
711+ row:=rowadd(row);
712+ Files.cells[NTEXT,row]:=getsearchtext(ss);
713+ Files.cells[NPATH,row]:=urls;
714+ end;
715+
716+ if not (sender=PReFind) then
717+ if Files.RowCount>(Files.VisibleRowCount+1) then
718+ Files.TopRow:=Files.RowCount-Files.VisibleRowCount;
657719 Files.ColExpand(10);
658720 Files.setfixed;
659-
660- sleep(Max(datoi(OpURLWait.Text,3000),1000));
721+ if i<le then
722+ sleep(Max(datoi(OpURLWait.Text,3000),1000));
661723 end;
662724 finally
663725 FindUrlButton.Caption:='URL検索';
@@ -668,6 +730,20 @@ begin
668730
669731 end;
670732
733+procedure TTextDeFindForm.PReFindClick(Sender: TObject);
734+begin
735+ FindUrlButtonClick(PReFind);
736+end;
737+
738+
739+procedure TTextDeFindForm.PReloadClick(Sender: TObject);
740+begin
741+// pname:='';
742+// ListNameChange(sender);
743+ Inifile.readgrid('grid\'+ListName.Text,TGrid(GridFiles));
744+
745+end;
746+
671747 procedure TTextDeFindForm.PFileExecClick(Sender:TObject);
672748 begin
673749 with GridFiles do
@@ -702,6 +778,7 @@ begin
702778 Files.save(SaveDialog.FileName);
703779 end;
704780
781+
705782 procedure TTextDeFindForm.PRowAddClick(Sender:TObject);
706783 begin
707784 Files.RowInsert(Files.Selection.Top,Files.Selection.Bottom-Files.Selection.Top+1)
@@ -737,6 +814,13 @@ begin
737814 FindUrlButtonClick(Sender);
738815 end;
739816
817+procedure TTextDeFindForm.PTextListNameClick(Sender: TObject);
818+begin
819+ ListName.Text:=InputBox('リスト名','リスト名',ListName.Text);
820+
821+ pname:=ListName.Text;
822+end;
823+
740824 procedure TTextDeFindForm.PTextOpenClick(Sender:TObject);
741825 begin
742826 OpenDialog.DefaultExt:='txt';
@@ -991,7 +1075,7 @@ var
9911075 begin
9921076 ls:=Text.Perform(EM_LINEFROMCHAR,Text.SelStart,0);
9931077 Result:=Path.Text;
994- Result:=Result.Replace('%リスト名%',ListName.Text);
1078+ Result:=Result.Replace('%リスト名%',getsearchtext(ListName.Text));
9951079 Result:=Result.Replace('%検索文字%',Text.lines[ls]);
9961080 if Result='' then
9971081 exit;
@@ -1010,7 +1094,7 @@ var
10101094 s:=zenkaku(s);
10111095 // s:=s.Replace(' ','');
10121096 // s:=s.Replace('・','');
1013- Result:=s;
1097+ Result:=trim(s);
10141098 end;
10151099
10161100 begin
@@ -1563,8 +1647,7 @@ begin
15631647 X:=ColCount;
15641648 for i:=0 to cnt-1 do
15651649 cols[X+i].clear();
1566- Result:=0
1567-
1650+ Result:=X+cnt-1;
15681651 end;
15691652
15701653 function TGrid.ColDelete(X,cnt:Integer):Integer;
@@ -1586,6 +1669,7 @@ begin
15861669 end;
15871670 RowClear(w,cnt);
15881671 ColCount:=w;
1672+ Result:=ColCount-1;
15891673 end;
15901674
15911675 function TGrid.ColInsert(X,cnt:Integer):Integer;
@@ -1606,7 +1690,7 @@ begin
16061690 end;
16071691 for i:=0 to cnt-1 do
16081692 cols[X+i].clear();
1609- Result:=0;
1693+ Result:=X+cnt-1;
16101694 end;
16111695
16121696 function TGrid.RowDelete(Y,cnt:Integer):Integer;
@@ -1628,6 +1712,7 @@ begin
16281712 end;
16291713 RowClear(w,cnt);
16301714 RowCount:=w;
1715+ Result:=RowCount-1;
16311716 end;
16321717
16331718 function TGrid.RowInsert(Y,cnt:Integer):Integer;
@@ -1648,7 +1733,7 @@ begin
16481733 end;
16491734 for i:=0 to cnt-1 do
16501735 Rows[Y+i].clear();
1651- Result:=0;
1736+ Result:=Y+cnt-1;
16521737 end;
16531738
16541739 function TGrid.RowClear(Y,cnt:Integer):Integer;
@@ -1661,7 +1746,7 @@ begin
16611746 Y:=RowCount;
16621747 for i:=0 to cnt-1 do
16631748 Rows[Y+i].clear();
1664- Result:=0
1749+ Result:=Y+cnt-1;
16651750 end;
16661751
16671752 function TStringDynArrayHelper.add(s:string):Integer;
Show on old repository browser