diff --git a/CMakeLists.txt b/CMakeLists.txt index 43498cd074ccce9109770ec4cef5f250d13619ca..c0793f67718343eef25f20369fa1df22e0cc9009 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,9 @@ SET(ringclient_CONTROLLERS src/SmartViewVC.mm src/SmartViewVC.h src/BrokerVC.mm - src/BrokerVC.h) + src/BrokerVC.h + src/ConversationVC.mm + src/ConversationVC.h) SET(ringclient_BACKENDS src/backends/AddressBookBackend.mm @@ -133,7 +135,9 @@ SET(ringclient_VIEWS src/views/ContextualTableCellView.mm src/views/ContextualTableCellView.h src/views/IconButton.h - src/views/IconButton.mm) + src/views/IconButton.mm + src/views/IMTableCellView.h + src/views/IMTableCellView.mm) SET(ringclient_OTHERS src/main.mm @@ -162,7 +166,8 @@ SET(ringclient_XIBS RingWizard CertificateWindow PersonLinker - Broker) + Broker + Conversation) # Icons # This part tells CMake where to find and install the file itself @@ -174,6 +179,7 @@ SET(ring_ICONS ${CMAKE_CURRENT_SOURCE_DIR}/data/symbol_name.png ${CMAKE_CURRENT_SOURCE_DIR}/data/background_tile.png ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_accept.png +${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_arrow_back.png ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_call.png ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_cancel.png ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_hangup.png @@ -193,6 +199,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_add_participant.png ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_merge_calls.png ${CMAKE_CURRENT_SOURCE_DIR}/data/default_user_icon.png ${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ancrage.png +${CMAKE_CURRENT_SOURCE_DIR}/data/dark/ic_action_send.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 diff --git a/data/dark/ic_action_send.png b/data/dark/ic_action_send.png new file mode 100644 index 0000000000000000000000000000000000000000..40b74ebc16e0bf2a85ebc3d920353fc4eb8337aa Binary files /dev/null and b/data/dark/ic_action_send.png differ diff --git a/data/dark/ic_action_video.png b/data/dark/ic_action_video.png index df6dd48e22e6ea444f6ffb4d499eb7de1bf46cd3..0039e804eb1684ea4ebc31799709a087f572e5f5 100644 Binary files a/data/dark/ic_action_video.png and b/data/dark/ic_action_video.png differ diff --git a/data/dark/ic_arrow_back.png b/data/dark/ic_arrow_back.png new file mode 100644 index 0000000000000000000000000000000000000000..1f0559fd0f104727c5172b2c05444d89e998da8b Binary files /dev/null and b/data/dark/ic_arrow_back.png differ diff --git a/src/AppDelegate.mm b/src/AppDelegate.mm index 96f529470ddb97f1a052b2a07e110c377db23149..77d58e513cf104676ad6766878db631487d51759 100644 --- a/src/AppDelegate.mm +++ b/src/AppDelegate.mm @@ -22,6 +22,8 @@ #import #import #import +#import +#import #import #import @@ -79,13 +81,42 @@ [self showIncomingNotification:call]; } }); + + + + QObject::connect(&Media::RecordingModel::instance(), + &Media::RecordingModel::newTextMessage, + [=](Media::TextRecording* t, ContactMethod* cm) { + + BOOL shouldNotify = [[NSUserDefaults standardUserDefaults] boolForKey:Preferences::Notifications]; + auto qIdx = t->instantTextMessagingModel()->index(t->instantTextMessagingModel()->rowCount()-1, 0); + + // Don't show a notification if we are sending the text OR window already has focus OR user disabled notifications + if(qvariant_cast(qIdx.data((int)Media::TextRecording::Role::Direction)) == Media::Media::Direction::OUT + || self.ringWindowController.window.keyWindow || !shouldNotify) + return; + + NSUserNotification* notification = [[NSUserNotification alloc] init]; + + NSString* localizedTitle = NSLocalizedString(([NSString stringWithFormat:@"Message from %@", + qIdx.data((int)Media::TextRecording::Role::AuthorDisplayname).toString().toNSString()]), + @"Text message notification title"); + + [notification setTitle:localizedTitle]; + [notification setSoundName:NSUserNotificationDefaultSoundName]; + [notification setSubtitle:qIdx.data().toString().toNSString()]; + + [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; + }); } - (void) showIncomingNotification:(Call*) call{ NSUserNotification *notification = [[NSUserNotification alloc] init]; - notification.title = @"Incoming call", call->peerName(); - //notification.informativeText = @"A notification"; - notification.soundName = NSUserNotificationDefaultSoundName; + NSString* localizedTitle = NSLocalizedString(([NSString stringWithFormat:@"Incoming call from %@", + call->peerName().toNSString()]), + @"Call notification title"); + [notification setTitle:localizedTitle]; + [notification setSoundName:NSUserNotificationDefaultSoundName]; [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; } @@ -99,7 +130,6 @@ - (void) showWizard { - NSLog(@"Showing wizard"); if(self.wizard == nil) { self.wizard = [[RingWizardWC alloc] initWithWindowNibName:@"RingWizard"]; } diff --git a/src/ConversationVC.h b/src/ConversationVC.h new file mode 100644 index 0000000000000000000000000000000000000000..9cecc254cae61d62ba0fea970c833f9fa018d075 --- /dev/null +++ b/src/ConversationVC.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2016 Savoir-faire Linux Inc. + * Author: Alexandre Lision + * + * 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 + +@interface ConversationVC : NSViewController + +-(void) initFrame; +-(void) animateIn; +-(IBAction) animateOut:(id)sender; + +/** + * Message contained in messageField TextField. + * This is a KVO method to bind the text with the send Button + * if message.length is > 0, button is enabled, otherwise disabled + */ +@property (retain) NSString* message; + +@end diff --git a/src/ConversationVC.mm b/src/ConversationVC.mm new file mode 100644 index 0000000000000000000000000000000000000000..142da8952c08579e6079404a9d1afa3f98d01993 --- /dev/null +++ b/src/ConversationVC.mm @@ -0,0 +1,361 @@ +/* + * Copyright (C) 2016 Savoir-faire Linux Inc. + * Author: Alexandre Lision + * + * 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 "ConversationVC.h" + +#import +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import + +#import "views/IconButton.h" +#import "views/IMTableCellView.h" +#import "views/NSColor+RingTheme.h" +#import "QNSTreeController.h" +#import "delegates/ImageManipulationDelegate.h" + +#import + +@interface ConversationVC () { + + __unsafe_unretained IBOutlet IconButton* backButton; + __unsafe_unretained IBOutlet NSTextField* messageField; + QVector contactMethods; + NSMutableString* textSelection; + + QNSTreeController* treeController; + + __unsafe_unretained IBOutlet NSView* sendPanel; + __unsafe_unretained IBOutlet NSTextField* conversationTitle; + __unsafe_unretained IBOutlet NSTextField* emptyConversationPlaceHolder; + __unsafe_unretained IBOutlet IconButton* sendButton; + __unsafe_unretained IBOutlet NSOutlineView* conversationView; + __unsafe_unretained IBOutlet NSPopUpButton* contactMethodsPopupButton; +} + +@end + +@implementation ConversationVC + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do view setup here. + [self.view setWantsLayer:YES]; + [self.view setLayer:[CALayer layer]]; + [self.view.layer setBackgroundColor:[NSColor ringGreyHighlight].CGColor]; + [self.view.layer setCornerRadius:5.0f]; + + [sendPanel setWantsLayer:YES]; + [sendPanel setLayer:[CALayer layer]]; + + [self setupChat]; + +} + +- (void) initFrame +{ + [self.view setFrame:self.view.superview.bounds]; + [self.view setHidden:YES]; + self.view.layer.position = self.view.frame.origin; +} + +- (void) setupChat +{ + QObject::connect(RecentModel::instance().selectionModel(), + &QItemSelectionModel::currentChanged, + [=](const QModelIndex ¤t, const QModelIndex &previous) { + + contactMethods = RecentModel::instance().getContactMethods(current); + if (contactMethods.isEmpty()) { + return ; + } + + [contactMethodsPopupButton removeAllItems]; + for (auto cm : contactMethods) { + [contactMethodsPopupButton addItemWithTitle:cm->uri().toNSString()]; + } + + [contactMethodsPopupButton setEnabled:(contactMethods.length() > 1)]; + + [emptyConversationPlaceHolder setHidden:NO]; + // Select first cm + [contactMethodsPopupButton selectItemAtIndex:0]; + [self itemChanged:contactMethodsPopupButton]; + + NSString* localizedTitle = current.data((int)Ring::Role::Name).toString().toNSString(); + [conversationTitle setStringValue:localizedTitle]; + + }); +} + +- (IBAction)sendMessage:(id)sender +{ + /* make sure there is text to send */ + NSString* text = self.message; + if (text && text.length > 0) { + QMap messages; + messages["text/plain"] = QString::fromNSString(text); + contactMethods.at([contactMethodsPopupButton indexOfSelectedItem])->sendOfflineTextMessage(messages); + self.message = @""; + } +} + +- (IBAction)placeCall:(id)sender +{ + if(auto cm = contactMethods.at([contactMethodsPopupButton indexOfSelectedItem])) { + auto c = CallModel::instance().dialingCall(); + c->setPeerContactMethod(cm); + c << Call::Action::ACCEPT; + CallModel::instance().selectCall(c); + } +} + +# pragma mark private IN/OUT animations + +-(void) animateIn +{ + CGRect frame = CGRectOffset(self.view.superview.bounds, -self.view.superview.bounds.size.width, 0); + [self.view setHidden:NO]; + + [CATransaction begin]; + CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"]; + [animation setFromValue:[NSValue valueWithPoint:frame.origin]]; + [animation setToValue:[NSValue valueWithPoint:self.view.superview.bounds.origin]]; + [animation setDuration:0.2f]; + [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]]; + [self.view.layer addAnimation:animation forKey:animation.keyPath]; + + [CATransaction commit]; +} + +-(IBAction) animateOut:(id)sender +{ + if(self.view.frame.origin.x < 0) { + return; + } + + CGRect frame = CGRectOffset(self.view.frame, -self.view.frame.size.width, 0); + [CATransaction begin]; + CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"]; + [animation setFromValue:[NSValue valueWithPoint:self.view.frame.origin]]; + [animation setToValue:[NSValue valueWithPoint:frame.origin]]; + [animation setDuration:0.2f]; + [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; + + [CATransaction setCompletionBlock:^{ + [self.view setHidden:YES]; + }]; + [self.view.layer addAnimation:animation forKey:animation.keyPath]; + + [self.view.layer setPosition:frame.origin]; + [CATransaction commit]; +} + +#pragma mark - NSOutlineViewDelegate methods + +- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item; +{ + return YES; +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item +{ + return YES; +} + +- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item +{ + QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)]; + auto dir = qvariant_cast(qIdx.data((int)Media::TextRecording::Role::Direction)); + IMTableCellView* result; + + if (dir == Media::Media::Direction::IN) { + result = [outlineView makeViewWithIdentifier:@"LeftMessageView" owner:self]; + } else { + result = [outlineView makeViewWithIdentifier:@"RightMessageView" owner:self]; + } + + [result setup]; + + NSMutableAttributedString* msgAttString = + [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n",qIdx.data((int)Qt::DisplayRole).toString().toNSString()] + attributes:[self messageAttributesFor:qIdx]]; + + NSAttributedString* timestampAttrString = + [[NSAttributedString alloc] initWithString:qIdx.data((int)Media::TextRecording::Role::FormattedDate).toString().toNSString() + attributes:[self timestampAttributesFor:qIdx]]; + + + CGFloat finalWidth = MAX(msgAttString.size.width, timestampAttrString.size.width); + finalWidth = MIN(finalWidth + 30, result.frame.size.width - result.photoView.frame.size.width - 30); + + [msgAttString appendAttributedString:timestampAttrString]; + [[result.msgView textStorage] appendAttributedString:msgAttString]; + [result.msgView checkTextInDocument:nil]; + [result.msgView setWantsLayer:YES]; + result.msgView.layer.cornerRadius = 5.0f; + + [result updateWidthConstraint:finalWidth]; + + Person* p = qvariant_cast(qIdx.data((int)Person::Role::Object)); + QVariant photo = GlobalInstances::pixmapManipulator().contactPhoto(p, QSize(50,50)); + [result.photoView setImage:QtMac::toNSImage(qvariant_cast(photo))]; + + return result; +} + +- (void)outlineView:(NSOutlineView *)outlineView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row +{ + if (auto txtRecording = contactMethods.at([contactMethodsPopupButton indexOfSelectedItem])->textRecording()) { + [emptyConversationPlaceHolder setHidden:txtRecording->instantMessagingModel()->rowCount() > 0]; + txtRecording->setAllRead(); + } +} + +- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item +{ + QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)]; + + double someWidth = outlineView.frame.size.width; + + NSMutableAttributedString* msgAttString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n",qIdx.data((int)Qt::DisplayRole).toString().toNSString()] + attributes:[self messageAttributesFor:qIdx]]; + NSAttributedString *timestampAttrString = [[NSAttributedString alloc] initWithString: + qIdx.data((int)Media::TextRecording::Role::FormattedDate).toString().toNSString() + attributes:[self timestampAttributesFor:qIdx]]; + + [msgAttString appendAttributedString:timestampAttrString]; + + NSRect frame = NSMakeRect(0, 0, someWidth, MAXFLOAT); + NSTextView *tv = [[NSTextView alloc] initWithFrame:frame]; + [tv setEnabledTextCheckingTypes:NSTextCheckingTypeLink]; + [tv setAutomaticLinkDetectionEnabled:YES]; + [[tv textStorage] setAttributedString:msgAttString]; + [tv sizeToFit]; + + double height = tv.frame.size.height + 20; + + return MAX(height, 60.0f); +} + +#pragma mark - Text formatting + +- (NSMutableDictionary*) timestampAttributesFor:(QModelIndex) qIdx +{ + auto dir = qvariant_cast(qIdx.data((int)Media::TextRecording::Role::Direction)); + NSMutableDictionary* attrs = [NSMutableDictionary dictionary]; + + if (dir == Media::Media::Direction::IN) { + attrs[NSForegroundColorAttributeName] = [NSColor grayColor]; + } else { + attrs[NSForegroundColorAttributeName] = [NSColor whiteColor]; + } + + NSFont* systemFont = [NSFont systemFontOfSize:12.0f]; + attrs[NSFontAttributeName] = systemFont; + attrs[NSParagraphStyleAttributeName] = [self paragraphStyle]; + + return attrs; +} + +- (NSMutableDictionary*) messageAttributesFor:(QModelIndex) qIdx +{ + auto dir = qvariant_cast(qIdx.data((int)Media::TextRecording::Role::Direction)); + NSMutableDictionary* attrs = [NSMutableDictionary dictionary]; + + if (dir == Media::Media::Direction::IN) { + attrs[NSForegroundColorAttributeName] = [NSColor blackColor]; + } else { + attrs[NSForegroundColorAttributeName] = [NSColor whiteColor]; + } + + NSFont* systemFont = [NSFont systemFontOfSize:14.0f]; + attrs[NSFontAttributeName] = systemFont; + attrs[NSParagraphStyleAttributeName] = [self paragraphStyle]; + + return attrs; +} + +- (NSParagraphStyle*) paragraphStyle +{ + /* + The only way to instantiate an NSMutableParagraphStyle is to mutably copy an + NSParagraphStyle. And since we don't have an existing NSParagraphStyle available + to copy, we use the default one. + + The default values supplied by the default NSParagraphStyle are: + Alignment NSNaturalTextAlignment + Tab stops 12 left-aligned tabs, spaced by 28.0 points + Line break mode NSLineBreakByWordWrapping + All others 0.0 + */ + NSMutableParagraphStyle* aMutableParagraphStyle = + [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; + + // Now adjust our NSMutableParagraphStyle formatting to be whatever we want. + // The numeric values below are in points (72 points per inch) + [aMutableParagraphStyle setAlignment:NSLeftTextAlignment]; + [aMutableParagraphStyle setLineSpacing:1.5]; + [aMutableParagraphStyle setParagraphSpacing:5.0]; + [aMutableParagraphStyle setHeadIndent:5.0]; + [aMutableParagraphStyle setTailIndent:-5.0]; + [aMutableParagraphStyle setFirstLineHeadIndent:5.0]; + [aMutableParagraphStyle setLineBreakMode:NSLineBreakByWordWrapping]; + return aMutableParagraphStyle; +} + +#pragma mark - NSTextFieldDelegate + +- (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector +{ + if (commandSelector == @selector(insertNewline:) && self.message.length > 0) { + [self sendMessage:nil]; + return YES; + } + return NO; +} + +#pragma mark - NSPopUpButton item selection + +- (IBAction)itemChanged:(id)sender { + NSInteger index = [(NSPopUpButton *)sender indexOfSelectedItem]; + + if (auto txtRecording = contactMethods.at(index)->textRecording()) { + treeController = [[QNSTreeController alloc] initWithQModel:txtRecording->instantMessagingModel()]; + [treeController setAvoidsEmptySelection:NO]; + [treeController setChildrenKeyPath:@"children"]; + [conversationView bind:@"content" toObject:treeController withKeyPath:@"arrangedObjects" options:nil]; + [conversationView bind:@"sortDescriptors" toObject:treeController withKeyPath:@"sortDescriptors" options:nil]; + [conversationView bind:@"selectionIndexPaths" toObject:treeController withKeyPath:@"selectionIndexPaths" options:nil]; + } + + [conversationView scrollToEndOfDocument:nil]; +} + + +@end diff --git a/src/CurrentCallVC.h b/src/CurrentCallVC.h index 5a3dc3da1db6a665c93a1ec381550ec93cd3a4cd..58105bb0e385946071e72c1c12d8dd07f15a8dfe 100644 --- a/src/CurrentCallVC.h +++ b/src/CurrentCallVC.h @@ -28,6 +28,8 @@ class Call; } -- (void) initFrame; +-(void) initFrame; +-(void) animateIn; +-(void) animateOut; @end diff --git a/src/CurrentCallVC.mm b/src/CurrentCallVC.mm index e234abeaa12bd674ee572fb821a7c0ef61c2e61f..1c3efdda3ab23cfeccd6142b82b463f592a9190d 100644 --- a/src/CurrentCallVC.mm +++ b/src/CurrentCallVC.mm @@ -124,7 +124,7 @@ NSButton* a = actionHash[(int) action]; if (a) { [a setHidden:!(idx.flags() & Qt::ItemIsEnabled)]; - [a setState:(idx.data(Qt::CheckStateRole) == Qt::Checked) ? NSOnState : NSOffState]; + [a setHighlighted:(idx.data(Qt::CheckStateRole) == Qt::Checked) ? YES : NO]; } } @@ -245,7 +245,6 @@ [=](const QModelIndex ¤t, const QModelIndex &previous) { auto call = RecentModel::instance().getActiveCall(current); if(!current.isValid() || !call) { - [self animateOut]; return; } @@ -258,7 +257,6 @@ [self collapseRightView]; [self updateCall]; [self updateAllActions]; - [self animateOut]; }); QObject::connect(CallModel::instance().userActionModel(), diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm index 8addce94c34dff36d5f36350b99d00e5e38cf88b..c589d5735b7cb155f4f6b4417a001532557fa968 100644 --- a/src/RingWindowController.mm +++ b/src/RingWindowController.mm @@ -17,16 +17,24 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #import "RingWindowController.h" +#import + + +//Qt +#import +#import //LRC #import #import #import #import +#import #import "AppDelegate.h" #import "Constants.h" #import "CurrentCallVC.h" +#import "ConversationVC.h" #import "PreferencesWC.h" #import "views/NSColor+RingTheme.h" @@ -37,7 +45,8 @@ __unsafe_unretained IBOutlet NSTextField *ringIDLabel; PreferencesWC *preferencesWC; - CurrentCallVC* currentVC; + CurrentCallVC* currentCallVC; + ConversationVC* offlineVC; } static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; @@ -46,23 +55,52 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; [super windowDidLoad]; [self.window setMovableByWindowBackground:YES]; - currentVC = [[CurrentCallVC alloc] initWithNibName:@"CurrentCall" bundle:nil]; + currentCallVC = [[CurrentCallVC alloc] initWithNibName:@"CurrentCall" bundle:nil]; + offlineVC = [[ConversationVC alloc] initWithNibName:@"Conversation" bundle:nil]; + [callView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [[currentVC view] setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + [[currentCallVC view] setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + [[offlineVC view] setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [callView addSubview:[currentVC view] positioned:NSWindowAbove relativeTo:nil]; + [callView addSubview:[currentCallVC view] positioned:NSWindowAbove relativeTo:nil]; + [callView addSubview:[offlineVC view] positioned:NSWindowAbove relativeTo:nil]; - [currentVC initFrame]; + [currentCallVC initFrame]; + [offlineVC initFrame]; // Fresh run, we need to make sure RingID appears [self updateRingID]; + [self connect]; +} + +- (void) connect +{ // Update Ring ID label based on account model changes QObject::connect(&AccountModel::instance(), &AccountModel::dataChanged, [=] { [self updateRingID]; }); + + QObject::connect(RecentModel::instance().selectionModel(), + &QItemSelectionModel::currentChanged, + [=](const QModelIndex ¤t, const QModelIndex &previous) { + auto call = RecentModel::instance().getActiveCall(current); + if(!current.isValid()) { + [offlineVC animateOut:self]; + [currentCallVC animateOut]; + return; + } + + if (!call) { + [currentCallVC animateOut]; + [offlineVC animateIn]; + } else { + [currentCallVC animateIn]; + [offlineVC animateOut:self]; + } + }); } /** diff --git a/src/SmartViewVC.mm b/src/SmartViewVC.mm index b2be8bbe1d27167c0cd7b10c295c3512424a2221..d0264589d3c3295ea4fbb7067cdae392ca8bb2e8 100644 --- a/src/SmartViewVC.mm +++ b/src/SmartViewVC.mm @@ -33,6 +33,7 @@ #import #import #import +#import #import "QNSTreeController.h" #import "delegates/ImageManipulationDelegate.h" @@ -42,7 +43,7 @@ #import "views/ContextualTableCellView.h" @interface SmartViewVC () { - BOOL isShowingContacts; + QNSTreeController *treeController; NSPopover* addToContactPopover; @@ -69,9 +70,8 @@ NSInteger const TXT_BUTTON_TAG = 500; { NSLog(@"INIT SmartView VC"); - isShowingContacts = false; + RecentModel::instance().peopleProxy()->setFilterRole((int)Ring::Role::Name); treeController = [[QNSTreeController alloc] initWithQModel:RecentModel::instance().peopleProxy()]; - [treeController setAvoidsEmptySelection:NO]; [treeController setChildrenKeyPath:@"children"]; @@ -105,9 +105,8 @@ NSInteger const TXT_BUTTON_TAG = 500; if (proxyIdx.isValid()) { [treeController setSelectionQModelIndex:proxyIdx]; - [showContactsButton setState:NO]; - isShowingContacts = NO; - [showHistoryButton setState:NO]; + [showContactsButton setHighlighted:NO]; + [showHistoryButton setHighlighted:NO]; [tabbar selectTabViewItemAtIndex:0]; [smartView scrollRowToVisible:proxyIdx.row()]; } @@ -124,6 +123,10 @@ NSInteger const TXT_BUTTON_TAG = 500; -(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); @@ -164,53 +167,42 @@ NSInteger const TXT_BUTTON_TAG = 500; } } -- (IBAction)showHistory:(NSButton*)sender { - if (isShowingContacts) { - [showContactsButton setState:NO]; - isShowingContacts = NO; - [tabbar selectTabViewItemAtIndex:1]; - } else if ([sender state] == NSOffState) { +- (IBAction)showHistory:(NSButton*)sender +{ + [showContactsButton setHighlighted:NO]; + [showHistoryButton setHighlighted:![sender isHighlighted]]; + + if (![sender isHighlighted]) { [tabbar selectTabViewItemAtIndex:0]; } else { [tabbar selectTabViewItemAtIndex:1]; } } -- (IBAction)showContacts:(NSButton*)sender { - if (isShowingContacts) { - [showContactsButton setState:NO]; +- (IBAction)showContacts:(NSButton*)sender +{ + [showContactsButton setHighlighted:![sender isHighlighted]]; + [showHistoryButton setHighlighted:NO]; + + if (![sender isHighlighted]) { [tabbar selectTabViewItemAtIndex:0]; } else { - [showHistoryButton setState:![sender state]]; [tabbar selectTabViewItemAtIndex:2]; } - - isShowingContacts = [sender state]; } #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; } -// ------------------------------------------------------------------------------- -// outlineViewSelectionDidChange:notification -// ------------------------------------------------------------------------------- - (void)outlineViewSelectionDidChange:(NSNotification *)notification { if ([treeController selectedNodes].count <= 0) { @@ -219,8 +211,6 @@ NSInteger const TXT_BUTTON_TAG = 500; } } -/* 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)]; @@ -229,7 +219,8 @@ NSInteger const TXT_BUTTON_TAG = 500; result = [outlineView makeViewWithIdentifier:@"MainCell" owner:outlineView]; NSTextField* details = [result viewWithTag:DETAILS_TAG]; - [((ContextualTableCellView*) result) setContextualsControls:[NSMutableArray arrayWithObject:[result viewWithTag:CALL_BUTTON_TAG]]]; + NSMutableArray* controls = [NSMutableArray arrayWithObject:[result viewWithTag:CALL_BUTTON_TAG]]; + [((ContextualTableCellView*) result) setContextualsControls:controls]; if (auto call = RecentModel::instance().getActiveCall(RecentModel::instance().peopleProxy()->mapToSource(qIdx))) { [details setStringValue:call->roleData((int)Ring::Role::FormattedState).toString().toNSString()]; @@ -239,6 +230,12 @@ NSInteger const TXT_BUTTON_TAG = 500; [((ContextualTableCellView*) result) setActiveState:NO]; } + NSTextField* unreadCount = [result viewWithTag:TXT_BUTTON_TAG]; + int unread = qIdx.data((int)Ring::Role::UnreadTextMessageCount).toInt(); + [unreadCount setHidden:(unread == 0)]; + [unreadCount.layer setCornerRadius:5.0f]; + [unreadCount setStringValue:qIdx.data((int)Ring::Role::UnreadTextMessageCount).toString().toNSString()]; + } else { result = [outlineView makeViewWithIdentifier:@"CallCell" owner:outlineView]; NSTextField* details = [result viewWithTag:DETAILS_TAG]; @@ -247,7 +244,7 @@ NSInteger const TXT_BUTTON_TAG = 500; } NSTextField* displayName = [result viewWithTag:DISPLAYNAME_TAG]; - [displayName setStringValue:qIdx.data(Qt::DisplayRole).toString().toNSString()]; + [displayName setStringValue:qIdx.data((int)Ring::Role::Name).toString().toNSString()]; NSImageView* photoView = [result viewWithTag:IMAGE_TAG]; Person* p = qvariant_cast(qIdx.data((int)Person::Role::Object)); QVariant photo = GlobalInstances::pixmapManipulator().contactPhoto(p, QSize(50,50)); @@ -255,6 +252,16 @@ NSInteger const TXT_BUTTON_TAG = 500; return result; } +- (void)outlineView:(NSOutlineView *)outlineView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row +{ + [outlineView scrollRowToVisible:0]; +} + +- (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item +{ + return [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil]; +} + - (IBAction)callClickedAtRow:(id)sender { NSInteger row = [smartView rowForView:sender]; [smartView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; @@ -267,52 +274,18 @@ NSInteger const TXT_BUTTON_TAG = 500; CallModel::instance().getCall(CallModel::instance().selectionModel()->currentIndex()) << Call::Action::REFUSE; } -/* View Based OutlineView: See the delegate method -tableView:rowViewForRow: in NSTableView. -*/ -- (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item -{ - return [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil]; -} - - -/* View Based OutlineView: This delegate method can be used to know when a new 'rowView' has been added to the table. At this point, you can choose to add in extra views, or modify any properties on 'rowView'. - */ -- (void)outlineView:(NSOutlineView *)outlineView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row -{ - -} - -/* View Based OutlineView: This delegate method can be used to know when 'rowView' has been removed from the table. The removed 'rowView' may be reused by the table so any additionally inserted views should be removed at this point. A 'row' parameter is included. 'row' will be '-1' for rows that are being deleted from the table and no longer have a valid row, otherwise it will be the valid row that is being removed due to it being moved off screen. - */ -- (void)outlineView:(NSOutlineView *)outlineView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row -{ - -} - - (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item { QModelIndex qIdx = [treeController toQIdx:((NSTreeNode*)item)]; return (((NSTreeNode*)item).indexPath.length == 1) ? 60.0 : 45.0; } -- (void) placeCallFromSearchField +- (void) startConversationFromSearchField { - Call* c = CallModel::instance().dialingCall(); - // check for a valid ring hash - NSCharacterSet *hexSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789abcdefABCDEF"]; - BOOL valid = [[[searchField stringValue] stringByTrimmingCharactersInSet:hexSet] isEqualToString:@""]; - - if(valid && searchField.stringValue.length == 40) { - c->setDialNumber(QString::fromNSString([NSString stringWithFormat:@"ring:%@",[searchField stringValue]])); - } else { - c->setDialNumber(QString::fromNSString([searchField stringValue])); - } - - c << Call::Action::ACCEPT; - - [searchField setStringValue:@""]; - RecentModel::instance().peopleProxy()-> - setFilterRegExp(QRegExp(QString::fromNSString([searchField stringValue]), Qt::CaseInsensitive, QRegExp::FixedString)); + auto cm = PhoneDirectoryModel::instance().getNumber(QString::fromNSString([searchField stringValue])); + time_t currentTime; + ::time(¤tTime); + cm->setLastUsed(currentTime); } - (void) addToContact @@ -365,7 +338,7 @@ NSInteger const TXT_BUTTON_TAG = 500; { if (commandSelector == @selector(insertNewline:)) { if([[searchField stringValue] isNotEqualTo:@""]) { - [self placeCallFromSearchField]; + [self startConversationFromSearchField]; return YES; } } @@ -385,8 +358,7 @@ NSInteger const TXT_BUTTON_TAG = 500; - (void)controlTextDidChange:(NSNotification *) notification { - RecentModel::instance().peopleProxy()-> - setFilterRegExp(QRegExp(QString::fromNSString([searchField stringValue]), Qt::CaseInsensitive, QRegExp::FixedString)); + RecentModel::instance().peopleProxy()->setFilterWildcard(QString::fromNSString([searchField stringValue])); } #pragma mark - ContactLinkedDelegate diff --git a/src/views/IMTableCellView.h b/src/views/IMTableCellView.h new file mode 100644 index 0000000000000000000000000000000000000000..68fd839114211be2c2246effe9885fcdea0696ad --- /dev/null +++ b/src/views/IMTableCellView.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2016 Savoir-faire Linux Inc. + * Author: Alexandre Lision + * + * 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 + +@interface IMTableCellView : NSTableCellView + +@property (nonatomic, strong) IBOutlet NSImageView* photoView; +@property (nonatomic, strong) IBOutlet NSTextView* msgView; + +- (void) setup; +- (void) updateWidthConstraint:(CGFloat) newWidth; + +@end diff --git a/src/views/IMTableCellView.mm b/src/views/IMTableCellView.mm new file mode 100644 index 0000000000000000000000000000000000000000..a9d94979753172d4d1676f2710df14fab453e0c1 --- /dev/null +++ b/src/views/IMTableCellView.mm @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 Savoir-faire Linux Inc. + * Author: Alexandre Lision + * + * 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 "IMTableCellView.h" + +#import "NSColor+RingTheme.h" + +@implementation IMTableCellView +@synthesize msgView; +@synthesize photoView; + + +- (void) setup +{ + if ([self.identifier isEqualToString:@"RightMessageView"]) { + [self.msgView setBackgroundColor:[NSColor ringBlue]]; + } + [self.msgView setString:@""]; + [self.msgView setAutoresizingMask:NSViewWidthSizable]; + [self.msgView setEnabledTextCheckingTypes:NSTextCheckingTypeLink]; + [self.msgView setAutomaticLinkDetectionEnabled:YES]; +} + +- (void) updateWidthConstraint:(CGFloat) newWidth +{ + [self.msgView removeConstraints:[self.msgView constraints]]; + NSLayoutConstraint* constraint = [NSLayoutConstraint + constraintWithItem:self.msgView + attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem: nil + attribute:NSLayoutAttributeWidth + multiplier:1.0f + constant:newWidth]; + + [self.msgView addConstraint:constraint]; +} + +@end diff --git a/src/views/IconButton.mm b/src/views/IconButton.mm index 59db443a25975385bfd717a834084463af2a6887..24ce76e06320aff6c2732849b167d5354fd92414 100644 --- a/src/views/IconButton.mm +++ b/src/views/IconButton.mm @@ -40,53 +40,63 @@ { [super drawRect:dirtyRect]; - NSColor* backgroundColor6; - NSColor* backgroundStrokeColor5; + NSColor* backgroundColor; + NSColor* backgroundStrokeColor; + NSColor* tintColor = [NSColor whiteColor]; - if (self.mouseDown || self.state == NSOnState) { + if (self.mouseDown || self.isHighlighted) { if (self.highlightColor) { - backgroundColor6 = self.highlightColor; - backgroundStrokeColor5 = [self.highlightColor darkenColorByValue:0.1]; + backgroundColor = self.highlightColor; + backgroundStrokeColor = [self.highlightColor darkenColorByValue:0.1]; } else { - backgroundColor6 = [self.bgColor darkenColorByValue:0.3]; - backgroundStrokeColor5 = [self.bgColor darkenColorByValue:0.4]; + backgroundColor = [self.bgColor darkenColorByValue:0.3]; + backgroundStrokeColor = [self.bgColor darkenColorByValue:0.4]; } - + } else if (!self.isEnabled) { + backgroundColor = [self.bgColor colorWithAlphaComponent:0.7]; + backgroundStrokeColor = [self.bgColor colorWithAlphaComponent:0.7]; + tintColor = [[NSColor grayColor] colorWithAlphaComponent:0.3]; } else { - backgroundColor6 = self.bgColor; - backgroundStrokeColor5 = [self.bgColor darkenColorByValue:0.1]; + backgroundColor = self.bgColor; + backgroundStrokeColor = [self.bgColor darkenColorByValue:0.1]; } //// Subframes - NSRect group = NSMakeRect(NSMinX(dirtyRect) + floor(NSWidth(dirtyRect) * 0.03333) + 0.5, NSMinY(dirtyRect) + floor(NSHeight(dirtyRect) * 0.03333) + 0.5, floor(NSWidth(dirtyRect) * 0.96667) - floor(NSWidth(dirtyRect) * 0.03333), floor(NSHeight(dirtyRect) * 0.96667) - floor(NSHeight(dirtyRect) * 0.03333)); + NSRect group = NSMakeRect(NSMinX(dirtyRect) + floor(NSWidth(dirtyRect) * 0.03333) + 0.5, + NSMinY(dirtyRect) + floor(NSHeight(dirtyRect) * 0.03333) + 0.5, + floor(NSWidth(dirtyRect) * 0.96667) - floor(NSWidth(dirtyRect) * 0.03333), + floor(NSHeight(dirtyRect) * 0.96667) - floor(NSHeight(dirtyRect) * 0.03333)); //// Group { //// Oval Drawing - NSBezierPath* ovalPath = [NSBezierPath bezierPathWithRoundedRect:NSMakeRect(NSMinX(group) + floor(NSWidth(group) * 0.00000 + 0.5), NSMinY(group) + floor(NSHeight(group) * 0.00000 + 0.5), floor(NSWidth(group) * 1.00000 + 0.5) - floor(NSWidth(group) * 0.00000 + 0.5), floor(NSHeight(group) * 1.00000 + 0.5) - floor(NSHeight(group) * 0.00000 + 0.5)) xRadius:[self.cornerRadius floatValue] yRadius:[self.cornerRadius floatValue]]; - - [backgroundColor6 setFill]; + NSBezierPath* ovalPath = [NSBezierPath bezierPathWithRoundedRect: + NSMakeRect(NSMinX(group) + floor(NSWidth(group) * 0.00000 + 0.5), + NSMinY(group) + floor(NSHeight(group) * 0.00000 + 0.5), + floor(NSWidth(group) * 1.00000 + 0.5) - floor(NSWidth(group) * 0.00000 + 0.5), + floor(NSHeight(group) * 1.00000 + 0.5) - floor(NSHeight(group) * 0.00000 + 0.5)) + xRadius:[self.cornerRadius floatValue] yRadius:[self.cornerRadius floatValue]]; + + [backgroundColor setFill]; [ovalPath fill]; - [backgroundStrokeColor5 setStroke]; + [backgroundStrokeColor setStroke]; [ovalPath setLineWidth: 0.5]; [ovalPath stroke]; [NSGraphicsContext saveGraphicsState]; - NSBezierPath *path = [NSBezierPath bezierPathWithRect:dirtyRect]; + NSBezierPath* path = [NSBezierPath bezierPathWithRect:dirtyRect]; [path addClip]; [self setImagePosition:NSImageOnly]; - auto rect2 = NSInsetRect(dirtyRect, self.imageInsets, self.imageInsets); - + auto rect = NSInsetRect(dirtyRect, self.imageInsets, self.imageInsets); - [[NSColor image:self.image tintedWithColor:[NSColor whiteColor]] - drawInRect:rect2 + [[NSColor image:self.image tintedWithColor:tintColor] drawInRect:rect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 - respectFlipped:YES - hints:nil]; + respectFlipped:YES + hints:nil]; [NSGraphicsContext restoreGraphicsState]; } diff --git a/src/views/NSColor+RingTheme.h b/src/views/NSColor+RingTheme.h index 35f58abb7255324a9724b17337cebeb6dcd4fac0..08d145b032a83e0c292c53a44fef56c4251520cc 100644 --- a/src/views/NSColor+RingTheme.h +++ b/src/views/NSColor+RingTheme.h @@ -27,6 +27,7 @@ + (NSColor*) ringDarkBlue; + (NSColor*) ringGreyHighlight; ++ (NSColor*) ringGreyLight; + (NSColor*) ringDarkGrey; - (NSColor *)lightenColorByValue:(float)value; diff --git a/src/views/NSColor+RingTheme.mm b/src/views/NSColor+RingTheme.mm index bf1f2560f0037aad939468e6925366e9a209ce13..1090e9564acacb6f608d0f40b70612056669ee2d 100644 --- a/src/views/NSColor+RingTheme.mm +++ b/src/views/NSColor+RingTheme.mm @@ -41,6 +41,11 @@ return [NSColor colorWithCalibratedRed:239/255.0 green:239/255.0 blue:239/255.0 alpha:1.0]; } ++ (NSColor*) ringGreyLight +{ + return [NSColor colorWithCalibratedRed:176/255.0 green:176/255.0 blue:176/255.0 alpha:1.0]; +} + + (NSColor*) ringDarkGrey { return [NSColor colorWithCalibratedRed:41/255.0 green:41/255.0 blue:41/255.0 alpha:1.0]; diff --git a/ui/Base.lproj/Conversation.xib b/ui/Base.lproj/Conversation.xib new file mode 100644 index 0000000000000000000000000000000000000000..f685088b4761e8630649e7f01f9d30f8d6b98d72 --- /dev/null +++ b/ui/Base.lproj/Conversation.xib @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Send a message + Send a message + Send a message + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/Base.lproj/CurrentCall.xib b/ui/Base.lproj/CurrentCall.xib index fd29ac53282b92e0c44aede3ea938431f05280df..a273113fdf8b28d3a4e6534a1def8dba5d748543 100644 --- a/ui/Base.lproj/CurrentCall.xib +++ b/ui/Base.lproj/CurrentCall.xib @@ -1,7 +1,7 @@ - + - + @@ -48,7 +48,7 @@ - + @@ -123,7 +123,7 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -373,59 +389,64 @@ - @@ -489,10 +510,10 @@ - + - + @@ -503,7 +524,7 @@ - + diff --git a/ui/Base.lproj/RingWindow.xib b/ui/Base.lproj/RingWindow.xib index e38394c112f6b717eb3ae9980dfc9b55a2022de5..490f9069ce50ffcf86058ffdfa6f5214c1eeac66 100644 --- a/ui/Base.lproj/RingWindow.xib +++ b/ui/Base.lproj/RingWindow.xib @@ -1,7 +1,7 @@ - + - + @@ -24,10 +24,68 @@ + + + + + + + + + + + + + + Ring is a secure and distributed voice, video and chat communication platform that requires no centralized server and leaves the power of privacy in the hands of the user. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -41,6 +99,26 @@ + + @@ -50,14 +128,14 @@ - - + + - + - + @@ -89,8 +167,12 @@ - + + + + + @@ -101,24 +183,37 @@ - + + + + + + + + - - + + + + + + + @@ -128,14 +223,6 @@ - - - - - - - - @@ -144,12 +231,13 @@ - + + + + + + + + + + - + @@ -204,14 +302,14 @@ - - + + - + - + @@ -335,14 +433,14 @@ - - + + - + - + @@ -365,8 +463,8 @@ - - + + @@ -390,7 +488,7 @@ - + @@ -517,134 +595,13 @@ - - + + - - - - - - - - Ring is a secure and distributed voice, video and chat communication platform that requires no centralized server and leaves the power of privacy in the hands of the user. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -694,6 +651,7 @@ +