提交 ccb2344d authored 作者: Mitch Capper's avatar Mitch Capper

Refined the layout, added option to hide the accounts/calls tabs and show status…

Refined the layout, added option to hide the accounts/calls tabs and show status information on dialpad tab.
上级 d1c85dda
...@@ -83,6 +83,7 @@ namespace FSClient { ...@@ -83,6 +83,7 @@ namespace FSClient {
DirectSipDial = Properties.Settings.Default.DirectSipDial; DirectSipDial = Properties.Settings.Default.DirectSipDial;
UseNumberOnlyInput = Properties.Settings.Default.UseNumberOnlyInput; UseNumberOnlyInput = Properties.Settings.Default.UseNumberOnlyInput;
CheckForUpdates = Properties.Settings.Default.CheckForUpdates; CheckForUpdates = Properties.Settings.Default.CheckForUpdates;
GUIStartup = Properties.Settings.Default.GuiStartup;
if (Properties.Settings.Default.Sofia != null) if (Properties.Settings.Default.Sofia != null)
sofia = Properties.Settings.Default.Sofia.GetSofia(); sofia = Properties.Settings.Default.Sofia.GetSofia();
...@@ -369,6 +370,7 @@ namespace FSClient { ...@@ -369,6 +370,7 @@ namespace FSClient {
Account.SaveSettings(); Account.SaveSettings();
Properties.Settings.Default.IncomingBalloons = IncomingBalloons; Properties.Settings.Default.IncomingBalloons = IncomingBalloons;
Properties.Settings.Default.CheckForUpdates = CheckForUpdates; Properties.Settings.Default.CheckForUpdates = CheckForUpdates;
Properties.Settings.Default.GuiStartup = GUIStartup;
Properties.Settings.Default.FrontOnIncoming = IncomingTopMost; Properties.Settings.Default.FrontOnIncoming = IncomingTopMost;
Properties.Settings.Default.ClearDTMFS = ClearDTMFS; Properties.Settings.Default.ClearDTMFS = ClearDTMFS;
Properties.Settings.Default.UPNPNAT = UPNPNAT; Properties.Settings.Default.UPNPNAT = UPNPNAT;
...@@ -475,6 +477,7 @@ namespace FSClient { ...@@ -475,6 +477,7 @@ namespace FSClient {
public bool IncomingBalloons; public bool IncomingBalloons;
public bool IncomingTopMost; public bool IncomingTopMost;
public string CheckForUpdates; public string CheckForUpdates;
public string GUIStartup;
private void VersionCheck() { private void VersionCheck() {
if (CheckForUpdates == "Never") if (CheckForUpdates == "Never")
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ours="clr-namespace:FSClient.Controls" xmlns:local="clr-namespace:FSClient" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" mc:Ignorable="d" x:Class="FSClient.MainWindow" xmlns:ours="clr-namespace:FSClient.Controls" xmlns:local="clr-namespace:FSClient" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" mc:Ignorable="d" x:Class="FSClient.MainWindow"
Title="FSClient" Height="319" Width="666" WindowStyle="SingleBorderWindow" ResizeMode="CanMinimize" Closing="Window_Closing" Icon="phone.ico"> Title="FSClient" Height="345" Width="666" WindowStyle="SingleBorderWindow" ResizeMode="CanMinimize" Closing="Window_Closing" Icon="phone.ico">
<Window.Resources> <Window.Resources>
<local:DurationTimeConverter x:Key="DurationTimeConverter"/> <local:DurationTimeConverter x:Key="DurationTimeConverter"/>
<local:ShortDateTimeConverter x:Key="ShortDateTimeConverter"/> <local:ShortDateTimeConverter x:Key="ShortDateTimeConverter"/>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</Window.Resources> </Window.Resources>
<Canvas Background="#FF1A207E" x:Name="mainControl"> <Canvas Background="#FF1A207E" x:Name="mainControl">
<Border x:Name="borderCalls" BorderThickness="2" BorderBrush="Black" Background="#FF000341" Height="271" Canvas.Left="4" Canvas.Top="12" Width="227" d:LayoutOverrides="VerticalAlignment"> <Border x:Name="borderCalls" BorderThickness="2" BorderBrush="Black" Background="#FF000341" Height="297" Canvas.Left="4" Canvas.Top="12" Width="227" d:LayoutOverrides="VerticalAlignment">
<Grid d:IsLocked="True"> <Grid d:IsLocked="True">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="20" /> <RowDefinition Height="20" />
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</DataGrid> </DataGrid>
</Grid> </Grid>
</Border> </Border>
<Border x:Name="borderAccounts" BorderThickness="2" BorderBrush="Black" Background="#FF000341" Width="192" Height="249" Canvas.Left="465" Canvas.Top="12" > <Border x:Name="borderAccounts" BorderThickness="2" BorderBrush="Black" Background="#FF000341" Width="192" Height="297" Canvas.Left="465" Canvas.Top="12" >
<Grid d:IsLocked="True"> <Grid d:IsLocked="True">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="20" /> <RowDefinition Height="20" />
...@@ -148,8 +148,8 @@ ...@@ -148,8 +148,8 @@
<Button Margin="2,0" Content="DND" FontWeight="Bold" Foreground="White" Height="20" Width="44" x:Name="btnDND" Style="{DynamicResource GlassButtonStyle}" VerticalAlignment="Top" Click="btnDND_Click" d:LayoutOverrides="HorizontalAlignment, Width" /> <Button Margin="2,0" Content="DND" FontWeight="Bold" Foreground="White" Height="20" Width="44" x:Name="btnDND" Style="{DynamicResource GlassButtonStyle}" VerticalAlignment="Top" Click="btnDND_Click" d:LayoutOverrides="HorizontalAlignment, Width" />
<Button Margin="2,0" Content="Speaker" FontWeight="Bold" Foreground="White" Height="20" x:Name="btnSpeaker" Style="{DynamicResource GlassButtonStyle}" VerticalAlignment="Top" Width="55" d:LayoutOverrides="HorizontalAlignment" Click="btnSpeaker_Click" /> <Button Margin="2,0" Content="Speaker" FontWeight="Bold" Foreground="White" Height="20" x:Name="btnSpeaker" Style="{DynamicResource GlassButtonStyle}" VerticalAlignment="Top" Width="55" d:LayoutOverrides="HorizontalAlignment" Click="btnSpeaker_Click" />
</StackPanel> </StackPanel>
<TextBox Height="35" x:Name="txtNumber" Text="" Background="#FF5C60AB" IsReadOnly="True" Foreground="White" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Width="215" Canvas.Left="8" Canvas.Top="10" /> <TextBox Height="35" x:Name="txtNumber" Text="" Background="#FF5C60AB" IsReadOnly="True" Foreground="White" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Width="215" Canvas.Left="8" Canvas.Top="9" />
<Border BorderThickness="1" x:Name="CurrentCallInfo" Width="215" Canvas.Left="8" Canvas.Top="49"> <Border BorderThickness="1" x:Name="CurrentCallInfo" Width="215" Canvas.Left="8" Canvas.Top="50">
<Border.Effect> <Border.Effect>
<DropShadowEffect/> <DropShadowEffect/>
</Border.Effect> </Border.Effect>
...@@ -171,23 +171,37 @@ ...@@ -171,23 +171,37 @@
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Border> </Border>
<Button Content="Options" HorizontalAlignment="Left" x:Name="btnOptions" Width="50" Click="btnOptions_Click" Style="{DynamicResource GlassButtonStyle}" Height="20" Canvas.Left="374" Canvas.Top="266" d:LayoutOverrides="VerticalAlignment" /> <StackPanel Orientation="Vertical" Name="CurrentStatusInfo" Width="215" Canvas.Left="10" Canvas.Top="49" Height="40">
</Canvas> <TextBlock Foreground="White" FontSize="13" Text="{Binding primary_account}" />
<Button Canvas.Left="283" Canvas.Top="21" Content="Send To Voicemail" FontWeight="Bold" Foreground="#FFF5E200" Height="20" Name="btnSendVoicemail" Style="{DynamicResource GlassButtonStyle}" Width="120" Visibility="Hidden" Click="btnSendVoicemail_Click" /> <StackPanel Orientation="Horizontal">
<TextBlock Foreground="White" FontSize="13" Text="{Binding active_accounts}"/>
<TextBlock Foreground="White" FontSize="13" Text=" of " />
<TextBlock Foreground="White" FontSize="13" Text="{Binding total_accounts}"/>
</StackPanel>
</StackPanel>
<Button Content="Options" HorizontalAlignment="Left" x:Name="btnOptions" Width="50" Click="btnOptions_Click" Style="{DynamicResource GlassButtonStyle}" Height="20" Canvas.Left="175" Canvas.Top="290" d:LayoutOverrides="VerticalAlignment" />
<Button Canvas.Left="52" Canvas.Top="21" Content="Send To Voicemail" FontWeight="Bold" Foreground="#FFF5E200" Height="20" Name="btnSendVoicemail" Style="{DynamicResource GlassButtonStyle}" Width="120" Visibility="Hidden" Click="btnSendVoicemail_Click" />
<ours:OurAutoCompleteBox Canvas.Left="435" Text="Contact Search" Canvas.Top="265" Height="22" Width="164.553" Opacity="0.8" x:Name="txtSearchBox" FilterMode="Contains" GotKeyboardFocus="txtSearchBox_GotKeyboardFocus" LostKeyboardFocus="txtSearchBox_LostKeyboardFocus" DropDownClosing="txtSearchBox_DropDownClosing" FontSize="11"> <ours:OurAutoCompleteBox Canvas.Left="10" Text="Contact Search" Canvas.Top="289" Height="22" Width="161" Opacity="0.8" x:Name="txtSearchBox" FilterMode="Contains" GotKeyboardFocus="txtSearchBox_GotKeyboardFocus" LostKeyboardFocus="txtSearchBox_LostKeyboardFocus" DropDownClosing="txtSearchBox_DropDownClosing" FontSize="11">
<ours:OurAutoCompleteBox.ItemTemplate> <ours:OurAutoCompleteBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding}"> <TextBlock Text="{Binding}">
<TextBlock.ContextMenu> <TextBlock.ContextMenu>
<ContextMenu x:Name="contactSearchConextMenu" ItemsSource="{Binding Path=(local:ContactPluginManager.ContactMenuItems)}" IsEnabled="true" Closed="contactSearchConextMenu_Closed" Loaded="contactSearchConextMenu_Loaded" /> <ContextMenu x:Name="contactSearchConextMenu" IsEnabled="true" Closed="contactSearchConextMenu_Closed" Loaded="contactSearchConextMenu_Loaded" ItemsSource="{Binding Path=(local:ContactPluginManager.ContactMenuItems)}" />
</TextBlock.ContextMenu> </TextBlock.ContextMenu>
</TextBlock> </TextBlock>
</DataTemplate> </DataTemplate>
</ours:OurAutoCompleteBox.ItemTemplate> </ours:OurAutoCompleteBox.ItemTemplate>
</ours:OurAutoCompleteBox> </ours:OurAutoCompleteBox>
<Button x:Name="btnCallsTab" Width="15" Style="{DynamicResource GlassButtonStyle}" Canvas.Left="10" Canvas.Top="127" Height="130" Click="btnCallsTab_Click">
<TextBlock TextAlignment="Center" LineHeight="12" FontWeight="Bold" LineStackingStrategy="BlockLineHeight" Text="&#xd;&#xa;C&#xd;&#xa;a&#xd;&#xa;l&#xd;&#xa;l&#xd;&#xa;s&#xd;&#xa;" />
</Button>
<Button x:Name="btnAccountsTab" Width="15" Style="{DynamicResource GlassButtonStyle}" Canvas.Left="208" Canvas.Top="127" Height="130" Click="btnAccountsTab_Click">
<TextBlock TextAlignment="Center" LineHeight="12" FontWeight="Bold" LineStackingStrategy="BlockLineHeight" Text="&#xd;&#xa;A&#xd;&#xa;c&#xd;&#xa;c&#xd;&#xa;o&#xd;&#xa;u&#xd;&#xa;n&#xd;&#xa;t&#xd;&#xa;s&#xd;&#xa;" />
</Button>
</Canvas>
<Control <Control
x:Name="busyAnimation" x:Name="busyAnimation"
Style="{StaticResource BusyAnimationStyle}" Style="{StaticResource BusyAnimationStyle}"
......
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
...@@ -21,18 +22,22 @@ namespace FSClient { ...@@ -21,18 +22,22 @@ namespace FSClient {
gridAccounts.DataContext = Account.accounts; gridAccounts.DataContext = Account.accounts;
this.Loaded += MainWindow_Loaded; this.Loaded += MainWindow_Loaded;
CurrentStatusInfo.DataContext = account_status;
} }
private void ActiveCallChanged(object sender, Call.ActiveCallChangedArgs e) { private void ActiveCallChanged(object sender, Call.ActiveCallChangedArgs e) {
Dispatcher.BeginInvoke((Action)(() => { Dispatcher.BeginInvoke((Action)(() => {
CurrentCallInfo.DataContext = Call.active_call; CurrentCallInfo.DataContext = Call.active_call;
if (Call.active_call == null) if (Call.active_call == null) {
CurrentCallInfo.Visibility = Visibility.Hidden; CurrentCallInfo.Visibility = Visibility.Hidden;
else CurrentStatusInfo.Visibility = Visibility.Visible;
}
else{
CurrentStatusInfo.Visibility = Visibility.Hidden;
CurrentCallInfo.Visibility = Visibility.Visible; CurrentCallInfo.Visibility = Visibility.Visible;
})); }
}));
} }
private void CallStateChanged(object sender, Call.CallPropertyEventArgs e) { private void CallStateChanged(object sender, Call.CallPropertyEventArgs e) {
gridCalls.Items.SortDescriptions.Clear(); gridCalls.Items.SortDescriptions.Clear();
...@@ -51,6 +56,14 @@ namespace FSClient { ...@@ -51,6 +56,14 @@ namespace FSClient {
gridAccounts.Items.SortDescriptions.Clear(); gridAccounts.Items.SortDescriptions.Clear();
gridAccounts.Items.SortDescriptions.Add(new SortDescription("gateway_id", ListSortDirection.Ascending)); gridAccounts.Items.SortDescriptions.Add(new SortDescription("gateway_id", ListSortDirection.Ascending));
} }
else if (e.PropertyName == "is_default_account"){
Account primary = (from a in Account.accounts where a.is_default_account == true select a).FirstOrDefault();
account_status.primary_account = primary == null ? "" : primary.ToString();
}else if (e.PropertyName == "state"){
account_status.total_accounts = (from a in Account.accounts where a.enabled == true select a).Count();
account_status.active_accounts = (from a in Account.accounts where a.state == "REGED" select a).Count();
}
} }
...@@ -244,6 +257,19 @@ namespace FSClient { ...@@ -244,6 +257,19 @@ namespace FSClient {
broker.SpeakerphoneActiveChanged += SpeakerActiveChanged; broker.SpeakerphoneActiveChanged += SpeakerActiveChanged;
CurrentCallInfo.Visibility = Visibility.Hidden; CurrentCallInfo.Visibility = Visibility.Hidden;
Windows.systray_icon_setup(); Windows.systray_icon_setup();
switch (broker.GUIStartup){
case "Calls":
borderAccounts.Visibility = Visibility.Hidden;
break;
case "Accounts":
borderCalls.Visibility = Visibility.Hidden;
break;
case "Dialpad":
borderAccounts.Visibility = Visibility.Hidden;
borderCalls.Visibility = Visibility.Hidden;
break;
}
ResizeForm();
} }
void MainWindow_MouseUp(object sender, MouseButtonEventArgs e) { void MainWindow_MouseUp(object sender, MouseButtonEventArgs e) {
...@@ -450,5 +476,82 @@ namespace FSClient { ...@@ -450,5 +476,82 @@ namespace FSClient {
e.Cancel = true; e.Cancel = true;
} }
#endregion #endregion
private bool border_calls_was_visible=true;
private void ResizeForm(){
int border_calls_width = 228;
int accounts_left = 237;
int total_width = 243;
int body_left = 3;
int new_left = 0;
if (borderAccounts.Visibility == Visibility.Visible)
total_width += 196;
if (borderCalls.Visibility == Visibility.Visible){
total_width += border_calls_width;
body_left += border_calls_width;
accounts_left += border_calls_width;
if (! border_calls_was_visible){
border_calls_was_visible = true;
Left -= border_calls_width;
}
} else if (border_calls_was_visible){
border_calls_was_visible = false;
Left += border_calls_width;
}
Canvas.SetLeft(canvasPhoneBody, body_left);
Canvas.SetLeft(borderAccounts, accounts_left);
Width = total_width;
}
private void btnCallsTab_Click(object sender, RoutedEventArgs e) {
if (borderCalls.Visibility == Visibility.Visible)
borderCalls.Visibility = Visibility.Hidden;
else
borderCalls.Visibility = Visibility.Visible;
ResizeForm();
}
private void btnAccountsTab_Click(object sender, RoutedEventArgs e) {
if (borderAccounts.Visibility == Visibility.Visible)
borderAccounts.Visibility = Visibility.Hidden;
else
borderAccounts.Visibility = Visibility.Visible;
ResizeForm();
}
AccountStatusInfo account_status = new AccountStatusInfo();
private class AccountStatusInfo : ObservableClass{
public string primary_account {
get { return _primary_account; }
set {
if (_primary_account == value)
return;
_primary_account = value;
RaisePropertyChanged("primary_account");
}
}
private string _primary_account;
public int active_accounts {
get { return _active_accounts; }
set {
if (_active_accounts == value)
return;
_active_accounts = value;
RaisePropertyChanged("active_accounts");
}
}
private int _active_accounts;
public int total_accounts {
get { return _total_accounts; }
set {
if (_total_accounts == value)
return;
_total_accounts = value;
RaisePropertyChanged("total_accounts");
}
}
private int _total_accounts;
}
} }
} }
<Window x:Class="FSClient.Options" <Window x:Class="FSClient.Options"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Options" Height="430" Width="550" Loaded="Window_Loaded" Closing="Window_Closing" WindowStyle="ThreeDBorderWindow" ResizeMode="NoResize" Icon="phone.ico"> Title="Options" Height="460" Width="550" Loaded="Window_Loaded" Closing="Window_Closing" WindowStyle="ThreeDBorderWindow" ResizeMode="NoResize" Icon="phone.ico">
<Window.Resources> <Window.Resources>
<Style x:Key="OptionHeaderStyle" TargetType="{x:Type TextBlock}"> <Style x:Key="OptionHeaderStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontWeight" Value="Bold"/> <Setter Property="FontWeight" Value="Bold"/>
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition />
<RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" > <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" >
<Button Content="Reload Devices" Height="23" Name="btnReloadDevices" Width="100" Click="btnReloadDevices_Click" /> <Button Content="Reload Devices" Height="23" Name="btnReloadDevices" Width="100" Click="btnReloadDevices_Click" />
...@@ -57,9 +58,11 @@ ...@@ -57,9 +58,11 @@
<ComboBox Height="23" Grid.Row="5" Grid.Column="1" Name="comboSpeakerOutput" Width="340" /> <ComboBox Height="23" Grid.Row="5" Grid.Column="1" Name="comboSpeakerOutput" Width="340" />
<TextBlock Grid.Row="6" Text="Ring Device:" Style="{DynamicResource OptionHeaderStyle}" /> <TextBlock Grid.Row="6" Text="Ring Device:" Style="{DynamicResource OptionHeaderStyle}" />
<ComboBox Height="23" Grid.Row="6" Grid.Column="1" Name="comboRingDevice" Width="340" /> <ComboBox Height="23" Grid.Row="6" Grid.Column="1" Name="comboRingDevice" Width="340" />
<TextBlock Grid.Row="7" Text="Recording Path:" Style="{DynamicResource OptionHeaderStyle}" /> <TextBlock Grid.Row="7" Text="Startup Layout:" Style="{DynamicResource OptionHeaderStyle}" />
<StackPanel Orientation="Horizontal" Grid.Row="7" Grid.Column="1"> <ComboBox Height="23" Grid.Row="7" Grid.Column="1" Name="comboGUIStartup" Width="340" />
<TextBox Height="23" Name="txtRecordingPath" Width="286" Margin="10,0" /> <TextBlock Grid.Row="8" Text="Recording Path:" Style="{DynamicResource OptionHeaderStyle}" />
<StackPanel Orientation="Horizontal" Grid.Row="8" Grid.Column="1">
<TextBox Height="23" Name="txtRecordingPath" Width="286" Margin="10,0" />
<Button Name="btnPathBrowse" Content="Browse" Height="25" Click="btnPathBrowse_Click" /> <Button Name="btnPathBrowse" Content="Browse" Height="25" Click="btnPathBrowse_Click" />
</StackPanel> </StackPanel>
</Grid> </Grid>
......
using System.Linq; using System.Collections.Generic;
using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Forms; using System.Windows.Forms;
using WF=System.Windows.Forms; using WF=System.Windows.Forms;
...@@ -13,10 +14,23 @@ namespace FSClient { ...@@ -13,10 +14,23 @@ namespace FSClient {
InitializeComponent(); InitializeComponent();
} }
private Broker broker = Broker.get_instance(); private Broker broker = Broker.get_instance();
private void Window_Loaded(object sender, RoutedEventArgs e) { private void Window_Loaded(object sender, RoutedEventArgs e) {
GuiOptions = new List<StartupOptions>();
GuiOptions.Add(new StartupOptions { key = "All",name = "Calls, Dialpad and Accounts"});
GuiOptions.Add(new StartupOptions { key = "Calls", name = "Calls and Dialpad" });
GuiOptions.Add(new StartupOptions { key = "Accounts", name = "Dialpad and Accounts" });
GuiOptions.Add(new StartupOptions { key = "Dialpad", name = "Dialpad Only" });
comboGUIStartup.ItemsSource = GuiOptions;
load_devices(true); load_devices(true);
} }
private class StartupOptions{
public string name;
public string key;
public override string ToString() {
return name;
}
}
private List<StartupOptions> GuiOptions;
private void load_devices(bool from_settings) { private void load_devices(bool from_settings) {
PortAudio.AudioDevice[] devices = broker.audio_devices; PortAudio.AudioDevice[] devices = broker.audio_devices;
comboSpeakerInput.ItemsSource = comboHeadsetInput.ItemsSource = (from d in devices where d.inputs > 0 select d).ToArray(); comboSpeakerInput.ItemsSource = comboHeadsetInput.ItemsSource = (from d in devices where d.inputs > 0 select d).ToArray();
...@@ -40,8 +54,10 @@ namespace FSClient { ...@@ -40,8 +54,10 @@ namespace FSClient {
chkUpdatesOnStart.IsChecked = broker.CheckForUpdates != "Never"; chkUpdatesOnStart.IsChecked = broker.CheckForUpdates != "Never";
chkNAT.IsChecked = broker.UPNPNAT; chkNAT.IsChecked = broker.UPNPNAT;
txtRecordingPath.Text = broker.recordings_folder; txtRecordingPath.Text = broker.recordings_folder;
chkDirectSip.IsChecked = broker.DirectSipDial; chkDirectSip.IsChecked = broker.DirectSipDial;
comboGUIStartup.SelectedItem = (from g in GuiOptions where g.key == broker.GUIStartup select g).FirstOrDefault();
if (comboGUIStartup.SelectedIndex == -1)
comboGUIStartup.SelectedIndex = 0;
comboHeadsetDevice.SelectedItem = broker.ActiveHeadset(); comboHeadsetDevice.SelectedItem = broker.ActiveHeadset();
if (comboHeadsetDevice.SelectedIndex == -1) if (comboHeadsetDevice.SelectedIndex == -1)
comboHeadsetDevice.SelectedIndex = 0; comboHeadsetDevice.SelectedIndex = 0;
...@@ -64,7 +80,8 @@ namespace FSClient { ...@@ -64,7 +80,8 @@ namespace FSClient {
broker.DirectSipDial = chkDirectSip.IsChecked == true; broker.DirectSipDial = chkDirectSip.IsChecked == true;
broker.UseNumberOnlyInput = chkUseNumbers.IsChecked == true; broker.UseNumberOnlyInput = chkUseNumbers.IsChecked == true;
broker.recordings_folder = txtRecordingPath.Text; broker.recordings_folder = txtRecordingPath.Text;
broker.CheckForUpdates = chkUpdatesOnStart.IsChecked == true ? "OnStart" : "Never"; broker.CheckForUpdates = chkUpdatesOnStart.IsChecked == true ? "OnStart" : "Never";
broker.GUIStartup = (comboGUIStartup.SelectedItem as StartupOptions).key;
broker.SetActiveHeadset(comboHeadsetDevice.SelectedItem as string); broker.SetActiveHeadset(comboHeadsetDevice.SelectedItem as string);
broker.SaveSettings(); broker.SaveSettings();
......
...@@ -269,5 +269,17 @@ namespace FSClient.Properties { ...@@ -269,5 +269,17 @@ namespace FSClient.Properties {
this["DirectSipDial"] = value; this["DirectSipDial"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("All")]
public string GuiStartup {
get {
return ((string)(this["GuiStartup"]));
}
set {
this["GuiStartup"] = value;
}
}
} }
} }
...@@ -65,5 +65,8 @@ ...@@ -65,5 +65,8 @@
<Setting Name="DirectSipDial" Type="System.Boolean" Scope="User"> <Setting Name="DirectSipDial" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">False</Value>
</Setting> </Setting>
<Setting Name="GuiStartup" Type="System.String" Scope="User">
<Value Profile="(Default)">All</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>
\ No newline at end of file
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
<setting name="DirectSipDial" serializeAs="String"> <setting name="DirectSipDial" serializeAs="String">
<value>False</value> <value>False</value>
</setting> </setting>
<setting name="GuiStartup" serializeAs="String">
<value>All</value>
</setting>
</FSClient.Properties.Settings> </FSClient.Properties.Settings>
</userSettings> </userSettings>
</configuration> </configuration>
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论