Skip to content
Snippets Groups Projects
Commit 034eab3e authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

settings: save parameters only when editing finished

Change-Id: Ieaeb2d40cff9cf34337aae634289004ba37d39f9
parent 24fe631a
No related branches found
No related tags found
No related merge requests found
......@@ -122,11 +122,9 @@ const NSInteger BOOTSTRAP_SERVER_TAG = 300;
#pragma mark - NSTextFieldDelegate methods
-(void)controlTextDidChange:(NSNotification *)notif
-(void)controlTextDidEndEditing:(NSNotification *)notif
{
NSTextField *textField = [notif object];
NSRange test = [[textField currentEditor] selectedRange];
[self valueDidChange:textField];
}
......
......@@ -354,11 +354,9 @@ NSString *TLS_PROTOCOL_TLSv1_2 = @"TLSv1_2";
#pragma mark - NSTextFieldDelegate methods
-(void)controlTextDidChange:(NSNotification *)notif
-(void)controlTextDidEndEditing:(NSNotification *)notif
{
NSTextField *textField = [notif object];
NSRange test = [[textField currentEditor] selectedRange];
[self valueDidChange:textField];
}
......
......@@ -297,15 +297,15 @@ typedef NS_ENUM(NSInteger, TagViews) {
#pragma mark - NSTextFieldDelegate delegate methods
- (void)controlTextDidChange:(NSNotification *)notif
-(void)controlTextDidEndEditing:(NSNotification *)notification
{
NSTextField* textField = [notif object];
NSTextField* textField = [notification object];
if (textField.tag != DISPLAYNAME) {
return;
}
NSString* displayName = textField.stringValue;
[NSObject cancelPreviousPerformRequestsWithTarget:self];
self.accountModel->setAlias(self.selectedAccountID, QString::fromNSString(displayName));
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
......@@ -423,6 +423,7 @@ typedef NS_ENUM(NSInteger, TagViews) {
[self.view.window beginSheet: passwordWC.window completionHandler:nil];
}
- (IBAction)triggerAdwancedSettings: (NSButton *)sender {
[self.view.window makeFirstResponder:nil];
[self.delegate triggerAdvancedOptions];
}
......
......@@ -118,6 +118,7 @@ typedef NS_ENUM(NSInteger, TagViews) {
}
- (IBAction)triggerAdwancedSettings: (NSButton *)sender {
[self.view.window makeFirstResponder:nil];
[self.delegate triggerAdvancedOptions];
}
......@@ -261,15 +262,13 @@ typedef NS_ENUM(NSInteger, TagViews) {
#pragma mark - NSTextFieldDelegate delegate methods
- (void)controlTextDidChange:(NSNotification *)notif
-(void)controlTextDidEndEditing:(NSNotification *)notification
{
NSTextField* textField = [notif object];
NSTextField* textField = [notification object];
if (textField.tag != DISPLAYNAME) {
return;
}
NSString* displayName = textField.stringValue;
[NSObject cancelPreviousPerformRequestsWithTarget:self];
self.accountModel->setAlias(self.selectedAccountID, QString::fromNSString(displayName));
lrc::api::account::ConfProperties_t accountProperties = self.accountModel->getAccountConfig(self.selectedAccountID);
self.accountModel->setAccountConfig(self.selectedAccountID, accountProperties);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment