Skip to content

Commit d00ad8e

Browse files
committed
IPCサーバステータスの表示を追加した
1 parent 8bba741 commit d00ad8e

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed

source/CeVIOAIProxy/CeVIOAIProxy.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
<AssemblyOriginatorKeyFile>CeVIOAIProxy.pfx</AssemblyOriginatorKeyFile>
1212
<Authors>anoyetta</Authors>
1313
<Copyright>(c) 2021 anoyetta</Copyright>
14-
<AssemblyVersion>1.1.0.0</AssemblyVersion>
14+
<AssemblyVersion>1.1.0.1</AssemblyVersion>
1515
<PackageIcon>share.ico</PackageIcon>
1616
<PackageIconUrl />
1717
<PackageProjectUrl>https://github.com/anoyetta/CeVIOAIProxy</PackageProjectUrl>
1818
<RepositoryUrl>https://github.com/anoyetta/CeVIOAIProxy.git</RepositoryUrl>
1919
<RepositoryType>GitHub</RepositoryType>
2020
<Version>1.0.4</Version>
2121
<StartupObject>CeVIOAIProxy.App</StartupObject>
22-
<FileVersion>1.1.0.0</FileVersion>
22+
<FileVersion>1.1.0.1</FileVersion>
2323
</PropertyGroup>
2424

2525
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

source/CeVIOAIProxy/MainViewModel.cs

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using CeVIO.Talk.RemoteService2;
2+
using CeVIOAIProxy.Servers;
23
using Prism.Commands;
34
using Prism.Mvvm;
45
using System.Collections.ObjectModel;
@@ -60,6 +61,13 @@ public async void OnLoaded()
6061

6162
this.Config.OnCastChanged += (_, _) => this.SetCurrentComponents();
6263
this.SetCurrentComponents();
64+
65+
if (IpcRemotingServerController.Current != null)
66+
{
67+
this.IPCServerStatus = IpcRemotingServerController.Current.IsAvailable ?
68+
"IPC server is running." :
69+
"IPC server is stopped.";
70+
}
6371
}
6472

6573
private void SetCurrentComponents()
@@ -80,6 +88,14 @@ private void SetCurrentComponents()
8088
}
8189
}
8290

91+
private string ipcServerStatus;
92+
93+
public string IPCServerStatus
94+
{
95+
get => this.ipcServerStatus;
96+
set => this.SetProperty(ref this.ipcServerStatus, value);
97+
}
98+
8399
private DelegateCommand testCommand;
84100

85101
public DelegateCommand TestCommand =>

source/CeVIOAIProxy/MainWindow.xaml

+18-20
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
<mah:MetroWindow
22
x:Class="CeVIOAIProxy.MainWindow"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
54
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
76
xmlns:bh="http://schemas.microsoft.com/xaml/behaviors"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
88
xmlns:tb="http://www.hardcodet.net/taskbar"
9-
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
10-
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
11-
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
129
xmlns:local="clr-namespace:CeVIOAIProxy"
10+
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
1311
mc:Ignorable="d"
1412
ResizeMode="CanMinimize"
1513
WindowStartupLocation="CenterScreen"
16-
Title="CeVIO AI Proxy"
14+
Title="CeVIO AI Proxy"
1715
Icon="share.png"
1816
Width="550" Height="540"
1917
Left="{Binding Config.X, Mode=TwoWay}"
@@ -34,7 +32,7 @@
3432
<ColumnDefinition Width="265" />
3533
<ColumnDefinition />
3634
</Grid.ColumnDefinitions>
37-
35+
3836
<tb:TaskbarIcon
3937
x:Name="NotifyIcon"
4038
IconSource="share.ico"
@@ -52,13 +50,13 @@
5250

5351
<StackPanel Grid.Column="0" Margin="0 0 20 0">
5452
<mah:MetroHeader Header="キャスト" Margin="0 0 0 0">
55-
<ComboBox
53+
<ComboBox
5654
ItemsSource="{Binding Casts, Mode=OneWay}"
5755
SelectedItem="{Binding Config.Cast, Mode=TwoWay}" />
5856
</mah:MetroHeader>
5957

6058
<mah:MetroHeader Header="パラメータ" Margin="0 15 0 0">
61-
<StackPanel
59+
<StackPanel
6260
Margin="0 10 0 0"
6361
Orientation="Horizontal">
6462
<StackPanel
@@ -156,7 +154,6 @@
156154
<TextBlock Text="{Binding Config.ToneScale, Mode=OneWay}" HorizontalAlignment="Center" />
157155
</StackPanel>
158156
</StackPanel>
159-
160157
</mah:MetroHeader>
161158

162159
<ItemsControl
@@ -195,14 +192,14 @@
195192

196193
<StackPanel Grid.Column="1">
197194
<mah:ToggleSwitch
198-
HorizontalAlignment="Stretch"
199-
Content="最小化して起動する"
200-
IsOn="{Binding Config.IsMinimizeStartup, Mode=TwoWay}" />
195+
HorizontalAlignment="Stretch"
196+
Content="最小化して起動する"
197+
IsOn="{Binding Config.IsMinimizeStartup, Mode=TwoWay}" />
201198

202199
<mah:MetroHeader Header="待受ポート" Margin="0 15 0 0">
203200
<TextBox
204-
Text="{Binding Config.TcpServerPort, Mode=TwoWay}"
205-
MaxLength="5" />
201+
Text="{Binding Config.TcpServerPort, Mode=TwoWay}"
202+
MaxLength="5" />
206203
</mah:MetroHeader>
207204
<TextBlock Text="* 通常は変更する必要がありません" FontSize="10" Margin="0 2 0 0" />
208205
<TextBlock Text="* 変更後は再起動してください" FontSize="10" />
@@ -211,20 +208,21 @@
211208
Margin="0 15 0 0"
212209
HorizontalAlignment="Stretch"
213210
Content="IPCサーバで待受ける"
214-
IsOn="{Binding Config.IsEnabledIPCServer, Mode=TwoWay}" />
211+
IsOn="{Binding Config.IsEnabledIPCServer, Mode=TwoWay}" />
215212
<TextBlock Text="* 変更後は再起動してください" FontSize="10" />
213+
<TextBlock Text="{Binding IPCServerStatus, Mode=OneWay}" FontStyle="Italic" />
216214

217215
<mah:MetroHeader Header="IPCチャンネル名" Margin="0 15 0 0">
218216
<TextBox
219-
Text="{Binding Config.IPCChannelName, Mode=TwoWay}" />
217+
Text="{Binding Config.IPCChannelName, Mode=TwoWay}" />
220218
</mah:MetroHeader>
221219
<TextBlock Text="* 通常は変更する必要がありません" FontSize="10" Margin="0 2 0 0" />
222220
<TextBlock Text="* 変更後は再起動してください" FontSize="10" />
223221
</StackPanel>
224-
225-
<Button
222+
223+
<Button
226224
Grid.ColumnSpan="2"
227-
Content="テスト"
225+
Content="テスト"
228226
VerticalAlignment="Bottom"
229227
Command="{Binding TestCommand, Mode=OneWay}" />
230228
</Grid>

0 commit comments

Comments
 (0)