deadmoon 2 年之前
父节点
当前提交
2b2785c252
共有 5 个文件被更改,包括 57 次插入9 次删除
  1. 2 2
      Optimizer/Controls/MoonTabs.cs
  2. 5 5
      Optimizer/Forms/MainForm.cs
  3. 0 1
      Optimizer/Program.cs
  4. 3 1
      Optimizer/Resources/i18n/KO.json
  5. 47 0
      Optimizer/Utilities.cs

+ 2 - 2
Optimizer/Controls/MoonTabs.cs

@@ -86,8 +86,8 @@ namespace Optimizer
 
             Margin = new Padding(0);
             Padding = new Point(0, 0);
-
-            this.SizeMode = TabSizeMode.Normal;
+            
+            this.SizeMode = TabSizeMode.Fixed;
         }
 
         private void SetDragState() => bDrag = (CanDrag && bMouseDown && bShiftKey);

+ 5 - 5
Optimizer/Forms/MainForm.cs

@@ -2031,19 +2031,19 @@ namespace Optimizer
                             switch (x.Group)
                             {
                                 case "SystemTools":
-                                    appCard.Location = new Point(0, groupSystemTools.Controls.Count * (Program.DPI_PREFERENCE / 3));
+                                    appCard.Location = new Point(0, groupSystemTools.Controls.Count * (Program.DPI_PREFERENCE / 2));
                                     groupSystemTools.Controls.Add(appCard);
                                     break;
                                 case "Internet":
-                                    appCard.Location = new Point(0, groupInternet.Controls.Count * (Program.DPI_PREFERENCE / 3));
+                                    appCard.Location = new Point(0, groupInternet.Controls.Count * (Program.DPI_PREFERENCE / 2));
                                     groupInternet.Controls.Add(appCard);
                                     break;
                                 case "Coding":
-                                    appCard.Location = new Point(0, groupCoding.Controls.Count * (Program.DPI_PREFERENCE / 3));
+                                    appCard.Location = new Point(0, groupCoding.Controls.Count * (Program.DPI_PREFERENCE / 2));
                                     groupCoding.Controls.Add(appCard);
                                     break;
                                 case "GraphicsSound":
-                                    appCard.Location = new Point(0, groupSoundVideo.Controls.Count * (Program.DPI_PREFERENCE / 3));
+                                    appCard.Location = new Point(0, groupSoundVideo.Controls.Count * (Program.DPI_PREFERENCE / 2));
                                     groupSoundVideo.Controls.Add(appCard);
                                     break;
                                 default:
@@ -2359,7 +2359,7 @@ namespace Optimizer
                     catch { }
                 }
 
-                appCard.Location = new Point(0, panelUwp.Controls.Count * (Program.DPI_PREFERENCE / 3));
+                appCard.Location = new Point(0, panelUwp.Controls.Count * (Program.DPI_PREFERENCE / 2));
                 panelUwp.Controls.Add(appCard);
 
             }

+ 0 - 1
Optimizer/Program.cs

@@ -67,7 +67,6 @@ namespace Optimizer
 
             DPI_PREFERENCE = Convert.ToInt32(Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ThemeManager", "LastLoadedDPI", "96"));
             if (Environment.OSVersion.Version.Major >= 6) SetProcessDPIAware();
-
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
 

+ 3 - 1
Optimizer/Resources/i18n/KO.json

@@ -450,5 +450,7 @@ Microsoft 계정 로그인이 필요합니다.",
 	"advancedTab": "고급",
 	"btnRestartSafe": "안전 모드에서 다시 시작",
 	"btnRestart": "정상 모드에서 다시 시작",
-	"btnRestartDisableDefender": "Defender 다시 시작 및 사용 안 함"
+	"btnRestartDisableDefender": "Defender 다시 시작 및 사용 안 함",
+	"storeUpdatesSw": "Microsoft Store 업데이트 비활성화",
+	"storeUpdatesTip": "Microsoft Store 자동 업데이트 기능을 비활성화합니다."
 }

+ 47 - 0
Optimizer/Utilities.cs

@@ -1,4 +1,6 @@
 using Microsoft.Win32;
+using Newtonsoft.Json.Linq;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -12,6 +14,7 @@ using System.ServiceProcess;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using System.Text;
 
 namespace Optimizer
 {
@@ -754,6 +757,31 @@ namespace Optimizer
             }
         }
 
+        internal static void AllowProcessToRun(string pName)
+        {
+            try
+            {
+                using (RegistryKey ifeo = Registry.LocalMachine.OpenSubKeyWritable(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", RegistryRights.FullControl))
+                {
+                    if (ifeo == null) return;
+
+                    ifeo.GrantFullControlOnSubKey("Image File Execution Options");
+
+                    using (RegistryKey k = ifeo.OpenSubKeyWritable("Image File Execution Options", RegistryRights.FullControl))
+                    {
+                        if (k == null) return;
+
+                        k.GrantFullControlOnSubKey(pName);
+                        k.DeleteSubKey(pName);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                ErrorLogger.LogError("Utilities.AllowProcessToRun", ex.Message, ex.StackTrace);
+            }
+        }
+
         internal static void PreventProcessFromRunning(string pName)
         {
             try
@@ -785,5 +813,24 @@ namespace Optimizer
                 ErrorLogger.LogError("Utilities.PreventProcessFromRunning", ex.Message, ex.StackTrace);
             }
         }
+
+        // for debugging purposes
+        internal static void FindDiffInTwoJsons()
+        {
+            JObject file1 = JObject.Parse(Properties.Resources.EN);
+            JObject file2 = JObject.Parse(Properties.Resources.KO);
+
+            var p1 = file1.Properties().ToList();
+            var p2 = file2.Properties().ToList();
+
+            var missingProps = p1.Where(expected => p2.Where(actual => actual.Name == expected.Name).Count() == 0);
+
+            StringBuilder sb = new StringBuilder();
+            foreach (var x in missingProps)
+            {
+                sb.Append(x.Name + Environment.NewLine);
+            }
+            MessageBox.Show(sb.ToString());
+        }
     }
 }