Read_only_native_address_book condition (Config RC)

This commit is contained in:
Benoit Martins 2023-05-04 17:27:17 +02:00
parent 9eb2e5609e
commit 5523ddf0f1
4 changed files with 19 additions and 3 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -12,6 +12,7 @@
<connections>
<outlet property="addButton" destination="6" id="91"/>
<outlet property="allButton" destination="4" id="27"/>
<outlet property="deleteButton" destination="DZc-zR-1Q7" id="M6N-vO-UIb"/>
<outlet property="ldapMoreResultsLabel" destination="cDH-mL-cHP" id="3d9-gp-Hog"/>
<outlet property="linphoneButton" destination="5" id="31"/>
<outlet property="loadingLabel" destination="qSa-Ba-dq9" id="CPa-pO-OQD"/>

View file

@ -53,6 +53,7 @@ typedef enum _ContactSelectionMode { ContactSelectionModeNone, ContactSelectionM
@property(nonatomic, strong) IBOutlet UIButton *allButton;
@property(nonatomic, strong) IBOutlet UIButton *linphoneButton;
@property(nonatomic, strong) IBOutlet UIButton *addButton;
@property(nonatomic, strong) IBOutlet UIButton *deleteButton;
@property(strong, nonatomic) IBOutlet UISearchBar *searchBar;
@property(weak, nonatomic) IBOutlet UIImageView *selectedButtonImage;
@property (weak, nonatomic) IBOutlet UIInterfaceStyleButton *toggleSelectionButton;

View file

@ -60,6 +60,7 @@ static BOOL addAddressFromOthers = FALSE;
@synthesize allButton;
@synthesize linphoneButton;
@synthesize addButton;
@synthesize deleteButton;
@synthesize topBar;
typedef enum { ContactsAll, ContactsLinphone, ContactsMAX } ContactsCategory;
@ -237,7 +238,11 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)refreshButtons {
[addButton setHidden:![LinphoneManager.instance lpConfigBoolForKey:@"enable_native_address_book"]];
[addButton setHidden:![LinphoneManager.instance lpConfigBoolForKey:@"enable_native_address_book"] || [LinphoneManager.instance lpConfigBoolForKey:@"read_only_native_address_book"]];
if ([LinphoneManager.instance lpConfigBoolForKey:@"read_only_native_address_book"]) {
addButton.hidden = true;
deleteButton.hidden = true;
}
[self changeView:[ContactSelection getSipFilterEnabled] ? ContactsLinphone : ContactsAll];
}
@ -287,6 +292,10 @@ static UICompositeViewDescription *compositeDescription = nil;
if ([LinphoneManager.instance lpConfigBoolForKey:@"enable_native_address_book"]) {
addButton.hidden = self.tableController.isEditing;
}
if ([LinphoneManager.instance lpConfigBoolForKey:@"read_only_native_address_book"]) {
addButton.hidden = true;
deleteButton.hidden = true;
}
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {

View file

@ -23,6 +23,11 @@ force_lime_chat_rooms=0
disable_chat_feature=0
disable_video_feature=0
enable_native_address_book=1
read_only_native_address_book=0
only_show_sip_contacts_list=0
hide_sip_contacts_list=0
[in_app_purchase]
#set to 1 if in-app purchases are to be shown in the application
enabled=0