blob: 47ceee3a15f063364754d8cc82fe1d46954e0c2b [file] [log] [blame]
Loïc Siretfcb4ca62016-09-21 17:12:09 -04001/*
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 Kostiukecaa3952018-07-13 16:00:34 -040026@implementation RingWizardChooseVC {
27
28__unsafe_unretained IBOutlet NSButton* createSIPAccount;
29
30}
Loïc Siretfcb4ca62016-09-21 17:12:09 -040031
32@synthesize delegate;
33
Kateryna Kostiukecaa3952018-07-13 16:00:34 -040034- (void)viewDidLoad {
35 [super viewDidLoad];
36 [self.view setAutoresizingMask: NSViewHeightSizable];
37}
38
Loïc Siretfcb4ca62016-09-21 17:12:09 -040039- (void)showCancelButton:(BOOL)showCancel{
40 self.isCancelable = showCancel;
Kateryna Kostiukecaa3952018-07-13 16:00:34 -040041 [createSIPAccount setHidden: YES];
42}
43
44- (void)showAdvancedButton:(BOOL)showAdvanced {
45 self.withAdvancedOptions = showAdvanced;
Loïc Siretfcb4ca62016-09-21 17:12:09 -040046}
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 Kostiukecaa3952018-07-13 16:00:34 -040069- (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 Siretfcb4ca62016-09-21 17:12:09 -040084@end