Disable video button and hide video when compiled without video

This commit is contained in:
Yann Diorcet 2012-09-26 17:51:03 +02:00
parent efcc6c9f35
commit e6207f08b1
3 changed files with 11 additions and 2 deletions

View file

@ -25,6 +25,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
@implementation LinphoneCoreSettingsStore
- (void)handleMigration {
NSUserDefaults *oldconfig=[NSUserDefaults standardUserDefaults];
NSArray *allkeys=[[oldconfig dictionaryRepresentation] allKeys];
@ -39,8 +40,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
- (id)init {
self = [super init];
if (self){
dict=[[NSMutableDictionary alloc] init];
changedDict=[[NSMutableDictionary alloc] init];
dict = [[NSMutableDictionary alloc] init];
changedDict = [[NSMutableDictionary alloc] init];
[self transformLinphoneCoreToKeys];
LinphoneCore *lc=[LinphoneManager getLc];
if (lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY,"config_migrated",0) == 0) {

View file

@ -104,6 +104,7 @@
- (bool)onUpdate {
if([LinphoneManager isLcReady]) {
bool val = false;
#ifdef VIDEO_ENABLED
if(linphone_core_video_enabled([LinphoneManager getLc])) {
LinphoneCall* currentCall = linphone_core_get_current_call([LinphoneManager getLc]);
if (currentCall) {
@ -141,6 +142,9 @@
[self setEnabled:FALSE];
[waitView stopAnimating];
}
#else //VIDEO_ENABLED
[self setEnabled:FALSE];
#endif //VIDEO_ENABLED
return val;
} else {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update video button: Linphone core not ready"];

View file

@ -542,6 +542,10 @@ static UICompositeViewDescription *compositeDescription = nil;
[hiddenKeys addObject:@"enable_first_login_view_preference"];
#ifndef VIDEO_ENABLED
[hiddenKeys addObject:@"enable_video_preference"];
#endif //VIDEO_ENABLED
if (!linphone_core_video_enabled([LinphoneManager getLc])) {
[hiddenKeys addObject:@"video_menu"];
}