-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: First main gui prototype
- Loading branch information
Showing
10 changed files
with
187 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
<Application x:Class="ChromeDevExtWarningPatcher.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:ChromeDevExtWarningPatcher" | ||
StartupUri="MainView.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:ChromeDevExtWarningPatcher" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
StartupUri="MainView.xaml"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="Blue" SecondaryColor="LightBlue" /> | ||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
39 changes: 22 additions & 17 deletions
39
ChromeDevExtWarningPatcher/ChromeDevExtWarningPatcher.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net5.0-windows</TargetFramework> | ||
<UseWPF>true</UseWPF> | ||
<Version>5.0.0.0</Version> | ||
<Authors>Ceiridge</Authors> | ||
<Company /> | ||
<Product>Chromium Developer Extension Warning Patcher</Product> | ||
<Description>Patches Chromium and disables the developer extension warning among others</Description> | ||
<Copyright>GNU General Public License 3, Ceiridge</Copyright> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageProjectUrl>https://github.com/Ceiridge/Chrome-Developer-Mode-Extension-Warning-Patcher</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/Ceiridge/Chrome-Developer-Mode-Extension-Warning-Patcher</RepositoryUrl> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net5.0-windows</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWPF>true</UseWPF> | ||
<Version>5.0.0.0</Version> | ||
<Authors>Ceiridge</Authors> | ||
<Company /> | ||
<Product>Chromium Developer Extension Warning Patcher</Product> | ||
<Description>Patches Chromium and disables the developer extension warning among others</Description> | ||
<Copyright>GNU General Public License 3, Ceiridge</Copyright> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageProjectUrl>https://github.com/Ceiridge/Chrome-Developer-Mode-Extension-Warning-Patcher</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/Ceiridge/Chrome-Developer-Mode-Extension-Warning-Patcher</RepositoryUrl> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\LICENSE"> | ||
<Pack>True</Pack> | ||
<PackagePath></PackagePath> | ||
</None> | ||
<None Include="..\LICENSE"> | ||
<Pack>True</Pack> | ||
<PackagePath></PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="MaterialDesignThemes" Version="4.0.0" /> | ||
</ItemGroup> | ||
|
||
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> | ||
<Exec Command="cmd.exe /c ..\..\..\signall.bat" /> | ||
<Exec Command="cmd.exe /c ..\signall.bat" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace ChromeDevExtWarningPatcher.ComponentModels { | ||
public class MainModel { | ||
public SelectionListModel BrowserListModel => new SelectionListModel(); | ||
public SelectionListModel PatchListModel => new SelectionListModel(); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
ChromeDevExtWarningPatcher/ComponentModels/SelectionListElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.ComponentModel; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Runtime.CompilerServices; | ||
using System.Windows.Controls; | ||
|
||
namespace ChromeDevExtWarningPatcher.ComponentModels { | ||
public class SelectionListElement : INotifyPropertyChanged { | ||
[Required] | ||
public string Name { get; set; } | ||
public string? Description { get; set; } | ||
public Image? IconImage { get; set; } | ||
|
||
private bool isSelected; | ||
public bool IsSelected { | ||
get => this.isSelected; | ||
set { | ||
this.isSelected = value; | ||
this.OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public event PropertyChangedEventHandler? PropertyChanged; | ||
|
||
public SelectionListElement(string name) { | ||
this.Name = name; | ||
} | ||
|
||
protected internal void OnPropertyChanged([CallerMemberName] string propertyName = "") { | ||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
ChromeDevExtWarningPatcher/ComponentModels/SelectionListModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Threading.Tasks; | ||
|
||
namespace ChromeDevExtWarningPatcher.ComponentModels { | ||
public class SelectionListModel { | ||
[Required] | ||
public ObservableCollection<SelectionListElement> ElementList { get; set; } = new ObservableCollection<SelectionListElement>(); | ||
|
||
public SelectionListModel() { | ||
Task.Run(async () => { | ||
await Task.Delay(100); | ||
this.ElementList.Add(new SelectionListElement("Edge") { | ||
Description = "Very edgy" | ||
}); | ||
}); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
ChromeDevExtWarningPatcher/ComponentViews/SelectionListView.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<UserControl x:Class="ChromeDevExtWarningPatcher.ComponentViews.SelectionListView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:ChromeDevExtWarningPatcher.ComponentViews" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" d:DesignWidth="650" Background="{DynamicResource MaterialDesignCardBackground}"> | ||
<Grid> | ||
<ListView ItemsSource="{Binding ElementList}"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="Auto" MaxWidth="150" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<CheckBox IsChecked="{Binding IsSelected}" /> | ||
<Image Grid.Column="1" Source="{Binding IconImage}" Margin="5, 0, 5, 0" /> | ||
<StackPanel Grid.Column="2" Orientation="Vertical"> | ||
<TextBlock FontSize="16" Text="{Binding Name}" /> | ||
<TextBlock Text="{Binding Description}" /> | ||
</StackPanel> | ||
</Grid> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</Grid> | ||
</UserControl> |
9 changes: 9 additions & 0 deletions
9
ChromeDevExtWarningPatcher/ComponentViews/SelectionListView.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace ChromeDevExtWarningPatcher.ComponentViews { | ||
public partial class SelectionListView : UserControl { | ||
public SelectionListView() { | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,47 @@ | ||
<Window x:Class="ChromeDevExtWarningPatcher.MainView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:ChromeDevExtWarningPatcher" | ||
mc:Ignorable="d" | ||
Title="MainView" Height="450" Width="800"> | ||
<Grid> | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:cv="clr-namespace:ChromeDevExtWarningPatcher.ComponentViews" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
mc:Ignorable="d" | ||
Title="Ceiridge's Chromium Patcher (Extension Warning Patcher)" Height="450" Width="800" WindowStartupLocation="CenterScreen" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{DynamicResource MaterialDesignFont}" TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.FontWeight="Medium" TextElement.FontSize="14"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
|
||
<Expander Header="Select Browsers" IsExpanded="True"> | ||
<cv:SelectionListView DataContext="{Binding BrowserListModel}" /> | ||
</Expander> | ||
|
||
<Expander Grid.Row="1" Header="Select Patches"> | ||
<cv:SelectionListView DataContext="{Binding PatchListModel}" /> | ||
</Expander> | ||
|
||
<Expander Grid.Row="2" Header="Install Patches"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="75*" /> | ||
</Grid.RowDefinitions> | ||
|
||
</Grid> | ||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0, 3, 0, 3"> | ||
<Button Content="(Re-)Install" /> | ||
<Button Content="Uninstall" Style="{DynamicResource MaterialDesignRaisedLightButton}" Margin="5, 0, 0, 0" /> | ||
</StackPanel> | ||
|
||
<RichTextBox Grid.Row="1" x:Name="ConsoleBox" Margin="0, 0, 0, 5" IsUndoEnabled="False" IsReadOnly="True" IsReadOnlyCaretVisible="True"> | ||
<FlowDocument LineHeight="1"> | ||
<Paragraph> | ||
<Run Text="Console" /> | ||
</Paragraph> | ||
</FlowDocument> | ||
</RichTextBox> | ||
</Grid> | ||
</Expander> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
using System.Windows; | ||
using ChromeDevExtWarningPatcher.ComponentModels; | ||
|
||
namespace ChromeDevExtWarningPatcher { | ||
public partial class MainView : Window { | ||
private readonly MainModel mainModel = new MainModel(); | ||
|
||
public MainView() { | ||
InitializeComponent(); | ||
this.InitializeComponent(); | ||
this.DataContext = this.mainModel; | ||
} | ||
} | ||
} |