summaryrefslogtreecommitdiff
path: root/windows/WinUI
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2016-11-18 11:42:15 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2016-11-18 12:03:21 -0800
commit7bea7097475dba27e67146bc0d865a37870818dd (patch)
tree5e7ab6070d2a5752d384762c95abcbea5289a3ca /windows/WinUI
parent6536474b94b7ce74e262307778ab7d9e69e57143 (diff)
downloadinfinitytier-7bea7097475dba27e67146bc0d865a37870818dd.tar.gz
infinitytier-7bea7097475dba27e67146bc0d865a37870818dd.zip
wire up the rest of the views to the menu. views not implemented yet tho.
Diffstat (limited to 'windows/WinUI')
-rw-r--r--windows/WinUI/AboutView.xaml2
-rw-r--r--windows/WinUI/JoinNetworkView.xaml2
-rw-r--r--windows/WinUI/PreferencesView.xaml12
-rw-r--r--windows/WinUI/PreferencesView.xaml.cs27
-rw-r--r--windows/WinUI/ToolbarItem.xaml6
-rw-r--r--windows/WinUI/ToolbarItem.xaml.cs34
-rw-r--r--windows/WinUI/WinUI.csproj7
7 files changed, 85 insertions, 5 deletions
diff --git a/windows/WinUI/AboutView.xaml b/windows/WinUI/AboutView.xaml
index b32ac327..770b86e3 100644
--- a/windows/WinUI/AboutView.xaml
+++ b/windows/WinUI/AboutView.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WinUI"
mc:Ignorable="d"
- Title="AboutView" Height="300" Width="300">
+ Title="AboutView" Height="300" Width="300" Icon="ZeroTierIcon.ico">
<Grid>
</Grid>
diff --git a/windows/WinUI/JoinNetworkView.xaml b/windows/WinUI/JoinNetworkView.xaml
index 789be106..0bd065a4 100644
--- a/windows/WinUI/JoinNetworkView.xaml
+++ b/windows/WinUI/JoinNetworkView.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WinUI"
mc:Ignorable="d"
- Title="Join a Network" Height="120" Width="320">
+ Title="Join a Network" Height="120" Width="320" Icon="ZeroTierIcon.ico">
<Grid HorizontalAlignment="Left" Margin="0,0,0,0" Width="315">
<TextBox x:Name="joinNetworkBox" HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="291" PreviewTextInput="joinNetworkBox_OnTextEntered" PreviewKeyDown="joinNetworkBox_OnKeyDown"/>
<CheckBox x:Name="allowManagedCheckbox" Content="Allow Managed" HorizontalAlignment="Left" Margin="10,38,0,0" VerticalAlignment="Top" IsChecked="True"/>
diff --git a/windows/WinUI/PreferencesView.xaml b/windows/WinUI/PreferencesView.xaml
new file mode 100644
index 00000000..09440236
--- /dev/null
+++ b/windows/WinUI/PreferencesView.xaml
@@ -0,0 +1,12 @@
+<Window x:Class="WinUI.PreferencesView"
+ 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:WinUI"
+ mc:Ignorable="d"
+ Title="PreferencesView" Height="300" Width="300" Icon="ZeroTierIcon.ico">
+ <Grid>
+
+ </Grid>
+</Window>
diff --git a/windows/WinUI/PreferencesView.xaml.cs b/windows/WinUI/PreferencesView.xaml.cs
new file mode 100644
index 00000000..9de8766e
--- /dev/null
+++ b/windows/WinUI/PreferencesView.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+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.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace WinUI
+{
+ /// <summary>
+ /// Interaction logic for PreferencesView.xaml
+ /// </summary>
+ public partial class PreferencesView : Window
+ {
+ public PreferencesView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/windows/WinUI/ToolbarItem.xaml b/windows/WinUI/ToolbarItem.xaml
index bbc17649..9ec159b9 100644
--- a/windows/WinUI/ToolbarItem.xaml
+++ b/windows/WinUI/ToolbarItem.xaml
@@ -42,8 +42,10 @@
</CollectionContainer>
<Separator/>
- <MenuItem Header="About..."/>
- <MenuItem Header="Preferences..."/>
+ <MenuItem Header="About..."
+ Click="ToolbarItem_AboutClicked"/>
+ <MenuItem Header="Preferences..."
+ Click="ToolbarItem_PreferencesClicked"/>
<Separator/>
<MenuItem Header="Quit"/>
diff --git a/windows/WinUI/ToolbarItem.xaml.cs b/windows/WinUI/ToolbarItem.xaml.cs
index b7ac793f..1a39ce0f 100644
--- a/windows/WinUI/ToolbarItem.xaml.cs
+++ b/windows/WinUI/ToolbarItem.xaml.cs
@@ -31,6 +31,8 @@ namespace WinUI
private NetworkListView netListView = null;
private JoinNetworkView joinNetView = null;
+ private AboutView aboutView = null;
+ private PreferencesView prefsView = null;
private NetworkMonitor mon = NetworkMonitor.Instance;
@@ -108,7 +110,7 @@ namespace WinUI
private void ToolbarItem_NodeIDClicked(object sender, System.Windows.RoutedEventArgs e)
{
-
+ // TODO: Copy Node ID to clipboard
}
private void ToolbarItem_ShowNetworksClicked(object sender, System.Windows.RoutedEventArgs e)
@@ -141,6 +143,36 @@ namespace WinUI
joinNetView = null;
}
+ private void ToolbarItem_AboutClicked(object sender, System.EventArgs e)
+ {
+ if (aboutView == null)
+ {
+ aboutView = new AboutView();
+ aboutView.Closed += AboutClosed;
+ aboutView.Show();
+ }
+ }
+
+ private void AboutClosed(object sender, System.EventArgs e)
+ {
+ aboutView = null;
+ }
+
+ private void ToolbarItem_PreferencesClicked(object sender, System.EventArgs e)
+ {
+ if (prefsView == null)
+ {
+ prefsView = new PreferencesView();
+ prefsView.Closed += PreferencesClosed;
+ prefsView.Show();
+ }
+ }
+
+ private void PreferencesClosed(object sender, System.EventArgs e)
+ {
+ prefsView = null;
+ }
+
private void ToolbarItem_NetworkClicked(object sender, System.Windows.RoutedEventArgs e)
{
if(sender.GetType() == typeof(MenuItem))
diff --git a/windows/WinUI/WinUI.csproj b/windows/WinUI/WinUI.csproj
index 53f715d0..4fcf1bc4 100644
--- a/windows/WinUI/WinUI.csproj
+++ b/windows/WinUI/WinUI.csproj
@@ -115,6 +115,9 @@
<Compile Include="PeersPage.xaml.cs">
<DependentUpon>PeersPage.xaml</DependentUpon>
</Compile>
+ <Compile Include="PreferencesView.xaml.cs">
+ <DependentUpon>PreferencesView.xaml</DependentUpon>
+ </Compile>
<Compile Include="ToolbarItem.xaml.cs">
<DependentUpon>ToolbarItem.xaml</DependentUpon>
</Compile>
@@ -155,6 +158,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="PreferencesView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Simple Styles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>