implement new conversation list
This patch is an implementation of the conversation list using the
conversation model recently introduced in LRC.
- Unused HistoryVC and PersonsVC are removed from the code base as we
are switching to a one list design.
- Setting a conversation model on SmartListVC switches the displayed
list.
- Actions such as selecting a conversation, double clicking, call
button and searching are also implemented (from the LRC point of
view which may not yet be visible for user as of this patch).
- As the new view is based on NSTableView rather than NSOutlineView,
a RingTableView class is introduced based on RingOutlineView code.
- The call button at the right of the search field is removed.
Change-Id: I668f102f435048d3c85efd22d1ab31b395139215
Reviewed-by: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e446b7a..07023d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -130,10 +130,6 @@
src/VideoPrefsVC.mm
src/VideoPrefsVC.h
src/GeneralPrefsVC.h
- src/HistoryVC.mm
- src/HistoryVC.h
- src/PersonsVC.mm
- src/PersonsVC.h
src/ChatVC.mm
src/ChatVC.h
src/PersonLinkerVC.mm
@@ -190,6 +186,8 @@
src/views/ITProgressIndicator.h
src/views/RingOutlineView.mm
src/views/RingOutlineView.h
+ src/views/RingTableView.mm
+ src/views/RingTableView.h
src/views/RingIDField.mm
src/views/RingIDField.h
src/views/HoverTableRowView.mm
@@ -230,7 +228,8 @@
src/delegates/ImageManipulationDelegate.mm
src/delegates/ImageManipulationDelegate.h
src/AccountSelectionManager.h
- src/AccountSelectionManager.mm)
+ src/AccountSelectionManager.mm
+ src/utils.h)
SET(ringclient_XIBS
diff --git a/src/HistoryVC.h b/src/HistoryVC.h
deleted file mode 100644
index b353ddc..0000000
--- a/src/HistoryVC.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2015-2016 Savoir-faire Linux Inc.
- * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-#import <Cocoa/Cocoa.h>
-
-#import "views/RingOutlineView.h"
-
-@interface HistoryVC : NSViewController <NSOutlineViewDelegate, ContextMenuDelegate>
-
-@end
diff --git a/src/HistoryVC.mm b/src/HistoryVC.mm
deleted file mode 100644
index 520ef86..0000000
--- a/src/HistoryVC.mm
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (C) 2015-2016 Savoir-faire Linux Inc.
- * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#import "HistoryVC.h"
-
-//Qt
-#import <QSortFilterProxyModel>
-#import <QtMacExtras/qmacfunctions.h>
-#import <QPixmap>
-
-//LRC
-#import <categorizedhistorymodel.h>
-#import <callmodel.h>
-#import <call.h>
-#import <person.h>
-#import <contactmethod.h>
-#import <globalinstances.h>
-#import <personmodel.h>
-#import <peerprofilecollection.h>
-
-#import "QNSTreeController.h"
-#import "PersonLinkerVC.h"
-#import "views/HoverTableRowView.h"
-#import "delegates/ImageManipulationDelegate.h"
-
-@interface HistoryVC() <NSPopoverDelegate, KeyboardShortcutDelegate, ContactLinkedDelegate> {
-
- QNSTreeController *treeController;
- IBOutlet RingOutlineView *historyView;
- QSortFilterProxyModel *historyProxyModel;
- NSPopover* addToContactPopover;
-}
-
-@end
-
-@implementation HistoryVC
-
-// Tags for Views
-NSInteger const DIRECTION_TAG = 100;
-NSInteger const DISPLAYNAME_TAG = 200;
-NSInteger const DETAILS_TAG = 300;
-NSInteger const PHOTO_TAG = 400;
-
-- (void)awakeFromNib
-{
- NSLog(@"INIT HVC");
- historyProxyModel = new QSortFilterProxyModel(&CategorizedHistoryModel::instance());
- historyProxyModel->setSourceModel(&CategorizedHistoryModel::instance());
- historyProxyModel->setSortRole(static_cast<int>(Call::Role::Date));
- historyProxyModel->sort(0,Qt::DescendingOrder);
- treeController = [[QNSTreeController alloc] initWithQModel:historyProxyModel];
-
- [treeController setAvoidsEmptySelection:NO];
- [treeController setChildrenKeyPath:@"children"];
-
- [historyView bind:@"content" toObject:treeController withKeyPath:@"arrangedObjects" options:nil];
- [historyView bind:@"sortDescriptors" toObject:treeController withKeyPath:@"sortDescriptors" options:nil];
- [historyView bind:@"selectionIndexPaths" toObject:treeController withKeyPath:@"selectionIndexPaths" options:nil];
- [historyView setTarget:self];
- [historyView setDoubleAction:@selector(placeHistoryCall:)];
- [historyView setContextMenuDelegate:self];
- [historyView setShortcutsDelegate:self];
-
- QObject::connect(&CallModel::instance(),
- &CategorizedHistoryModel::dataChanged,
- [=](const QModelIndex &topLeft, const QModelIndex &bottomRight) {
- [historyView reloadDataForRowIndexes:
- [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(topLeft.row(), bottomRight.row() + 1)]
- columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, historyView.tableColumns.count)]];
- });
-}
-
-- (void) dealloc
-{
- delete historyProxyModel;
-}
-
-- (void)placeHistoryCall:(id)sender
-{
- if([[treeController selectedNodes] count] > 0) {
- auto item = [treeController selectedNodes][0];
- QModelIndex qIdx = [treeController toQIdx:item];
- if (!qIdx.parent().isValid()) {
- if ([historyView isItemExpanded:item]) {
- [[historyView animator] collapseItem:item];
- } else
- [[historyView animator] expandItem:item];
- return;
- }
- QVariant var = historyProxyModel->data(qIdx, (int)Call::Role::ContactMethod);
- ContactMethod* m = qvariant_cast<ContactMethod*>(var);
- if(m){
- auto c = CallModel::instance().dialingCall();
- c->setPeerContactMethod(m);
- c << Call::Action::ACCEPT;
- CallModel::instance().selectCall(c);
- }
- }
-}
-
-#pragma mark - NSOutlineViewDelegate methods
-
-// -------------------------------------------------------------------------------
-// shouldSelectItem:item
-// -------------------------------------------------------------------------------
-- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
-{
- return YES;
-}
-
-// -------------------------------------------------------------------------------
-// shouldEditTableColumn:tableColumn:item
-//
-// Decide to allow the edit of the given outline view "item".
-// -------------------------------------------------------------------------------
-- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
-{
- return NO;
-}
-
-- (NSImage*) image:(NSImage*) img withTintedWithColor:(NSColor *)tint
-{
- if (tint) {
- [img lockFocus];
- [tint set];
- NSRect imageRect = {NSZeroPoint, [img size]};
- NSRectFillUsingOperation(imageRect, NSCompositeSourceAtop);
- [img unlockFocus];
- }
- return img;
-}
-
-/* View Based OutlineView: See the delegate method -tableView:viewForTableColumn:row: in NSTableView.
- */
-- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
-
- NSTableCellView* result;
- if(!qIdx.parent().isValid()) {
- result = [outlineView makeViewWithIdentifier:@"CategoryCell" owner:outlineView];
-
- } else {
- result = [outlineView makeViewWithIdentifier:@"HistoryCell" owner:outlineView];
- NSImageView* directionView = [result viewWithTag:DIRECTION_TAG];
-
- if (qvariant_cast<Call::Direction>(qIdx.data((int)Call::Role::Direction)) == Call::Direction::INCOMING) {
- if (qvariant_cast<Boolean>(qIdx.data((int) Call::Role::Missed))) {
- [directionView setImage:[self image:[NSImage imageNamed:@"ic_call_missed"] withTintedWithColor:[NSColor redColor]]];
- } else {
- [directionView setImage:[self image:[NSImage imageNamed:@"ic_call_received"]
- withTintedWithColor:[NSColor colorWithCalibratedRed:116/255.0 green:179/255.0 blue:93/255.0 alpha:1.0]]];
- }
- } else {
- if (qvariant_cast<Boolean>(qIdx.data((int) Call::Role::Missed))) {
- [directionView setImage:[self image:[NSImage imageNamed:@"ic_call_missed"] withTintedWithColor:[NSColor redColor]]];
- } else {
- [directionView setImage:[self image:[NSImage imageNamed:@"ic_call_made"]
- withTintedWithColor:[NSColor colorWithCalibratedRed:116/255.0 green:179/255.0 blue:93/255.0 alpha:1.0]]];
- }
- }
-
- auto call = qvariant_cast<Call*>(qIdx.data((int)Call::Role::Object));
-
- NSImageView* photoView = [result viewWithTag:PHOTO_TAG];
- [photoView setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(qIdx.data(Qt::DecorationRole)))];
-
- NSTextField* details = [result viewWithTag:DETAILS_TAG];
- [details setStringValue:qIdx.data((int)Call::Role::FormattedDate).toString().toNSString()];
- }
-
- NSTextField* displayName = [result viewWithTag:DISPLAYNAME_TAG];
- [displayName setStringValue:qIdx.data(Qt::DisplayRole).toString().toNSString()];
-
- return result;
-}
-
-- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
- if(!qIdx.parent().isValid()) {
- return 35.0;
- } else {
- return 48.0;
- }
-}
-
-/* View Based OutlineView: See the delegate method -tableView:rowViewForRow: in NSTableView.
- */
-- (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
-
- HoverTableRowView* result = [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil];
- if(!qIdx.parent().isValid()) {
- [result setHighlightable:NO];
- } else
- [result setHighlightable:YES];
-
- return result;
-}
-
-#pragma mark - ContextMenuDelegate
-
-- (NSMenu*) contextualMenuForIndex:(NSTreeNode*) item
-{
-
- QModelIndex qIdx = [treeController toQIdx:item];
- if (!qIdx.isValid()) {
- return nil;
- }
-
- const auto& var = qIdx.data(static_cast<int>(Call::Role::Object));
- if (qIdx.parent().isValid() && var.isValid()) {
- if (auto call = var.value<Call *>()) {
- auto contactmethod = call->peerContactMethod();
- if (!contactmethod->contact() || contactmethod->contact()->isPlaceHolder()) {
- NSMenu *theMenu = [[NSMenu alloc]
- initWithTitle:@""];
- NSMenuItem* addContactItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Add to contacts", @"Contextual menu action")
- action:@selector(addContactForRow:)
- keyEquivalent:@""];
-
- [addContactItem setRepresentedObject:item];
- [theMenu addItem:addContactItem];
- return theMenu;
- }
- }
- }
- return nil;
-}
-
-- (void) addToContact
-{
- ContactMethod* contactmethod = nullptr;
- if([[treeController selectedNodes] count] > 0) {
- QModelIndex qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
- const auto& var = qIdx.data(static_cast<int>(Call::Role::Object));
- if (qIdx.parent().isValid() && var.isValid()) {
- if (auto call = var.value<Call *>()) {
- contactmethod = call->peerContactMethod();
- }
- }
- }
-
- // TODO: Uncomment to reuse contact name editing popover
-// if (addToContactPopover != nullptr) {
-// [addToContactPopover performClose:self];
-// addToContactPopover = NULL;
-// } else if (contactmethod) {
-// auto* editorVC = [[PersonLinkerVC alloc] initWithNibName:@"PersonLinker" bundle:nil];
-// [editorVC setMethodToLink:contactmethod];
-// [editorVC setContactLinkedDelegate:self];
-// addToContactPopover = [[NSPopover alloc] init];
-// [addToContactPopover setContentSize:editorVC.view.frame.size];
-// [addToContactPopover setContentViewController:editorVC];
-// [addToContactPopover setAnimates:YES];
-// [addToContactPopover setBehavior:NSPopoverBehaviorTransient];
-// [addToContactPopover setDelegate:self];
-//
-// [addToContactPopover showRelativeToRect:[historyView frameOfOutlineCellAtRow:[historyView selectedRow]] ofView:historyView preferredEdge:NSMaxXEdge];
-// }
-
- auto* newPerson = new Person();
- newPerson->setFormattedName(contactmethod->bestName());
-
- Person::ContactMethods numbers;
- numbers << contactmethod;
- newPerson->setContactMethods(numbers);
- contactmethod->setPerson(newPerson);
-
- auto personCollections = PersonModel::instance().collections();
- CollectionInterface *peerProfileCollection = nil;
- foreach(auto collection, personCollections) {
- if(dynamic_cast<PeerProfileCollection*>(collection))
- peerProfileCollection = collection;
- }
- if(peerProfileCollection) {
- PersonModel::instance().addNewPerson(newPerson, peerProfileCollection);
- }
-}
-
-- (void) addContactForRow:(id) sender
-{
- NSInteger row = [historyView rowForItem:[sender representedObject]];
- if(row < 0) {
- return;
- }
- [historyView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
- [self addToContact];
-}
-
-#pragma mark - NSPopOverDelegate
-
-- (void)popoverDidClose:(NSNotification *)notification
-{
- if (addToContactPopover != nullptr) {
- [addToContactPopover performClose:self];
- addToContactPopover = NULL;
- }
-}
-
-#pragma mark - ContactLinkedDelegate
-
-- (void)contactLinked
-{
- if (addToContactPopover != nullptr) {
- [addToContactPopover performClose:self];
- addToContactPopover = NULL;
- }
-}
-
-#pragma mark - KeyboardShortcutDelegate
-
-- (void) onAddShortcut
-{
- if([[treeController selectedNodes] count] > 0) {
- QModelIndex qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
- const auto& var = qIdx.data(static_cast<int>(Call::Role::Object));
- if (qIdx.parent().isValid() && var.isValid()) {
- if (auto call = var.value<Call *>()) {
- auto contactmethod = call->peerContactMethod();
- if (!contactmethod->contact() || contactmethod->contact()->isPlaceHolder()) {
- [self addToContact];
- }
- }
- }
- }
-}
-
-@end
diff --git a/src/PersonsVC.mm b/src/PersonsVC.mm
deleted file mode 100644
index 0e01929..0000000
--- a/src/PersonsVC.mm
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (C) 2015-2016 Savoir-faire Linux Inc.
- * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#import "PersonsVC.h"
-
-
-//Qt
-#import <QSortFilterProxyModel>
-#import <QtMacExtras/qmacfunctions.h>
-#import <QPixmap>
-
-//LRC
-#import <person.h>
-#import <personmodel.h>
-#import <callmodel.h>
-#import <contactmethod.h>
-#import <categorizedcontactmodel.h>
-#import <globalinstances.h>
-
-#import "backends/AddressBookBackend.h"
-#import "QNSTreeController.h"
-#import "delegates/ImageManipulationDelegate.h"
-#import "views/HoverTableRowView.h"
-#import "views/ContextualTableCellView.h"
-
-#import <AddressBook/AddressBook.h>
-
-class ReachablePersonModel : public QSortFilterProxyModel
-{
-public:
- ReachablePersonModel(QAbstractItemModel* parent) : QSortFilterProxyModel(parent)
- {
- setSourceModel(parent);
- }
- virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
- {
- return sourceModel()->index(source_row,0,source_parent).flags() & Qt::ItemIsEnabled;
- }
-};
-
-
-@interface PersonsVC () {
-
- QNSTreeController *treeController;
- __unsafe_unretained IBOutlet RingOutlineView *personsView;
- QSortFilterProxyModel *contactProxyModel;
-
-}
-
-@end
-
-@implementation PersonsVC
-
-// Tags for views
-NSInteger const IMAGE_TAG = 100;
-NSInteger const DISPLAYNAME_TAG = 200;
-NSInteger const DETAILS_TAG = 300;
-NSInteger const CALL_BUTTON_TAG = 400;
-
--(void) awakeFromNib
-{
- NSLog(@"INIT PersonsVC");
- contactProxyModel = new ReachablePersonModel(&CategorizedContactModel::instance());
- contactProxyModel->setSortRole(static_cast<int>(Qt::DisplayRole));
- contactProxyModel->sort(0,Qt::AscendingOrder);
- treeController = [[QNSTreeController alloc] initWithQModel:contactProxyModel];
-
- [treeController setAvoidsEmptySelection:NO];
- [treeController setChildrenKeyPath:@"children"];
-
- [personsView bind:@"content" toObject:treeController withKeyPath:@"arrangedObjects" options:nil];
- [personsView bind:@"sortDescriptors" toObject:treeController withKeyPath:@"sortDescriptors" options:nil];
- [personsView bind:@"selectionIndexPaths" toObject:treeController withKeyPath:@"selectionIndexPaths" options:nil];
- [personsView setTarget:self];
- [personsView setDoubleAction:@selector(callContact:)];
- [personsView setContextMenuDelegate:self];
-
- CategorizedContactModel::instance().setUnreachableHidden(YES);
-}
-
-- (void) dealloc
-{
- delete contactProxyModel;
-}
-
-- (IBAction)callContact:(id)sender
-{
- if([[treeController selectedNodes] count] > 0) {
- auto item = [treeController selectedNodes][0];
- QModelIndex qIdx = [treeController toQIdx:item];
- ContactMethod* m = nil;
- if (!qIdx.parent().isValid()) {
- if ([personsView isItemExpanded:item]) {
- [[personsView animator] collapseItem:item];
- } else
- [[personsView animator] expandItem:item];
- return;
- }
- if(((NSTreeNode*)[treeController selectedNodes][0]).indexPath.length == 2) {
- // Person
- QVariant var = qIdx.data((int)Person::Role::Object);
- if (var.isValid()) {
- Person *c = var.value<Person*>();
- if (c->phoneNumbers().size() > 0) {
- m = c->phoneNumbers().first();
- }
- }
- } else if (((NSTreeNode*)[treeController selectedNodes][0]).indexPath.length == 3) {
- //ContactMethod
- QVariant var = qIdx.data(static_cast<int>(ContactMethod::Role::Object));
- if (var.isValid()) {
- m = var.value<ContactMethod *>();
- }
- }
-
- if(m){
- Call* c = CallModel::instance().dialingCall();
- c->setPeerContactMethod(m);
- c << Call::Action::ACCEPT;
- CallModel::instance().selectCall(c);
- }
- }
-}
-
-#pragma mark - NSOutlineViewDelegate methods
-
-// -------------------------------------------------------------------------------
-// shouldSelectItem:item
-// -------------------------------------------------------------------------------
-- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
- if(!qIdx.isValid())
- return NO;
-
- return YES;
-}
-
-// -------------------------------------------------------------------------------
-// shouldEditTableColumn:tableColumn:item
-//
-// Decide to allow the edit of the given outline view "item".
-// -------------------------------------------------------------------------------
-- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
-{
- return NO;
-}
-
-/* View Based OutlineView: See the delegate method -tableView:viewForTableColumn:row: in NSTableView.
- */
-- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
-
- NSTableCellView *result;
-
- NSString* displayNameString = qIdx.data(Qt::DisplayRole).toString().toNSString();
- if(!qIdx.parent().isValid()) {
- result = [outlineView makeViewWithIdentifier:@"LetterCell" owner:outlineView];
- [result setWantsLayer:YES];
- [result setLayer:[CALayer layer]];
- } else if(((NSTreeNode*)item).indexPath.length == 2) {
- result = [outlineView makeViewWithIdentifier:@"PersonCell" owner:outlineView];
- NSImageView* photoView = [result viewWithTag:IMAGE_TAG];
- Person* p = qvariant_cast<Person*>(qIdx.data((int)Person::Role::Object));
-
- if(displayNameString.length == 0 && p) {
- displayNameString = qIdx.data((int)Person::Role::IdOfLastCMUsed).toString().toNSString();
- }
- [photoView setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(qIdx.data(Qt::DecorationRole)))];
-
- [((ContextualTableCellView*) result) setContextualsControls:[NSMutableArray arrayWithObject:[result viewWithTag:CALL_BUTTON_TAG]]];
- [((ContextualTableCellView*) result) setShouldBlurParentView:NO];
-
- NSTextField* details = [result viewWithTag:DETAILS_TAG];
- if (p && p->phoneNumbers().size() > 0)
- [details setStringValue:p->phoneNumbers().first()->uri().toNSString()];
- } else {
- result = [outlineView makeViewWithIdentifier:@"ContactMethodCell" owner:outlineView];
- }
-
- NSTextField* displayName = [result viewWithTag:DISPLAYNAME_TAG];
- [displayName setStringValue:displayNameString];
-
- return result;
-}
-
-/* View Based OutlineView: See the delegate method -tableView:rowViewForRow: in NSTableView.
- */
-- (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
- HoverTableRowView* result = [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil];
- if(!qIdx.parent().isValid()) {
- [result setHighlightable:NO];
- } else
- [result setHighlightable:YES];
-
- return result;
-}
-
-- (void)startCallForRow:(id)sender {
- NSInteger row = [personsView rowForView:sender];
- [personsView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
- [self callContact:nil];
-}
-
-// -------------------------------------------------------------------------------
-// outlineViewSelectionDidChange:notification
-// -------------------------------------------------------------------------------
-- (void)outlineViewSelectionDidChange:(NSNotification *)notification
-{
-
-}
-
-- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
- return (((NSTreeNode*)item).indexPath.length == 2) ? 60.0 : 20.0;
-}
-
-#pragma mark - ContextMenuDelegate
-
-- (NSMenu*) contextualMenuForIndex:(NSTreeNode*) item
-{
- QModelIndex qIdx = [treeController toQIdx:item];
- if (!qIdx.isValid()) {
- return nil;
- }
-
- if (qIdx.parent().isValid()) {
- Person* p = qvariant_cast<Person*>(qIdx.data((int)Person::Role::Object));
- if (p) {
- NSMenu *theMenu = [[NSMenu alloc] initWithTitle:@""];
- NSMenuItem* removeContactItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Delete contact", @"Contextual menu action")
- action:@selector(removeContactForRow:)
- keyEquivalent:@""];
- [removeContactItem setRepresentedObject:item];
- [theMenu addItem:removeContactItem];
- return theMenu;
- }
- }
- return nil;
-}
-
-- (void) removeContactForRow:(id) sender
-{
- QModelIndex qIdx = [treeController toQIdx:[sender representedObject]];
- if (!qIdx.isValid()) {
- return;
- }
-
- if (!qIdx.parent().isValid()) {
- return;
- }
- Person* p = qvariant_cast<Person*>(qIdx.data((int)Person::Role::Object));
- if(!p) {
- return;
- }
-
- //check if contact is from MAC address book
- ABPerson* adPerson = [[ABAddressBook sharedAddressBook] recordForUniqueId:[[NSString alloc] initWithUTF8String:p->uid().data()]];
-
- if(adPerson) {
- NSAlert *alert = [[NSAlert alloc] init];
- [alert addButtonWithTitle:@"OK"];
- [alert setMessageText:NSLocalizedString(@"Could not delete MAC contact", @"Contextual menu alert title")];
- [alert setInformativeText:NSLocalizedString(@"To delete go to MAC Contacts App", @"Contextual menu alert remove contact")];
- [alert setAlertStyle:NSAlertStyleWarning];
- [alert runModal];
- return;
- }
- NSString* name = qIdx.data(Qt::DisplayRole).toString().toNSString();
- if(name.length == 0) {
- name = qIdx.data((int)Person::Role::IdOfLastCMUsed).toString().toNSString();
- }
- NSAlert *alert = [[NSAlert alloc] init];
- [alert addButtonWithTitle:@"OK"];
- [alert addButtonWithTitle:@"Cancel"];
- [alert setMessageText:NSLocalizedString(@"Contact will be deleted", @"Contextual menu alert title")];
- NSString* allertMsg = [NSString stringWithFormat:
- NSLocalizedString(@"Are you sure you want to delete contact \"%@\"", @"Contextual menu alert remove contact {Name}"), name];
- [alert setInformativeText:allertMsg];
- [alert setAlertStyle:NSAlertStyleWarning];
-
- NSInteger answer = [alert runModal];
- if (answer == NSAlertFirstButtonReturn) {
- p->remove();
- }
-}
-
-@end
diff --git a/src/RingWindowController.h b/src/RingWindowController.h
index 6e5151d..e6cc7c9 100644
--- a/src/RingWindowController.h
+++ b/src/RingWindowController.h
@@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import <Cocoa/Cocoa.h>
-#import "HistoryVC.h"
@interface RingWindowController : NSWindowController <NSSharingServicePickerDelegate> {
IBOutlet NSView *currentView;
diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm
index 0febf3f..8838fff 100644
--- a/src/RingWindowController.mm
+++ b/src/RingWindowController.mm
@@ -48,7 +48,6 @@
#import "views/BackgroundView.h"
#import "ChooseAccountVC.h"
#import "ContactRequestVC.h"
-#import "PersonsVC.h"
@interface RingWindowController () <MigrateRingAccountsDelegate, NSToolbarDelegate>
@@ -70,7 +69,6 @@
PreferencesWC* preferencesWC;
IBOutlet SmartViewVC* smartViewVC;
- IBOutlet PersonsVC* personsVC;
CurrentCallVC* currentCallVC;
ConversationVC* offlineVC;
@@ -106,6 +104,7 @@
[currentCallVC initFrame];
[offlineVC initFrame];
+ [smartViewVC setConversationModel: [chooseAccountVC selectedAccount].conversationModel.get()];
// Fresh run, we need to make sure RingID appears
[shareButton sendActionOn:NSLeftMouseDownMask];
@@ -306,9 +305,6 @@
case 0:
[smartViewVC startCallForRow:sender];
break;
- case 2:
- [personsVC startCallForRow:sender];
- break;
default:
break;
}
diff --git a/src/SmartViewVC.h b/src/SmartViewVC.h
index 0fd05f0..6bab153 100644
--- a/src/SmartViewVC.h
+++ b/src/SmartViewVC.h
@@ -19,10 +19,18 @@
#import <Cocoa/Cocoa.h>
+namespace lrc {
+ namespace api {
+ class ConversationModel;
+ }
+}
+
@interface SmartViewVC : NSViewController <NSTextFieldDelegate>
@property (unsafe_unretained) IBOutlet NSTabView* tabbar;
+@property lrc::api::ConversationModel* conversationModel;
+
- (void)startCallForRow:(id)sender;
@end
diff --git a/src/SmartViewVC.mm b/src/SmartViewVC.mm
old mode 100644
new mode 100755
index cf7608e..e6cecfe
--- a/src/SmartViewVC.mm
+++ b/src/SmartViewVC.mm
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2015-2016 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ * Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
+ * Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
*
* 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
@@ -26,41 +28,36 @@
#import <QItemSelectionModel>
//LRC
-#import <recentmodel.h>
-#import <callmodel.h>
-#import <call.h>
-#import <uri.h>
-#import <itemdataroles.h>
-#import <namedirectory.h>
-#import <accountmodel.h>
-#import <account.h>
-#import <person.h>
-#import <contactmethod.h>
#import <globalinstances.h>
-#import <phonedirectorymodel.h>
-#import <AvailableAccountModel.h>
-#import <personmodel.h>
-#import <peerprofilecollection.h>
+#import <api/newaccountmodel.h>
+#import <api/conversationmodel.h>
+#import <api/account.h>
+#import <api/contact.h>
+#import <api/contactmodel.h>
+#import <api/newcallmodel.h>
#import "QNSTreeController.h"
#import "delegates/ImageManipulationDelegate.h"
#import "views/HoverTableRowView.h"
#import "PersonLinkerVC.h"
#import "views/IconButton.h"
-#import "views/RingOutlineView.h"
+#import "views/RingTableView.h"
#import "views/ContextualTableCellView.h"
+#import "utils.h"
-@interface SmartViewVC () <NSOutlineViewDelegate, NSPopoverDelegate, ContextMenuDelegate, ContactLinkedDelegate, KeyboardShortcutDelegate> {
+@interface SmartViewVC () <NSTableViewDelegate, NSTableViewDataSource, NSPopoverDelegate, ContextMenuDelegate, ContactLinkedDelegate, KeyboardShortcutDelegate> {
- QNSTreeController *treeController;
NSPopover* addToContactPopover;
//UI elements
- __unsafe_unretained IBOutlet RingOutlineView* smartView;
+ __unsafe_unretained IBOutlet RingTableView* smartView;
__unsafe_unretained IBOutlet NSSearchField* searchField;
/* Pending ring usernames lookup for the search entry */
- QMetaObject::Connection usernameLookupConnection;
+ QMetaObject::Connection usernameLookupConnection, modelSortedConnection_, filterChangedConnection_;
+
+ lrc::api::ConversationModel* model_;
+ std::string selectedUid_;
}
@end
@@ -82,61 +79,16 @@
- (void)awakeFromNib
{
NSLog(@"INIT SmartView VC");
+ //get selected account
+ //encapsulate conversationmodel in local version
- treeController = [[QNSTreeController alloc] initWithQModel:RecentModel::instance().peopleProxy()];
- [treeController setAvoidsEmptySelection:NO];
- [treeController setChildrenKeyPath:@"children"];
-
- [smartView bind:@"content" toObject:treeController withKeyPath:@"arrangedObjects" options:nil];
- [smartView bind:@"sortDescriptors" toObject:treeController withKeyPath:@"sortDescriptors" options:nil];
- [smartView bind:@"selectionIndexPaths" toObject:treeController withKeyPath:@"selectionIndexPaths" options:nil];
[smartView setTarget:self];
- [smartView setAction:@selector(selectRow:)];
[smartView setDoubleAction:@selector(placeCall:)];
[smartView setContextMenuDelegate:self];
[smartView setShortcutsDelegate:self];
- QObject::connect(RecentModel::instance().peopleProxy(),
- &QAbstractItemModel::dataChanged,
- [self](const QModelIndex &topLeft, const QModelIndex &bottomRight) {
- for(int row = topLeft.row() ; row <= bottomRight.row() ; ++row)
- {
- [smartView reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:row]
- columnIndexes:[NSIndexSet indexSetWithIndex:0]];
- }
- });
-
- QObject::connect(RecentModel::instance().selectionModel(),
- &QItemSelectionModel::currentChanged,
- [=](const QModelIndex ¤t, const QModelIndex &previous) {
- if(!current.isValid()) {
- [smartView deselectAll:nil];
- return;
- }
-
- auto proxyIdx = RecentModel::instance().peopleProxy()->mapFromSource(current);
- if (proxyIdx.isValid()) {
- [treeController setSelectionQModelIndex:proxyIdx];
- [tabbar selectTabViewItemAtIndex:0];
- [smartView scrollRowToVisible:proxyIdx.row()];
- }
- });
-
- QObject::connect(RecentModel::instance().peopleProxy(),
- &QAbstractItemModel::rowsInserted,
- [=](const QModelIndex &parent, int first, int last) {
- Q_UNUSED(parent)
- Q_UNUSED(first)
- Q_UNUSED(last)
- [smartView scrollRowToVisible:0];
- });
-
- QObject::connect(AvailableAccountModel::instance().selectionModel(),
- &QItemSelectionModel::currentChanged,
- [self](const QModelIndex& idx){
- [self clearSearchField];
- });
+ [smartView setDataSource: self];
[self.view setWantsLayer:YES];
[self.view setLayer:[CALayer layer]];
@@ -147,113 +99,121 @@
[searchField.layer setBackgroundColor:[NSColor colorWithCalibratedRed:0.949 green:0.949 blue:0.949 alpha:0.9].CGColor];
}
--(void) selectRow:(id)sender
-{
- if ([treeController selectedNodes].count == 0) {
- RecentModel::instance().selectionModel()->clearCurrentIndex();
- return;
- }
- auto qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
- auto proxyIdx = RecentModel::instance().peopleProxy()->mapToSource(qIdx);
- RecentModel::instance().selectionModel()->setCurrentIndex(proxyIdx, QItemSelectionModel::ClearAndSelect);
-}
-
- (void)placeCall:(id)sender
{
- QModelIndex qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
- ContactMethod* m = nil;
-
- // Double click on an ongoing call
- if (qIdx.parent().isValid()) {
+ NSInteger row;
+ if (sender != nil && [sender clickedRow] != -1)
+ row = [sender clickedRow];
+ else if ([smartView selectedRow] != -1)
+ row = [smartView selectedRow];
+ else
return;
- }
- if([[treeController selectedNodes] count] > 0) {
- QVariant var = qIdx.data((int)Call::Role::ContactMethod);
- m = qvariant_cast<ContactMethod*>(var);
- if (!m) {
- // test if it is a person
- QVariant var = qIdx.data((int)Person::Role::Object);
- if (var.isValid()) {
- Person *c = var.value<Person*>();
- if (c->phoneNumbers().size() > 0) {
- m = c->phoneNumbers().first();
- }
- }
+ auto conv = model_->filteredConversation(row);
+ model_->placeCall(conv.uid);
+}
+
+-(void) reloadData
+{
+ [smartView deselectAll:nil];
+ [smartView reloadData];
+
+ if (!selectedUid_.empty() && model_ != nil) {
+ auto it = std::find_if(model_->allFilteredConversations().begin(), model_->allFilteredConversations().end(),
+ [self] (const lrc::api::conversation::Info& conv) {
+ return selectedUid_ == conv.uid;
+ });
+ if (it != model_->allFilteredConversations().end()) {
+ NSIndexSet* indexSet = [NSIndexSet indexSetWithIndex:(it - model_->allFilteredConversations().begin())];
+ [smartView selectRowIndexes:indexSet byExtendingSelection:NO];
+ } else {
+ selectedUid_.clear();
}
}
- // Before calling check if we properly extracted a contact method and that
- // there is NOT already an ongoing call for this index (e.g: no children for this node)
- if(m && !RecentModel::instance().peopleProxy()->index(0, 0, qIdx).isValid()){
- auto c = CallModel::instance().dialingCall();
- c->setPeerContactMethod(m);
- c << Call::Action::ACCEPT;
- CallModel::instance().selectCall(c);
+ [smartView scrollToBeginningOfDocument:nil];
+}
+
+- (void)setConversationModel:(lrc::api::ConversationModel *)conversationModel
+{
+ if (model_ != conversationModel) {
+ model_ = conversationModel;
+ [self reloadData];
+ QObject::disconnect(modelSortedConnection_);
+ if (model_ != nil) {
+ modelSortedConnection_ = QObject::connect(model_, &lrc::api::ConversationModel::modelSorted,
+ [self] (){
+ [self reloadData];
+ });
+ filterChangedConnection_ = QObject::connect(model_, &lrc::api::ConversationModel::filterChanged,
+ [self] (){
+ [self reloadData];
+ });
+ }
}
}
-#pragma mark - NSOutlineViewDelegate methods
+#pragma mark - NSTableViewDelegate methods
-- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
+- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row
{
return YES;
}
-- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
+- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
return NO;
}
-- (void)outlineViewSelectionDidChange:(NSNotification *)notification
+- (void)tableViewSelectionDidChange:(NSNotification *)notification
{
- if ([treeController selectedNodes].count <= 0) {
- RecentModel::instance().selectionModel()->clearCurrentIndex();
+ NSInteger row = [notification.object selectedRow];
+
+ if (row == -1)
return;
+
+ auto uid = model_->filteredConversation(row).uid;
+ if (selectedUid_ != uid) {
+ selectedUid_ = uid;
+ model_->selectConversation(uid);
}
}
-- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
+- (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row
{
- QModelIndex proxyIdx = [treeController toQIdx:((NSTreeNode*)item)];
- QModelIndex qIdx = RecentModel::instance().peopleProxy()->mapToSource(proxyIdx);
+ return [tableView makeViewWithIdentifier:@"HoverRowView" owner:nil];
+}
+- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
+{
+ if (model_ == nil)
+ return nil;
+
+ auto conversation = model_->filteredConversation(row);
NSTableCellView* result;
- if (!qIdx.parent().isValid()) {
- result = [outlineView makeViewWithIdentifier:@"MainCell" owner:outlineView];
- NSTextField* details = [result viewWithTag:DETAILS_TAG];
- NSMutableArray* controls = [NSMutableArray arrayWithObject:[result viewWithTag:CALL_BUTTON_TAG]];
- [((ContextualTableCellView*) result) setContextualsControls:controls];
- [((ContextualTableCellView*) result) setShouldBlurParentView:YES];
+ result = [tableView makeViewWithIdentifier:@"MainCell" owner:tableView];
+// NSTextField* details = [result viewWithTag:DETAILS_TAG];
- if (auto call = RecentModel::instance().getActiveCall(qIdx)) {
- [details setStringValue:call->roleData((int)Ring::Role::FormattedState).toString().toNSString()];
- [((ContextualTableCellView*) result) setActiveState:YES];
- } else {
- [details setStringValue:qIdx.data((int)Ring::Role::FormattedLastUsed).toString().toNSString()];
- [((ContextualTableCellView*) result) setActiveState:NO];
- }
+ NSMutableArray* controls = [NSMutableArray arrayWithObject:[result viewWithTag:CALL_BUTTON_TAG]];
+ [((ContextualTableCellView*) result) setContextualsControls:controls];
+ [((ContextualTableCellView*) result) setShouldBlurParentView:YES];
- NSTextField* unreadCount = [result viewWithTag:TXT_BUTTON_TAG];
- int unread = qIdx.data((int)Ring::Role::UnreadTextMessageCount).toInt();
- [unreadCount setHidden:(unread == 0)];
- [unreadCount setStringValue:qIdx.data((int)Ring::Role::UnreadTextMessageCount).toString().toNSString()];
+// if (auto call = RecentModel::instance().getActiveCall(qIdx)) {
+// [details setStringValue:call->roleData((int)Ring::Role::FormattedState).toString().toNSString()];
+// [((ContextualTableCellView*) result) setActiveState:YES];
+// } else {
+// [details setStringValue:qIdx.data((int)Ring::Role::FormattedLastUsed).toString().toNSString()];
+// [((ContextualTableCellView*) result) setActiveState:NO];
+// }
- } else {
- result = [outlineView makeViewWithIdentifier:@"CallCell" owner:outlineView];
- NSMutableArray* controls = [NSMutableArray arrayWithObject:[result viewWithTag:CANCEL_BUTTON_TAG]];
- [((ContextualTableCellView*) result) setContextualsControls:controls];
- [((ContextualTableCellView*) result) setShouldBlurParentView:YES];
- [((ContextualTableCellView*) result) setActiveState:NO];
- NSTextField* details = [result viewWithTag:DETAILS_TAG];
-
- [details setStringValue:qIdx.data((int)Call::Role::HumanStateName).toString().toNSString()];
- }
+ NSTextField* unreadCount = [result viewWithTag:TXT_BUTTON_TAG];
+ [unreadCount setHidden:(conversation.unreadMessages == 0)];
+ [unreadCount setIntValue:conversation.unreadMessages];
NSTextField* displayName = [result viewWithTag:DISPLAYNAME_TAG];
- NSString* displayNameString = qIdx.data((int)Ring::Role::Name).toString().toNSString();
- NSString* displayIDString = qIdx.data((int)Ring::Role::Number).toString().toNSString();
+ NSString* displayNameString = bestNameForConversation(conversation, *model_);
+ NSString* displayIDString = bestIDForConversation(conversation, *model_);
if(displayNameString.length == 0 || [displayNameString isEqualToString:displayIDString]) {
NSTextField* displayRingID = [result viewWithTag:RING_ID_LABEL];
[displayName setStringValue:displayIDString];
@@ -267,10 +227,11 @@
}
NSImageView* photoView = [result viewWithTag:IMAGE_TAG];
- [photoView setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(qIdx.data(Qt::DecorationRole)))];
+ auto& imageManip = reinterpret_cast<Interfaces::ImageManipulationDelegate&>(GlobalInstances::pixmapManipulator());
+ [photoView setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(imageManip.conversationPhoto(conversation, model_->owner)))];
NSView* presenceView = [result viewWithTag:PRESENCE_TAG];
- if (qIdx.data(static_cast<int>(Ring::Role::IsPresent)).value<bool>()) {
+ if (model_->owner.contactModel->getContact(conversation.participants[0]).isPresent) {
[presenceView setHidden:NO];
} else {
[presenceView setHidden:YES];
@@ -278,9 +239,21 @@
return result;
}
-- (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item
+- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row
{
- return [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil];
+ return 60.0;
+}
+
+#pragma mark - NSTableDataSource methods
+
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
+{
+ if (tableView == smartView) {
+ if (model_ != nullptr)
+ return model_->allFilteredConversations().size();
+ }
+
+ return 0;
}
- (void)startCallForRow:(id)sender {
@@ -291,52 +264,18 @@
- (IBAction)hangUpClickedAtRow:(id)sender {
NSInteger row = [smartView rowForView:sender];
- id callNode = [smartView itemAtRow:row];
- auto callIdx = [treeController toQIdx:((NSTreeNode*)callNode)];
- if (callIdx.isValid()) {
- auto call = RecentModel::instance().getActiveCall(RecentModel::instance().peopleProxy()->mapToSource(callIdx));
- call << Call::Action::REFUSE;
- }
-}
-
-- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item
-{
- QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
- return (((NSTreeNode*)item).indexPath.length == 1) ? 60.0 : 50.0;
-}
-
-- (IBAction)placeCallFromSearchField:(id)sender
-{
- if ([searchField stringValue].length == 0) {
+ if (row == -1)
return;
- }
- [self processSearchFieldInputAndStartCall:YES];
-}
-- (void) startCallFromURI:(const URI&) uri
-{
- auto cm = PhoneDirectoryModel::instance().getNumber(uri, [self chosenAccount]);
- if(!cm->account() && [self chosenAccount]) {
- cm->setAccount([self chosenAccount]);
- }
- auto c = CallModel::instance().dialingCall();
- c->setPeerContactMethod(cm);
- c << Call::Action::ACCEPT;
- CallModel::instance().selectCall(c);
-}
+ auto conv = model_->filteredConversation(row);
+ auto& callId = conv.callId;
-- (void) startConversationFromURI:(const URI&) uri
-{
- auto cm = PhoneDirectoryModel::instance().getNumber(uri, [self chosenAccount]);
- if(!cm->account() && [self chosenAccount]) {
- cm->setAccount([self chosenAccount]);
- }
- time_t currentTime;
- ::time(¤tTime);
- cm->setLastUsed(currentTime);
- auto proxyIdx = RecentModel::instance().peopleProxy()->mapToSource(RecentModel::instance().peopleProxy()->index(0, 0));
- RecentModel::instance().selectionModel()->setCurrentIndex(proxyIdx, QItemSelectionModel::ClearAndSelect);
+ if (callId.empty())
+ return;
+
+ auto* callModel = model_->owner.callModel.get();
+ callModel->hangUp(callId);
}
- (void) displayErrorModalWithTitle:(NSString*) title WithMessage:(NSString*) message
@@ -350,150 +289,20 @@
[alert beginSheetModalForWindow:self.view.window modalDelegate:nil didEndSelector:NULL contextInfo:NULL];
}
-- (void) processSearchFieldInputAndStartCall:(BOOL) shouldCall
+- (void) processSearchFieldInput
{
- NSString* noValidAccountTitle = NSLocalizedString(@"No valid account available",
- @"Alert dialog title");
- NSString* noValidAccountMessage = NSLocalizedString(@"Make sure you have at least one valid account",
- @"Alert dialo message");
-
- const auto* numberEntered = [searchField stringValue];
- URI uri = URI(numberEntered.UTF8String);
- [self clearSearchField];
-
- if ([self chosenAccount] && [self chosenAccount]->protocol() == Account::Protocol::RING) {
- if (uri.protocolHint() == URI::ProtocolHint::RING) {
- // If it is a RingID start the conversation or the call
- if (shouldCall) {
- [self startCallFromURI:uri];
- } else {
- [self startConversationFromURI:uri];
- }
- } else {
- // If it's not a ringID and the user choosen account is a Ring account do a search on the blockchain
- QString usernameToLookup = uri.userinfo();
- QObject::disconnect(usernameLookupConnection);
- usernameLookupConnection = QObject::connect(&NameDirectory::instance(),
- &NameDirectory::registeredNameFound,
- [self,usernameToLookup,shouldCall] (const Account* account, NameDirectory::LookupStatus status, const QString& address, const QString& name) {
- if (usernameToLookup.compare(name) != 0) {
- //That is not our lookup.
- return;
- }
- switch(status) {
- case NameDirectory::LookupStatus::SUCCESS: {
- URI uri = URI("ring:" + address);
- if (shouldCall) {
- [self startCallFromURI:uri];
- } else {
- [self startConversationFromURI:uri];
- }
- break;
- }
- case NameDirectory::LookupStatus::INVALID_NAME:
- case NameDirectory::LookupStatus::ERROR:
- case NameDirectory::LookupStatus::NOT_FOUND: {
- [self displayErrorModalWithTitle:NSLocalizedString(@"Entered name not found",
- @"Alert dialog title")
- WithMessage:NSLocalizedString(@"The username you entered do not match a RingID on the network",
- @"Alert dialog title")];
- }
- break;
- }
- });
-
- NameDirectory::instance().lookupName([self chosenAccount], QString(), usernameToLookup);
- }
- } else if ([self chosenAccount] && [self chosenAccount]->protocol() == Account::Protocol::SIP) {
- if (uri.protocolHint() == URI::ProtocolHint::RING) {
- // If it is a RingID and no valid account is available, present error
- [self displayErrorModalWithTitle:noValidAccountTitle
- WithMessage:noValidAccountMessage];
- return;
- }
- if (shouldCall) {
- [self startCallFromURI:uri];
- } else {
- [self startConversationFromURI:uri];
- }
- } else {
- [self displayErrorModalWithTitle:noValidAccountTitle
- WithMessage:noValidAccountMessage];
- }
+ model_->setFilter(std::string([[searchField stringValue] UTF8String]));
}
--(Account* ) chosenAccount
+-(const lrc::api::account::Info&) chosenAccount
{
- auto idx = AvailableAccountModel::instance().selectionModel()->currentIndex();
- if (idx.isValid()) {
- return idx.data(static_cast<int>(Ring::Role::Object)).value<Account*>();
- }
- return nullptr;
+ return model_->owner;
}
- (void) clearSearchField
{
[searchField setStringValue:@""];
- RecentModel::instance().peopleProxy()->setFilterWildcard(QString::fromNSString([searchField stringValue]));
-}
-
-- (void) addToContact
-{
- if ([treeController selectedNodes].count == 0)
- return;
-
- auto qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
- auto originIdx = RecentModel::instance().peopleProxy()->mapToSource(qIdx);
- auto contactmethod = RecentModel::instance().getContactMethods(originIdx);
- if (contactmethod.isEmpty())
- return;
-
- // TODO: Uncomment to reuse contact name editing popover
-// if (addToContactPopover != nullptr) {
-// [addToContactPopover performClose:self];
-// addToContactPopover = NULL;
-// } else if (contactmethod.first()) {
-// auto* editorVC = [[PersonLinkerVC alloc] initWithNibName:@"PersonLinker" bundle:nil];
-// [editorVC setMethodToLink:contactmethod.first()];
-// [editorVC setContactLinkedDelegate:self];
-// addToContactPopover = [[NSPopover alloc] init];
-// [addToContactPopover setContentSize:editorVC.view.frame.size];
-// [addToContactPopover setContentViewController:editorVC];
-// [addToContactPopover setAnimates:YES];
-// [addToContactPopover setBehavior:NSPopoverBehaviorTransient];
-// [addToContactPopover setDelegate:self];
-//
-// [addToContactPopover showRelativeToRect:[smartView frameOfCellAtColumn:0 row:[smartView selectedRow]]
-// ofView:smartView preferredEdge:NSMaxXEdge];
-// }
-
- auto* newPerson = new Person();
- newPerson->setFormattedName(contactmethod.first()->bestName());
-
- Person::ContactMethods numbers;
- numbers << contactmethod.first();
- newPerson->setContactMethods(numbers);
- contactmethod.first()->setPerson(newPerson);
-
- auto personCollections = PersonModel::instance().collections();
- CollectionInterface *peerProfileCollection = nil;
- foreach(auto collection, personCollections) {
- if(dynamic_cast<PeerProfileCollection*>(collection))
- peerProfileCollection = collection;
- }
- if(peerProfileCollection) {
- PersonModel::instance().addNewPerson(newPerson, peerProfileCollection);
- }
-}
-
-- (void) addContactForRow:(id) sender
-{
- NSInteger row = [smartView rowForItem:[sender representedObject]];
- if(row < 0) {
- return;
- }
- [smartView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
- [self addToContact];
+ [self processSearchFieldInput];
}
/**
@@ -508,20 +317,13 @@
[pasteBoard setString:[sender representedObject] forType:NSStringPboardType];
}
-- (void) callNumber:(id) sender
-{
- Call* c = CallModel::instance().dialingCall();
- c->setDialNumber(QString::fromNSString([sender representedObject]));
- c << Call::Action::ACCEPT;
-}
-
#pragma NSTextFieldDelegate
- (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector
{
if (commandSelector == @selector(insertNewline:)) {
if([[searchField stringValue] isNotEqualTo:@""]) {
- [self processSearchFieldInputAndStartCall:NO];
+ [self processSearchFieldInput];
return YES;
}
}
@@ -530,7 +332,7 @@
- (void)controlTextDidChange:(NSNotification *) notification
{
- RecentModel::instance().peopleProxy()->setFilterWildcard(QString::fromNSString([searchField stringValue]));
+ [self processSearchFieldInput];
}
#pragma mark - NSPopOverDelegate
@@ -558,20 +360,17 @@
- (void) onAddShortcut
{
- auto qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
- auto originIdx = RecentModel::instance().peopleProxy()->mapToSource(qIdx);
- auto contactmethods = RecentModel::instance().getContactMethods(originIdx);
- if (contactmethods.isEmpty())
+ if ([smartView selectedRow] == -1)
return;
- auto contactmethod = contactmethods.first();
- if (contactmethod && (!contactmethod->contact() || contactmethod->contact()->isPlaceHolder())) {
- [self addToContact];
- }
+ auto uid = model_->filteredConversation([smartView selectedRow]).uid;
+ model_->makePermanent(uid);
}
#pragma mark - ContextMenuDelegate
+#if 0
+// TODO: Reimplement contextual menu with new models and behaviors
- (NSMenu*) contextualMenuForIndex:(NSTreeNode*) item
{
auto qIdx = [treeController toQIdx:item];
@@ -637,5 +436,6 @@
return theMenu;
}
+#endif
@end
diff --git a/src/utils.h b/src/utils.h
new file mode 100755
index 0000000..d496e56
--- /dev/null
+++ b/src/utils.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2017 Savoir-faire Linux Inc.
+ * Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#import <Foundation/Foundation.h>
+#import <api/conversation.h>
+#import <api/conversationmodel.h>
+#import <api/account.h>
+#import <api/contactmodel.h>
+#import <api/contact.h>
+
+static inline NSString* bestIDForConversation(const lrc::api::conversation::Info& conv, const lrc::api::ConversationModel& model)
+{
+ auto contact = model.owner.contactModel->getContact(conv.participants[0]);
+ if (!contact.registeredName.empty())
+ return @(contact.registeredName.c_str());
+ else
+ return @(contact.profileInfo.uri.c_str());
+}
+
+static inline NSString* bestNameForConversation(const lrc::api::conversation::Info& conv, const lrc::api::ConversationModel& model)
+{
+ auto contact = model.owner.contactModel->getContact(conv.participants[0]);
+ if (!contact.profileInfo.alias.empty())
+ return @(contact.profileInfo.alias.c_str());
+ else
+ return bestIDForConversation(conv, model);
+}
diff --git a/src/views/HoverTableRowView.h b/src/views/HoverTableRowView.h
index e477087..e89471b 100644
--- a/src/views/HoverTableRowView.h
+++ b/src/views/HoverTableRowView.h
@@ -57,5 +57,5 @@
@end
-// Used by the HoverTableRowView and the RingOutlineView
+// Used by the HoverTableRowView and the RingTableView
void DrawSeparatorInRect(NSRect rect);
diff --git a/src/PersonsVC.h b/src/views/RingTableView.h
similarity index 63%
rename from src/PersonsVC.h
rename to src/views/RingTableView.h
index a56bf48..96d4a35 100644
--- a/src/PersonsVC.h
+++ b/src/views/RingTableView.h
@@ -16,12 +16,33 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+
#import <Cocoa/Cocoa.h>
-#import "views/RingOutlineView.h"
+@protocol ContextMenuDelegate;
+@protocol ContextMenuDelegate
-@interface PersonsVC : NSViewController <NSOutlineViewDelegate, ContextMenuDelegate>
+@required
-- (void)startCallForRow:(id)sender;
+- (NSMenu*) contextualMenuForIndex:(NSTreeNode*) path;
+
+@end
+
+@protocol KeyboardShortcutDelegate;
+@protocol KeyboardShortcutDelegate
+
+@optional
+
+/**
+ * This shortcut has to respond to cmd (⌘) + a
+ */
+- (void) onAddShortcut;
+
+@end
+
+@interface RingTableView : NSTableView
+
+@property (nonatomic,weak) id <ContextMenuDelegate> contextMenuDelegate;
+@property (nonatomic,weak) id <KeyboardShortcutDelegate> shortcutsDelegate;
@end
diff --git a/src/views/RingTableView.mm b/src/views/RingTableView.mm
new file mode 100644
index 0000000..6363b00
--- /dev/null
+++ b/src/views/RingTableView.mm
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2015-2016 Savoir-faire Linux Inc.
+ * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#import "RingTableView.h"
+
+#import "HoverTableRowView.h" // For the grid drawing shared code
+
+@implementation RingTableView
+
+- (NSMenu*)menuForEvent:(NSEvent*)evt
+{
+ // TODO : Reimplement without outlineView itemAtRow: method
+// NSPoint pt = [self convertPoint:[evt locationInWindow] fromView:nil];
+// int rowIdx = [self rowAtPoint:pt];
+// if (self.contextMenuDelegate && rowIdx >= 0) {
+// return [self.contextMenuDelegate contextualMenuForIndex:[self itemAtRow:rowIdx]];
+// }
+ return nil;
+}
+
+- (void)keyDown:(NSEvent *)theEvent
+{
+ // Handle the Tab key
+ if ([[theEvent characters] characterAtIndex:0] == NSTabCharacter) {
+ if (([theEvent modifierFlags] & NSShiftKeyMask) != NSShiftKeyMask) {
+ [[self window] selectKeyViewFollowingView:self];
+ } else {
+ [[self window] selectKeyViewPrecedingView:self];
+ }
+ }
+ else if (([theEvent modifierFlags] & NSCommandKeyMask) == NSCommandKeyMask) {
+ if (self.shortcutsDelegate) {
+ if ([[theEvent characters] characterAtIndex:0] == 'a') {
+ [self.shortcutsDelegate onAddShortcut];
+ }
+ }
+ } else
+ [super keyDown:theEvent];
+}
+
+- (CGFloat)yPositionPastLastRow {
+ // Only draw the grid past the last visible row
+ NSInteger numberOfRows = self.numberOfRows;
+ CGFloat yStart = 0;
+ if (numberOfRows > 0) {
+ yStart = NSMaxY([self rectOfRow:numberOfRows - 1]);
+ }
+ return yStart;
+}
+
+- (void)drawGridInClipRect:(NSRect)clipRect {
+ // Only draw the grid past the last visible row
+ CGFloat yStart = [self yPositionPastLastRow];
+ // Draw the first separator one row past the last row
+ yStart += self.rowHeight;
+
+ // One thing to do is smarter clip testing to see if we actually need to draw!
+ NSRect boundsToDraw = self.bounds;
+ NSRect separatorRect = boundsToDraw;
+ separatorRect.size.height = 1;
+ while (yStart < NSMaxY(boundsToDraw)) {
+ separatorRect.origin.y = yStart;
+ DrawSeparatorInRect(separatorRect);
+ yStart += self.rowHeight;
+ }
+}
+
+- (void)setFrameSize:(NSSize)size {
+ [super setFrameSize:size];
+ // We need to invalidate more things when live-resizing since we fill with a gradient and stroke
+ if ([self inLiveResize]) {
+ CGFloat yStart = [self yPositionPastLastRow];
+ if (NSHeight(self.bounds) > yStart) {
+ // Redraw our horizontal grid lines
+ NSRect boundsPastY = self.bounds;
+ boundsPastY.size.height -= yStart;
+ boundsPastY.origin.y = yStart;
+ [self setNeedsDisplayInRect:boundsPastY];
+ }
+ }
+}
+
+@end
diff --git a/ui/Base.lproj/RingWindow.xib b/ui/Base.lproj/RingWindow.xib
index 0c6ad9a..eaefdf5 100644
--- a/ui/Base.lproj/RingWindow.xib
+++ b/ui/Base.lproj/RingWindow.xib
@@ -3,6 +3,7 @@
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="RingWindowController">
@@ -11,7 +12,6 @@
<outlet property="centerYQRCodeConstraint" destination="16A-gO-qJA" id="n19-pY-QTQ"/>
<outlet property="centerYWelcomeContainerConstraint" destination="Duk-XW-qcv" id="Jg8-0V-Khf"/>
<outlet property="currentView" destination="se5-gp-TjO" id="Sae-7F-MB3"/>
- <outlet property="personsVC" destination="9RF-6W-vEW" id="QZW-1T-r5D"/>
<outlet property="qrcodeView" destination="dZR-JL-MY4" id="6Jf-42-qwY"/>
<outlet property="ringIDLabel" destination="JN3-vO-zcd" id="WHd-L7-6od"/>
<outlet property="shareButton" destination="Oac-o7-2Ge" id="b0D-xr-PCx"/>
@@ -27,7 +27,7 @@
<windowCollectionBehavior key="collectionBehavior" fullScreenPrimary="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="1053" height="658"/>
- <rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
+ <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1200"/>
<view key="contentView" autoresizesSubviews="NO" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="1053" height="658"/>
<autoresizingMask key="autoresizingMask"/>
@@ -38,7 +38,7 @@
<customView wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YgH-CN-tkB" userLabel="Left Panel">
<rect key="frame" x="0.0" y="0.0" width="324" height="658"/>
<subviews>
- <tabView focusRingType="none" drawsBackground="NO" type="noTabsNoBorder" translatesAutoresizingMaskIntoConstraints="NO" id="xXW-iq-GcP">
+ <tabView focusRingType="none" drawsBackground="NO" type="noTabsNoBorder" initialItem="0MO-4e-8mo" translatesAutoresizingMaskIntoConstraints="NO" id="xXW-iq-GcP">
<rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
<font key="font" metaFont="system"/>
<tabViewItems>
@@ -53,7 +53,7 @@
<rect key="frame" x="0.0" y="0.0" width="324" height="609"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="60" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" outlineTableColumn="3NN-k0-vDM" id="tcL-dy-Q3h" customClass="RingOutlineView">
+ <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="60" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" outlineTableColumn="3NN-k0-vDM" id="tcL-dy-Q3h" customClass="RingTableView">
<rect key="frame" x="0.0" y="0.0" width="324" height="609"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
@@ -77,7 +77,7 @@
<rect key="frame" x="1" y="1" width="321" height="60"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" translatesAutoresizingMaskIntoConstraints="NO" id="epa-Ih-aKF" userLabel="name">
+ <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="epa-Ih-aKF" userLabel="name">
<rect key="frame" x="57" y="34" width="89" height="23"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="Display Role" id="uSw-g5-kte">
<font key="font" size="16" name="HelveticaNeue-Light"/>
@@ -93,7 +93,7 @@
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSUser" id="bqQ-Jp-DPH"/>
</imageView>
- <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="500" translatesAutoresizingMaskIntoConstraints="NO" id="MYe-rn-qOP" userLabel="UnreadMsgCount" customClass="RoundedTextField">
+ <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="500" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MYe-rn-qOP" userLabel="UnreadMsgCount" customClass="RoundedTextField">
<rect key="frame" x="295" y="11" width="21" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" secondItem="MYe-rn-qOP" secondAttribute="height" multiplier="3/2" priority="750" id="2hf-oz-IbF"/>
@@ -112,7 +112,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</textField>
- <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="700" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bZ6-1S-zx2" userLabel="ringId">
+ <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="700" translatesAutoresizingMaskIntoConstraints="NO" id="bZ6-1S-zx2" userLabel="ringId">
<rect key="frame" x="57" y="11" width="37" height="20"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" state="on" placeholderString="ringID" id="zp2-mv-NHW">
<font key="font" size="13" name="HelveticaNeue-Light"/>
@@ -120,7 +120,7 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" tag="800" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YkV-D4-ddd" userLabel="PresenceIndicator" customClass="RoundedTextField">
+ <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" tag="800" translatesAutoresizingMaskIntoConstraints="NO" id="YkV-D4-ddd" userLabel="PresenceIndicator" customClass="RoundedTextField">
<rect key="frame" x="39" y="6" width="14" height="14"/>
<constraints>
<constraint firstAttribute="width" constant="10" id="IdR-WT-Pvg"/>
@@ -137,7 +137,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</textField>
- <textField verticalHuggingPriority="750" tag="300" translatesAutoresizingMaskIntoConstraints="NO" id="epi-ZP-as5" userLabel="date">
+ <textField hidden="YES" verticalHuggingPriority="750" tag="300" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="epi-ZP-as5" userLabel="date">
<rect key="frame" x="274" y="36" width="44" height="20"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="40" id="asz-gD-lug"/>
@@ -217,7 +217,7 @@
<action selector="hangUpClickedAtRow:" target="-1" id="mlM-gd-4bQ"/>
</connections>
</button>
- <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" translatesAutoresizingMaskIntoConstraints="NO" id="sfz-V3-QhK">
+ <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sfz-V3-QhK">
<rect key="frame" x="6" y="24" width="73" height="23"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="Knk-h9-HbW"/>
@@ -228,7 +228,7 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="300" translatesAutoresizingMaskIntoConstraints="NO" id="Sm2-al-NU0">
+ <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="300" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Sm2-al-NU0">
<rect key="frame" x="6" y="3" width="40" height="20"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" placeholderString="details" id="mK5-kV-YOO">
<font key="font" size="13" name="HelveticaNeue-Light"/>
@@ -282,322 +282,10 @@
</constraints>
</view>
</tabViewItem>
- <tabViewItem label="History" identifier="1" id="Wi9-Zd-O1N">
- <view key="view" id="h2E-qI-upQ">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="72" horizontalPageScroll="10" verticalLineScroll="72" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="9uI-D5-KRt">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="eME-fQ-3QX">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <autoresizingMask key="autoresizingMask"/>
- <subviews>
- <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="70" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="3" outlineTableColumn="pTT-gU-NVa" id="rr8-UC-gGF" customClass="RingOutlineView">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <autoresizingMask key="autoresizingMask"/>
- <size key="intercellSpacing" width="3" height="2"/>
- <color key="backgroundColor" white="1" alpha="0.0" colorSpace="deviceWhite"/>
- <tableViewGridLines key="gridStyleMask" horizontal="YES"/>
- <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
- <tableColumns>
- <tableColumn identifier="" width="321" minWidth="40" maxWidth="1000" id="pTT-gU-NVa">
- <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
- <font key="font" metaFont="smallSystem"/>
- <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
- </tableHeaderCell>
- <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" title="Text" id="3Bh-xR-4Vn">
- <font key="font" metaFont="system"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
- <prototypeCellViews>
- <customView identifier="HoverRowView" id="I4b-1u-B0k" customClass="HoverTableRowView">
- <rect key="frame" x="1" y="1" width="321" height="70"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
- </customView>
- <tableCellView identifier="CategoryCell" id="p9h-Zd-GtR">
- <rect key="frame" x="1" y="73" width="321" height="32"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" translatesAutoresizingMaskIntoConstraints="NO" id="9c4-YB-v5K">
- <rect key="frame" x="8" y="5" width="305" height="23"/>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="Category" id="gaf-Za-tuc">
- <font key="font" size="16" name="HelveticaNeue-Light"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- </subviews>
- <constraints>
- <constraint firstItem="9c4-YB-v5K" firstAttribute="centerY" secondItem="p9h-Zd-GtR" secondAttribute="centerY" id="0Zl-ch-JZv"/>
- <constraint firstItem="9c4-YB-v5K" firstAttribute="centerX" secondItem="p9h-Zd-GtR" secondAttribute="centerX" id="mbs-m6-CmE"/>
- <constraint firstItem="9c4-YB-v5K" firstAttribute="leading" secondItem="p9h-Zd-GtR" secondAttribute="leading" constant="10" id="zaf-la-w44"/>
- </constraints>
- <connections>
- <outlet property="textField" destination="9c4-YB-v5K" id="dVq-jW-swn"/>
- </connections>
- </tableCellView>
- <tableCellView identifier="HistoryCell" id="agj-oV-Bb0">
- <rect key="frame" x="1" y="107" width="321" height="48"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="300" translatesAutoresizingMaskIntoConstraints="NO" id="eGS-mC-h5A" userLabel="Date Field">
- <rect key="frame" x="54" y="3" width="233" height="20"/>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="date" id="UKP-Et-CT0">
- <font key="font" size="13" name="HelveticaNeue-Light"/>
- <color key="textColor" name="windowFrameColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="200" translatesAutoresizingMaskIntoConstraints="NO" id="CF6-GV-88E" userLabel="Name Field">
- <rect key="frame" x="54" y="25" width="233" height="23"/>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="Name" id="bgk-oz-u7n">
- <font key="font" size="16" name="HelveticaNeue"/>
- <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" tag="100" translatesAutoresizingMaskIntoConstraints="NO" id="yXU-aM-QzI" userLabel="Dir View">
- <rect key="frame" x="293" y="12" width="25" height="25"/>
- <constraints>
- <constraint firstAttribute="height" constant="25" id="VAR-He-2Qx"/>
- <constraint firstAttribute="width" constant="25" id="WB7-n5-GSl"/>
- </constraints>
- <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="UbN-dY-FV8"/>
- </imageView>
- <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" tag="400" translatesAutoresizingMaskIntoConstraints="NO" id="m5q-Hl-1dF" userLabel="Photo View">
- <rect key="frame" x="8" y="4" width="40" height="40"/>
- <constraints>
- <constraint firstAttribute="width" constant="40" id="XqD-Tf-5NS"/>
- <constraint firstAttribute="height" constant="40" id="eBN-SG-DI4"/>
- </constraints>
- <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="0fm-ha-CAn"/>
- </imageView>
- </subviews>
- <constraints>
- <constraint firstItem="eGS-mC-h5A" firstAttribute="leading" secondItem="CF6-GV-88E" secondAttribute="leading" id="A21-T9-xjp"/>
- <constraint firstItem="yXU-aM-QzI" firstAttribute="leading" secondItem="eGS-mC-h5A" secondAttribute="trailing" constant="8" id="MEZ-Fi-uf1"/>
- <constraint firstItem="yXU-aM-QzI" firstAttribute="leading" secondItem="CF6-GV-88E" secondAttribute="trailing" constant="8" id="TMg-VN-MtS"/>
- <constraint firstItem="m5q-Hl-1dF" firstAttribute="centerY" secondItem="agj-oV-Bb0" secondAttribute="centerY" id="WsZ-ez-rFh"/>
- <constraint firstItem="m5q-Hl-1dF" firstAttribute="leading" secondItem="agj-oV-Bb0" secondAttribute="leading" constant="8" id="Yc0-vi-iei"/>
- <constraint firstItem="eGS-mC-h5A" firstAttribute="top" secondItem="CF6-GV-88E" secondAttribute="bottom" constant="2" id="bWt-O2-dvg"/>
- <constraint firstAttribute="trailing" secondItem="yXU-aM-QzI" secondAttribute="trailing" constant="3" id="jTk-jr-jg3"/>
- <constraint firstItem="eGS-mC-h5A" firstAttribute="leading" secondItem="m5q-Hl-1dF" secondAttribute="trailing" constant="8" id="pKf-4c-zVN"/>
- <constraint firstItem="CF6-GV-88E" firstAttribute="top" secondItem="agj-oV-Bb0" secondAttribute="top" id="sMA-ce-flh"/>
- <constraint firstItem="yXU-aM-QzI" firstAttribute="centerY" secondItem="agj-oV-Bb0" secondAttribute="centerY" id="zpc-fB-fFr"/>
- </constraints>
- </tableCellView>
- </prototypeCellViews>
- </tableColumn>
- </tableColumns>
- <connections>
- <outlet property="delegate" destination="jzj-dD-ryc" id="UpR-Pm-j0w"/>
- </connections>
- </outlineView>
- </subviews>
- </clipView>
- <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="9To-im-dx7">
- <rect key="frame" x="1" y="119" width="223" height="15"/>
- <autoresizingMask key="autoresizingMask"/>
- </scroller>
- <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="oow-9i-3Tx">
- <rect key="frame" x="224" y="17" width="15" height="102"/>
- <autoresizingMask key="autoresizingMask"/>
- </scroller>
- </scrollView>
- </subviews>
- <constraints>
- <constraint firstAttribute="trailing" secondItem="9uI-D5-KRt" secondAttribute="trailing" id="3ql-Ay-dMA"/>
- <constraint firstItem="9uI-D5-KRt" firstAttribute="top" secondItem="h2E-qI-upQ" secondAttribute="top" id="8Ow-c0-AbH"/>
- <constraint firstItem="9uI-D5-KRt" firstAttribute="leading" secondItem="h2E-qI-upQ" secondAttribute="leading" id="8Wg-jy-DtF"/>
- <constraint firstAttribute="bottom" secondItem="9uI-D5-KRt" secondAttribute="bottom" id="niN-fI-6OF"/>
- </constraints>
- </view>
- </tabViewItem>
- <tabViewItem label="Contacts" identifier="" id="Zbi-X6-DLT" userLabel="Persons">
- <view key="view" id="sag-tS-7Jw">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="72" horizontalPageScroll="10" verticalLineScroll="72" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="rJv-ju-DFe">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <clipView key="contentView" focusRingType="none" drawsBackground="NO" copiesOnScroll="NO" id="S00-xr-jYM">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="70" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="10" outlineTableColumn="8Ve-L0-o7V" id="Hrg-Fe-uGq" customClass="RingOutlineView">
- <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
- <autoresizingMask key="autoresizingMask"/>
- <size key="intercellSpacing" width="3" height="2"/>
- <color key="backgroundColor" white="1" alpha="0.0" colorSpace="deviceWhite"/>
- <tableViewGridLines key="gridStyleMask" horizontal="YES"/>
- <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
- <tableColumns>
- <tableColumn identifier="NameColumn" width="320.7734375" minWidth="40" maxWidth="1000" id="8Ve-L0-o7V">
- <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
- <font key="font" metaFont="system"/>
- <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
- </tableHeaderCell>
- <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="GAa-pQ-t4g">
- <font key="font" metaFont="system"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
- <prototypeCellViews>
- <tableCellView identifier="PersonCell" id="b38-tQ-FEz" customClass="ContextualTableCellView">
- <rect key="frame" x="1" y="1" width="321" height="60"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" translatesAutoresizingMaskIntoConstraints="NO" id="eGe-4R-pNq">
- <rect key="frame" x="57" y="31" width="225" height="23"/>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="Display Role" id="Q1F-xo-N3e">
- <font key="font" size="16" name="HelveticaNeue-Light"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="300" translatesAutoresizingMaskIntoConstraints="NO" id="eXn-EJ-bSE">
- <rect key="frame" x="57" y="7" width="225" height="20"/>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="details" id="isD-c6-X5Q">
- <font key="font" size="13" name="HelveticaNeue-Light"/>
- <color key="textColor" name="windowFrameColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" tag="100" translatesAutoresizingMaskIntoConstraints="NO" id="akc-1J-SlS">
- <rect key="frame" x="11" y="10" width="40" height="40"/>
- <constraints>
- <constraint firstAttribute="height" constant="40" id="CrK-Ie-5bf"/>
- <constraint firstAttribute="width" constant="40" id="UI6-4M-0El"/>
- </constraints>
- <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="uT7-b3-sLX"/>
- </imageView>
- <button verticalHuggingPriority="750" tag="400" translatesAutoresizingMaskIntoConstraints="NO" id="D2v-io-eAw" userLabel="Call Button" customClass="IconButton">
- <rect key="frame" x="288" y="18" width="30" height="30"/>
- <constraints>
- <constraint firstAttribute="width" constant="30" id="GrO-uI-c46"/>
- <constraint firstAttribute="height" constant="30" id="InT-OX-mtQ"/>
- </constraints>
- <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ic_action_call" imagePosition="overlaps" alignment="center" transparent="YES" imageScaling="proportionallyDown" inset="2" id="LSh-Ow-NcP">
- <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
- <font key="font" metaFont="system"/>
- </buttonCell>
- <userDefinedRuntimeAttributes>
- <userDefinedRuntimeAttribute type="number" keyPath="imageInsets">
- <integer key="value" value="6"/>
- </userDefinedRuntimeAttribute>
- </userDefinedRuntimeAttributes>
- <connections>
- <action selector="callClickedAtRow:" target="-1" id="3lv-9D-TpH"/>
- </connections>
- </button>
- </subviews>
- <constraints>
- <constraint firstItem="D2v-io-eAw" firstAttribute="centerY" secondItem="b38-tQ-FEz" secondAttribute="centerY" constant="-3" id="164-he-Pvx"/>
- <constraint firstItem="akc-1J-SlS" firstAttribute="leading" secondItem="b38-tQ-FEz" secondAttribute="leading" constant="11" id="5kx-HC-bBU"/>
- <constraint firstItem="eGe-4R-pNq" firstAttribute="top" secondItem="b38-tQ-FEz" secondAttribute="top" constant="6" id="8Wv-Vg-yRP"/>
- <constraint firstAttribute="trailing" secondItem="D2v-io-eAw" secondAttribute="trailing" constant="3" id="Bfw-dI-wa0"/>
- <constraint firstItem="D2v-io-eAw" firstAttribute="leading" secondItem="eGe-4R-pNq" secondAttribute="trailing" constant="8" id="CfV-hv-5sI"/>
- <constraint firstAttribute="bottom" secondItem="akc-1J-SlS" secondAttribute="bottom" constant="10" id="Kqx-IH-Vuf"/>
- <constraint firstItem="eXn-EJ-bSE" firstAttribute="leading" secondItem="eGe-4R-pNq" secondAttribute="leading" id="bap-6e-vDW"/>
- <constraint firstItem="eXn-EJ-bSE" firstAttribute="top" secondItem="eGe-4R-pNq" secondAttribute="bottom" constant="4" id="gJ2-g6-MYL"/>
- <constraint firstItem="eGe-4R-pNq" firstAttribute="top" secondItem="b38-tQ-FEz" secondAttribute="top" constant="6" id="oNW-AO-oVK"/>
- <constraint firstItem="akc-1J-SlS" firstAttribute="top" secondItem="b38-tQ-FEz" secondAttribute="top" constant="10" id="oTf-L2-iEw"/>
- <constraint firstItem="eXn-EJ-bSE" firstAttribute="leading" secondItem="akc-1J-SlS" secondAttribute="trailing" constant="8" id="plb-4c-0Js"/>
- <constraint firstItem="eGe-4R-pNq" firstAttribute="leading" secondItem="akc-1J-SlS" secondAttribute="trailing" constant="8" id="rmh-vN-PlS"/>
- <constraint firstItem="D2v-io-eAw" firstAttribute="leading" secondItem="eXn-EJ-bSE" secondAttribute="trailing" constant="8" id="tem-uL-fNz"/>
- </constraints>
- <connections>
- <outlet property="textField" destination="eGe-4R-pNq" id="VAp-mO-qUH"/>
- </connections>
- </tableCellView>
- <tableCellView identifier="LetterCell" id="VHd-0l-32E">
- <rect key="frame" x="1" y="63" width="321" height="20"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" translatesAutoresizingMaskIntoConstraints="NO" id="ILI-pW-VaK">
- <rect key="frame" x="7" y="-1" width="305" height="23"/>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="Category" id="d5o-nL-fRP">
- <font key="font" size="16" name="HelveticaNeue-Light"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- </subviews>
- <constraints>
- <constraint firstItem="ILI-pW-VaK" firstAttribute="leading" secondItem="VHd-0l-32E" secondAttribute="leading" constant="9" id="6RM-sy-lhS"/>
- <constraint firstItem="ILI-pW-VaK" firstAttribute="centerY" secondItem="VHd-0l-32E" secondAttribute="centerY" id="SEK-f2-VLR"/>
- <constraint firstAttribute="trailing" secondItem="ILI-pW-VaK" secondAttribute="trailing" constant="11" id="eUu-ht-UR9"/>
- </constraints>
- <connections>
- <outlet property="textField" destination="ILI-pW-VaK" id="bFA-iS-Cmh"/>
- </connections>
- </tableCellView>
- <tableCellView identifier="ContactMethodCell" id="V0C-vp-6vb">
- <rect key="frame" x="1" y="85" width="321" height="23"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" tag="200" translatesAutoresizingMaskIntoConstraints="NO" id="Gys-Du-oeQ">
- <rect key="frame" x="7" y="1" width="305" height="25"/>
- <constraints>
- <constraint firstAttribute="height" constant="25" id="f3J-Cg-x14"/>
- </constraints>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" placeholderString="Contact Method" id="FlQ-Th-nfO">
- <font key="font" size="14" name="HelveticaNeue-Light"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- </subviews>
- <constraints>
- <constraint firstAttribute="trailing" secondItem="Gys-Du-oeQ" secondAttribute="trailing" constant="11" id="3uT-Hq-7N6"/>
- <constraint firstItem="Gys-Du-oeQ" firstAttribute="top" secondItem="V0C-vp-6vb" secondAttribute="top" constant="-3" id="Q49-9n-Ce8"/>
- <constraint firstItem="Gys-Du-oeQ" firstAttribute="leading" secondItem="V0C-vp-6vb" secondAttribute="leading" constant="9" id="TZq-f5-vM5"/>
- </constraints>
- <connections>
- <outlet property="textField" destination="Gys-Du-oeQ" id="Rne-nh-bXU"/>
- </connections>
- </tableCellView>
- <customView identifier="HoverRowView" id="cZe-WC-bXt" customClass="HoverTableRowView">
- <rect key="frame" x="1" y="110" width="321" height="70"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
- </customView>
- </prototypeCellViews>
- </tableColumn>
- </tableColumns>
- <connections>
- <outlet property="delegate" destination="9RF-6W-vEW" id="5bm-gu-2q9"/>
- </connections>
- </outlineView>
- </subviews>
- </clipView>
- <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="TGe-ww-q1j">
- <rect key="frame" x="1" y="119" width="223" height="15"/>
- <autoresizingMask key="autoresizingMask"/>
- </scroller>
- <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="dD5-3G-tUh">
- <rect key="frame" x="308" y="563" width="16" height="0.0"/>
- <autoresizingMask key="autoresizingMask"/>
- </scroller>
- </scrollView>
- </subviews>
- <constraints>
- <constraint firstItem="rJv-ju-DFe" firstAttribute="top" secondItem="sag-tS-7Jw" secondAttribute="top" id="3mo-DH-0ZH"/>
- <constraint firstAttribute="trailing" secondItem="rJv-ju-DFe" secondAttribute="trailing" id="Agj-CV-6sB"/>
- <constraint firstAttribute="bottom" secondItem="rJv-ju-DFe" secondAttribute="bottom" id="TFr-jD-eT5"/>
- <constraint firstItem="rJv-ju-DFe" firstAttribute="leading" secondItem="sag-tS-7Jw" secondAttribute="leading" id="jNI-5T-WhD"/>
- </constraints>
- </view>
- </tabViewItem>
</tabViewItems>
</tabView>
- <searchField wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="PoQ-x4-ES3">
- <rect key="frame" x="20" y="620" width="258" height="22"/>
+ <searchField wantsLayer="YES" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PoQ-x4-ES3">
+ <rect key="frame" x="20" y="620" width="284" height="22"/>
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" placeholderString="Name, ringID" usesSingleLineMode="YES" bezelStyle="round" id="vvE-nM-kSl">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -607,37 +295,16 @@
<outlet property="delegate" destination="jrf-42-1l2" id="UtW-SL-Loa"/>
</connections>
</searchField>
- <button verticalHuggingPriority="750" tag="400" translatesAutoresizingMaskIntoConstraints="NO" id="j5k-WC-n59" userLabel="Call Button" customClass="IconButton">
- <rect key="frame" x="286" y="616" width="30" height="30"/>
- <constraints>
- <constraint firstAttribute="height" constant="30" id="FTa-mZ-R4s"/>
- <constraint firstAttribute="width" constant="30" id="HPd-La-IgC"/>
- </constraints>
- <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ic_action_video" imagePosition="overlaps" alignment="center" allowsMixedState="YES" transparent="YES" imageScaling="proportionallyDown" inset="2" id="96C-5v-Xun">
- <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
- <font key="font" metaFont="system"/>
- </buttonCell>
- <userDefinedRuntimeAttributes>
- <userDefinedRuntimeAttribute type="number" keyPath="imageInsets">
- <integer key="value" value="6"/>
- </userDefinedRuntimeAttribute>
- </userDefinedRuntimeAttributes>
- <connections>
- <action selector="placeCallFromSearchField:" target="jrf-42-1l2" id="dHt-jp-DGZ"/>
- </connections>
- </button>
</subviews>
<constraints>
+ <constraint firstAttribute="trailing" secondItem="PoQ-x4-ES3" secondAttribute="trailing" constant="20" id="4sB-9A-dhz"/>
<constraint firstItem="PoQ-x4-ES3" firstAttribute="leading" secondItem="YgH-CN-tkB" secondAttribute="leading" constant="20" id="9e0-oX-skE"/>
<constraint firstItem="xXW-iq-GcP" firstAttribute="top" secondItem="PoQ-x4-ES3" secondAttribute="bottom" constant="8" id="FWN-Kb-wE9"/>
- <constraint firstItem="j5k-WC-n59" firstAttribute="centerY" secondItem="PoQ-x4-ES3" secondAttribute="centerY" id="LrO-eP-hAU"/>
<constraint firstAttribute="bottom" secondItem="xXW-iq-GcP" secondAttribute="bottom" id="MYN-Zf-Bvk"/>
<constraint firstAttribute="trailing" secondItem="xXW-iq-GcP" secondAttribute="trailing" id="TXC-lN-yL8"/>
<constraint firstAttribute="width" constant="324" id="Yjy-go-Dgc"/>
<constraint firstItem="xXW-iq-GcP" firstAttribute="leading" secondItem="YgH-CN-tkB" secondAttribute="leading" id="aSr-vt-QvR"/>
- <constraint firstAttribute="trailing" secondItem="j5k-WC-n59" secondAttribute="trailing" constant="8" id="hOF-Eb-Zd4"/>
<constraint firstItem="PoQ-x4-ES3" firstAttribute="top" secondItem="YgH-CN-tkB" secondAttribute="top" constant="16" id="pNA-2g-7AA"/>
- <constraint firstItem="j5k-WC-n59" firstAttribute="leading" secondItem="PoQ-x4-ES3" secondAttribute="trailing" constant="8" id="pxS-0T-P3J"/>
</constraints>
</customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Fzg-MB-mlx" userLabel="HomeView">
@@ -672,7 +339,7 @@
<customView translatesAutoresizingMaskIntoConstraints="NO" id="D6e-KX-8gC">
<rect key="frame" x="103" y="194" width="520" height="270"/>
<subviews>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kFj-Sh-o5u">
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kFj-Sh-o5u">
<rect key="frame" x="95" y="98" width="330" height="19"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="326" id="i1K-ok-BEb"/>
@@ -686,7 +353,7 @@
<binding destination="-2" name="hidden" keyPath="self.hideRingID" id="EPK-C2-VsC"/>
</connections>
</textField>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JN3-vO-zcd" userLabel="Ring ID" customClass="RingIDField">
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JN3-vO-zcd" userLabel="Ring ID" customClass="RingIDField">
<rect key="frame" x="20" y="64" width="400" height="26"/>
<constraints>
<constraint firstAttribute="height" constant="26" id="TYe-h2-pPT"/>
@@ -740,7 +407,7 @@
<binding destination="-2" name="hidden" keyPath="self.hideRingID" id="4zb-wx-Nna"/>
</connections>
</button>
- <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VJ1-xk-v5e">
+ <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VJ1-xk-v5e">
<rect key="frame" x="24" y="125" width="473" height="42"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Ring is free software for universal communication which respects the freedoms and privacy of its users." id="eln-Vm-t0d">
<font key="font" size="15" name="HelveticaNeue"/>
@@ -814,18 +481,6 @@
</connections>
<point key="canvasLocation" x="467.5" y="235"/>
</window>
- <viewController id="jzj-dD-ryc" customClass="HistoryVC">
- <connections>
- <outlet property="historyView" destination="rr8-UC-gGF" id="8NW-8O-X5L"/>
- <outlet property="view" destination="9uI-D5-KRt" id="hCt-k1-UV2"/>
- </connections>
- </viewController>
- <viewController id="9RF-6W-vEW" customClass="PersonsVC">
- <connections>
- <outlet property="personsView" destination="Hrg-Fe-uGq" id="nMb-nK-g6a"/>
- <outlet property="view" destination="rJv-ju-DFe" id="A8H-6d-bW2"/>
- </connections>
- </viewController>
<viewController id="jrf-42-1l2" customClass="SmartViewVC">
<connections>
<outlet property="searchField" destination="PoQ-x4-ES3" id="pOb-2e-PPS"/>
@@ -843,7 +498,6 @@
<resources>
<image name="NSShareTemplate" width="11" height="16"/>
<image name="NSUser" width="32" height="32"/>
- <image name="ic_action_call" width="72" height="72"/>
<image name="ic_action_cancel" width="72" height="72"/>
<image name="ic_action_video" width="72" height="72"/>
<image name="qrcode" width="72" height="72"/>