Hide edit button in history view if it is empty

This commit is contained in:
Gautier Pelloux-Prayer 2014-11-07 17:09:35 +01:00
parent b076a58a3a
commit 1b57057d2d

View file

@ -88,8 +88,8 @@ static UICompositeViewDescription *compositeDescription = nil;
}
[deleteButton setHidden:TRUE];
[editButton setOff];
[self changeView: History_All];
[self changeView: History_All];
// Reset missed call
linphone_core_reset_missed_calls_count([LinphoneManager getLc]);
// Fake event
@ -98,6 +98,8 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
editButton.hidden = ([[tableView dataSource] tableView:tableView numberOfRowsInSection:0] == 0);
if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) {
[tableController viewDidAppear:animated];
}
@ -160,6 +162,8 @@ static UICompositeViewDescription *compositeDescription = nil;
} else {
missedButton.selected = FALSE;
}
editButton.hidden = ([[tableView dataSource] tableView:tableView numberOfRowsInSection:0] == 0);
}
@ -181,6 +185,7 @@ static UICompositeViewDescription *compositeDescription = nil;
- (IBAction)onDeleteClick:(id) event {
linphone_core_clear_call_logs([LinphoneManager getLc]);
[tableController loadData];
editButton.hidden = ([[tableView dataSource] tableView:tableView numberOfRowsInSection:0] == 0);
if([editButton isSelected]) {
[editButton toggle];
[self onEditClick:nil];