Przeglądaj źródła

Updated to 6.3. Important!

deadmoon 4 lat temu
rodzic
commit
663863b7b9

+ 4 - 0
CHANGELOG.md

@@ -2,6 +2,10 @@
 
 All notable changes to this project will be documented in this file.
 
+## [6.3] - 2021-02-15
+- New: Common Apps is getting the links online, no need to update the app to get new links
+- Improved: Tons of bug fixes to UI and beyond
+
 ## [6.2] - 2021-02-14
 - New: Nice styling to checkboxes & radios
 

+ 0 - 26
Optimizer/AppLinks.cs

@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using System.Net;
-using System.IO;
-
-namespace Optimizer
-{
-    public class AppLinks
-    {
-      
-
-        public List<AppInfo> Apps = new List<AppInfo>();
-
-        public AppLinks()
-        {
-            string feed = @"feed.json";
-            Apps = JsonConvert.DeserializeObject<List<AppInfo>>(File.ReadAllText(feed));
-
-            
-        }
-    }
-}

+ 1 - 1
Optimizer/AppInfo.cs → Optimizer/FeedApp.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace Optimizer
 {
-    public class AppInfo
+    public class FeedApp
     {
         public string Title { get; set; }
         public string Link64 { get; set; }

Plik diff jest za duży
+ 575 - 458
Optimizer/MainForm.Designer.cs


+ 71 - 4
Optimizer/MainForm.cs

@@ -12,13 +12,13 @@ using System.Threading;
 using System.Linq;
 using System.Drawing;
 using Timer = System.Windows.Forms.Timer;
+using Newtonsoft.Json;
 
 namespace Optimizer
 {
     public partial class MainForm : Form
     {
         ListViewColumnSorter _columnSorter;
-        AppLinks apps = new AppLinks();
 
         List<StartupItem> _startUpItems = new List<StartupItem>();
         List<string> _hostsEntries = new List<string>();
@@ -29,7 +29,8 @@ namespace Optimizer
         DesktopItemType _desktopItemType = DesktopItemType.Program;
         DesktopTypePosition _desktopItemPosition = DesktopTypePosition.Top;
 
-        readonly string _feedLink = "https://raw.githubusercontent.com/hellzerg/optimizer/master/fesdt";
+        public List<FeedApp> AppsFromFeed = new List<FeedApp>();
+        readonly string _feedLink = "https://raw.githubusercontent.com/hellzerg/optimizer/master/feed.json";
 
         readonly string _latestVersionLink = "https://raw.githubusercontent.com/hellzerg/optimizer/master/version.txt";
         readonly string _changelogLink = "https://github.com/hellzerg/optimizer/blob/master/CHANGELOG.md";
@@ -389,6 +390,67 @@ namespace Optimizer
                 }
                 txtDownloadFolder.Text = Options.CurrentOptions.AppsFolder;
             }
+
+            GetFeed();
+        }
+
+        private void GetFeed()
+        {
+            WebClient client = new WebClient
+            {
+                Encoding = Encoding.UTF8
+            };
+
+            try
+            {
+                string feed = client.DownloadString(_feedLink);
+                AppsFromFeed = JsonConvert.DeserializeObject<List<FeedApp>>(feed);
+
+                // UI handling
+                panel1.Visible = true;
+                panel2.Visible = true;
+                panel3.Visible = true;
+                panel4.Visible = true;
+                panel5.Visible = true;
+                panel6.Visible = true;
+                label42.Visible = true;
+                label44.Visible = true;
+                txtDownloadFolder.Visible = true;
+                button5.Visible = true;
+                button6.Visible = true;
+                btnDownloadApps.Visible = true;
+                c32.Visible = true;
+                c64.Visible = true;
+                cAutoInstall.Visible = true;
+                linkLabel1.Visible = false;
+                progressDownloader.Visible = true;
+                txtDownloadStatus.Visible = true;
+                btnGetFeed.Visible = false;
+                txtFeedError.Visible = false;
+            }
+            catch (Exception)
+            {
+                panel1.Visible = false;
+                panel2.Visible = false;
+                panel3.Visible = false;
+                panel4.Visible = false;
+                panel5.Visible = false;
+                panel6.Visible = false;
+                label42.Visible = false;
+                label44.Visible = false;
+                txtDownloadFolder.Visible = false;
+                button5.Visible = true;
+                button6.Visible = false;
+                btnDownloadApps.Visible = false;
+                c32.Visible = false;
+                c64.Visible = false;
+                cAutoInstall.Visible = false;
+                linkLabel1.Visible = false;
+                progressDownloader.Visible = false;
+                txtDownloadStatus.Visible = false;
+                btnGetFeed.Visible = true;
+                txtFeedError.Visible = true;
+            }
         }
 
         private void CleanPC()
@@ -2044,7 +2106,7 @@ namespace Optimizer
 
             ColoredCheckBox currentCheck;
             Control[] temp;
-            foreach (AppInfo x in apps.Apps)
+            foreach (FeedApp x in AppsFromFeed)
             {
                 if (string.IsNullOrEmpty(x.Tag)) continue;
                 temp = appsTab.Controls.Find(x.Tag, true);
@@ -2109,7 +2171,7 @@ namespace Optimizer
         }
 
         string fileExtension = ".exe";
-        private async Task DownloadApp(AppInfo app, bool pref64)
+        private async Task DownloadApp(FeedApp app, bool pref64)
         {
             try
             {
@@ -2227,5 +2289,10 @@ namespace Optimizer
         {
             GetModernApps(!chkOnlyRemovable.Checked);
         }
+
+        private void btnGetFeed_Click(object sender, EventArgs e)
+        {
+            GetFeed();
+        }
     }
 }

Plik diff jest za duży
+ 182 - 9050
Optimizer/MainForm.resx


+ 1 - 2
Optimizer/Optimizer.csproj

@@ -82,8 +82,7 @@
     <Compile Include="AboutForm.Designer.cs">
       <DependentUpon>AboutForm.cs</DependentUpon>
     </Compile>
-    <Compile Include="AppInfo.cs" />
-    <Compile Include="AppLinks.cs" />
+    <Compile Include="FeedApp.cs" />
     <Compile Include="ByteSize\BinaryByteSize.cs" />
     <Compile Include="ByteSize\ByteSize.cs" />
     <Compile Include="ByteSize\DecimalByteSize.cs" />

+ 1 - 1
Optimizer/Program.cs

@@ -13,7 +13,7 @@ namespace Optimizer
         // Enter current version here
 
         internal readonly static float Major = 6;
-        internal readonly static float Minor = 2;
+        internal readonly static float Minor = 3;
 
         internal static string GetCurrentVersionTostring()
         {

+ 2 - 2
README.md

@@ -44,5 +44,5 @@ https://github.com/hellzerg/optimizer/blob/master/CHANGELOG.md
 
 ## Details: ##
 
-* Latest version: 6.2
-* Released: February 14, 2021
+* Latest version: 6.3
+* Released: February 15, 2021

+ 1 - 1
version.txt

@@ -1 +1 @@
-6.2
+6.3

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików