diff --git a/CommonProperties.xml b/CommonProperties.xml index 09f02e2..73722af 100644 --- a/CommonProperties.xml +++ b/CommonProperties.xml @@ -4,8 +4,8 @@ ..\SuperLauncherAssets\logo.ico Super Launcher Super Launcher - 2.1.3.0 - 2.1.3.0 + 2.1.4.0 + 2.1.4.0 en-US https://github.com/belowaverage-org/SuperLauncher GIT @@ -13,7 +13,7 @@ ..\LICENSE below average © 2024 Dylan Bickerstaff; Adam Cunningham - 2.1.3.0 + 2.1.4.0 🚀 Super Launcher is an admin launcher that persists in the system tray that can launch programs quickly; optionally, with administrator rights, as another user, or both. x64 x64 diff --git a/SuperLauncher/AutoStartHelper.cs b/SuperLauncher/AutoStartHelper.cs index 397c309..f5d9dc8 100644 --- a/SuperLauncher/AutoStartHelper.cs +++ b/SuperLauncher/AutoStartHelper.cs @@ -7,7 +7,8 @@ public static class AutoStartHelper { private const string SuperLauncherPath = "C:\\Users\\Public\\below average\\Super Launcher\\SuperLauncherBootstrap.exe"; private const string RelativeRunKeyPath = "\\Software\\Microsoft\\Windows\\CurrentVersion\\Run"; - public static AutoStartStatus Status { + public static AutoStartStatus Status + { get => GetStatus(); set { @@ -35,7 +36,7 @@ private static void Enable() key.Close(); } } - private static void Disable() + private static void Disable() { if (Status == AutoStartStatus.Disabled) return; RegistryKey key = Registry.Users.OpenSubKey(RunKeyPath, true); diff --git a/SuperLauncher/ModernLauncherContextMenuIcon.xaml.cs b/SuperLauncher/ModernLauncherContextMenuIcon.xaml.cs index 454c86b..228deac 100644 --- a/SuperLauncher/ModernLauncherContextMenuIcon.xaml.cs +++ b/SuperLauncher/ModernLauncherContextMenuIcon.xaml.cs @@ -50,7 +50,7 @@ private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e) } private void BtnRename_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { - + new ModernLauncherRenameUI(Icon).ShowDialog(); } } } \ No newline at end of file diff --git a/SuperLauncher/ModernLauncherIcon.xaml.cs b/SuperLauncher/ModernLauncherIcon.xaml.cs index 47328c2..b184b7b 100644 --- a/SuperLauncher/ModernLauncherIcon.xaml.cs +++ b/SuperLauncher/ModernLauncherIcon.xaml.cs @@ -17,7 +17,26 @@ public partial class ModernLauncherIcon : UserControl public bool rFilterFocus = false; public ModernLauncherBadge Badge; public bool IsMouseDown = false; - public string Title = null; + private string rTitle = ""; + public string Title + { + get + { + return rTitle; + } + set + { + if (string.IsNullOrEmpty(value)) + { + rTitle = Shared.ExtRemover(rFilePath); + } + else + { + rTitle = value; + } + NameText.Text = rTitle; + } + } public Timer BadgeTimer = new() { Interval = 1000, @@ -35,14 +54,6 @@ public string FilePath { rFilePath = value; Icon icon = Icon.ExtractAssociatedIcon(rFilePath); - if (Title == null) - { - NameText.Text = Shared.ExtRemover(rFilePath); - } - else - { - NameText.Text = Title; - } LIcon.Source = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); } } @@ -68,8 +79,8 @@ public bool FilterFocus public ModernLauncherIcon(string FilePath, string Title = null) { InitializeComponent(); - this.Title = Title; this.FilePath = FilePath; + this.Title = Title; } private readonly DoubleAnimation To1 = new() { @@ -143,7 +154,7 @@ private void UserControl_MouseUp(object sender, MouseButtonEventArgs e) private void Menu_MouseUp(object sender, MouseButtonEventArgs e) { ModernLauncherContextMenuIcon menu = (ModernLauncherContextMenuIcon)sender; - if (e.Source == menu.BtnUnpin) + if (e.Source == menu.BtnUnpin || e.Source == menu.BtnRename) { PWindow.Focus(); } diff --git a/SuperLauncher/ModernLauncherIcons.xaml.cs b/SuperLauncher/ModernLauncherIcons.xaml.cs index ccdc459..00b7828 100644 --- a/SuperLauncher/ModernLauncherIcons.xaml.cs +++ b/SuperLauncher/ModernLauncherIcons.xaml.cs @@ -63,8 +63,12 @@ public void PopulateIcons() foreach (XmlNode app in apps) { if (!File.Exists(app.InnerText)) continue; - - ModernLauncherIcon mli = new(app.InnerText); + string name = null; + if (app.Attributes["Name"] != null) + { + name = app.Attributes["Name"].InnerText; + } + ModernLauncherIcon mli = new(app.InnerText, name); IconPanel.Children.Add(mli); } } @@ -73,14 +77,16 @@ public void PopulateIcons() IconPanel.Children.Add(new ModernLauncherIcon(@"C:\Windows\System32\cmd.exe", "Command Prompt")); } } - private void CommitIconsToFile() + public void CommitIconsToFile() { Settings.Default.FileList.Clear(); foreach (ModernLauncherIcon mli in IconPanel.Children) { Settings.Default.FileList.Add(mli.FilePath); - //XmlNode node = Settings.Default.XDoc.SelectSingleNode("/SuperLauncher/AppList/App[. = \"" + mli.FilePath + "\"]"); - //node.Attributes. + XmlNode node = Settings.Default.XDoc.SelectSingleNode("/SuperLauncher/AppList/App[. = \"" + mli.FilePath + "\"]"); + XmlAttribute name = Settings.Default.XDoc.CreateAttribute("Name"); + name.InnerText = mli.Title; + node.Attributes.Append(name); } Settings.Default.Save(); } diff --git a/SuperLauncher/ModernLauncherRenameUI.xaml b/SuperLauncher/ModernLauncherRenameUI.xaml new file mode 100644 index 0000000..17aefc7 --- /dev/null +++ b/SuperLauncher/ModernLauncherRenameUI.xaml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + +