@@ -199,13 +199,20 @@ public sealed partial class ShellMode : IDisposable, IMode
199199
200200 } ;
201201
202- private static readonly Button Btn_Queue = new ( "Queue" )
202+ private static readonly CheckBox Cb_Queue = new ( )
203203 {
204204 X = Pos . X ( Btn_Run ) ,
205205 Y = Pos . Bottom ( Btn_Run ) ,
206206
207+ } ;
208+
209+ private static readonly Button Btn_Queue = new ( "Queue" )
210+ {
211+ X = Pos . Right ( Cb_Queue ) ,
212+ Y = Pos . Y ( Cb_Queue ) ,
213+
207214 Height = Dim . Height ( Btn_Run ) ,
208- ColorScheme = UI . Cs_Lbl1
215+ ColorScheme = UI . Cs_Btn1
209216
210217 } ;
211218
@@ -260,6 +267,8 @@ public sealed partial class ShellMode : IDisposable, IMode
260267
261268 internal ManualResetEvent IsReady { get ; set ; }
262269
270+ private readonly ConcurrentQueue < ustring > m_queue ;
271+
263272 #endregion
264273
265274 #endregion
@@ -273,6 +282,7 @@ public ShellMode(string[] args)
273282 Query = SearchQuery . Null ;
274283 Client = new SearchClient ( new SearchConfig ( ) ) ;
275284 IsReady = new ManualResetEvent ( false ) ;
285+ m_queue = new ( ) ;
276286
277287 m_results = new ( ) ;
278288
@@ -295,7 +305,7 @@ public ShellMode(string[] args)
295305 m_cbCallbackTok = Application . MainLoop . AddTimeout ( TimeoutTimeSpan , ClipboardCallback ) ;
296306
297307 m_clipboard = new List < ustring > ( ) ;
298-
308+
299309 Mb_Menu . Menus = new MenuBarItem [ ]
300310 {
301311 new ( "_About" , null , AboutDialog ) ,
@@ -373,17 +383,32 @@ public ShellMode(string[] args)
373383
374384 if ( ! string . IsNullOrWhiteSpace ( file ) ) {
375385 Query . Dispose ( ) ;
386+ Debug . WriteLine ( $ "{ IsQueryReady ( ) } ") ;
376387 FileSystem . DeleteFile ( file , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
377388 Debug . WriteLine ( $ "deleted { file } ") ;
378389 Clear ( ) ;
379390 }
380391
381392 } ;
393+
394+ Cb_Queue . Toggled += b =>
395+ {
396+ Btn_Queue . Enabled = ! b ;
397+ } ;
398+
399+ Btn_Queue . Clicked += ( ) =>
400+ {
401+ if ( IsQueryReady ( ) ) {
402+
403+ }
404+ } ;
405+
406+ Btn_Queue . Enabled = false ;
382407
383408 Win . Add ( Lbl_Input , Tf_Input , Btn_Run , Lbl_InputOk ,
384409 Btn_Clear , Tv_Results , Pbr_Status , Lbl_InputInfo , Lbl_QueryUpload ,
385410 Btn_Restart , Btn_Config , Lbl_InputInfo2 , Btn_Cancel , Lbl_Status , Btn_Browse ,
386- Lbl_Status2 , /* Btn_Queue,*/ Btn_Delete
411+ Lbl_Status2 , Btn_Queue , Btn_Delete , Cb_Queue
387412 ) ;
388413
389414 Top . Add ( Win ) ;
@@ -610,6 +635,9 @@ private async Task<bool> SetQuery(ustring text)
610635 IsReady . Set ( ) ;
611636 Btn_Run . Enabled = false ;
612637 Pbr_Status . Fraction = 0 ;
638+ // Btn_Delete.Enabled = true;
639+
640+ Tf_Input . ReadOnly = true ;
613641
614642 return true ;
615643 }
@@ -680,5 +708,6 @@ public void Dispose()
680708 Client . Dispose ( ) ;
681709 Query . Dispose ( ) ;
682710 m_token . Dispose ( ) ;
711+ m_queue . Clear ( ) ;
683712 }
684713}
0 commit comments