Commit 8ca0c7e8 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

Contact request: remove msg

Remove view to display msg for pending contact request list

Change-Id: I695061d2d8840da5f5691d4f6e992439a7a4c2b0
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent 78e1f126
......@@ -205,8 +205,6 @@ SET(ringclient_VIEWS
src/views/IMTableCellView.mm
src/views/AccountMenuItemView.h
src/views/AccountMenuItemView.mm
src/views/ContactRequestCellView.h
src/views/ContactRequestCellView.mm
src/views/RoundedTextField.h
src/views/RoundedTextField.mm
src/views/MessageBubbleView.h
......
......@@ -34,7 +34,6 @@
#import "ContactRequestsListVC.h"
#import "QNSTreeController.h"
#import <interfaces/pixmapmanipulatori.h>
#import "views/ContactRequestCellView.h"
@interface ContactRequestsListVC ()
......@@ -59,7 +58,6 @@ NSInteger const TAG_NAME = 100;
NSInteger const TAG_RINGID = 200;
NSInteger const TAG_PHOTO = 300;
NSString* defaultMsg = @"Hello, I would like invite you";
- (void)awakeFromNib
......@@ -130,23 +128,17 @@ NSString* defaultMsg = @"Hello, I would like invite you";
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
ContactRequestCellView* result;
result = [outlineView makeViewWithIdentifier:@"ContactRequestView" owner:self];
NSTableCellView* result = [outlineView makeViewWithIdentifier:@"ContactRequestView" owner:self];
QModelIndex qIdx = [self.requestsTreeController toQIdx:((NSTreeNode*)item)];
if(!qIdx.isValid()) {
return result;
}
[result setup];
NSTextField* nameLabel = [result viewWithTag:TAG_NAME];
NSTextField* ringIDLabel = [result viewWithTag:TAG_RINGID];
NSImageView* photoView = [result viewWithTag:TAG_PHOTO];
NSString* localizedTitle = [NSString stringWithFormat:
NSLocalizedString(@"Hi %@. Please add me to your contact list.", @"Default contact request msg"), [self nameForAccount:[self chosenAccount]]];
[result.msgView setString:localizedTitle];
ContactRequest* contactRequest = qvariant_cast<ContactRequest*>(qIdx.data((int)Ring::Role::Object));
Person* person = contactRequest->peer();
if(!person) {
......@@ -180,15 +172,4 @@ NSString* defaultMsg = @"Hello, I would like invite you";
return index.data(static_cast<int>(Account::Role::Object)).value<Account*>();
}
-(NSString*) nameForAccount:(Account*) account {
auto name = account->registeredName();
NSString* userNameString = nullptr;
if (!name.isNull() && !name.isEmpty()) {
userNameString = name.toNSString();
} else {
userNameString = account->username().toNSString();
}
return userNameString;
}
@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 ContactRequestCellView : NSTableCellView
@property (nonatomic, strong) IBOutlet NSTextView* msgView;
- (void) setup;
@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 "ContactRequestCellView.h"
@implementation ContactRequestCellView
@synthesize msgView;
- (void) setup
{
[self.msgView setWantsLayer:YES];
self.msgView.layer.cornerRadius = 5.0f;
}
@end
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment