@@ -308,25 +308,21 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
308
308
Action = e =>
309
309
{
310
310
string message ;
311
- //TODO: display all plugins to be updated in the message
312
- if ( /*Settings.AutoRestartAfterChanging*/ false ) // TODO: remove false
311
+ if ( Settings . AutoRestartAfterChanging )
313
312
{
314
- message = string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_subtitle" ) , "FlowLauncher will restart after updating all plugins." ,
315
- Environment . NewLine , Environment . NewLine ) ;
313
+ message = "Would you like to update all plugins?\n FlowLauncher will restart after updating all plugins.\n " ;
316
314
}
317
315
else
318
316
{
319
- message = string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_subtitle" ) ,
320
- Environment . NewLine ) ;
317
+ message = "Would you like to update all plugins?\n FlowLauncher will restart after updating all plugins.\n " ;
321
318
}
319
+
322
320
if ( MessageBox . Show ( message ,
323
321
Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
324
322
MessageBoxButton . YesNo ) == MessageBoxResult . Yes )
325
323
{
326
- Debug . Print ( "Looping through plugins to update" ) ;
327
324
foreach ( var plugin in resultsForUpdate )
328
325
{
329
- Debug . Print ( $ "Updating { plugin . Name } ") ;
330
326
var downloadToFilePath = Path . Combine ( Path . GetTempPath ( ) ,
331
327
$ "{ plugin . Name } -{ plugin . NewVersion } .zip") ;
332
328
@@ -342,20 +338,6 @@ await Http.DownloadAsync(plugin.PluginNewUserPlugin.UrlDownload, downloadToFileP
342
338
343
339
PluginManager . UpdatePlugin ( plugin . PluginExistingMetadata , plugin . PluginNewUserPlugin , downloadToFilePath ) ;
344
340
345
- //TODO: fix
346
- // if (Settings.AutoRestartAfterChanging)
347
- // {
348
- // Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
349
- // string.Format(Context.API.GetTranslation("plugin_pluginsmanager_update_success_restart"),
350
- // x.Name));
351
- // Context.API.RestartApp();
352
- // }
353
- // else
354
- // {
355
- // Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_update_title"),
356
- // string.Format(Context.API.GetTranslation("plugin_pluginsmanager_update_success_no_restart"),
357
- // x.Name));
358
- // }
359
341
} ) . ContinueWith ( t =>
360
342
{
361
343
Log . Exception ( "PluginsManager" , $ "Update failed for { plugin . Name } ",
@@ -367,10 +349,24 @@ await Http.DownloadAsync(plugin.PluginNewUserPlugin.UrlDownload, downloadToFileP
367
349
plugin . Name ) ) ;
368
350
} , TaskContinuationOptions . OnlyOnFaulted ) ;
369
351
}
370
- Debug . Print ( "Finished updating all plugins" ) ;
371
- return true ; // User confirmed to update all plugins
352
+
353
+ if ( Settings . AutoRestartAfterChanging )
354
+ {
355
+ Context . API . ShowMsg ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
356
+ string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_success_restart" ) ,
357
+ "all" ) ) ;
358
+ Context . API . RestartApp ( ) ;
359
+ }
360
+ else
361
+ {
362
+ Context . API . ShowMsg ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
363
+ string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_success_no_restart" ) ,
364
+ "all" ) ) ;
365
+ }
366
+
367
+ return true ;
372
368
}
373
- return false ; //user cancelled
369
+ return false ;
374
370
} ,
375
371
ContextData = new UserPlugin ( )
376
372
} ;
0 commit comments