Skip to content

Commit

Permalink
Moving some settings & new AI Providers
Browse files Browse the repository at this point in the history
- New UI providers (GitHub Copilot & Grok)
- Microsoft Edge removal moved to a separate page
- AI provider list added to the setup stage
  • Loading branch information
valnoxy committed Dec 16, 2024
1 parent 81584f8 commit 225fc58
Show file tree
Hide file tree
Showing 20 changed files with 225 additions and 134 deletions.
93 changes: 24 additions & 69 deletions GoAwayEdge/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace GoAwayEdge
public partial class App
{
public static bool IsDebug = false;

public void Application_Startup(object sender, StartupEventArgs e)
{
#if DEBUG
Expand All @@ -50,17 +50,7 @@ public void Application_Startup(object sender, StartupEventArgs e)
IsDebug = true;
if (IsAdministrator() == false)
{
// Restart program and run as admin
var exeName = Process.GetCurrentProcess().MainModule?.FileName;
if (exeName != null)
{
var startInfo = new ProcessStartInfo(exeName)
{
Verb = "runas",
UseShellExecute = true
};
Process.Start(startInfo);
}
ElevateAsAdmin();
Environment.Exit(0);
return;
}
Expand All @@ -80,18 +70,7 @@ public void Application_Startup(object sender, StartupEventArgs e)
{
if (IsAdministrator() == false)
{
// Restart program and run as admin
var exeName = Process.GetCurrentProcess().MainModule?.FileName;
if (exeName != null)
{
var startInfo = new ProcessStartInfo(exeName)
{
Verb = "runas",
UseShellExecute = true,
Arguments = string.Join(" ", args)
};
Process.Start(startInfo);
}
ElevateAsAdmin(string.Join(" ", args));
Environment.Exit(0);
return;
}
Expand Down Expand Up @@ -145,18 +124,7 @@ public void Application_Startup(object sender, StartupEventArgs e)

if (IsAdministrator() == false)
{
// Restart program and run as admin
var exeName = Process.GetCurrentProcess().MainModule?.FileName;
if (exeName != null)
{
var startInfo = new ProcessStartInfo(exeName)
{
Verb = "runas",
UseShellExecute = true,
Arguments = string.Join(" ", args)
};
Process.Start(startInfo);
}
ElevateAsAdmin(string.Join(" ", args));
Environment.Exit(0);
return;
}
Expand Down Expand Up @@ -223,22 +191,8 @@ public void Application_Startup(object sender, StartupEventArgs e)
ifeoMessageUi.ShowDialog();

if (ifeoMessageUi.Summary == "Btn1")
{
// Restart program and run as admin
var exeName = Process.GetCurrentProcess().MainModule?.FileName;
if (exeName != null)
{
var startInfo = new ProcessStartInfo(exeName)
{
Verb = "runas",
UseShellExecute = true,
Arguments = "--update"
};
Process.Start(startInfo);
}
Environment.Exit(0);
return;
}
ElevateAsAdmin("--update");

Environment.Exit(0);
}
Updater.ModifyIfeoBinary(ModifyAction.Update);
Expand All @@ -253,22 +207,8 @@ public void Application_Startup(object sender, StartupEventArgs e)
ifeoMessageUi.ShowDialog();

if (ifeoMessageUi.Summary == "Btn1")
{
// Restart program and run as admin
var exeName = Process.GetCurrentProcess().MainModule?.FileName;
if (exeName != null)
{
var startInfo = new ProcessStartInfo(exeName)
{
Verb = "runas",
UseShellExecute = true,
Arguments = "--update"
};
Process.Start(startInfo);
}
Environment.Exit(0);
return;
}
ElevateAsAdmin("--update");

Environment.Exit(0);
}
Updater.ModifyIfeoBinary(ModifyAction.Create);
Expand All @@ -285,14 +225,29 @@ public void Application_Startup(object sender, StartupEventArgs e)
ArgumentParse.Parse(args);
Environment.Exit(0);
}


private void ElevateAsAdmin(string arguments = null)

Check warning on line 229 in GoAwayEdge/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Cannot convert null literal to non-nullable reference type.

Check warning on line 229 in GoAwayEdge/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Cannot convert null literal to non-nullable reference type.

Check warning on line 229 in GoAwayEdge/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Cannot convert null literal to non-nullable reference type.

Check warning on line 229 in GoAwayEdge/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Cannot convert null literal to non-nullable reference type.
{
// Restart program and run as admin
var exeName = Process.GetCurrentProcess().MainModule?.FileName;
if (exeName == null) return;
var startInfo = new ProcessStartInfo(exeName)
{
Verb = "runas",
UseShellExecute = true,
Arguments = arguments
};
Process.Start(startInfo);
}

private static string? ParseCustomSearchEngine(string argument)
{
var argParsed = argument.Remove(0, 6);
var result = Uri.TryCreate(argParsed, UriKind.Absolute, out var uriResult)
&& (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
return result ? argParsed : null;
}

private static bool IsAdministrator()
{
var identity = WindowsIdentity.GetCurrent();
Expand Down
36 changes: 18 additions & 18 deletions GoAwayEdge/Assets/Copilot.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Geometry x:Key="microsoft_copilotGeometry1">F1 M48,48z M0,0z M21.676,19.303C21.676,19.303,22.49,16.048,26.367,15.904L38.144,15.904C38.144,15.904 34.745,15.617 34.075,11.5 33.405,7.383 31.634,5.755 29.144,5.707 26.655,5.659 25.506,8.292 25.218,9.202 24.931,10.112 21.676,19.303 21.676,19.303z</Geometry>
<Geometry x:Key="microsoft_copilotGeometry2">F1 M48,48z M0,0z M19.234,29.261L25.266,9.011C25.266,9.011,26.415,5.612,29.144,5.708L14.016,5.708C14.016,5.708 11.431,5.708 9.564,8.676 9.564,8.676 6.692,12.41 5.016,20.07 3.34,27.73 4.011,28.16 4.011,28.16 4.011,28.16 3.58,32.373 10.043,32.038L15.022,32.038C15.021,32.037,18.037,32.085,19.234,29.261z</Geometry>
<Geometry x:Key="microsoft_copilotGeometry3">F1 M48,48z M0,0z M28.887,6.707L31.358,6.303C30.762,5.945,30.048,5.759,29.308,5.719L29.109,5.708C29.105,5.708 29.102,5.708 29.098,5.707 29.082,5.707 29.067,5.709 29.05,5.709 28.875,5.708 28.71,5.724 28.548,5.748 28.479,5.758 28.412,5.771 28.346,5.785 28.241,5.808 28.14,5.837 28.041,5.869 27.589,6.018 27.193,6.255 26.855,6.546 26.738,6.648 26.63,6.755 26.526,6.866 25.765,7.677 25.344,8.699 25.186,9.2 25.147,9.325 25.047,9.616 24.912,10.008L22.694,17.452C22.78,17.36 22.892,17.273 22.991,17.183 23.047,17.132 23.099,17.08 23.159,17.031 23.247,16.959 23.339,16.892 23.436,16.823 23.602,16.705 23.777,16.592 23.973,16.49 23.998,16.477 24.016,16.46 24.042,16.447L26.173,9.293C26.174,9.296,27.066,6.787,28.887,6.707z</Geometry>
<Geometry x:Key="microsoft_copilotGeometry4">F1 M48,48z M0,0z M28.864,6.207L30.34,5.867C30.34,5.867 29.654,5.691 29.088,5.712 28.668,5.727 28.286,5.784 27.941,5.915 27.914,5.926 27.885,5.934 27.858,5.946 27.777,5.979 27.699,6.019 27.622,6.058 27.565,6.088 27.507,6.117 27.452,6.149 27.404,6.177 27.358,6.207 27.311,6.237 27.226,6.293 27.142,6.351 27.062,6.413 27.045,6.426 27.029,6.439 27.013,6.452 26.584,6.798 26.24,7.219 25.974,7.62 25.968,7.629 25.962,7.637 25.957,7.646 25.928,7.69 25.904,7.732 25.877,7.776 25.535,8.338 25.321,8.88 25.219,9.204 25.201,9.262 25.169,9.356 25.128,9.478L22.751,17.456C22.931,17.262,23.139,17.071,23.377,16.893L25.682,9.155C25.685,9.143,26.684,6.292,28.864,6.207z</Geometry>
<Geometry x:Key="microsoft_copilotGeometry5">F1 M48,48z M0,0z M26.474,28.607C26.474,28.607,25.66,31.862,21.783,32.006L10.006,32.006C10.006,32.006 13.405,32.293 14.075,36.41 14.745,40.527 16.516,42.155 19.006,42.203 21.496,42.251 22.644,39.618 22.932,38.708 23.219,37.799 26.474,28.607 26.474,28.607z</Geometry>
<Geometry x:Key="microsoft_copilotGeometry6">F1 M48,48z M0,0z M19.255,41.171L16.784,41.575C17.38,41.933,18.094,42.119,18.834,42.159L19.033,42.17C19.037,42.17 19.04,42.17 19.044,42.171 19.06,42.171 19.075,42.169 19.092,42.169 19.267,42.17 19.432,42.154 19.594,42.13 19.663,42.12 19.73,42.107 19.796,42.093 19.901,42.07 20.002,42.041 20.101,42.009 20.553,41.86 20.949,41.623 21.287,41.332 21.404,41.23 21.512,41.123 21.616,41.012 22.377,40.201 22.798,39.179 22.956,38.678 22.995,38.553 23.095,38.262 23.23,37.87L25.448,30.426C25.362,30.518 25.25,30.605 25.151,30.695 25.095,30.746 25.043,30.798 24.983,30.847 24.895,30.919 24.803,30.986 24.706,31.055 24.54,31.173 24.365,31.286 24.169,31.388 24.144,31.401 24.126,31.418 24.1,31.431L21.969,38.585C21.969,38.582,21.077,41.091,19.255,41.171z</Geometry>
<Geometry x:Key="microsoft_copilotGeometry7">F1 M48,48z M0,0z M19.278,41.671L17.802,42.011C17.802,42.011 18.488,42.187 19.054,42.166 19.474,42.151 19.856,42.094 20.201,41.963 20.228,41.952 20.257,41.944 20.284,41.932 20.365,41.899 20.443,41.859 20.52,41.82 20.577,41.79 20.635,41.761 20.69,41.729 20.738,41.701 20.784,41.671 20.831,41.641 20.916,41.585 21,41.527 21.08,41.465 21.097,41.452 21.113,41.439 21.129,41.426 21.558,41.08 21.902,40.659 22.168,40.258 22.174,40.249 22.18,40.241 22.185,40.232 22.214,40.188 22.238,40.146 22.265,40.102 22.607,39.54 22.821,38.998 22.923,38.674 22.941,38.616 22.973,38.522 23.014,38.4L25.391,30.422C25.211,30.616,25.003,30.807,24.765,30.985L22.46,38.723C22.457,38.736,21.458,41.586,19.278,41.671z</Geometry>
<Geometry x:Key="microsoft_copilotGeometry8">F1 M48,48z M0,0z M28.915,18.65L22.845,38.913C22.845,38.913,21.734,42.299,19.006,42.203L34.134,42.203C34.134,42.203 36.719,42.203 38.586,39.235 38.586,39.235 41.458,35.501 43.134,27.841 44.81,20.181 44.139,19.751 44.139,19.751 44.139,19.751 44.57,15.538 38.107,15.873L33.128,15.873C33.128,15.873,30.112,15.826,28.915,18.65z</Geometry>
<DrawingGroup x:Key="microsoft_copilotDrawingGroup" ClipGeometry="M0,0 V48 H48 V0 H0 Z">
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry1}">
<Geometry x:Key="MicrosoftCopilotGeometry1">F1 M48,48z M0,0z M21.676,19.303C21.676,19.303,22.49,16.048,26.367,15.904L38.144,15.904C38.144,15.904 34.745,15.617 34.075,11.5 33.405,7.383 31.634,5.755 29.144,5.707 26.655,5.659 25.506,8.292 25.218,9.202 24.931,10.112 21.676,19.303 21.676,19.303z</Geometry>
<Geometry x:Key="MicrosoftCopilotGeometry2">F1 M48,48z M0,0z M19.234,29.261L25.266,9.011C25.266,9.011,26.415,5.612,29.144,5.708L14.016,5.708C14.016,5.708 11.431,5.708 9.564,8.676 9.564,8.676 6.692,12.41 5.016,20.07 3.34,27.73 4.011,28.16 4.011,28.16 4.011,28.16 3.58,32.373 10.043,32.038L15.022,32.038C15.021,32.037,18.037,32.085,19.234,29.261z</Geometry>
<Geometry x:Key="MicrosoftCopilotGeometry3">F1 M48,48z M0,0z M28.887,6.707L31.358,6.303C30.762,5.945,30.048,5.759,29.308,5.719L29.109,5.708C29.105,5.708 29.102,5.708 29.098,5.707 29.082,5.707 29.067,5.709 29.05,5.709 28.875,5.708 28.71,5.724 28.548,5.748 28.479,5.758 28.412,5.771 28.346,5.785 28.241,5.808 28.14,5.837 28.041,5.869 27.589,6.018 27.193,6.255 26.855,6.546 26.738,6.648 26.63,6.755 26.526,6.866 25.765,7.677 25.344,8.699 25.186,9.2 25.147,9.325 25.047,9.616 24.912,10.008L22.694,17.452C22.78,17.36 22.892,17.273 22.991,17.183 23.047,17.132 23.099,17.08 23.159,17.031 23.247,16.959 23.339,16.892 23.436,16.823 23.602,16.705 23.777,16.592 23.973,16.49 23.998,16.477 24.016,16.46 24.042,16.447L26.173,9.293C26.174,9.296,27.066,6.787,28.887,6.707z</Geometry>
<Geometry x:Key="MicrosoftCopilotGeometry4">F1 M48,48z M0,0z M28.864,6.207L30.34,5.867C30.34,5.867 29.654,5.691 29.088,5.712 28.668,5.727 28.286,5.784 27.941,5.915 27.914,5.926 27.885,5.934 27.858,5.946 27.777,5.979 27.699,6.019 27.622,6.058 27.565,6.088 27.507,6.117 27.452,6.149 27.404,6.177 27.358,6.207 27.311,6.237 27.226,6.293 27.142,6.351 27.062,6.413 27.045,6.426 27.029,6.439 27.013,6.452 26.584,6.798 26.24,7.219 25.974,7.62 25.968,7.629 25.962,7.637 25.957,7.646 25.928,7.69 25.904,7.732 25.877,7.776 25.535,8.338 25.321,8.88 25.219,9.204 25.201,9.262 25.169,9.356 25.128,9.478L22.751,17.456C22.931,17.262,23.139,17.071,23.377,16.893L25.682,9.155C25.685,9.143,26.684,6.292,28.864,6.207z</Geometry>
<Geometry x:Key="MicrosoftCopilotGeometry5">F1 M48,48z M0,0z M26.474,28.607C26.474,28.607,25.66,31.862,21.783,32.006L10.006,32.006C10.006,32.006 13.405,32.293 14.075,36.41 14.745,40.527 16.516,42.155 19.006,42.203 21.496,42.251 22.644,39.618 22.932,38.708 23.219,37.799 26.474,28.607 26.474,28.607z</Geometry>
<Geometry x:Key="MicrosoftCopilotGeometry6">F1 M48,48z M0,0z M19.255,41.171L16.784,41.575C17.38,41.933,18.094,42.119,18.834,42.159L19.033,42.17C19.037,42.17 19.04,42.17 19.044,42.171 19.06,42.171 19.075,42.169 19.092,42.169 19.267,42.17 19.432,42.154 19.594,42.13 19.663,42.12 19.73,42.107 19.796,42.093 19.901,42.07 20.002,42.041 20.101,42.009 20.553,41.86 20.949,41.623 21.287,41.332 21.404,41.23 21.512,41.123 21.616,41.012 22.377,40.201 22.798,39.179 22.956,38.678 22.995,38.553 23.095,38.262 23.23,37.87L25.448,30.426C25.362,30.518 25.25,30.605 25.151,30.695 25.095,30.746 25.043,30.798 24.983,30.847 24.895,30.919 24.803,30.986 24.706,31.055 24.54,31.173 24.365,31.286 24.169,31.388 24.144,31.401 24.126,31.418 24.1,31.431L21.969,38.585C21.969,38.582,21.077,41.091,19.255,41.171z</Geometry>
<Geometry x:Key="MicrosoftCopilotGeometry7">F1 M48,48z M0,0z M19.278,41.671L17.802,42.011C17.802,42.011 18.488,42.187 19.054,42.166 19.474,42.151 19.856,42.094 20.201,41.963 20.228,41.952 20.257,41.944 20.284,41.932 20.365,41.899 20.443,41.859 20.52,41.82 20.577,41.79 20.635,41.761 20.69,41.729 20.738,41.701 20.784,41.671 20.831,41.641 20.916,41.585 21,41.527 21.08,41.465 21.097,41.452 21.113,41.439 21.129,41.426 21.558,41.08 21.902,40.659 22.168,40.258 22.174,40.249 22.18,40.241 22.185,40.232 22.214,40.188 22.238,40.146 22.265,40.102 22.607,39.54 22.821,38.998 22.923,38.674 22.941,38.616 22.973,38.522 23.014,38.4L25.391,30.422C25.211,30.616,25.003,30.807,24.765,30.985L22.46,38.723C22.457,38.736,21.458,41.586,19.278,41.671z</Geometry>
<Geometry x:Key="MicrosoftCopilotGeometry8">F1 M48,48z M0,0z M28.915,18.65L22.845,38.913C22.845,38.913,21.734,42.299,19.006,42.203L34.134,42.203C34.134,42.203 36.719,42.203 38.586,39.235 38.586,39.235 41.458,35.501 43.134,27.841 44.81,20.181 44.139,19.751 44.139,19.751 44.139,19.751 44.57,15.538 38.107,15.873L33.128,15.873C33.128,15.873,30.112,15.826,28.915,18.65z</Geometry>
<DrawingGroup x:Key="MicrosoftCopilotDrawingGroup" ClipGeometry="M0,0 V48 H48 V0 H0 Z">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry1}">
<GeometryDrawing.Brush>
<LinearGradientBrush StartPoint="18.179,6.205" EndPoint="37.232,21.237" MappingMode="Absolute" SpreadMethod="Pad" Opacity="1">
<GradientStop Color="#FF0837C4" Offset="0" />
Expand All @@ -18,7 +18,7 @@
</LinearGradientBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry2}">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry2}">
<GeometryDrawing.Brush>
<LinearGradientBrush StartPoint="8.61,36.864" EndPoint="20.866,1.503" MappingMode="Absolute" SpreadMethod="Pad" Opacity="1">
<GradientStop Color="#FFF8C704" Offset="0" />
Expand All @@ -36,17 +36,17 @@
</LinearGradientBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry3}">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry3}">
<GeometryDrawing.Brush>
<SolidColorBrush Color="#FF000000" Opacity="0.05" />
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry4}">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry4}">
<GeometryDrawing.Brush>
<SolidColorBrush Color="#FF000000" Opacity="0.07" />
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry5}">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry5}">
<GeometryDrawing.Brush>
<LinearGradientBrush StartPoint="9.38,35.55" EndPoint="27.188,35.358" MappingMode="Absolute" SpreadMethod="Pad" Opacity="1">
<GradientStop Color="#FFFFB155" Offset="0" />
Expand All @@ -57,17 +57,17 @@
</LinearGradientBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry6}">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry6}">
<GeometryDrawing.Brush>
<SolidColorBrush Color="#FF000000" Opacity="0.05" />
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry7}">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry7}">
<GeometryDrawing.Brush>
<SolidColorBrush Color="#FF000000" Opacity="0.07" />
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing Geometry="{StaticResource microsoft_copilotGeometry8}">
<GeometryDrawing Geometry="{StaticResource MicrosoftCopilotGeometry8}">
<GeometryDrawing.Brush>
<LinearGradientBrush StartPoint="28.874,43.472" EndPoint="37.108,12.068" MappingMode="Absolute" SpreadMethod="Pad" Opacity="1">
<GradientStop Color="#FFFFB152" Offset="0" />
Expand All @@ -77,5 +77,5 @@
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup>
<DrawingImage x:Key="MicrosoftCopilot" Drawing="{StaticResource microsoft_copilotDrawingGroup}" />
<DrawingImage x:Key="MicrosoftCopilot" Drawing="{StaticResource MicrosoftCopilotDrawingGroup}" />
</ResourceDictionary>
Loading

0 comments on commit 225fc58

Please sign in to comment.