Loïc Siret | fcb4ca6 | 2016-09-21 17:12:09 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015-2016 Savoir-faire Linux Inc. |
| 3 | * Author: Loïc Siret <loic.siret@savoirfairelinux.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | */ |
| 19 | |
| 20 | #import "RingWizardChooseVC.h" |
| 21 | |
| 22 | @interface RingWizardChooseVC() |
| 23 | |
| 24 | @end |
| 25 | |
Kateryna Kostiuk | ecaa395 | 2018-07-13 16:00:34 -0400 | [diff] [blame^] | 26 | @implementation RingWizardChooseVC { |
| 27 | |
| 28 | __unsafe_unretained IBOutlet NSButton* createSIPAccount; |
| 29 | |
| 30 | } |
Loïc Siret | fcb4ca6 | 2016-09-21 17:12:09 -0400 | [diff] [blame] | 31 | |
| 32 | @synthesize delegate; |
| 33 | |
Kateryna Kostiuk | ecaa395 | 2018-07-13 16:00:34 -0400 | [diff] [blame^] | 34 | - (void)viewDidLoad { |
| 35 | [super viewDidLoad]; |
| 36 | [self.view setAutoresizingMask: NSViewHeightSizable]; |
| 37 | } |
| 38 | |
Loïc Siret | fcb4ca6 | 2016-09-21 17:12:09 -0400 | [diff] [blame] | 39 | - (void)showCancelButton:(BOOL)showCancel{ |
| 40 | self.isCancelable = showCancel; |
Kateryna Kostiuk | ecaa395 | 2018-07-13 16:00:34 -0400 | [diff] [blame^] | 41 | [createSIPAccount setHidden: YES]; |
| 42 | } |
| 43 | |
| 44 | - (void)showAdvancedButton:(BOOL)showAdvanced { |
| 45 | self.withAdvancedOptions = showAdvanced; |
Loïc Siret | fcb4ca6 | 2016-09-21 17:12:09 -0400 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | - (IBAction)createRingAccount:(id)sender |
| 49 | { |
| 50 | if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){ |
| 51 | [delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_NEW]; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | - (IBAction)linkExistingRingAccount:(id)sender |
| 56 | { |
| 57 | if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){ |
| 58 | [delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_LINK]; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | - (IBAction)onCancel:(id)sender |
| 63 | { |
| 64 | if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){ |
| 65 | [delegate didCompleteWithAction:WIZARD_ACTION_INVALID]; |
| 66 | } |
| 67 | } |
| 68 | |
Kateryna Kostiuk | ecaa395 | 2018-07-13 16:00:34 -0400 | [diff] [blame^] | 69 | - (IBAction)showCreateSIP:(id)sender |
| 70 | { |
| 71 | if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){ |
| 72 | [delegate didCompleteWithAction:WIZARD_ACTION_ADVANCED]; |
| 73 | } |
| 74 | [createSIPAccount setHidden: NO]; |
| 75 | } |
| 76 | |
| 77 | - (IBAction)addSIPAccount:(id)sender |
| 78 | { |
| 79 | if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){ |
| 80 | [delegate didCompleteWithAction:WIZARD_ACTION_SIP_ACCOUNT]; |
| 81 | } |
| 82 | } |
| 83 | |
Loïc Siret | fcb4ca6 | 2016-09-21 17:12:09 -0400 | [diff] [blame] | 84 | @end |