blob: 463e0f76cb9e2d2cb92d86b54f1d23fcf8994625 [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;
Kateryna Kostiukc7e68f32019-10-09 16:15:45 -040029__unsafe_unretained IBOutlet NSButton* connectToManager;
30__unsafe_unretained IBOutlet NSLayoutConstraint* viewBottomConstraint;
Kateryna Kostiukecaa3952018-07-13 16:00:34 -040031
32}
Loïc Siretfcb4ca62016-09-21 17:12:09 -040033
34@synthesize delegate;
35
Kateryna Kostiukc7e68f32019-10-09 16:15:45 -040036- (void)showInitialwithCancell:(BOOL)showCancel {
Kateryna Kostiuk23222fe2018-11-16 14:28:02 -050037 self.isCancelable = showCancel;
Kateryna Kostiukc7e68f32019-10-09 16:15:45 -040038 [self.view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
39 [createSIPAccount setHidden: YES];
40 [connectToManager setHidden: YES];
41 viewBottomConstraint.constant = showCancel ? 25 : 0;
Kateryna Kostiuk23222fe2018-11-16 14:28:02 -050042}
43
Loïc Siretfcb4ca62016-09-21 17:12:09 -040044- (IBAction)createRingAccount:(id)sender
45{
46 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
47 [delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_NEW];
48 }
49}
50
Kateryna Kostiuk707c7ac2020-09-18 11:27:13 -040051- (IBAction)createRendezvousAccount:(id)sender
52{
53 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
54 [delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_RENDEZVOUS];
55 }
56}
57
Kateryna Kostiukc7e68f32019-10-09 16:15:45 -040058- (IBAction)importFromArchive:(id)sender
Loïc Siretfcb4ca62016-09-21 17:12:09 -040059{
60 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
Kateryna Kostiukc7e68f32019-10-09 16:15:45 -040061 [delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_IMPORT_FROM_ADCHIVE];
62 }
63}
64
65- (IBAction)importFromDevice:(id)sender
66{
67 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
68 [delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_IMPORT_FROM_DEVICE];
69 }
70}
71
72- (IBAction)connectToAccountManager:(id)sender
73{
74 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
75 [delegate didCompleteWithAction:WizardAction::WIZARD_ACTION_ACCOUNT_MANAGER];
Loïc Siretfcb4ca62016-09-21 17:12:09 -040076 }
77}
78
79- (IBAction)onCancel:(id)sender
80{
81 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
82 [delegate didCompleteWithAction:WIZARD_ACTION_INVALID];
83 }
84}
85
Kateryna Kostiukc7e68f32019-10-09 16:15:45 -040086- (IBAction)expandAdwanced:(id)sender
Kateryna Kostiukecaa3952018-07-13 16:00:34 -040087{
88 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
Kateryna Kostiukc7e68f32019-10-09 16:15:45 -040089 [createSIPAccount setHidden: !createSIPAccount.isHidden];
90 [connectToManager setHidden: !connectToManager.isHidden];
Kateryna Kostiukecaa3952018-07-13 16:00:34 -040091 [delegate didCompleteWithAction:WIZARD_ACTION_ADVANCED];
92 }
Kateryna Kostiukecaa3952018-07-13 16:00:34 -040093}
94
95- (IBAction)addSIPAccount:(id)sender
96{
97 if ([self.delegate respondsToSelector:@selector(didCompleteWithAction:)]){
98 [delegate didCompleteWithAction:WIZARD_ACTION_SIP_ACCOUNT];
99 }
100}
101
Loïc Siretfcb4ca62016-09-21 17:12:09 -0400102@end