Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xXxTheDarkprogramerxXx committed May 18, 2020
1 parent 291eebb commit 4ef107d
Show file tree
Hide file tree
Showing 32 changed files with 980 additions and 579 deletions.
7 changes: 4 additions & 3 deletions My Neighborhood/My Neighborhood(WPF)/AddSKU.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:My_Neighborhood_WPF_"
mc:Ignorable="d"
Title="Add SKU" Height="205.97" Width="577.612" Icon="Images/favicon (1).ico" WindowStartupLocation="CenterScreen">
Title="Add SKU" Height="230.737" Width="591.479" Icon="Images/favicon (1).ico" WindowStartupLocation="CenterScreen">
<Grid>
<GroupBox x:Name="groupBox" Header="Add a new SKU" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="156" Width="551">
<GroupBox x:Name="groupBox" Header="Add a new SKU" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="181" Width="551">
<Grid Margin="0,0,-0.4,-12.8">
<Label x:Name="label" Content="Target name :" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
<Label Content="IP address :" HorizontalAlignment="Left" Margin="10,41,0,0" VerticalAlignment="Top"/>
<Label Content="File serving directory :" HorizontalAlignment="Left" Margin="10,72,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="txtTargetname" HorizontalAlignment="Left" Height="23" Margin="176,10,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="352"/>
<TextBox x:Name="txtipaddress" HorizontalAlignment="Left" Height="23" Margin="176,41,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="318"/>
<TextBox x:Name="txtfileserdir" HorizontalAlignment="Left" Height="23" Margin="176,72,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="352"/>
<TextBox x:Name="txtfileserdir" HorizontalAlignment="Left" Height="23" Margin="176,72,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="318"/>
<Button x:Name="btnAddItem" Content="Add SKU" HorizontalAlignment="Left" Margin="453,114,0,0" VerticalAlignment="Top" Width="75" Click="btnAddItem_Click"/>
<Button x:Name="btnLoadIPs" Content="..." HorizontalAlignment="Left" Margin="499,41,0,0" VerticalAlignment="Top" Width="29" Click="btnLoadIPs_Click"/>
<Button x:Name="btnDirBrowser" Content="..." HorizontalAlignment="Left" Margin="499,70,0,0" VerticalAlignment="Top" Width="29" Click="btnDirBrowser_Click"/>
</Grid>
</GroupBox>

Expand Down
17 changes: 16 additions & 1 deletion My Neighborhood/My Neighborhood(WPF)/AddSKU.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Microsoft.AppCenter.Utils.Files;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
Expand All @@ -8,6 +9,7 @@
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
Expand Down Expand Up @@ -50,5 +52,18 @@ private void btnLoadIPs_Click(object sender, RoutedEventArgs e)
txtipaddress.Text = ips.IPSelected;
}
}

private void btnDirBrowser_Click(object sender, RoutedEventArgs e)
{
using (var fbd = new FolderBrowserDialog())
{
DialogResult result = fbd.ShowDialog();

if (result == System.Windows.Forms.DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
{
txtfileserdir.Text = fbd.SelectedPath;
}
}
}
}
}
2 changes: 2 additions & 0 deletions My Neighborhood/My Neighborhood(WPF)/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
<!--<ResourceDictionary Source="/Themes/ExpressionLight.xaml"/>-->
</ResourceDictionary.MergedDictionaries>
<System:Double x:Key="WindowTitleFontSize">10</System:Double>
<FontFamily x:Key="HeaderFontFamily">Segoe UI</FontFamily>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

Expand Down
1 change: 1 addition & 0 deletions My Neighborhood/My Neighborhood(WPF)/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected override void OnStartup(StartupEventArgs e)
ThemeManager.ChangeAppStyle(Application.Current,
ThemeManager.GetAccent("Cobalt"),
ThemeManager.GetAppTheme("BaseDark")); // or appStyle.Item1

}
catch (Exception ex)
{
Expand Down
37 changes: 28 additions & 9 deletions My Neighborhood/My Neighborhood(WPF)/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@
ShowCloseButton="True"
ShowMaxRestoreButton="True"
ShowMinButton="True"
Width="1299.3" Height="480" Icon="Images/Obris.ico" Loaded="RibbonWindow_Loaded" Closing="RibbonWindow_Closing" WindowStartupLocation="CenterScreen">

Width="1299.3" Height="480" Icon="Images/Obris.ico" Loaded="RibbonWindow_Loaded" Closing="RibbonWindow_Closing" WindowStartupLocation="CenterScreen"
TextOptions.TextFormattingMode="Ideal"
>

<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Ribbon Visibility="Visible" x:Name="Ribbon" Foreground="Black" Title="Neighborhood for PlayStation®4 (Open Source by TheDarkprogramer)" Background="White" SelectionChanged="Ribbon_SelectionChanged" SelectedIndex="1">
<!--Title="Neighborhood for PlayStation®4 (Open Source by TheDarkprogramer)"-->
<Ribbon Visibility="Visible" x:Name="Ribbon" Foreground="Black" Background="White" SelectionChanged="Ribbon_SelectionChanged" SelectedIndex="1" RenderTransformOrigin="0.5,0.5">
<Ribbon.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="-20"/>
</TransformGroup>
</Ribbon.RenderTransform>
<!--<Ribbon.HelpPaneContent>
<RibbonButton SmallImageSource="Images/icons8-help-64.png" />
</Ribbon.HelpPaneContent>-->
Expand Down Expand Up @@ -157,10 +168,18 @@
</RibbonGroup>
</RibbonTab>
</Ribbon>
<ListView x:Name="lstSKU" VirtualizingStackPanel.IsVirtualizing="False" HorizontalAlignment="Stretch" Margin="0,138,-0.2,0.4" Grid.RowSpan="2" SizeChanged="lstSKU_SizeChanged" SelectionChanged="lstSKU_SelectionChanged" MouseDoubleClick="lstSKU_MouseDoubleClick">
<ListView x:Name="lstSKU" VirtualizingStackPanel.IsVirtualizing="False" HorizontalAlignment="Stretch" Margin="0,138,-0.2,0.4" Grid.RowSpan="2" SizeChanged="lstSKU_SizeChanged" SelectionChanged="lstSKU_SelectionChanged" MouseDoubleClick="lstSKU_MouseDoubleClick" RenderTransformOrigin="0.5,0.5">
<ListView.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform Y="-20"/>
</TransformGroup>
</ListView.RenderTransform>
<ListView.ContextMenu>
<ContextMenu>
<MenuItem Header="Refresh" InputGestureText="F5"/>
<MenuItem x:Name="cmbRefresh" Header="Refresh" InputGestureText="F5" Click="cmbRefresh_Click"/>
<Separator/>
<MenuItem x:Name="cmbNav" Header="Navigate" IsEnabled="False">
<MenuItem></MenuItem>
Expand Down Expand Up @@ -195,7 +214,7 @@
<MenuItem Header="System update..." IsEnabled="False" Click="MenuItem_Click"></MenuItem>
<MenuItem Header="Activate..." IsEnabled="False" Click="MenuItem_Click_1"></MenuItem>
<Separator></Separator>
<MenuItem x:Name="cmbDelete" Header="Delete" InputGestureText="Delete" IsEnabled="False" Click="cmbDelete_Click"></MenuItem>
<MenuItem x:Name="cmbDelete" Header="Delete" InputGestureText="Delete" IsEnabled="True" Click="cmbDelete_Click"></MenuItem>
<MenuItem x:Name="cmbRename" Header="Rename" InputGestureText="F2" IsEnabled="False" Click="cmbRename_Click"></MenuItem>
<Separator></Separator>
<MenuItem x:Name="cmbInstallPkg" Header="Install package" IsEnabled="False" Click="cmbInstallPkg_Click" ></MenuItem>
Expand Down Expand Up @@ -234,7 +253,7 @@
<Grid>
<ProgressBar Foreground="Blue" x:Name="pbstatus" Value="{Binding Progress}" Height="{Binding Height, ElementName=StatusProgress}" Width="{Binding Width, ElementName=StatusProgress}"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black" Text="{Binding ProgressName}">

</TextBlock>
</Grid>
</DataTemplate>
Expand All @@ -256,8 +275,8 @@
</GridView>
</ListView.View>
</ListView>


</Grid>

</Controls:MetroWindow>
21 changes: 19 additions & 2 deletions My Neighborhood/My Neighborhood(WPF)/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,19 @@ public string Read()

public bool IsConnected
{
get { return tcpSocket.Connected; }

get {
if (tcpSocket != null)
{
return tcpSocket.Connected;
}
else
{
MessageBox.Show("PS4 Is NOT Connected!");
return false;
}
}

}


Expand Down Expand Up @@ -1644,7 +1656,7 @@ public void SetSkuUIItems(SKUS currentsku)
//cmbConnect.IsEnabled = true;
cmbCopy.IsEnabled = false;
cmbCopyFiles.IsEnabled = false;
cmbDelete.IsEnabled = false;
cmbDelete.IsEnabled = true;
cmbDiscconect.IsEnabled = false;
cmbExportargetSettings.IsEnabled = false;
cmbImportTargetSettings.IsEnabled = false;
Expand Down Expand Up @@ -1757,5 +1769,10 @@ public enum ThemeChooser
}

#endregion << Functions >>

private void cmbRefresh_Click(object sender, RoutedEventArgs e)
{
btnRefresh.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
}
}
}
34 changes: 18 additions & 16 deletions My Neighborhood/My Neighborhood(WPF)/PS4Console.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<Ribbon x:Name="Ribbon" Title="Neighborhood for PlayStation®4 (Open Source by TheDarkprogramer)" Background="White" SelectedIndex="1" Foreground="Black">
<!-- Title="Neighborhood for PlayStation®4 (Open Source by TheDarkprogramer)"-->
<!-- Title="Neighborhood for PlayStation®4 (Open Source by TheDarkprogramer)"-->
<Ribbon x:Name="Ribbon" Background="White" SelectedIndex="1" Foreground="Black" RenderTransformOrigin="0.5,0.5">
<Ribbon.HelpPaneContent>
<RibbonButton SmallImageSource="Images/icons8-help-64.png" />
</Ribbon.HelpPaneContent>
Expand All @@ -33,7 +34,7 @@
</RibbonApplicationMenu>
</Ribbon.ApplicationMenu>
<RibbonTab x:Name="FileTab"
Header="File"></RibbonTab>
Header="File"/>
<RibbonTab x:Name="HomeTab"
Header="Home">

Expand All @@ -51,7 +52,7 @@
<RibbonButton x:Name="btnClearAll" SmallImageSource="Images\icons8-multiply-52.png" Label="Clear all" Click="btnClearAll_Click"/>
<RibbonButton x:Name="btnRefreshProcesses" SmallImageSource="Images\icons8-update-left-rotation-96.png" Label="Refresh processes" Click="btnRefreshProcesses_Click"/>
<RibbonMenuButton x:Name="btnProcessChanVis" SmallImageSource="Images\icons8-eye-96.png" Label="Process channel visibility" IsEnabled="False">
<RibbonMenuItem></RibbonMenuItem>
<RibbonMenuItem/>
</RibbonMenuButton>
</RibbonGroup>
<RibbonGroup x:Name="rgbxTargets"
Expand All @@ -65,7 +66,7 @@
<RibbonMenuButton x:Name="txtEscapeChar"
SmallImageSource="Images\icons8-line-96.png"
Label="Unknown ESC" >
<RibbonMenuItem></RibbonMenuItem>
<RibbonMenuItem/>
</RibbonMenuButton>
<RibbonCheckBox x:Name="cbxEmptyHide"
IsChecked="True"
Expand All @@ -78,7 +79,7 @@
Label="Echo console input" />
<RibbonCheckBox x:Name="cbxScrollimput"
IsChecked="True"
Label="Auto-Scroll" Checked="cbxScrollimput_Checked" Unchecked="cbxScrollimput_Checked" Content="Auto-Scroll&#xD;&#xA;" Margin="0,0,0,0.4" />
Label="Auto-Scroll" Checked="cbxScrollimput_Checked" Unchecked="cbxScrollimput_Checked" Content="Auto-Scroll&#xA;" Margin="0,0,0,0.4" />
</RibbonGroup>
<RibbonGroup x:Name="rgbxData"
Header="Data">
Expand All @@ -90,24 +91,25 @@
Label="Reset layout" />
<RibbonButton x:Name="btnOpenLogDirectory"
SmallImageSource="Images\icons8-opened-folder-96.png"
Label="Open log directory" Click="btnOpenLogDirectory_Click" >
</RibbonButton>
Label="Open log directory" Click="btnOpenLogDirectory_Click" />
<RibbonMenuButton x:Name="btnTheme"
SmallImageSource="Images\icons8-change-theme-96.png"
Label="Theme" >
<RibbonMenuItem></RibbonMenuItem>
<RibbonMenuItem/>
</RibbonMenuButton>
</RibbonGroup>
</RibbonTab>
</Ribbon>
<TabControl x:Name="tabControl" Grid.RowSpan="2" Margin="0,138,-0.2,0.4">
<TabItem Header="All" Background="Orange">
<TabControl x:Name="tabControl" Grid.RowSpan="2" Margin="0,138,-0.2,0.4" RenderTransformOrigin="0.5,0.5">
<TabItem Header="All" Background="Orange" Controls:ControlsHelper.HeaderFontSize="12">
<Grid Background="#FFE5E5E5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="422*"/>
<ColumnDefinition Width="21*"/>
<ColumnDefinition Width="264*"/>
<ColumnDefinition Width="11*"/>
<ColumnDefinition Width="991*"/>
</Grid.ColumnDefinitions>
<RichTextBox x:Name="rtbAll" Grid.ColumnSpan="2" Margin="0,0,-0.8,0" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Auto">
<RichTextBox x:Name="rtbAll" Grid.ColumnSpan="4" Margin="0,0,-0.8,-0.6" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Auto">
<FlowDocument>
<Paragraph>
<Run x:Name="rtbText" Text=""/>
Expand All @@ -116,9 +118,9 @@
</RichTextBox>
</Grid>
</TabItem>
<TabItem Header="TabItem">
<!--<TabItem Header="TabItem">
<Grid Background="#FFE5E5E5"/>
</TabItem>
</TabItem>-->
</TabControl>
<Grid HorizontalAlignment="Left" Height="45" Margin="10,266.6,0,0" Grid.Row="1" VerticalAlignment="Top" Width="1273"/>

Expand Down
32 changes: 21 additions & 11 deletions My Neighborhood/My Neighborhood(WPF)/PS4Console.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,33 @@ private void RibbonWindow_Loaded(object sender, RoutedEventArgs e)
string AppPath = System.AppDomain.CurrentDomain.BaseDirectory;
//Log Directory
LogDirectory = AppPath + "/Logs/" + SKU.Target;
if(!Directory.Exists(LogDirectory))
{
Directory.CreateDirectory(LogDirectory);
}
if (Properties.Settings.Default.DisableSingleFileLogging == true)
try
{
if (File.Exists(LogDirectory + "/PS4-KLOG-RPC-log.txt"))
if (!Directory.Exists(LogDirectory))
{
Directory.CreateDirectory(LogDirectory);
}
if (Properties.Settings.Default.DisableSingleFileLogging == true)
{
if (File.Exists(LogDirectory + "/PS4-KLOG-RPC-log.txt"))
{
File.Delete(LogDirectory + "/PS4-KLOG-RPC-log.txt");
}
}
else
{
File.Delete(LogDirectory + "/PS4-KLOG-RPC-log.txt");
if (File.Exists(LogDirectory + "/PS4-KLOG-RPC-log.txt"))
{
File.Move(LogDirectory + "/PS4-KLOG-RPC-log.txt", LogDirectory + "/PS4-KLOG-RPC-log-backup-" + DateTime.Now.ToString("hmmsstt") + ".txt");
}
}

File.Create(LogDirectory + "/PS4-KLOG-RPC-log.txt");
}
else
catch(Exception ex)
{
File.Move(LogDirectory + "/PS4-KLOG-RPC-log.txt", LogDirectory + "/PS4-KLOG-RPC-log-backup-" + DateTime.Now.ToString("hmmsstt") + ".txt");
}
File.Create(LogDirectory + "/PS4-KLOG-RPC-log.txt");

}
if (Properties.Settings.Default.ConsolePrefCom == true && Properties.Settings.Default.ConsolePrefPort != "")
{
this.Monitor.NewSerialDataRecieved += this.OnNewSerialDataReceived;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void chbLogFile_Checked(object sender, RoutedEventArgs e)
Properties.Settings.Default.DisableSingleFileLogging = true;
Properties.Settings.Default.Save();

chbCopy.IsChecked = false;
chbCopy.IsChecked = true;
}
}

Expand Down
Loading

0 comments on commit 4ef107d

Please sign in to comment.