Skip to content

Commit

Permalink
New version: 2.0.1.339
Browse files Browse the repository at this point in the history
Welcome to ModernNotify's 2nd major update!
What's new:
- New control panel design.
- Weather forecast, depending on the location of the computer.
- A panel of pinned applications, for quick launch.
- Sync application settings with your account.
(All computers where the application is installed and you are logged into your account will have the same personalization settings)

What's changed:
- Added media control buttons to the player.
- The application information page has not been improved much.
- Other bug fixes and improvements.

Thank you for being with us for 2 years! Your Unesell Studio 💕
Date of development: 08/31/2022.
  • Loading branch information
Stamir36 committed Aug 31, 2023
1 parent 7f4c156 commit 5e072ce
Show file tree
Hide file tree
Showing 625 changed files with 38,005 additions and 8,020 deletions.
Binary file added .vs/ModernNotify/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/ModernNotify/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/ModernNotify/v17/.suo
Binary file not shown.
3 changes: 3 additions & 0 deletions ModernNotyfi/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
<setting name="WeatherAPI" serializeAs="String">
<value>b8ce7bba8c275b3b442213b29b0eef32</value>
</setting>
<setting name="GameWindowStyle" serializeAs="String">
<value>gamePanel</value>
</setting>
</ModernNotyfi.Properties.Settings>
</userSettings>
</configuration>
Binary file added ModernNotyfi/Image/abstract-lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
278 changes: 153 additions & 125 deletions ModernNotyfi/MainWindow.xaml

Large diffs are not rendered by default.

599 changes: 311 additions & 288 deletions ModernNotyfi/MainWindow.xaml.cs

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions ModernNotyfi/ModernNotify.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
<Compile Include="ConnectQR.xaml.cs">
<DependentUpon>ConnectQR.xaml</DependentUpon>
</Compile>
<Compile Include="Other Page\LauncherEdit.xaml.cs">
<DependentUpon>LauncherEdit.xaml</DependentUpon>
</Compile>
<Compile Include="Other Page\game_bar.xaml.cs">
<DependentUpon>game_bar.xaml</DependentUpon>
</Compile>
<Compile Include="Other Page\gamePanel.xaml.cs">
<DependentUpon>gamePanel.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -160,6 +166,7 @@
<DependentUpon>shutdown.xaml</DependentUpon>
</Compile>
<Compile Include="Scripts\PInvoke.cs" />
<Compile Include="Settings.cs" />
<Compile Include="settings.xaml.cs">
<DependentUpon>settings.xaml</DependentUpon>
</Compile>
Expand All @@ -176,6 +183,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Other Page\LauncherEdit.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Other Page\game_bar.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Other Page\gamePanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -450,6 +465,15 @@
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary">
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>
Expand All @@ -473,5 +497,20 @@
<Resource Include="icons\Weather\thunderstorm.png" />
<Resource Include="icons\Weather\tornado.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Image\abstract-lines.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\icon.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\mydevice.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\cursus.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\lipari.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
38 changes: 38 additions & 0 deletions ModernNotyfi/Other Page/LauncherEdit.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Window x:Class="ModernNotyfi.Other_Page.LauncherEdit"
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:ModernNotyfi.Other_Page"
mc:Ignorable="d"
xmlns:wpfui="clr-namespace:WPFUI.Controls;assembly=WPFUI"
xmlns:wpfuiCommon="clr-namespace:WPFUI.Common;assembly=WPFUI"
Title="Редактирование панели быстрого доступа"
Style="{StaticResource UiWindow}"
WindowStyle="None"
WindowStartupLocation="CenterScreen"
Icon="/icons/App_Color.png" Background="#F21B1B1B" MinHeight="300" MinWidth="512" Height="248" Width="422">
<Grid Margin="0,0,10,10">
<wpfui:TitleBar
FontFamily="/icons/Fonts/#Google Sans Medium"
Title="Редактирование панели быстрого доступа"
Icon="pack://application:,,,/icons/App_Color.png"
Grid.Row="0" Margin="0,0,-9,0"/>

<wpfui:Card Margin="20,51,208,10" Padding="0,0,0,0">
<ListBox SelectionMode="Single" Foreground="{DynamicResource Button.Static.Background}" ItemsSource="{Binding ItemsApp}" x:Name="Apps_List" Background="{x:Null}" Margin="0,0,0,-2" SelectionChanged="App_Delete" BorderBrush="{x:Null}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding Image}" MaxWidth="20" MaxHeight="20" Margin="0,0,10,0"/>
<TextBlock Foreground="{DynamicResource Button.Static.Background}" Text="{Binding Name}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</wpfui:Card>
<Button Style="{StaticResource AccentButtonStyle}" Content="Добавить файл" HorizontalAlignment="Right" Margin="0,56,10,0" VerticalAlignment="Top" Padding="10,6,10,6" Width="185" Height="33" Click="AddApp"/>
<Label FontFamily="/icons/Fonts/#Google Sans Medium" Content="Как добавить:&#xA;Нажмите кнопку &quot;Добавить&quot; и&#xA;выберите приложение,&#xA;которое хотите поместить&#xA;в быстрый доступ.&#xA;&#xA;Как удалить:&#xA;Для удаления выберите&#xA;приложение из списка слево&#xA;и подтвердите удаление." Margin="0,103,0,0" VerticalAlignment="Top" Height="187" HorizontalAlignment="Right" Width="195"/>
<Label x:Name="NoApps" FontFamily="/icons/Fonts/#Google Sans Medium" Content="Нет приложений" Margin="98,153,286,112" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</Grid>
</Window>
209 changes: 209 additions & 0 deletions ModernNotyfi/Other Page/LauncherEdit.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
using IWshRuntimeLibrary;
using NAudio.Wave;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Management;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Windows.Devices.Bluetooth;
using Windows.Devices.Enumeration;
using Windows.UI.WindowManagement;
using Woof.SystemEx;

namespace ModernNotyfi.Other_Page
{
/// <summary>
/// Логика взаимодействия для DebugWindow.xaml
/// </summary>
public partial class LauncherEdit : Window, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

private void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

private ObservableCollection<ItemModel> items;
public ObservableCollection<ItemModel> Items
{
get { return items; }
set
{
if (items != value)
{
items = value;
OnPropertyChanged(nameof(Items));
}
}
}

public ObservableCollection<ItemModel> ItemsApp { get; set; } = new ObservableCollection<ItemModel>();

public LauncherEdit()
{
InitializeComponent();
DataContext = this;

WPFUI.Appearance.Background.Apply(this, WPFUI.Appearance.BackgroundType.Mica);
UpdateList();
}

public void UpdateList()
{
string shortcutsFolderPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "shortcuts");
if (!Directory.Exists(shortcutsFolderPath))
{
Directory.CreateDirectory(shortcutsFolderPath);
}

string[] shortcutFiles = Directory.GetFiles(shortcutsFolderPath);
foreach (string shortcutFilePath in shortcutFiles)
{
ImageSource imageSource = null;

FileInfo fileInfo = new FileInfo(shortcutFilePath);

if (fileInfo.Extension.ToLower() == ".lnk")
{
string targetPath = GetShortcutTarget(shortcutFilePath);
BitmapSource iconSource = GetFileIcon(targetPath);

if (iconSource != null)
{
imageSource = iconSource;
}
}

ItemsApp.Add(new ItemModel(fileInfo.Name.Replace(".lnk", ""), imageSource, fileInfo.FullName));
}

if (ItemsApp.Count > 0){
NoApps.Visibility = Visibility.Collapsed;
}
else{
NoApps.Visibility = Visibility.Visible;
}
}

private string GetShortcutTarget(string shortcutFilePath)
{
WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutFilePath);
string targetPath = shortcut.TargetPath;
Marshal.ReleaseComObject(shortcut);
Marshal.ReleaseComObject(shell);
return targetPath;
}

private BitmapSource GetFileIcon(string filePath)
{
if (System.IO.File.Exists(filePath))
{
Icon icon = System.Drawing.Icon.ExtractAssociatedIcon(filePath);
if (icon != null)
{
return Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
}
}
return null;
}

private void App_Delete(object sender, SelectionChangedEventArgs e)
{
if (Apps_List.SelectedIndex != -1)
{
var selectedItem = (ItemModel)Apps_List.SelectedItem;
string message = $"Вы уверены, что хотите удалить ярлык для приложения '{selectedItem.Name}'?";
MessageBoxResult result = MessageBox.Show(message, "Подтвердите удаление", MessageBoxButton.YesNo, MessageBoxImage.Question);

if (result == MessageBoxResult.Yes)
{
try
{
System.IO.File.Delete(selectedItem.Sourse);
ItemsApp.Remove(selectedItem);
}
catch (Exception ex)
{
MessageBox.Show($"Ошибка при удалении: {ex.Message}", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}

Apps_List.SelectedIndex = -1;
ItemsApp.Clear();
UpdateList();

try
{
MainWindow my = Application.Current.Windows.OfType<MainWindow>().FirstOrDefault();
my.QuickLaunchItems.Clear();
my.LauncherUpdate();
}catch { }
}

private void AddApp(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
if (openFileDialog.ShowDialog() == true)
{
string shortcutsFolderPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "shortcuts");
if (!Directory.Exists(shortcutsFolderPath))
{
Directory.CreateDirectory(shortcutsFolderPath);
}

string appFilePath = openFileDialog.FileName;
string shortcutFilePath = System.IO.Path.Combine(shortcutsFolderPath, System.IO.Path.GetFileNameWithoutExtension(appFilePath) + ".lnk");

WshShell wshShell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)wshShell.CreateShortcut(shortcutFilePath);
shortcut.TargetPath = appFilePath;
shortcut.Save();

// Освобождаем ресурсы
Marshal.ReleaseComObject(shortcut);
Marshal.ReleaseComObject(wshShell);

// Обновляем листбокс или выполните другие действия, если необходимо
ItemsApp.Clear();
UpdateList();

MainWindow my = Application.Current.Windows.OfType<MainWindow>().FirstOrDefault();
my.QuickLaunchItems.Clear();
my.LauncherUpdate();
}
}

}

public class ItemModel
{
public ItemModel(string name, ImageSource image, string sourse)
{
Name = name;
Image = image;
Sourse = sourse;
}

public string Name { get; set; }
public string Sourse { get; set; }
public ImageSource Image { get; set; }
}
}
2 changes: 1 addition & 1 deletion ModernNotyfi/Other Page/UiLoginUnesell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<wpfui:TitleBar
FontFamily="/icons/Fonts/#Google Sans Medium"
Title="Вход в аккаунт Unesell Studio"
Icon="pack://application:,,,/icons/App_Color.png"
Icon="pack://application:,,,/icons/icon.png"
Grid.Row="0" Foreground="White"/>
<wpfui:Card Visibility="Hidden" x:Name="LoginCard" Background="#26FFFFFF" Height="167" VerticalAlignment="Top" HorizontalAlignment="Left" Width="358" Margin="46,175,0,0">
<StackPanel Margin="6,3,0,3">
Expand Down
5 changes: 4 additions & 1 deletion ModernNotyfi/Other Page/gamePanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</wpfui:Card>

<wpfui:Card Margin="20,179,20,0" Height="70" VerticalAlignment="Top"/>
<Label x:Name="Logo" FontFamily="/icons/Fonts/#Google Sans Medium" Content="Unesell GameBar" HorizontalAlignment="Left" Margin="20,30,0,0" VerticalAlignment="Top" Width="261" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Height="28" FontSize="20" FontWeight="Bold" Foreground="White"/>
<Label x:Name="Logo" FontFamily="/icons/Fonts/#Google Sans Medium" Content="Unesell GameBar" HorizontalAlignment="Left" Margin="20,30,0,0" VerticalAlignment="Top" Width="167" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Height="28" FontSize="20" FontWeight="Bold" Foreground="White"/>
<Button FontFamily="../icons/Fonts/#Google Sans Medium" x:Name="close" Content="Закрыть" Margin="0,30,20,0" HorizontalAlignment="Right" Width="106" VerticalAlignment="Top" Cursor="Hand" Click="Close" Background="#4CBFBFBF" Padding="10,6,10,6" Height="32" />
<wpfui:Card BorderThickness="1" Margin="20,0,20,19" Padding="0,0,0,0" Height="64" VerticalAlignment="Bottom">
<Grid>
Expand Down Expand Up @@ -110,5 +110,8 @@
</TransformGroup>
</Border.RenderTransform>
</Border>
<Button FontFamily="../icons/Fonts/#Google Sans Medium" Margin="232,30,0,0" HorizontalAlignment="Left" Width="37" VerticalAlignment="Top" Cursor="Hand" Click="Minimization" Background="#4CBFBFBF" Padding="10,6,10,6" Height="32">
<wpfui:Icon Glyph="ArrowMinimize24" />
</Button>
</Grid>
</Window>
7 changes: 7 additions & 0 deletions ModernNotyfi/Other Page/gamePanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,13 @@ private void Settings_Closed(object sender, EventArgs e)
my.gameBar_show = false;
}));
}

private void Minimization(object sender, RoutedEventArgs e)
{
gameBar gameBar = new gameBar();
gameBar.Show();
Close();
}
}

//вспомогательный класс для хранения моментов времени отрисовки кадров
Expand Down
Loading

0 comments on commit 5e072ce

Please sign in to comment.