Commit 1f8c125f authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

account settings: link to new lrc

This patch use new lrc to manage account settings and refactor
account ui. Due to the changes next views were removed:
-AccountsVC
-AccMediaVC
-AccDevicesVC
-AccSecurityVC
-AccRingVC

Change-Id: I08ddfc7be3bc2d71d646c8f18cf3d1980378142c
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent d73f960e
......@@ -112,16 +112,16 @@ SET(ringclient_CONTROLLERS
src/RingWindowController.h
src/PreferencesWC.mm
src/PreferencesWC.h
src/AccGeneralVC.mm
src/AccGeneralVC.h
src/AccMediaVC.mm
src/AccMediaVC.h
src/AccRingVC.mm
src/AccRingVC.h
src/AccSipGeneralVC.mm
src/AccSipGeneralVC.h
src/AccAdvancedVC.mm
src/AccAdvancedVC.h
src/AccSecurityVC.mm
src/AccSecurityVC.h
src/AccRingGeneralVC.mm
src/AccRingGeneralVC.h
src/AccAdvancedSipVC.mm
src/AccAdvancedSipVC.h
src/AccAdvancedRingVC.mm
src/AccAdvancedRingVC.h
src/CertificateWC.mm
src/CertificateWC.h
src/BackupAccountWC.mm
......@@ -130,8 +130,6 @@ SET(ringclient_CONTROLLERS
src/RestoreAccountWC.h
src/AudioPrefsVC.mm
src/AudioPrefsVC.h
src/AccountsVC.mm
src/AccountsVC.h
src/VideoPrefsVC.mm
src/VideoPrefsVC.h
src/GeneralPrefsVC.h
......@@ -148,8 +146,6 @@ SET(ringclient_CONTROLLERS
src/LoadingWCDelegate.h
src/AbstractLoadingWC.h
src/AbstractLoadingWC.mm
src/AccDevicesVC.mm
src/AccDevicesVC.h
src/ExportPasswordWC.mm
src/ExportPasswordWC.h
src/MigrateRingAccountsWC.mm
......@@ -179,6 +175,8 @@ SET(ringclient_CONTROLLERS
src/LrcModelsProtocol.h
src/AddSIPAccountVC.mm
src/AddSIPAccountVC.h
src/AccountSettingsVC.mm
src/AccountSettingsVC.h
)
SET(ringclient_BACKENDS
......@@ -222,6 +220,8 @@ SET(ringclient_VIEWS
src/views/SendMessagePanel.mm
src/views/HoverButton.h
src/views/HoverButton.mm
src/views/CenteredClipView.h
src/views/CenteredClipView.mm
)
SET(ringclient_OTHERS
......@@ -247,12 +247,11 @@ SET(ringclient_XIBS
RingWindow
CurrentCall
GeneralPrefs
Accounts
AccGeneral
AccSipGeneral
AccMedia
AccRing
AccAdvanced
AccSecurity
AccRingGeneral
AccAdvancedSip
AccAdvancedRing
AudioPrefs
VideoPrefs
PreferencesWindow
......@@ -265,7 +264,6 @@ SET(ringclient_XIBS
PersonLinker
Broker
Conversation
AccDevices
RingWizardLinkAccount
RingWizardNewAccount
RingWizardChoose
......@@ -279,6 +277,7 @@ SET(ringclient_XIBS
PasswordChange
MessageCells
AddSIPAccountVC
AccountSettings
)
# Icons
......
/*
* Copyright (C) 2016 Savoir-faire Linux Inc.
* Copyright (C) 2015-2018 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -18,9 +19,8 @@
*/
#import <Cocoa/Cocoa.h>
#import <account.h>
@interface AccDevicesVC : NSViewController
#import "AccAdvancedVC.h"
@property Account* account;
@interface AccAdvancedRingVC : AccAdvancedVC <NSTextFieldDelegate>
@end
/*
* Copyright (C) 2015-2018 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import "AccAdvancedRingVC.h"
//LRC
#import <api/lrc.h>
#import <api/newaccountmodel.h>
#import <api/newdevicemodel.h>
@interface AccAdvancedRingVC () {
__unsafe_unretained IBOutlet NSButton *allowIncoming;
__unsafe_unretained IBOutlet NSTextField *nameServerField;
__unsafe_unretained IBOutlet NSTextField *proxyServerField;
__unsafe_unretained IBOutlet NSTextField *bootstrapServerField;
__unsafe_unretained IBOutlet NSButton *enableProxyButton;
}
@end
@implementation AccAdvancedRingVC
//Tags for views
const NSInteger NAME_SERVER_TAG = 100;
const NSInteger PROXY_SERVER_TAG = 200;
const NSInteger BOOTSTRAP_SERVER_TAG = 300;
-(void) updateView {
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
[allowIncoming setState: accountProperties.allowIncoming];
[nameServerField setStringValue: @(accountProperties.RingNS.uri.c_str())];
[proxyServerField setStringValue:@(accountProperties.proxyServer.c_str())];
[bootstrapServerField setStringValue:@(accountProperties.hostname.c_str())];
[enableProxyButton setState: accountProperties.proxyEnabled];
[proxyServerField setEditable:accountProperties.proxyEnabled];
}
-(void) viewDidLoad {
[super viewDidLoad];
[self updateView];
}
- (void) setSelectedAccount:(std::string) account {
[super setSelectedAccount: account];
[self updateView];
}
#pragma mark - Actions
- (IBAction)allowCallFromUnknownPeer:(id)sender {
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.allowIncoming != [sender state]) {
accountProperties.allowIncoming = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction)enableProxy:(id)sender {
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.proxyEnabled != [sender state]) {
accountProperties.proxyEnabled = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
[proxyServerField setEditable:[sender state]];
}
- (IBAction) valueDidChange: (id) sender
{
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
switch ([sender tag]) {
case NAME_SERVER_TAG:
if(accountProperties.RingNS.uri != [[sender stringValue] UTF8String]) {
accountProperties.RingNS.uri = [[sender stringValue] UTF8String];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
return;
case PROXY_SERVER_TAG:
if(accountProperties.proxyServer != [[sender stringValue] UTF8String]) {
accountProperties.proxyServer = [[sender stringValue] UTF8String];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
return;
case BOOTSTRAP_SERVER_TAG:
if(accountProperties.hostname != [[sender stringValue] UTF8String]) {
accountProperties.hostname = [[sender stringValue] UTF8String];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
return;
default:
break;
}
[super valueDidChange:sender];
}
#pragma mark - NSTextFieldDelegate methods
-(void)controlTextDidChange:(NSNotification *)notif
{
NSTextField *textField = [notif object];
NSRange test = [[textField currentEditor] selectedRange];
[self valueDidChange:textField];
}
@end
/*
* Copyright (C) 2015-2016 Savoir-faire Linux Inc.
* Copyright (C) 2015-2018 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -19,10 +20,8 @@
#import <Cocoa/Cocoa.h>
#import <account.h>
#import "AccAdvancedVC.h"
@interface AccGeneralVC : NSViewController <NSTextFieldDelegate> {
}
@interface AccAdvancedSipVC : AccAdvancedVC <NSTextFieldDelegate>
@end
/*
* Copyright (C) 2015-2018 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define OUTGOING_TLS_SERVER_TAG 0
#define NEGOTIATION_TIMOUT_TAG 1
#define REGISTRATION_TAG 2
#define LOCALPORT_TAG 3
#define CUSTOM_PORT_TAG 4
#define CUSTOM_ADDRESS_TAG 5
#define MINAUDIO_TAG 6
#define MAXAUDIO_TAG 7
#define MINVIDEO_TAG 8
#define MAXVIDEO_TAG 9
#import "AccAdvancedSipVC.h"
//LRC
#import <api/lrc.h>
#import <api/newaccountmodel.h>
@interface AccAdvancedSipVC () {
__unsafe_unretained IBOutlet NSButton *encryptMediaButton;
__unsafe_unretained IBOutlet NSButton *enableSDESButton;
__unsafe_unretained IBOutlet NSButton *fallbackEncryptionFailureButton;
__unsafe_unretained IBOutlet NSButton *encryptNegotiationButton;
__unsafe_unretained IBOutlet NSButton *checkIncomingCertificatesButton;
__unsafe_unretained IBOutlet NSButton *checkAnswerCertificatesButton;
__unsafe_unretained IBOutlet NSButton *requereIncomingCertificateButton;
__unsafe_unretained IBOutlet NSPopUpButton *tlsProtocolsList;
__unsafe_unretained IBOutlet NSTextField *outgoingTlsServerNameField;
__unsafe_unretained IBOutlet NSStepper *negotiationTimeoutStepper;
__unsafe_unretained IBOutlet NSTextField *negotiationTimeoutField;
__unsafe_unretained IBOutlet NSStepper *registrationTimeoutStepper;
__unsafe_unretained IBOutlet NSTextField *registrationTimeoutField;
__unsafe_unretained IBOutlet NSStepper *networkStepper;
__unsafe_unretained IBOutlet NSTextField *networkField;
__unsafe_unretained IBOutlet NSTextField *customAddressField;
__unsafe_unretained IBOutlet NSButton *useCustomAddressButton;
__unsafe_unretained IBOutlet NSStepper *customPortStepper;
__unsafe_unretained IBOutlet NSTextField *customPortField;
__unsafe_unretained IBOutlet NSStepper *minAudioPortStepper;
__unsafe_unretained IBOutlet NSStepper *maxAudioPortStepper;
__unsafe_unretained IBOutlet NSStepper *minVideoPortStepper;
__unsafe_unretained IBOutlet NSStepper *maxVideoPortStepper;
__unsafe_unretained IBOutlet NSTextField *minAudioRTPRange;
__unsafe_unretained IBOutlet NSTextField *maxAudioRTPRange;
__unsafe_unretained IBOutlet NSTextField *minVideoRTPRange;
__unsafe_unretained IBOutlet NSTextField *maxVideoRTPRange;
}
@end
@implementation AccAdvancedSipVC
NSString *TLS_PROTOCOL_DEFAULT = @"Default";
NSString *TLS_PROTOCOL_TLSv1 = @"TLSv1";
NSString *TLS_PROTOCOL_TLSv1_1 = @"TLSv1_1";
NSString *TLS_PROTOCOL_TLSv1_2 = @"TLSv1_2";
@synthesize privateKeyPaswordField;
@synthesize selectCACertificateButton, selectUserCertificateButton, selectPrivateKeyButton;
- (void)awakeFromNib
{
[super awakeFromNib];
[negotiationTimeoutStepper setTag:NEGOTIATION_TIMOUT_TAG];
[negotiationTimeoutField setTag:NEGOTIATION_TIMOUT_TAG];
[registrationTimeoutStepper setTag:REGISTRATION_TAG];
[registrationTimeoutField setTag:REGISTRATION_TAG];
[networkStepper setTag:LOCALPORT_TAG];
[networkField setTag:LOCALPORT_TAG];
[customAddressField setTag: CUSTOM_ADDRESS_TAG];
[outgoingTlsServerNameField setTag: OUTGOING_TLS_SERVER_TAG];
[customPortStepper setTag: CUSTOM_PORT_TAG];
[customPortField setTag: CUSTOM_PORT_TAG];
[minAudioPortStepper setTag:MINAUDIO_TAG];
[maxAudioPortStepper setTag:MAXAUDIO_TAG];
[minVideoPortStepper setTag:MINVIDEO_TAG];
[maxVideoPortStepper setTag:MAXVIDEO_TAG];
[minAudioRTPRange setTag:MINAUDIO_TAG];
[maxAudioRTPRange setTag:MAXAUDIO_TAG];
[minVideoRTPRange setTag:MINVIDEO_TAG];
[maxVideoRTPRange setTag:MAXVIDEO_TAG];
}
-(void)viewDidLoad {
[super viewDidLoad];
NSMenu *tlsMethods = [[NSMenu alloc] initWithTitle:@""];
[tlsMethods addItem: [[NSMenuItem alloc] initWithTitle: TLS_PROTOCOL_DEFAULT action:nil keyEquivalent:@""]];
[tlsMethods addItem: [[NSMenuItem alloc] initWithTitle: TLS_PROTOCOL_TLSv1 action:nil keyEquivalent:@""]];
[tlsMethods addItem: [[NSMenuItem alloc] initWithTitle: TLS_PROTOCOL_TLSv1_1 action:nil keyEquivalent:@""]];
[tlsMethods addItem: [[NSMenuItem alloc] initWithTitle: TLS_PROTOCOL_TLSv1_2 action:nil keyEquivalent:@""]];
tlsProtocolsList.menu = tlsMethods;
[self updateView];
}
- (void) setSelectedAccount:(std::string) account {
[super setSelectedAccount: account];
[self updateView];
}
- (void) updateView {
auto accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
[encryptMediaButton setState: accountProperties.SRTP.enable];
[enableSDESButton setState: accountProperties.SRTP.keyExchange == lrc::api::account::KeyExchangeProtocol::SDES ? NSControlStateValueOn : NSControlStateValueOff];
[fallbackEncryptionFailureButton setState: accountProperties.SRTP.rtpFallback];
[encryptNegotiationButton setState: accountProperties.TLS.enable];
[selectCACertificateButton setEnabled: accountProperties.TLS.enable];
[selectUserCertificateButton setEnabled: accountProperties.TLS.enable];
[selectPrivateKeyButton setEnabled: accountProperties.TLS.enable];
[privateKeyPaswordField setEnabled: accountProperties.TLS.enable];
[checkIncomingCertificatesButton setState: accountProperties.TLS.verifyServer];
[checkAnswerCertificatesButton setState: accountProperties.TLS.verifyClient];
[requereIncomingCertificateButton setState: accountProperties.TLS.requireClientCertificate];
switch (accountProperties.TLS.method) {
case lrc::api::account::TlsMethod::DEFAULT:
[tlsProtocolsList selectItemWithTitle:TLS_PROTOCOL_DEFAULT];
break;
case lrc::api::account::TlsMethod::TLSv1:
[tlsProtocolsList selectItemWithTitle:TLS_PROTOCOL_TLSv1];
break;
case lrc::api::account::TlsMethod::TLSv1_1:
[tlsProtocolsList selectItemWithTitle:TLS_PROTOCOL_TLSv1_1];
break;
case lrc::api::account::TlsMethod::TLSv1_2:
[tlsProtocolsList selectItemWithTitle:TLS_PROTOCOL_TLSv1_2];
break;
default:
break;
}
[negotiationTimeoutStepper setIntegerValue: accountProperties.TLS.negotiationTimeoutSec];
[negotiationTimeoutField setIntegerValue: accountProperties.TLS.negotiationTimeoutSec];
[registrationTimeoutStepper setIntegerValue: accountProperties.Registration.expire];
[registrationTimeoutField setIntegerValue: accountProperties.Registration.expire];
[networkStepper setIntegerValue: accountProperties.localPort];
[networkField setIntegerValue: accountProperties.localPort];
[customAddressField setEnabled:!accountProperties.publishedSameAsLocal];
[customPortField setEnabled:!accountProperties.publishedSameAsLocal];
[customPortStepper setEnabled:!accountProperties.publishedSameAsLocal];
[useCustomAddressButton setState:!accountProperties.publishedSameAsLocal];
[customPortStepper setIntegerValue: accountProperties.publishedPort];
[customPortField setIntegerValue: accountProperties.publishedPort];
[customAddressField setStringValue: @(accountProperties.publishedAddress.c_str())];
[minAudioPortStepper setIntegerValue: accountProperties.Audio.audioPortMin];
[minAudioRTPRange setIntegerValue: accountProperties.Audio.audioPortMin];
[maxAudioPortStepper setIntegerValue: accountProperties.Audio.audioPortMax];
[maxAudioRTPRange setIntegerValue: accountProperties.Audio.audioPortMax];
[minVideoPortStepper setIntegerValue: accountProperties.Video.videoPortMin];
[minVideoRTPRange setIntegerValue: accountProperties.Video.videoPortMin];
[maxVideoPortStepper setIntegerValue: accountProperties.Video.videoPortMin];
[maxVideoRTPRange setIntegerValue: accountProperties.Video.videoPortMin];
}
#pragma mark - Actions
- (IBAction)toggleEnableSDES:(id)sender {
auto accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
lrc::api::account::KeyExchangeProtocol newState = [sender state] == NSControlStateValueOn ? lrc::api::account::KeyExchangeProtocol::SDES : lrc::api::account::KeyExchangeProtocol::NONE;
if(accountProperties.SRTP.keyExchange != newState) {
accountProperties.SRTP.keyExchange = newState;
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction)toggleEncryptMedia:(id)sender {
auto accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.SRTP.enable!= [sender state]) {
accountProperties.SRTP.enable = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction)toggleFallbackEncryptionFailure:(id)sender {
auto accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.SRTP.rtpFallback != [sender state]) {
accountProperties.SRTP.rtpFallback = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction)toggleEncryptNegotiation:(id)sender {
auto accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.TLS.enable != [sender state]) {
accountProperties.TLS.enable = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[selectCACertificateButton setEnabled: [sender state]];
[selectUserCertificateButton setEnabled: [sender state]];
[selectPrivateKeyButton setEnabled: [sender state]];
[privateKeyPaswordField setEnabled: [sender state]];
}
}
- (IBAction)toggleVerifyServerCertificate:(id)sender {
auto accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.TLS.verifyServer != [sender state]) {
accountProperties.TLS.verifyServer = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction)toggleVerifyClientCertificate:(id)sender {
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.TLS.verifyClient != [sender state]) {
accountProperties.TLS.verifyClient = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction)toggleCertForIncomingConnection:(id)sender {
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.TLS.requireClientCertificate != [sender state]) {
accountProperties.TLS.requireClientCertificate = [sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction)enableCustomAddress:(id)sender {
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.publishedSameAsLocal != ![sender state]) {
accountProperties.publishedSameAsLocal = ![sender state];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[customAddressField setEnabled:[sender state]];
[customPortField setEnabled:[sender state]];
[customPortStepper setEnabled:[sender state]];
}
}
- (IBAction)chooseTlsProtocol:(id)sender {
int index = [sender indexOfSelectedItem];
if(index < 0) {
return;
}
NSString *title = [[tlsProtocolsList.menu itemAtIndex:index] title];
lrc::api::account::TlsMethod method;
if(title == TLS_PROTOCOL_DEFAULT) {
method = lrc::api::account::TlsMethod::DEFAULT;
} else if(title == TLS_PROTOCOL_TLSv1) {
method = lrc::api::account::TlsMethod::TLSv1;
} else if(title == TLS_PROTOCOL_TLSv1_1) {
method = lrc::api::account::TlsMethod::TLSv1_1;
} else if(title == TLS_PROTOCOL_TLSv1_2) {
method = lrc::api::account::TlsMethod::TLSv1_2;
} else {
return;
}
auto accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
if(accountProperties.TLS.method != method) {
accountProperties.TLS.method = method;
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
}
- (IBAction) valueDidChange: (id) sender
{
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
switch ([sender tag]) {
case OUTGOING_TLS_SERVER_TAG:
if(accountProperties.TLS.serverName != [[sender stringValue] UTF8String]) {
accountProperties.TLS.serverName = [[sender stringValue] UTF8String];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
return;
case NEGOTIATION_TIMOUT_TAG:
if(accountProperties.TLS.negotiationTimeoutSec != [[sender stringValue] integerValue]) {
accountProperties.TLS.negotiationTimeoutSec = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[negotiationTimeoutStepper setIntegerValue: [[sender stringValue] integerValue]];
[negotiationTimeoutField setIntegerValue: [[sender stringValue] integerValue]];
}
return;
case REGISTRATION_TAG:
if(accountProperties.Registration.expire != [[sender stringValue] integerValue]) {
accountProperties.Registration.expire = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[registrationTimeoutStepper setIntegerValue: [[sender stringValue] integerValue]];
[registrationTimeoutField setIntegerValue: [[sender stringValue] integerValue]];
}
return;
case LOCALPORT_TAG:
if(accountProperties.localPort != [[sender stringValue] integerValue]) {
accountProperties.localPort = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[networkStepper setIntegerValue: [[sender stringValue] integerValue]];
[networkField setIntegerValue: [[sender stringValue] integerValue]];
}
return;
case CUSTOM_ADDRESS_TAG:
if(accountProperties.publishedAddress != [[sender stringValue] UTF8String]) {
NSString *name = [sender stringValue];
accountProperties.publishedAddress = [[sender stringValue] UTF8String];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
}
return;
case CUSTOM_PORT_TAG:
if(accountProperties.publishedPort != [[sender stringValue] integerValue]) {
accountProperties.publishedPort = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[customPortStepper setIntegerValue: [[sender stringValue] integerValue]];
[customPortField setIntegerValue: [[sender stringValue] integerValue]];
}
return;
case MINAUDIO_TAG:
if(accountProperties.Audio.audioPortMin != [[sender stringValue] integerValue]) {
accountProperties.Audio.audioPortMin = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[minAudioPortStepper setIntegerValue: [[sender stringValue] integerValue]];
[minAudioRTPRange setIntegerValue: [[sender stringValue] integerValue]];
}
return;
case MAXAUDIO_TAG:
if(accountProperties.Audio.audioPortMax != [[sender stringValue] integerValue]) {
accountProperties.Audio.audioPortMax = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[maxAudioPortStepper setIntegerValue: [[sender stringValue] integerValue]];
[maxAudioRTPRange setIntegerValue: [[sender stringValue] integerValue]];
}
return;
case MINVIDEO_TAG:
if(accountProperties.Video.videoPortMin != [[sender stringValue] integerValue]) {
accountProperties.Video.videoPortMin = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[minVideoPortStepper setIntegerValue: [[sender stringValue] integerValue]];
[minVideoRTPRange setIntegerValue: [[sender stringValue] integerValue]];
}
return;
case MAXVIDEO_TAG:
if(accountProperties.Video.videoPortMax != [[sender stringValue] integerValue]) {
accountProperties.Video.videoPortMax = [[sender stringValue] integerValue];
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
[maxVideoPortStepper setIntegerValue: [[sender stringValue] integerValue]];
[maxVideoRTPRange setIntegerValue: [[sender stringValue] integerValue]];
}
return;
default:
break;