@@ -56,7 +56,7 @@ private static NConsoleOption[] AllOptions
5656 /// <remarks>
5757 /// User-friendly menu
5858 /// </remarks>
59- internal static void Run ( ) => NConsoleIO . ReadOptions ( MainMenu ) ;
59+ internal static void Run ( ) => NConsole . ReadOptions ( MainMenu ) ;
6060
6161
6262 /// <summary>
@@ -96,6 +96,9 @@ private static NConsoleOption[] AllOptions
9696 /// </summary>
9797 internal const int ConsoleWindowHeight = 50 ;
9898
99+ /// <summary>
100+ /// Main option
101+ /// </summary>
99102 private static readonly NConsoleOption RunSelectImage = new ( )
100103 {
101104 Name = ">>> Select image <<<" ,
@@ -104,11 +107,11 @@ private static NConsoleOption[] AllOptions
104107 {
105108 Console . WriteLine ( "Drag and drop the image here." ) ;
106109
107- string ? img = NConsoleIO . ReadInput ( "Image" ) ;
110+ string ? img = NConsole . ReadInput ( "Image" ) ;
108111
109112 if ( String . IsNullOrWhiteSpace ( img ) ) {
110113 NConsole . WriteError ( "Invalid image" ) ;
111- NConsoleIO . WaitForInput ( ) ;
114+ NConsole . WaitForInput ( ) ;
112115 return null ;
113116 }
114117
@@ -128,15 +131,15 @@ private static NConsoleOption[] AllOptions
128131 Function = ( ) =>
129132 {
130133 var rgEnum = NConsoleOption . FromEnum < SearchEngineOptions > ( ) ;
131- var values = NConsoleIO . ReadOptions ( rgEnum , true ) ;
134+ var values = NConsole . ReadOptions ( rgEnum , true ) ;
132135
133136 var newValues = Enums . ReadFromSet < SearchEngineOptions > ( values ) ;
134137
135138 NConsole . WriteSuccess ( newValues ) ;
136139
137140 SearchConfig . Config . SearchEngines = newValues ;
138141
139- NConsoleIO . WaitForSecond ( ) ;
142+ NConsole . WaitForSecond ( ) ;
140143 return null ;
141144 }
142145 } ;
@@ -149,15 +152,15 @@ private static NConsoleOption[] AllOptions
149152 Function = ( ) =>
150153 {
151154 var rgEnum = NConsoleOption . FromEnum < SearchEngineOptions > ( ) ;
152- var values = NConsoleIO . ReadOptions ( rgEnum , true ) ;
155+ var values = NConsole . ReadOptions ( rgEnum , true ) ;
153156
154157 var newValues = Enums . ReadFromSet < SearchEngineOptions > ( values ) ;
155158
156159 NConsole . WriteSuccess ( newValues ) ;
157160
158161 SearchConfig . Config . PriorityEngines = newValues ;
159162
160- NConsoleIO . WaitForSecond ( ) ;
163+ NConsole . WaitForSecond ( ) ;
161164 return null ;
162165 }
163166 } ;
@@ -169,9 +172,9 @@ private static NConsoleOption[] AllOptions
169172 Color = ColorConfig ,
170173 Function = ( ) =>
171174 {
172- SearchConfig . Config . SauceNaoAuth = NConsoleIO . ReadInput ( "API key" ) ;
175+ SearchConfig . Config . SauceNaoAuth = NConsole . ReadInput ( "API key" ) ;
173176
174- NConsoleIO . WaitForSecond ( ) ;
177+ NConsole . WaitForSecond ( ) ;
175178 return null ;
176179 }
177180 } ;
@@ -183,13 +186,36 @@ private static NConsoleOption[] AllOptions
183186 Function = ( ) =>
184187 {
185188
186- SearchConfig . Config . ImgurAuth = NConsoleIO . ReadInput ( "API key" ) ;
189+ SearchConfig . Config . ImgurAuth = NConsole . ReadInput ( "API key" ) ;
187190
188- NConsoleIO . WaitForSecond ( ) ;
191+ NConsole . WaitForSecond ( ) ;
189192 return null ;
190193 }
191194 } ;
192195
196+ private static readonly NConsoleOption ConfigAutoFilter = new ( )
197+ {
198+ Name = GetAutoFilterString ( ) ,
199+ Color = ColorConfig ,
200+ Function = ( ) =>
201+ {
202+
203+ SearchConfig . Config . FilterResults = ! SearchConfig . Config . FilterResults ;
204+ ConfigAutoFilter . Name = GetAutoFilterString ( ) ;
205+ return null ;
206+ }
207+ } ;
208+
209+ private static string GetAutoFilterString ( )
210+ {
211+ //var x = SearchConfig.Config.FilterResults
212+ // ? Formatting.CHECK_MARK.ToString()
213+ // : Formatting.BALLOT_X.ToString();
214+
215+ var x = SearchConfig . Config . FilterResults ;
216+ return $ "Filter results: { x } ";
217+ }
218+
193219 private static readonly NConsoleOption ConfigUpdateOption = new ( )
194220 {
195221 Name = "Update configuration file" ,
@@ -198,20 +224,20 @@ private static NConsoleOption[] AllOptions
198224 {
199225 SearchConfig . Config . SaveFile ( ) ;
200226
201- NConsoleIO . WaitForSecond ( ) ;
227+ NConsole . WaitForSecond ( ) ;
202228 return null ;
203229 }
204230 } ;
205231
206232 private static readonly NConsoleOption ShowInfoOption = new ( )
207233 {
208- Name = "Show info" ,
234+ Name = "Show info and config " ,
209235 Color = ColorMisc ,
210236 Function = ( ) =>
211237 {
212238 Info . ShowInfo ( ) ;
213239
214- NConsoleIO . WaitForInput ( ) ;
240+ NConsole . WaitForInput ( ) ;
215241 return null ;
216242 }
217243 } ;
@@ -224,22 +250,17 @@ private static NConsoleOption[] AllOptions
224250 Function = ( ) =>
225251 {
226252 bool ctx = Integration . IsContextMenuAdded ;
227- bool added ;
228253
229- if ( ! ctx ) {
230- Integration . HandleContextMenu ( IntegrationOption . Add ) ;
231- NConsole . WriteSuccess ( "Added to context menu" ) ;
232- added = true ;
233- }
234- else {
235- Integration . HandleContextMenu ( IntegrationOption . Remove ) ;
236- NConsole . WriteSuccess ( "Removed from context menu" ) ;
237- added = false ;
238- }
254+ var io = ! ctx ? IntegrationOption . Add : IntegrationOption . Remove ;
255+
256+ Integration . HandleContextMenu ( io ) ;
257+ bool added = io == IntegrationOption . Add ;
258+
259+ NConsole . WriteInfo ( $ "Context menu integrated: { added } ") ;
239260
240261 ContextMenuOption . Name = GetContextMenuString ( added ) ;
241262
242- NConsoleIO . WaitForSecond ( ) ;
263+ NConsole . WaitForSecond ( ) ;
243264 return null ;
244265 }
245266 } ;
@@ -256,7 +277,7 @@ private static string GetContextMenuString(bool added) =>
256277 {
257278 UpdateInfo . AutoUpdate ( ) ;
258279
259- NConsoleIO . WaitForSecond ( ) ;
280+ NConsole . WaitForSecond ( ) ;
260281 return null ;
261282 }
262283 } ;
@@ -269,7 +290,7 @@ private static string GetContextMenuString(bool added) =>
269290 {
270291 Integration . ResetIntegrations ( ) ;
271292
272- NConsoleIO . WaitForSecond ( ) ;
293+ NConsole . WaitForSecond ( ) ;
273294 return null ;
274295 }
275296 } ;
@@ -285,7 +306,7 @@ private static string GetContextMenuString(bool added) =>
285306 bool ok = LegacyIntegration . LegacyCleanup ( ) ;
286307
287308 NConsole . WriteInfo ( $ "Legacy cleanup: { ok } ") ;
288- NConsoleIO . WaitForInput ( ) ;
309+ NConsole . WaitForInput ( ) ;
289310
290311 return null ;
291312 }
@@ -335,7 +356,7 @@ private static string GetContextMenuString(bool added) =>
335356
336357 var rgOption = NConsoleOption . FromArray ( TestImages , s => s ) ;
337358
338- var testImg = ( string ) NConsoleIO . ReadOptions ( rgOption ) . First ( ) ;
359+ var testImg = ( string ) NConsole . ReadOptions ( rgOption ) . First ( ) ;
339360
340361 var img = Path . Combine ( cd2 , testImg ) ;
341362
0 commit comments