Commit 1ba5a019 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

refactor: remove unused code

Change-Id: Ie567c7ab73d782eff48527eb5eb11cb89b6576fb
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent e3503844
......@@ -135,12 +135,8 @@ SET(ringclient_CONTROLLERS
src/GeneralPrefsVC.h
src/ChatVC.mm
src/ChatVC.h
src/PersonLinkerVC.mm
src/PersonLinkerVC.h
src/SmartViewVC.mm
src/SmartViewVC.h
src/BrokerVC.mm
src/BrokerVC.h
src/ConversationVC.mm
src/ConversationVC.h
src/LoadingWCDelegate.h
......@@ -162,12 +158,6 @@ SET(ringclient_CONTROLLERS
src/RegisterNameWC.h
src/ChooseAccountVC.h
src/ChooseAccountVC.mm
src/ContactRequestsListVC.h
src/ContactRequestsListVC.mm
src/ContactRequestVC.h
src/ContactRequestVC.mm
src/AccBannedContactsVC.h
src/AccBannedContactsVC.mm
src/MessagesVC.h
src/MessagesVC.mm
src/PasswordChangeWC.h
......@@ -248,7 +238,6 @@ SET(ringclient_XIBS
CurrentCall
GeneralPrefs
AccSipGeneral
AccMedia
AccRingGeneral
AccAdvancedSip
AccAdvancedRing
......@@ -261,8 +250,6 @@ SET(ringclient_XIBS
RestoreAccountWindow
ExportPasswordWindow
MigrateRingAccountsWindow
PersonLinker
Broker
Conversation
RingWizardLinkAccount
RingWizardNewAccount
......@@ -270,9 +257,6 @@ SET(ringclient_XIBS
Dialpad
RegisterNameWindow
AccountMenuItemView
ContactRequestList
ContactRequest
AccBannedContacts
PasswordChange
MessageCells
AddSIPAccountVC
......
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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>
@interface AccBannedContactsVC : NSViewController
@property (nonatomic) BOOL bannedListIsEmpty;
@end
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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.
*/
//Qt
#import <QItemSelectionModel>
//LRC
#import <account.h>
#import <availableAccountModel.h>
#import <contactmethod.h>
#import <bannedContactmodel.h>
#import "AccBannedContactsVC.h"
#import "QNSTreeController.h"
@interface AccBannedContactsVC ()
@property QNSTreeController* bannedContactsTreeController;
@property (unsafe_unretained) IBOutlet NSOutlineView* banedContactsView;
@end
@implementation AccBannedContactsVC
@synthesize bannedContactsTreeController;
@synthesize banedContactsView;
NSInteger const TAG_NAME = 100;
NSInteger const TAG_RINGID = 200;
- (void)awakeFromNib
{
QObject::connect(AccountModel::instance().selectionModel(),
&QItemSelectionModel::currentChanged,
[=](const QModelIndex &current, const QModelIndex &previous) {
if(!current.isValid())
return;
[self loadAccount];
});
}
- (void)loadAccount
{
auto account = AccountModel::instance().selectedAccount();
self.bannedContactsTreeController = [[QNSTreeController alloc] initWithQModel:(QAbstractItemModel*)account->bannedContactModel()];
[self.bannedContactsTreeController setAvoidsEmptySelection:NO];
[self.bannedContactsTreeController setChildrenKeyPath:@"children"];
[self.banedContactsView bind:@"content" toObject:self.bannedContactsTreeController withKeyPath:@"arrangedObjects" options:nil];
[self.banedContactsView bind:@"sortDescriptors" toObject:self.bannedContactsTreeController withKeyPath:@"sortDescriptors" options:nil];
[self.banedContactsView bind:@"selectionIndexPaths" toObject:self.bannedContactsTreeController withKeyPath:@"selectionIndexPaths" options:nil];
NSLog(@"numberofRowsBanned, %d", account->bannedContactModel()->rowCount());
self.bannedListIsEmpty = banedContactsView.numberOfRows == 0;
}
- (IBAction)unbanContact:(NSView*)sender
{
NSInteger row = [self.banedContactsView rowForView:sender];
if(row < 0) {
return;
}
auto account = AccountModel::instance().selectedAccount();
id item = [self.banedContactsView itemAtRow:row];
QModelIndex qIdx = [self.bannedContactsTreeController toQIdx:((NSTreeNode*)item)];
if(!qIdx.isValid()) {
return;
}
auto cm = qIdx.data(static_cast<int>(ContactMethod::Role::Object)).value<ContactMethod*>();
if( account && cm) {
account->bannedContactModel()->remove(cm);
}
self.bannedListIsEmpty = banedContactsView.numberOfRows == 0;
}
#pragma mark - NSOutlineViewDelegate methods
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item
{
return YES;
}
- (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item
{
return [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil];
}
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
NSTableView* result = [outlineView makeViewWithIdentifier:@"BannedContactsCellView" owner:self];
QModelIndex qIdx = [self.bannedContactsTreeController toQIdx:((NSTreeNode*)item)];
if(!qIdx.isValid())
return result;
NSTextField* nameLabel = [result viewWithTag:TAG_NAME];
NSTextField* deviceIDLabel = [result viewWithTag:TAG_RINGID];
auto account = AccountModel::instance().selectedAccount();
NSString* stringID = account->bannedContactModel()->data(qIdx,Qt::DisplayRole).toString().toNSString();
[nameLabel setStringValue:stringID];
[deviceIDLabel setStringValue:stringID];
return result;
}
@end
......@@ -34,7 +34,6 @@
#import <api/newaccountmodel.h>
#import <api/newdevicemodel.h>
#import <interfaces/pixmapmanipulatori.h>
#import <globalinstances.h>
#import "RegisterNameWC.h"
#import "RestoreAccountWC.h"
......
......@@ -20,7 +20,6 @@
#import <Cocoa/Cocoa.h>
#import <account.h>
#import "LrcModelsProtocol.h"
#import "AccountSettingsVC.h"
......
......@@ -32,7 +32,6 @@
#import <api/newaccountmodel.h>
#import <api/newdevicemodel.h>
#import <interfaces/pixmapmanipulatori.h>
#import <globalinstances.h>
#import "AccSipGeneralVC.h"
#import "views/NSColor+RingTheme.h"
......
......@@ -19,7 +19,6 @@
//LRC
#import <api/lrc.h>
#import <api/account.h>
#import <api/newaccountmodel.h>
#import "views/NSColor+RingTheme.h"
......
......@@ -25,7 +25,6 @@
//LRC
#import <api/lrc.h>
#import <api/newaccountmodel.h>
#import <account.h>
//ring
#import "AddSIPAccountVC.h"
......
......@@ -21,7 +21,6 @@
//LRC
#import <api/lrc.h>
#import <api/newaccountmodel.h>
#import <account.h>
//Ring
#import "views/ITProgressIndicator.h"
......
/*
* 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>
@interface BrokerVC : NSViewController
enum class BrokerMode {
TRANSFER = 0,
CONFERENCE,
};
- (instancetype)initWithMode:(BrokerMode) m;
@end
This diff is collapsed.
......@@ -27,8 +27,6 @@
#import <QPixmap>
//LRC
#import <globalinstances.h>
#import <QItemSelectionModel.h>
#import <interfaces/pixmapmanipulatori.h>
#import <api/newaccountmodel.h>
#import <api/account.h>
......
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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>
@interface ContactRequestVC : NSViewController
@property (nonatomic) NSInteger numberOfRequests;
@property (nonatomic) Boolean hideRequestNumberLabel;
@end
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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.
*/
//Qt
#import <QItemSelectionModel>
//LRC
#import <account.h>
#import <pendingContactRequestModel.h>
#import <availableAccountModel.h>
#import "ContactRequestVC.h"
#import "ContactRequestsListVC.h"
@interface ContactRequestVC ()<NSPopoverDelegate> {
NSPopover* pendingContactRequestPopover;
}
@end
@implementation ContactRequestVC
QMetaObject::Connection requestAdded;
QMetaObject::Connection requestRemoved;
- (void)awakeFromNib
{
[self.view setHidden:AvailableAccountModel::instance().rowCount() == 0];
QObject::connect(&AvailableAccountModel::instance(),
&QAbstractItemModel::rowsRemoved,
[self]{
[self hideIfNeeded];
});
QObject::connect(&AvailableAccountModel::instance(),
&QAbstractItemModel::dataChanged,
[self]{
[self hideIfNeeded];
});
QObject::connect(AvailableAccountModel::instance().selectionModel(),
&QItemSelectionModel::currentChanged,
[self](const QModelIndex& idx){
[self setupWithSelectedAccount];
});
self.hideRequestNumberLabel = YES;
[self setupWithSelectedAccount];
}
- (IBAction)displayTrustRequests:(NSView*)sender
{
ContactRequestsListVC* contactRequestVC = [[ContactRequestsListVC alloc] initWithNibName:@"ContactRequestList" bundle:nil];
pendingContactRequestPopover = [[NSPopover alloc] init];
pendingContactRequestPopover.delegate = self;
[pendingContactRequestPopover setContentSize:contactRequestVC.view.frame.size];
[pendingContactRequestPopover setContentViewController:contactRequestVC];
[pendingContactRequestPopover setAnimates:YES];
[pendingContactRequestPopover setBehavior:NSPopoverBehaviorTransient];
[pendingContactRequestPopover setDelegate:self];
[pendingContactRequestPopover showRelativeToRect: sender.frame ofView:sender preferredEdge:NSMaxYEdge];
}
- (void)popoverDidClose:(NSNotification *)notification {
// when popover is closed remove ContactRequestsListVC to let it be deallocated
[pendingContactRequestPopover setContentViewController:nil];
}
-(void)setNumberOfRequests:(NSInteger)numberOfRequests
{
_numberOfRequests = numberOfRequests;
self.hideRequestNumberLabel = (_numberOfRequests == 0);
}
-(Account* ) chosenAccount
{
QModelIndex index = AvailableAccountModel::instance().selectionModel()->currentIndex();
if(!index.isValid()) {
return nullptr;
}
Account* account = index.data(static_cast<int>(Account::Role::Object)).value<Account*>();
return account;
}
-(void) setupWithSelectedAccount
{
Account* chosenAccount = [self chosenAccount];
if(!chosenAccount) {
return;
}
[self.view setHidden:chosenAccount->protocol() != Account::Protocol::RING];
if(chosenAccount->protocol() != Account::Protocol::RING) {
return;
}
self.numberOfRequests = chosenAccount->pendingContactRequestModel()->rowCount();
QObject::disconnect(requestAdded);
requestAdded = QObject::connect(chosenAccount->pendingContactRequestModel(),
&QAbstractItemModel::rowsInserted,
[=]() {
self.numberOfRequests = chosenAccount->pendingContactRequestModel()->rowCount();
}
);
QObject::disconnect(requestRemoved);
requestRemoved = QObject::connect(chosenAccount->pendingContactRequestModel(),
&QAbstractItemModel::rowsRemoved,
[=]() {
self.numberOfRequests = chosenAccount->pendingContactRequestModel()->rowCount();
}
);
}
-(void)hideIfNeeded
{
if(AvailableAccountModel::instance().rowCount() == 0) {
[self.view setHidden:YES];
return;
}
Account* chosenAccount = [self chosenAccount];
if(!chosenAccount) {
return;
}
[self.view setHidden:chosenAccount->protocol() != Account::Protocol::RING];
}
@end
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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>
@interface ContactRequestsListVC : NSViewController
@end
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@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.
*/
//Qt
#import <QItemSelectionModel>
#import <QSize>
#import <QtMacExtras/qmacfunctions.h>
#import <QPixmap>
//LRC
#import <account.h>
#import <availableAccountModel.h>
#import <contactRequest.h>
#import <pendingContactRequestModel.h>
#import <globalinstances.h>
#import <contactmethod.h>
#import "ContactRequestsListVC.h"
#import "QNSTreeController.h"
#import <interfaces/pixmapmanipulatori.h>
@interface ContactRequestsListVC ()
@property QNSTreeController* requestsTreeController;
@property (unsafe_unretained) IBOutlet NSOutlineView* contactRequestView;
@property (unsafe_unretained) IBOutlet NSTextField* noRequestsLabel;
@end
@implementation ContactRequestsListVC
@synthesize requestsTreeController;
@synthesize contactRequestView;
@synthesize noRequestsLabel;
typedef NS_ENUM(NSInteger, ContactAction) {
ACCEPT = 0,
REFUSE,
BLOCK,
};
NSInteger const TAG_NAME = 100;
NSInteger const TAG_RINGID = 200;
NSInteger const TAG_PHOTO = 300;
- (void)awakeFromNib
{
Account* chosenAccount = [self chosenAccount];
requestsTreeController = [[QNSTreeController alloc] initWithQModel:chosenAccount->pendingContactRequestModel()];
[requestsTreeController setAvoidsEmptySelection:NO];
[requestsTreeController setAlwaysUsesMultipleValuesMarker:YES];
[requestsTreeController setChildrenKeyPath:@"children"];
[contactRequestView bind:@"content" toObject:requestsTreeController withKeyPath:@"arrangedObjects" options:nil];
[contactRequestView bind:@"sortDescriptors" toObject:requestsTreeController withKeyPath:@"sortDescriptors" options:nil];
[contactRequestView bind:@"selectionIndexPaths" toObject:requestsTreeController withKeyPath:@"selectionIndexPaths" options:nil];
contactRequestView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleNone;
[noRequestsLabel setHidden:[contactRequestView numberOfRows]>0];
}
- (IBAction)acceptContactRequest:(NSView*)sender
{
NSInteger row = [self.contactRequestView rowForView:sender];
[self performAction:ACCEPT forRequestAtRow:row];
}
- (IBAction)refuseContactRequest:(NSView*)sender
{
NSInteger row = [self.contactRequestView rowForView:sender];
[self performAction:REFUSE forRequestAtRow:row];
}
- (IBAction)blockContactRequest:(NSView*)sender
{
NSInteger row = [self.contactRequestView rowForView:sender];
[self performAction:BLOCK forRequestAtRow:row];
}
-(void) performAction:(ContactAction)action forRequestAtRow:(NSInteger)row {
id item = [self.contactRequestView itemAtRow:row];
QModelIndex qIdx = [self.requestsTreeController toQIdx:((NSTreeNode*)item)];
Account* chosenAccount = AccountModel::instance().userChosenAccount();
const auto& var = qIdx.data(static_cast<int>(Ring::Role::Object));
if (!var.isValid()) {
return;
}
auto contactRequest = qvariant_cast<ContactRequest*>(var);
switch (action) {
case ACCEPT:
contactRequest->accept();
break;
case REFUSE:
contactRequest->discard();
break;
case BLOCK:
contactRequest->block();
break;
default:
break;
}
[noRequestsLabel setHidden:[contactRequestView numberOfRows]>0];
}
#pragma mark - NSOutlineViewDelegate methods
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item
{
return NO;
}
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
NSTableCellView* result = [outlineView makeViewWithIdentifier:@"ContactRequestView" owner:self];
QModelIndex qIdx = [self.requestsTreeController toQIdx:((NSTreeNode*)item)];
if(!qIdx.isValid()) {
return result;
}
NSTextField* nameLabel = [result viewWithTag:TAG_NAME];
NSTextField* ringIDLabel = [result viewWithTag:TAG_RINGID];
NSImageView* photoView = [result viewWithTag:TAG_PHOTO];
ContactRequest* contactRequest = qvariant_cast<ContactRequest*>(qIdx.data((int)Ring::Role::Object));
Person* person = contactRequest->peer();
if(!person) {
Account* chosenAccount = [self chosenAccount];
NSString* ringID = chosenAccount->pendingContactRequestModel()->data(qIdx,Qt::DisplayRole).toString().toNSString();
[nameLabel setStringValue:ringID];
return result;
}
QVariant photo = GlobalInstances::pixmapManipulator().contactPhoto(person, {100,100});
[photoView setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(photo))];
NSString* idString = person->phoneNumbers()[0]->getBestId().toNSString();
if(person->formattedName() != nil && person->formattedName().length()>0) {
NSString* name = person->formattedName().toNSString();
[nameLabel setStringValue:name];
if(![person->formattedName().toNSString() isEqualToString:idString]){
NSString* formattedID = [NSString stringWithFormat:@"%@%@%@",@"(",idString, @")"];
[ringIDLabel setStringValue:formattedID];
}
return result;
}
[nameLabel setStringValue:idString];
return result;
}
-(Account* ) chosenAccount
{
QModelIndex index = AvailableAccountModel::instance().selectionModel()->currentIndex();
return index.data(static_cast<int>(Account::Role::Object)).value<Account*>();
}
@end
......@@ -23,9 +23,9 @@
#import <qstring.h>
#import <QPixmap>
#import <QtMacExtras/qmacfunctions.h>
#import <QuartzCore/QuartzCore.h>
// LRC
#import <globalinstances.h>
#import "views/IconButton.h"
#import "views/HoverButton.h"
......@@ -37,8 +37,6 @@
#import "RingWindowController.h"
#import "NSString+Extensions.h"
#import <QuartzCore/QuartzCore.h>
@interface ConversationVC () {
__unsafe_unretained IBOutlet NSTextField* conversationTitle;
......
......@@ -21,12 +21,7 @@
#import <Cocoa/Cocoa.h>
#import "views/CallView.h"
// LRC
#import <api/account.h>
#import <api/call.h>
class Call;
@protocol CallViewControllerDelegate
......
......@@ -24,8 +24,6 @@
#import <QMimeData>
#import <QtMacExtras/qmacfunctions.h>
#import <QtCore/qabstractitemmodel.h>
#import <QItemSelectionModel>
#import <QItemSelection>
#import <QPixmap>
///LRC
......@@ -41,9 +39,7 @@
#import "views/CallView.h"
#import "views/NSColor+RingTheme.h"
#import "delegates/ImageManipulationDelegate.h"
#import "PersonLinkerVC.h"
#import "ChatVC.h"
#import "BrokerVC.h"
#import "views/IconButton.h"
#import "views/CallLayer.h"
#import "utils.h"
......@@ -60,7 +56,7 @@
@end
@interface CurrentCallVC () <NSPopoverDelegate, ContactLinkedDelegate> {
@interface CurrentCallVC () <NSPopoverDelegate> {
std::string convUid_;
std::string callUid_;
const lrc::api::account::Info *accountInfo_;
......@@ -918,39 +914,11 @@
}
- (IBAction)toggleTransferView:(id)sender {
if (_brokerPopoverVC != nullptr) {
[_brokerPopoverVC performClose:self];
_brokerPopoverVC = NULL;
[self.transferButton setPressed:NO];
} else {
auto* brokerVC = [[BrokerVC alloc] initWithMode:BrokerMode::TRANSFER];
_brokerPopoverVC = [[NSPopover alloc] init];
[_brokerPopoverVC setContentSize:brokerVC.view.frame.size];
[_brokerPopoverVC setContentViewController:brokerVC];
[_brokerPopoverVC setAnimates:YES];
[_brokerPopoverVC setBehavior:NSPopoverBehaviorTransient];
[_brokerPopoverVC setDelegate:self];
[_brokerPopoverVC showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
[videoView setCallDelegate:nil];
}
}
- (IBAction)toggleAddParticipantView:(id)sender {
if (_brokerPopoverVC != nullptr) {
[_brokerPopoverVC performClose:self];
_brokerPopoverVC = NULL;
[self.addParticipantButton setPressed:NO];
} else {
auto* brokerVC = [[BrokerVC alloc] initWithMode:BrokerMode::CONFERENCE];
_brokerPopoverVC = [[NSPopover alloc] init];
[_brokerPopoverVC setContentSize:brokerVC.view.frame.size];
[_brokerPopoverVC setContentViewController:brokerVC];
[_brokerPopoverVC setAnimates:YES];
[_brokerPopoverVC setBehavior:NSPopoverBehaviorTransient];
[_brokerPopoverVC setDelegate:self];
[_brokerPopoverVC showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
[videoView setCallDelegate:nil];
}