Skip to content

Commit

Permalink
Restart notice as an in-app InfoBar instead of a TeachingTip
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Feb 10, 2023
1 parent a82d5a3 commit 07859c6
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 237 deletions.
4 changes: 2 additions & 2 deletions Amethyst/Assets/Strings/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
"/DevicesPage/Badges/Devices/Override": "Override",
"/DevicesPage/Badges/Devices/Error": "Error",
"/DevicesPage/ToolTips/Overrides/Overlapping": "This joint is currently overiden by:\n{0}",
"/DevicesPage/Devices/Reload/Title": "Device configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new device plugin has been added or removed.\nAmethyst must be restarted for these changes to take effect.\n\nWould you like to restart Amethyst now?",
"/DevicesPage/Devices/Reload/Title": "Plugin configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new plugin has been added or removed. Amethyst must be restarted for these changes to take effect.",
"/DevicesPage/Devices/Reload/Restart": "Restart Amethyst",
"/DevicesPage/Devices/Manager/Open": "Manage Plugins",
"/DevicesPage/Devices/Manager/Title": "Manage Plugins",
Expand Down
4 changes: 2 additions & 2 deletions Amethyst/Assets/Strings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
"/DevicesPage/Badges/Devices/Override": "Override",
"/DevicesPage/Badges/Devices/Error": "Error",
"/DevicesPage/ToolTips/Overrides/Overlapping": "This joint is currently overiden by:\n{0}",
"/DevicesPage/Devices/Reload/Title": "Device configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new device plugin has been added or removed.\nAmethyst must be restarted for these changes to take effect.\n\nWould you like to restart Amethyst now?",
"/DevicesPage/Devices/Reload/Title": "Plugin configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new plugin has been added or removed. Amethyst must be restarted for these changes to take effect.",
"/DevicesPage/Devices/Reload/Restart": "Restart Amethyst",
"/DevicesPage/Devices/Manager/Open": "Manage Plugins",
"/DevicesPage/Devices/Manager/Title": "Manage Plugins",
Expand Down
4 changes: 2 additions & 2 deletions Amethyst/Assets/Strings/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
"/DevicesPage/Badges/Devices/Override": "Override",
"/DevicesPage/Badges/Devices/Error": "Error",
"/DevicesPage/ToolTips/Overrides/Overlapping": "This joint is currently overiden by:\n{0}",
"/DevicesPage/Devices/Reload/Title": "Device configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new device plugin has been added or removed.\nAmethyst must be restarted for these changes to take effect.\n\nWould you like to restart Amethyst now?",
"/DevicesPage/Devices/Reload/Title": "Plugin configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new plugin has been added or removed. Amethyst must be restarted for these changes to take effect.",
"/DevicesPage/Devices/Reload/Restart": "Restart Amethyst",
"/DevicesPage/Devices/Manager/Open": "Manage Plugins",
"/DevicesPage/Devices/Manager/Title": "Manage Plugins",
Expand Down
4 changes: 2 additions & 2 deletions Amethyst/Assets/Strings/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
"/DevicesPage/Badges/Devices/Override": "Override",
"/DevicesPage/Badges/Devices/Error": "Error",
"/DevicesPage/ToolTips/Overrides/Overlapping": "This joint is currently overiden by:\n{0}",
"/DevicesPage/Devices/Reload/Title": "Device configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new device plugin has been added or removed.\nAmethyst must be restarted for these changes to take effect.\n\nWould you like to restart Amethyst now?",
"/DevicesPage/Devices/Reload/Title": "Plugin configuration has changed!",
"/DevicesPage/Devices/Reload/Content": "A new plugin has been added or removed. Amethyst must be restarted for these changes to take effect.",
"/DevicesPage/Devices/Reload/Restart": "Restart Amethyst",
"/DevicesPage/Devices/Manager/Open": "Manage Plugins",
"/DevicesPage/Devices/Manager/Title": "Manage Plugins",
Expand Down
5 changes: 3 additions & 2 deletions Amethyst/Classes/Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ public static class TeachingTips
{
public static class MainPage
{
public static TeachingTip
InitializerTeachingTip, ReloadTeachingTip;
public static TeachingTip InitializerTeachingTip;

public static InfoBar ReloadInfoBar;
}

public static class GeneralPage
Expand Down
9 changes: 7 additions & 2 deletions Amethyst/MVVM/PluginHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ public bool IsLoaded
// == cause the upper check would make it different
// and it's already been assigned at the beginning
if (Shared.Devices.PluginsPageOpened && IsLoaded == value)
Shared.TeachingTips.MainPage.ReloadTeachingTip.IsOpen = true;
{
Shared.TeachingTips.MainPage.ReloadInfoBar.IsOpen = true;
Shared.TeachingTips.MainPage.ReloadInfoBar.Opacity = 1.0;
}

// Save settings
AppData.Settings.SaveSettings();
Expand Down Expand Up @@ -477,7 +480,9 @@ public static bool AddPlugin<T>(this ICollection<T> collection, DirectoryInfo it
}
catch (Exception e)
{
Crashes.TrackError(e); // Unknown exception
if ((e as System.Reflection.ReflectionTypeLoadException)?.LoaderExceptions.First() is not
FileNotFoundException) Crashes.TrackError(e); // Only send unknown exceptions

if (fileInfo.Name.StartsWith("plugin"))
Logger.Error($"Loading {fileInfo} failed with an exception: Message: {e.Message} " +
"Probably some assembly referenced by this plugin is missing.");
Expand Down
Loading

0 comments on commit 07859c6

Please sign in to comment.