add default settings

This commit is contained in:
Jehan Monnier 2011-02-04 14:54:24 +01:00
parent 57ff6ba06f
commit bbea0544cc
4 changed files with 19 additions and 6 deletions

View file

@ -1,6 +1,6 @@
/* IncallViewController.h
/* FirstLoginViewController.h
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
* 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

View file

@ -1,6 +1,6 @@
/* IncallViewController.h
/* FirstLoginViewController.m
*
* Copyright (C) 2009 Belledonne Comunications, Grenoble, France
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
* 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
@ -79,7 +79,7 @@
}
-(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain {
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"enable_first_login_view_preference"];
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"enable_first_login_view_preference"];
[self.parentViewController dismissModalViewControllerAnimated:true];
[self.activityIndicator setHidden:true];
[[LinphoneManager instance] setRegistrationDelegate:nil];

View file

@ -82,7 +82,7 @@
- (void)viewDidAppear:(BOOL)animated {
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
[mute reset];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enable_first_login_view_preference"] == false) {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enable_first_login_view_preference"] == true) {
myFirstLoginViewController = [[FirstLoginViewController alloc] initWithNibName:@"FirstLoginViewController"
bundle:[NSBundle mainBundle]];
[[LinphoneManager instance] setRegistrationDelegate:myFirstLoginViewController];

View file

@ -43,8 +43,21 @@
[[LinphoneManager instance] becomeActive];
}
- (void) loadDefaultSettings {
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"NO", @"enable_first_login_view_preference", //
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
/*
*Custumization
*/
[self loadDefaultSettings];
//as defined in PhoneMainView.xib
//dialer
myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX];