Commit b90f92af authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

Add contact: check if MAC contacts is available

Do not show msg about adding to ICloud contacts, if MAC address book
is not available.

Change-Id: If2901b7e60380da86a1090fcbe3ad905b67ae8ad
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent 065aaf26
......@@ -34,6 +34,8 @@
#import "delegates/ImageManipulationDelegate.h"
#import "backends/AddressBookBackend.h"
#import <AddressBook/AddressBook.h>
class OnlyPersonProxyModel : public QSortFilterProxyModel
{
public:
......@@ -58,6 +60,7 @@ public:
__unsafe_unretained IBOutlet NSButton *createNewContactButton;
__unsafe_unretained IBOutlet NSComboBox *categoryComboBox;
__unsafe_unretained IBOutlet NSView *linkToExistingSubview;
__unsafe_unretained IBOutlet NSView *addCloudContactMsg;
QSortFilterProxyModel* contactProxyModel;
QNSTreeController* treeController;
......@@ -139,6 +142,9 @@ NSInteger const DETAILS_TAG = 300;
- (IBAction)presentNewContactForm:(id)sender {
[createContactSubview setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
//[createContactSubview setBounds:linkToExistingSubview.bounds];
BOOL shoudHide = [ABAddressBook sharedAddressBook] == nil;
[addCloudContactMsg setHidden:shoudHide];
[createContactSubview setFrame:linkToExistingSubview.frame];
[linkToExistingSubview setHidden:YES];
[self.view addSubview:createContactSubview];
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="16A313a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D30a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PersonLinkerVC">
<connections>
<outlet property="addCloudContactMsg" destination="TQq-By-akw" id="P1I-KU-vMh"/>
<outlet property="categoryComboBox" destination="MFf-kv-pz3" id="a2g-cf-dcv"/>
<outlet property="contactMethodLabel" destination="8pP-Sy-Vkd" id="UGZ-bY-lDO"/>
<outlet property="createContactSubview" destination="6M0-sm-haN" id="Ba5-9R-6fh"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment