Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
damienvanrobaeys authored Sep 20, 2022
1 parent 8399814 commit fc2c8da
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 22 deletions.
32 changes: 32 additions & 0 deletions Sources/Dialog_Support.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Grid
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
Height="160">

<StackPanel Orientation="Vertical" Margin="0,-5,0,0" HorizontalAlignment="Center">
<Label Name="Title_Label" Content="Contact your support team" FontWeight="Bold" Foreground="White" FontSize="20" HorizontalAlignment="Center"/>

<Border Name="Border" BorderBrush="#1d88bc" BorderThickness="1" Width="300" Height="75" Margin="0,5,0,0">
<StackPanel HorizontalAlignment="Center" Orientation="Vertical" Margin="0,5,0,0">
<StackPanel Orientation="Horizontal" Margin="5,5,0,0">
<iconPacks:PackIconFontAwesome Kind="Phone" Margin="0,5,0,0"/>
<Label Name="Phone_Number_Label" FontWeight="Bold" Foreground="#C9C6D3" Margin="4,0,0,0"/>
<Label Name="Phone_Number" FontWeight="Bold" Foreground="#C9C6D3" Margin="-5,0,0,0"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5,5,0,0">
<iconPacks:PackIconMaterial Kind="email" Margin="0,5,0,0"/>
<Label Content="Mail:" Name="Mail_Label" FontWeight="Bold" Foreground="#C9C6D3" Margin="4,0,0,0"/>
<Label Name="Mail" FontWeight="Bold" Foreground="#C9C6D3" Margin="-5,0,0,0"/>
</StackPanel>
</StackPanel>
</Border>

<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<Button Name="Close_Dialog" Margin="0,5,0,0" Content="Close" Width="300" Background="#1d88bc" Foreground="White" BorderThickness="0"/>
</StackPanel>

</StackPanel>
</Grid>
22 changes: 17 additions & 5 deletions Sources/Issues_List.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<GUI_Config>
<XML_Version>1.0.0</XML_Version>
<Tool_Version>1.0.1</Tool_Version>


<!-- Install location part -->
<Shortcut_Desktop>True</Shortcut_Desktop> <!-- True or False -->
<Shortcut_StartMenu>True</Shortcut_StartMenu> <!-- True or False -->

<!-- User Toast notification part -->
<Show_Install_Toast>True</Show_Install_Toast> <!-- Display a toast to user after installing the tool. True or False -->
<Toast_Header_Picture>Toast_Header.gif</Toast_Header_Picture>
<Toast_Company_Name>Syst and Deploy informs you</Toast_Company_Name>
Expand All @@ -15,11 +17,12 @@
Click on the SelfX shortcut available on your desktop or Start menu to launch the tool.
</Toast_Text>
<Toast_Button_Text>Dismiss</Toast_Button_Text>


<!-- Main part -->
<Link_Scripts></Link_Scripts> <!-- If Type = Download, type the path where to find Issues_List.xml-->
<Tool_Color>Cyan</Tool_Color> <!-- Available colors: “Red”, “Green”, “Blue”, “Purple”, “Orange”, “Lime”, “Emerald”, “Teal”, “Cyan”, “Cobalt”, “Indigo”, “Violet”, “Pink”, “Magenta”, “Crimson”, “Amber”, “Yellow”, “Brown”, “Olive”, “Steel”, “Mauve”, “Taupe”, “Sienna” -->
<Main_Title_Text>An issue with your device ?</Main_Title_Text> <!-- Main GUI: main title -->
<Main_Title_Text>An issue with your device</Main_Title_Text> <!-- Main GUI: main title -->
<Show_Computer_Name>True</Show_Computer_Name> <!-- Display the computer name beside the main title. True or False -->
<Subtitle_Text>You may find a way to solve it here with a list of clickable solutions</Subtitle_Text> <!-- Main GUI: subtitle -->
<Expander_Category_Text_Part1>Solve issues with</Expander_Category_Text_Part1> <!-- Main GUI: subtitle -->
<Expander_Category_Text_Part2>action(s) available)</Expander_Category_Text_Part2> <!-- Main GUI: subtitle -->
Expand All @@ -32,7 +35,16 @@ Click on the SelfX shortcut available on your desktop or Start menu to launch th
<Issue_filter_Category_Text>Choose a category</Issue_filter_Category_Text> <!-- Search filter issue box: category text -->
<Issue_filter_KeyWord_Text>Type a key word</Issue_filter_KeyWord_Text> <!-- Search filter issue box: keyword text -->
<Issue_filter_SearchButton_Text>Search</Issue_filter_SearchButton_Text> <!-- Search filter issue box: search button text -->
<Issue_filter_CloseButton_Text>Close</Issue_filter_CloseButton_Text> <!-- Search filter issue box: close button text -->
<Issue_filter_CloseButton_Text>Close</Issue_filter_CloseButton_Text> <!-- Search filter issue box: close button text -->

<!-- Support part -->
<Show_Support_Button>False</Show_Support_Button> <!-- Display button in the title bar to view support information. True or False -->
<Support_Phone_Label>Phone number:</Support_Phone_Label>
<Support_Phone_number>0000000000</Support_Phone_number>
<Support_Mail_Label>Mail:</Support_Mail_Label>
<Support_Mail>[email protected]</Support_Mail>
<Close_Button_Text>Close</Close_Button_Text>

</GUI_Config>

<!-- Part for device -->
Expand Down
137 changes: 120 additions & 17 deletions Sources/Self_X.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ TitleCaps="False">
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<Button Name="Support_Info">
<iconPacks:PackIconFontAwesome Kind="phone"/>
</Button>
<Button Name="Search_Issue">
<iconPacks:PackIconMaterial Kind="magnify"/>
</Button>
Expand Down Expand Up @@ -293,7 +296,6 @@ $About.Add_Click({
})

$GUI_Config = $Depannage_Actions_XML.Actions.GUI_Config
$Main_Title.Content = $GUI_Config.Main_Title_Text
$Subtitle.Content = $GUI_Config.Subtitle_Text
$Run_solution_label.Content = $GUI_Config.Run_solution_Text
$Run_explanation_label.Content = $GUI_Config.Run_explanation_Text
Expand All @@ -303,6 +305,24 @@ $Tool_Version = $GUI_Config.Tool_Version
$Tool_Color = $GUI_Config.Tool_Color
$Category_Text_Part1 = $GUI_Config.Expander_Category_Text_Part1
$Category_Text_Part2 = $GUI_Config.Expander_Category_Text_Part2
$Show_Computer_Name = $GUI_Config.Show_Computer_Name
$Show_Support_Button = $GUI_Config.Show_Support_Button
$Support_Phone_number = $GUI_Config.Support_Phone_number
$Support_Mail = $GUI_Config.Support_Mail

$Support_Phone_Label = $GUI_Config.Support_Phone_Label
$Support_Mail_Label = $GUI_Config.Support_Mail_Label
$Close_Button_Text = $GUI_Config.Close_Button_Text


If($Show_Computer_Name -eq $True)
{
$Main_Title.Content = $GUI_Config.Main_Title_Text + " " + "($env:computername)" + " ?"
}
Else
{
$Main_Title.Content = $GUI_Config.Main_Title_Text
}

$Theme = [MahApps.Metro.ThemeManager]::DetectAppStyle($form)
[MahApps.Metro.ThemeManager]::ChangeAppStyle($form, [MahApps.Metro.ThemeManager]::GetAccent("$Tool_Color"), $Theme.Item1);
Expand Down Expand Up @@ -411,6 +431,92 @@ Function See_Details($rowObj)
}





# $Support_Phone_Label = $GUI_Config.Support_Phone_Label
# $Support_Mail_Label = $GUI_Config.Support_Mail_Label
# $Close_Button_Text = $GUI_Config.Close_Button_Text


#******************************************************************************
# Support contact dialog part
#******************************************************************************
If($Show_Support_Button -eq $True)
{
$Support_Info.Visibility = "Visible"
$Support_Info.add_Click({
[MahApps.Metro.Controls.Dialogs.DialogManager]::ShowMetroDialogAsync($form, $Dialog_Support)
})
}
Else
{
$Support_Info.Visibility = "Collapsed"
}

function LoadXml ($global:filename)
{
$XamlLoader=(New-Object System.Xml.XmlDocument)
$XamlLoader.Load($filename)
return $XamlLoader
}
$xamlDialog = LoadXml(".\Dialog_Support.xaml")

$read=(New-Object System.Xml.XmlNodeReader $xamlDialog)
$DialogForm=[Windows.Markup.XamlReader]::Load($read)

$Dialog_Support = [MahApps.Metro.Controls.Dialogs.CustomDialog]::new($form)
$Dialog_Support.AddChild($DialogForm)

$Title_Label = $DialogForm.FindName("Title_Label")
$Phone_Number_Label = $DialogForm.FindName("Phone_Number_Label")
$Phone_Number = $DialogForm.FindName("Phone_Number")
$Mail_Label = $DialogForm.FindName("Mail_Label")
$Mail = $DialogForm.FindName("Mail")
$Close_Dialog = $DialogForm.FindName("Close_Dialog")
$Border = $DialogForm.FindName("Border")

$Phone_Number_Label.Content = $Support_Phone_Label
$Phone_Number.Content = $Support_Phone_number
$Mail_Label.Content = $Support_Mail_Label
$Mail.Content = $Support_Mail
$Close_Dialog.Content = $Close_Button_Text

$Close_Dialog.Width = $Border.Width

$Close_Dialog.add_Click({
$Dialog_Support.RequestCloseAsync()
})


#******************************************************************************
# Filter on issues part end
#******************************************************************************





















#******************************************************************************
# Filter on issues part
#******************************************************************************

function LoadXml ($global:filename)
{
$XamlLoader=(New-Object System.Xml.XmlDocument)
Expand Down Expand Up @@ -440,10 +546,6 @@ $KeyWord_Label.Content = $GUI_Config.Issue_filter_KeyWord_Text
$Search.Content = $GUI_Config.Issue_filter_SearchButton_Text
$Close_Dialog.Content = $GUI_Config.Issue_filter_CloseButton_Text

# $Close_Dialog.Background = "$Tool_Color"
# $Search.Background = "$Tool_Color"
# $Border.BorderBrush = "$Tool_Color"

$Dir_Sources_Folder = get-childitem $Sources_Folder -recurse
$List_All_Files = $Dir_Sources_Folder | where { ! $_.PSIsContainer }

Expand All @@ -465,8 +567,7 @@ $Close_Dialog.add_Click({
$Search_Issue.add_Click({
[MahApps.Metro.Controls.Dialogs.DialogManager]::ShowMetroDialogAsync($form, $Dialog_Search)
})



$Search.Add_Click({
$All_Categories = $Depannage_Actions_XML.Actions.Action.Category | Sort-Object -Unique
Add-Type -AssemblyName PresentationCore,PresentationFramework
Expand All @@ -478,19 +579,21 @@ foreach($Category in $All_Categories)
$Datagrid_Log_Count = $Form.FindName("DataGrid_$Category").Items.Count

ForEach($Log in $Form.FindName("DataGrid_$Category").Items)
{
# For ($i = 0; $i -lt $Datagrid_Log_Count; $i++)
# {
If($Log.Action -like "*$Get_TextBox_Value*")
{
$Form.FindName("DataGrid_$Category").SelectedItem = $Log#[$i]
# break
}

# }
{
If($Log.Action -like "*$Get_TextBox_Value*")
{
$Form.FindName("DataGrid_$Category").SelectedItem = $Log#[$i]
}
}
$Dialog_Search.RequestCloseAsync()
}
})

#******************************************************************************
# Filter on issues part end
#******************************************************************************




$Form.ShowDialog() | Out-Null

0 comments on commit fc2c8da

Please sign in to comment.