Commit 882cbacf authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

UI: change responder for place call button

Call button in SmartList or Persons tab does not work when other views keep
focus. This patch change it by sending action to mainView.

Change-Id: I93c869886fcc0e7419614a7efc257def771e2433
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent b2645475
...@@ -20,4 +20,6 @@ ...@@ -20,4 +20,6 @@
@interface PersonsVC : NSViewController <NSOutlineViewDelegate> @interface PersonsVC : NSViewController <NSOutlineViewDelegate>
- (void)startCallForRow:(id)sender;
@end @end
...@@ -212,7 +212,7 @@ NSInteger const CALL_BUTTON_TAG = 400; ...@@ -212,7 +212,7 @@ NSInteger const CALL_BUTTON_TAG = 400;
return result; return result;
} }
- (IBAction)callClickedAtRow:(id)sender { - (void)startCallForRow:(id)sender {
NSInteger row = [personsView rowForView:sender]; NSInteger row = [personsView rowForView:sender];
[personsView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; [personsView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
[self callContact:nil]; [self callContact:nil];
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#import "views/BackgroundView.h" #import "views/BackgroundView.h"
#import "ChooseAccountVC.h" #import "ChooseAccountVC.h"
#import "ContactRequestVC.h" #import "ContactRequestVC.h"
#import "PersonsVC.h"
@interface RingWindowController () <MigrateRingAccountsDelegate, NSToolbarDelegate> @interface RingWindowController () <MigrateRingAccountsDelegate, NSToolbarDelegate>
...@@ -65,6 +66,7 @@ ...@@ -65,6 +66,7 @@
PreferencesWC* preferencesWC; PreferencesWC* preferencesWC;
IBOutlet SmartViewVC* smartViewVC; IBOutlet SmartViewVC* smartViewVC;
IBOutlet PersonsVC* personsVC;
CurrentCallVC* currentCallVC; CurrentCallVC* currentCallVC;
ConversationVC* offlineVC; ConversationVC* offlineVC;
...@@ -296,6 +298,21 @@ NSString* const kTrustRequestMenuItemIdentifier = @"TrustRequestMenuItemIde ...@@ -296,6 +298,21 @@ NSString* const kTrustRequestMenuItemIdentifier = @"TrustRequestMenuItemIde
[smartViewVC showSmartlist]; [smartViewVC showSmartlist];
} }
- (IBAction)callClickedAtRow:(id)sender
{
NSTabViewItem *selectedTab = [smartViewVC.tabbar selectedTabViewItem];
int index = [smartViewVC.tabbar indexOfTabViewItem:selectedTab];
switch (index) {
case 0:
[smartViewVC startCallForRow:sender];
break;
case 2:
[personsVC startCallForRow:sender];
break;
default:
break;
}
}
#pragma mark - Ring account migration #pragma mark - Ring account migration
- (void) migrateRingAccount:(Account*) acc - (void) migrateRingAccount:(Account*) acc
......
...@@ -21,10 +21,14 @@ ...@@ -21,10 +21,14 @@
@interface SmartViewVC : NSViewController <NSTextFieldDelegate> @interface SmartViewVC : NSViewController <NSTextFieldDelegate>
@property (unsafe_unretained) IBOutlet NSTabView* tabbar;
- (void)showHistory; - (void)showHistory;
- (void)showContacts; - (void)showContacts;
- (void)showSmartlist; - (void)showSmartlist;
- (void)startCallForRow:(id)sender;
@end @end
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
//UI elements //UI elements
__unsafe_unretained IBOutlet RingOutlineView* smartView; __unsafe_unretained IBOutlet RingOutlineView* smartView;
__unsafe_unretained IBOutlet NSSearchField* searchField; __unsafe_unretained IBOutlet NSSearchField* searchField;
__unsafe_unretained IBOutlet NSTabView* tabbar;
/* Pending ring usernames lookup for the search entry */ /* Pending ring usernames lookup for the search entry */
QMetaObject::Connection usernameLookupConnection; QMetaObject::Connection usernameLookupConnection;
...@@ -66,6 +65,8 @@ ...@@ -66,6 +65,8 @@
@implementation SmartViewVC @implementation SmartViewVC
@synthesize tabbar;
// Tags for views // Tags for views
NSInteger const IMAGE_TAG = 100; NSInteger const IMAGE_TAG = 100;
NSInteger const DISPLAYNAME_TAG = 200; NSInteger const DISPLAYNAME_TAG = 200;
...@@ -292,7 +293,7 @@ NSInteger const PRESENCE_TAG = 800; ...@@ -292,7 +293,7 @@ NSInteger const PRESENCE_TAG = 800;
return [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil]; return [outlineView makeViewWithIdentifier:@"HoverRowView" owner:nil];
} }
- (IBAction)callClickedAtRow:(id)sender { - (void)startCallForRow:(id)sender {
NSInteger row = [smartView rowForView:sender]; NSInteger row = [smartView rowForView:sender];
[smartView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; [smartView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
[self placeCall:nil]; [self placeCall:nil];
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<outlet property="centerYQRCodeConstraint" destination="16A-gO-qJA" id="n19-pY-QTQ"/> <outlet property="centerYQRCodeConstraint" destination="16A-gO-qJA" id="n19-pY-QTQ"/>
<outlet property="centerYWelcomeContainerConstraint" destination="Duk-XW-qcv" id="Jg8-0V-Khf"/> <outlet property="centerYWelcomeContainerConstraint" destination="Duk-XW-qcv" id="Jg8-0V-Khf"/>
<outlet property="currentView" destination="se5-gp-TjO" id="Sae-7F-MB3"/> <outlet property="currentView" destination="se5-gp-TjO" id="Sae-7F-MB3"/>
<outlet property="personsVC" destination="9RF-6W-vEW" id="QZW-1T-r5D"/>
<outlet property="qrcodeView" destination="dZR-JL-MY4" id="6Jf-42-qwY"/> <outlet property="qrcodeView" destination="dZR-JL-MY4" id="6Jf-42-qwY"/>
<outlet property="ringIDLabel" destination="JN3-vO-zcd" id="WHd-L7-6od"/> <outlet property="ringIDLabel" destination="JN3-vO-zcd" id="WHd-L7-6od"/>
<outlet property="shareButton" destination="Oac-o7-2Ge" id="b0D-xr-PCx"/> <outlet property="shareButton" destination="Oac-o7-2Ge" id="b0D-xr-PCx"/>
...@@ -427,7 +428,7 @@ ...@@ -427,7 +428,7 @@
<rect key="frame" x="0.0" y="0.0" width="324" height="612"/> <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
<clipView key="contentView" focusRingType="none" drawsBackground="NO" copiesOnScroll="NO" id="S00-xr-jYM"> <clipView key="contentView" focusRingType="none" drawsBackground="NO" copiesOnScroll="NO" id="S00-xr-jYM">
<rect key="frame" x="0.0" y="0.0" width="324" height="612"/> <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="70" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="10" outlineTableColumn="8Ve-L0-o7V" id="Hrg-Fe-uGq" customClass="RingOutlineView"> <outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="70" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="10" outlineTableColumn="8Ve-L0-o7V" id="Hrg-Fe-uGq" customClass="RingOutlineView">
<rect key="frame" x="0.0" y="0.0" width="324" height="612"/> <rect key="frame" x="0.0" y="0.0" width="324" height="612"/>
......
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