public static void SaveGroups() { Registry.CurrentUser.DeleteSubKeyTree(RegConst.Root + RegConst.Groups); using (RegistryKey key = Registry.CurrentUser.CreateSubKey(RegConst.Root + RegConst.Groups)) { for (int i = 0; i < groupList.Count; i++) { Group g = groupList[i]; using (RegistryKey gkey = key.CreateSubKey("" + i)) { gkey.SetValue("", g.Name); if (g.ShortcutKey != Keys.None) { gkey.SetValue("key", (int)g.ShortcutKey); } if (g.Startup) { gkey.SetValue("startup", ""); } for (int j = 0; j < g.Paths.Count; j++) { gkey.SetValue("" + j, g.Paths[j]); } } } } InstanceManager.LocalBBarBroadcast(bbar => bbar.RefreshButtons()); InstanceManager.StaticBroadcast(() => { LoadGroups(); InstanceManager.LocalBBarBroadcast(bbar => bbar.RefreshButtons()); }); // todo: desktop }
public static void SaveApps() { Registry.CurrentUser.DeleteSubKeyTree(RegConst.Root + RegConst.Apps); using (RegistryKey key = Registry.CurrentUser.CreateSubKey(RegConst.Root + RegConst.Apps)) { for (int i = 0; i < appList.Count; i++) { UserApp a = appList[i]; using (RegistryKey akey = key.CreateSubKey("" + i)) { akey.SetValue("", a.Name); if (a.IsFolder) { akey.SetValue("children", a.ChildrenCount); } else { akey.SetValue("path", a.Path); akey.SetValue("args", a.Args); akey.SetValue("wdir", a.WorkingDir); if (a.ShortcutKey != Keys.None) { akey.SetValue("key", (int)a.ShortcutKey); } } } } } InstanceManager.StaticBroadcast(LoadApps); }
public static void UpdateConfig(bool fBroadcast = true) { QTUtility.TextResourcesDic = Config.Lang.UseLangFile && File.Exists(Config.Lang.LangFile) ? QTUtility.ReadLanguageFile(Config.Lang.LangFile) : null; QTUtility.ValidateTextResources(); StaticReg.ClosedTabHistoryList.MaxCapacity = Config.Misc.TabHistoryCount; StaticReg.ExecutedPathsList.MaxCapacity = Config.Misc.FileHistoryCount; DropDownMenuBase.InitializeMenuRenderer(); ContextMenuStripEx.InitializeMenuRenderer(); PluginManager.RefreshPlugins(); InstanceManager.LocalTabBroadcast(tabbar => tabbar.RefreshOptions()); if (fBroadcast) { // SyncTaskBarMenu(); todo InstanceManager.StaticBroadcast(() => { ReadConfig(); UpdateConfig(false); }); } }