Commit 4dfcafc0 authored by Alexandre Lision's avatar Alexandre Lision

smartview: refactor left panel

Major rewrite of the main left panel UI

- remove the ongoing calls treeview
- default to smartview treeview
- remove call field from toolbar and display it on top of left panel
- add access to alphabetical contacts treeview
- add access to history

Issue: #79398
Change-Id: Iac36b6f4ace30cdb70c4dcf619d64cd91b84c95c
parent 004ccbb5
......@@ -77,8 +77,6 @@ SET(ringclient_CONTROLLERS
src/RingWizardWC.h
src/RingWindowController.mm
src/RingWindowController.h
src/ConversationsVC.mm
src/ConversationsVC.h
src/PreferencesVC.mm
src/PreferencesVC.h
src/AccGeneralVC.mm
......@@ -111,7 +109,9 @@ SET(ringclient_CONTROLLERS
src/ChatVC.mm
src/ChatVC.h
src/PersonLinkerVC.mm
src/PersonLinkerVC.h)
src/PersonLinkerVC.h
src/SmartViewVC.mm
src/SmartViewVC.h)
SET(ringclient_BACKENDS
src/backends/AddressBookBackend.mm
......@@ -122,8 +122,6 @@ SET(ringclient_VIEWS
src/views/CallView.h
src/views/ITProgressIndicator.mm
src/views/ITProgressIndicator.h
src/views/PersonCell.mm
src/views/PersonCell.h
src/views/RingOutlineView.mm
src/views/RingOutlineView.h
src/views/RingIDField.mm
......@@ -175,9 +173,14 @@ ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_mute_audio.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_chat.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_search.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_quality.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_call_received.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_call_missed.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_call_made.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ancrage.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/audio.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_person_add.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_persons.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_history.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/general.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/video.png
${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_video.png)
......
/*
* Copyright (C) 2004-2015 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.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef CONVERSATIONSVC_H
#define CONVERSATIONSVC_H
#import <Cocoa/Cocoa.h>
#import "QNSTreeController.h"
@interface ConversationsVC : NSViewController <NSOutlineViewDelegate> {
}
@end
#endif // CONVERSATIONSVC_H
/*
* Copyright (C) 2004-2015 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.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#import "ConversationsVC.h"
#import <callmodel.h>
#import <QtCore/qitemselectionmodel.h>
#define COLUMNID_CONVERSATIONS @"ConversationsColumn" // the single column name in our outline view
@interface ConversationsVC ()
@property QNSTreeController *treeController;
@property (assign) IBOutlet NSOutlineView *conversationsView;
@end
@implementation ConversationsVC
@synthesize conversationsView;
@synthesize treeController;
- (void)awakeFromNib
{
NSLog(@"INIT Conversations VC");
treeController = [[QNSTreeController alloc] initWithQModel:CallModel::instance()];
[treeController setAvoidsEmptySelection:NO];
[treeController setChildrenKeyPath:@"children"];
[self.conversationsView bind:@"content" toObject:treeController withKeyPath:@"arrangedObjects" options:nil];
[self.conversationsView bind:@"sortDescriptors" toObject:treeController withKeyPath:@"sortDescriptors" options:nil];
[self.conversationsView bind:@"selectionIndexPaths" toObject:treeController withKeyPath:@"selectionIndexPaths" options:nil];
NSInteger idx = [conversationsView columnWithIdentifier:COLUMNID_CONVERSATIONS];
[[[[self.conversationsView tableColumns] objectAtIndex:idx] headerCell] setStringValue:@"Conversations"];
QObject::connect(CallModel::instance(),
&QAbstractItemModel::dataChanged,
[=](const QModelIndex &topLeft, const QModelIndex &bottomRight) {
[conversationsView reloadDataForRowIndexes:
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(topLeft.row(), bottomRight.row() + 1)]
columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, conversationsView.tableColumns.count)]];
});
}
#pragma mark - NSOutlineViewDelegate methods
// -------------------------------------------------------------------------------
// shouldSelectItem:item
// -------------------------------------------------------------------------------
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
{
return YES;
}
// -------------------------------------------------------------------------------
// dataCellForTableColumn:tableColumn:item
// -------------------------------------------------------------------------------
- (NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
NSCell *returnCell = [tableColumn dataCell];
if(item == nil)
return returnCell;
return returnCell;
}
// -------------------------------------------------------------------------------
// textShouldEndEditing:fieldEditor
// -------------------------------------------------------------------------------
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
{
if ([[fieldEditor string] length] == 0)
{
// don't allow empty node names
return NO;
}
else
{
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;
}
// -------------------------------------------------------------------------------
// outlineView:willDisplayCell:forTableColumn:item
// -------------------------------------------------------------------------------
- (void)outlineView:(NSOutlineView *)olv willDisplayCell:(NSCell*)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
if ([[tableColumn identifier] isEqualToString:COLUMNID_CONVERSATIONS])
{
QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
if(qIdx.isValid())
cell.title = CallModel::instance()->data(qIdx, Qt::DisplayRole).toString().toNSString();
}
}
// -------------------------------------------------------------------------------
// outlineViewSelectionDidChange:notification
// -------------------------------------------------------------------------------
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
{
// ask the tree controller for the current selection
if([[treeController selectedNodes] count] > 0) {
QModelIndex qIdx = [treeController toQIdx:[treeController selectedNodes][0]];
//Update details view by changing selection
CallModel::instance()->selectionModel()->setCurrentIndex(qIdx, QItemSelectionModel::ClearAndSelect);
} else {
CallModel::instance()->selectionModel()->clearCurrentIndex();
}
}
@end
/*
* Copyright (C) 2004-2015 Savoir-Faire Linux Inc.
* Copyright (C) 2015 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
......@@ -15,20 +15,7 @@
* 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.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef CURRENTCALLVC_H
#define CURRENTCALLVC_H
#import <Cocoa/Cocoa.h>
......@@ -43,5 +30,3 @@ class Call;
- (void) initFrame;
@end
#endif // CURRENTCALLVC_H
\ No newline at end of file
/*
* Copyright (C) 2004-2015 Savoir-Faire Linux Inc.
* Copyright (C) 2015 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
......@@ -15,17 +15,6 @@
* 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.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#import "CurrentCallVC.h"
......@@ -436,6 +425,8 @@
[self connectVideoSignals];
/* check if text media is already present */
if(!CallModel::instance()->selectedCall())
return;
if (CallModel::instance()->selectedCall()->hasMedia(Media::Media::Type::TEXT, Media::Media::Direction::IN)) {
Media::Text *text = CallModel::instance()->selectedCall()->firstMedia<Media::Text>(Media::Media::Direction::IN);
[self monitorIncomingTextMessages:text];
......
/*
* Copyright (C) 2004-2015 Savoir-Faire Linux Inc.
* Copyright (C) 2015 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
......@@ -15,28 +15,10 @@
* 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.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef HISTORYVIEWCONTROLLER_H
#define HISTORYVIEWCONTROLLER_H
#import <Cocoa/Cocoa.h>
#import "views/RingOutlineView.h"
@interface HistoryVC : NSViewController <NSOutlineViewDelegate, ContextMenuDelegate> {
}
@interface HistoryVC : NSViewController <NSOutlineViewDelegate, ContextMenuDelegate>
@end
#endif // HISTORYVIEWCONTROLLER_H
/*
* Copyright (C) 2004-2015 Savoir-Faire Linux Inc.
* Copyright (C) 2015 Savoir-faire Linux Inc.
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
......@@ -15,17 +15,6 @@
* 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.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#import "HistoryVC.h"
......@@ -40,34 +29,26 @@
#import "QNSTreeController.h"
#import "PersonLinkerVC.h"
#define COLUMNID_DAY @"DayColumn" // the single column name in our outline view
#define COLUMNID_CONTACTMETHOD @"ContactMethodColumn" // the single column name in our outline view
#define COLUMNID_DATE @"DateColumn" // the single column name in our outline view
@interface HistoryVC() <NSPopoverDelegate, KeyboardShortcutDelegate, ContactLinkedDelegate>
@interface HistoryVC() <NSPopoverDelegate, KeyboardShortcutDelegate, ContactLinkedDelegate> {
@property QNSTreeController *treeController;
@property (assign) IBOutlet RingOutlineView *historyView;
@property QSortFilterProxyModel *historyProxyModel;
@property (strong) NSPopover* addToContactPopover;
QNSTreeController *treeController;
IBOutlet RingOutlineView *historyView;
QSortFilterProxyModel *historyProxyModel;
NSPopover* addToContactPopover;
}
@end
@implementation HistoryVC
@synthesize treeController;
@synthesize historyView;
@synthesize historyProxyModel;
- (id)initWithCoder:(NSCoder *)aDecoder
{
if (self = [super initWithCoder:aDecoder]) {
NSLog(@"INIT HVC");
}
return self;
}
// Tags for Views
NSInteger const IMAGE_TAG = 100;
NSInteger const DISPLAYNAME_TAG = 200;
NSInteger const DETAILS_TAG = 300;
- (void)awakeFromNib
{
NSLog(@"INIT HVC");
historyProxyModel = new QSortFilterProxyModel(CategorizedHistoryModel::instance());
historyProxyModel->setSourceModel(CategorizedHistoryModel::instance());
historyProxyModel->setSortRole(static_cast<int>(Call::Role::Date));
......@@ -86,6 +67,14 @@
[historyView setShortcutsDelegate:self];
CategorizedHistoryModel::instance()->addCollection<LocalHistoryCollection>(LoadOptions::FORCE_ENABLED);
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
......@@ -96,15 +85,20 @@
- (void)placeHistoryCall:(id)sender
{
if([[treeController selectedNodes] count] > 0) {
QModelIndex qIdx = [treeController toQIdx:[treeController selectedNodes][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){
Call* c = CallModel::instance()->dialingCall();
c->setDialNumber(m);
c->setPeerContactMethod(m);
c << Call::Action::ACCEPT;
}
}
......@@ -121,70 +115,80 @@
}
// -------------------------------------------------------------------------------
// dataCellForTableColumn:tableColumn:item
// shouldEditTableColumn:tableColumn:item
//
// Decide to allow the edit of the given outline view "item".
// -------------------------------------------------------------------------------
- (NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
NSCell *returnCell = [tableColumn dataCell];
if(item == nil)
return returnCell;
return returnCell;
return NO;
}
// -------------------------------------------------------------------------------
// textShouldEndEditing:fieldEditor
// -------------------------------------------------------------------------------
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
- (NSImage*) image:(NSImage*) img withTintedWithColor:(NSColor *)tint
{
if ([[fieldEditor string] length] == 0)
{
// don't allow empty node names
return NO;
}
else
{
return YES;
if (tint) {
[img lockFocus];
[tint set];
NSRect imageRect = {NSZeroPoint, [img size]};
NSRectFillUsingOperation(imageRect, NSCompositeSourceAtop);
[img unlockFocus];
}
return img;
}
// -------------------------------------------------------------------------------
// shouldEditTableColumn:tableColumn:item
//
// Decide to allow the edit of the given outline view "item".
// -------------------------------------------------------------------------------
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
/* View Based OutlineView: See the delegate method -tableView:viewForTableColumn:row: in NSTableView.
*/
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
return NO;
QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
NSTableCellView *result;
if(!qIdx.parent().isValid()) {
result = [outlineView makeViewWithIdentifier:@"CategoryCell" owner:outlineView];
[result.layer setBackgroundColor:[NSColor selectedControlColor].CGColor];
} else {
result = [outlineView makeViewWithIdentifier:@"HistoryCell" owner:outlineView];
NSImageView* photoView = [result viewWithTag:IMAGE_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))) {
[photoView setImage:[self image:[NSImage imageNamed:@"ic_call_missed"] withTintedWithColor:[NSColor redColor]]];
} else {
[photoView 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))) {
[photoView setImage:[self image:[NSImage imageNamed:@"ic_call_missed"] withTintedWithColor:[NSColor redColor]]];
} else {
[photoView 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]]];
}
}
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;
}
// -------------------------------------------------------------------------------
// outlineView:willDisplayCell:forTableColumn:item
// -------------------------------------------------------------------------------
- (void)outlineView:(NSOutlineView *)olv willDisplayCell:(NSCell*)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item
{
QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)];
if(!qIdx.isValid())
return;
if ([[tableColumn identifier] isEqualToString:COLUMNID_DAY])
{
cell.title = historyProxyModel->data(qIdx, Qt::DisplayRole).toString().toNSString();
} else if ([[tableColumn identifier] isEqualToString:COLUMNID_CONTACTMETHOD])
{
cell.title = historyProxyModel->data(qIdx, (int)Call::Role::Number).toString().toNSString();
} else if ([[tableColumn identifier] isEqualToString:COLUMNID_DATE])
{
cell.title = historyProxyModel->data(qIdx, (int)Call::Role::FormattedDate).toString().toNSString();
if(!qIdx.parent().isValid()) {
return 35.0;
} else {
return 48.0;
}
}
// -------------------------------------------------------------------------------
// outlineViewSelectionDidChange:notification
// -------------------------------------------------------------------------------
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item
{
// ask the tree controller for the current selection
//NSLog(@"outlineViewSelectionDidChange!!");
return [treeController toQIdx:((NSTreeNode*)item)].parent().isValid();
}
#pragma mark - ContextMenuDelegate
......@@ -225,21 +229,21 @@
}
}
if (self.addToContactPopover != nullptr) {
[self.addToContactPopover performClose:self];
self.addToContactPopover = NULL;
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];
self.addToContactPopover = [[NSPopover alloc] init];
[self.addToContactPopover setContentSize:editorVC.view.frame.size];
[self.addToContactPopover setContentViewController:editorVC];
[self.addToContactPopover setAnimates:YES];
[self.addToContactPopover setBehavior:NSPopoverBehaviorTransient];
[self.addToContactPopover setDelegate:self];
[self.addToContactPopover showRelativeToRect:[historyView frameOfOutlineCellAtRow:[historyView selectedRow]] ofView:historyView preferredEdge:NSMaxXEdge];
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];
}
}
......@@ -247,9 +251,9 @@
- (void)popoverDidClose:(NSNotification *)notification
{
if (self.addToContactPopover != nullptr) {
[self.addToContactPopover performClose:self];
self.addToContactPopover = NULL;
if (addToContactPopover != nullptr) {
[addToContactPopover performClose:self];
addToContactPopover = NULL;
}
}
......@@ -257,9 +261,9 @@
- (void)contactLinked
{
if (self.addToContactPopover != nullptr) {
[self.addToContactPopover performClose:self];
self.addToContactPopover = NULL;