diff --git a/CMakeLists.txt b/CMakeLists.txt index 6773ddfa12b4f30e5ceb89bcae799adc8e398e08..220e3c884d48c5708da410cd24fb846cf47feffe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,6 +137,8 @@ SET(ringclient_VIEWS src/views/HoverTableRowView.h src/views/NSColor+RingTheme.mm src/views/NSColor+RingTheme.h + src/views/NSImage+Extensions.mm + src/views/NSImage+Extensions.h src/views/ContextualTableCellView.mm src/views/ContextualTableCellView.h src/views/IconButton.h diff --git a/src/CurrentCallVC.mm b/src/CurrentCallVC.mm index 2d8cbb35e0b24e378c391e051c98f5887db32192..8cc9f224dff8cec0824c2c034e23d56454ab07f9 100644 --- a/src/CurrentCallVC.mm +++ b/src/CurrentCallVC.mm @@ -156,7 +156,7 @@ [stateLabel setStringValue:callIdx.data((int)Call::Role::HumanStateName).toString().toNSString()]; if (firstRun) { - QVariant photo = GlobalInstances::pixmapManipulator().callPhoto(current, QSize(50,50)); + QVariant photo = GlobalInstances::pixmapManipulator().callPhoto(current, QSize(100,100)); [personPhoto setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(photo))]; } diff --git a/src/GeneralPrefsVC.mm b/src/GeneralPrefsVC.mm index 0e7e51f0b348d383f640d24da7c60f2ae18c794d..b1693ccfd47cc8f5f05168292d6a54ea0121082f 100644 --- a/src/GeneralPrefsVC.mm +++ b/src/GeneralPrefsVC.mm @@ -18,35 +18,43 @@ */ #import "GeneralPrefsVC.h" +#import <Quartz/Quartz.h> + +//Qt +#import <QSize> +#import <QtMacExtras/qmacfunctions.h> +#import <QPixmap> + +//LRC #import <categorizedhistorymodel.h> +#import <profilemodel.h> +#import <profile.h> +#import <person.h> +#import <globalinstances.h> #if ENABLE_SPARKLE #import <Sparkle/Sparkle.h> #endif #import "Constants.h" - -@interface GeneralPrefsVC () -@property (unsafe_unretained) IBOutlet NSTextField* historyChangedLabel; -@property (unsafe_unretained) IBOutlet NSButton* startUpButton; -@property (unsafe_unretained) IBOutlet NSButton* toggleAutomaticUpdateCheck; -@property (unsafe_unretained) IBOutlet NSPopUpButton* checkIntervalPopUp; -@property (unsafe_unretained) IBOutlet NSView* sparkleContainer; -@property (unsafe_unretained) IBOutlet NSTextField* historyTextField; -@property (unsafe_unretained) IBOutlet NSStepper* historyStepper; -@property (unsafe_unretained) IBOutlet NSButton* historySwitch; - +#import "views/NSImage+Extensions.h" +#import "delegates/ImageManipulationDelegate.h" + +@interface GeneralPrefsVC () { + __unsafe_unretained IBOutlet NSTextField* historyChangedLabel; + __unsafe_unretained IBOutlet NSButton* startUpButton; + __unsafe_unretained IBOutlet NSButton* toggleAutomaticUpdateCheck; + __unsafe_unretained IBOutlet NSPopUpButton* checkIntervalPopUp; + __unsafe_unretained IBOutlet NSView* sparkleContainer; + __unsafe_unretained IBOutlet NSTextField* historyTextField; + __unsafe_unretained IBOutlet NSStepper* historyStepper; + __unsafe_unretained IBOutlet NSButton* historySwitch; + __unsafe_unretained IBOutlet NSButton* photoView; + __unsafe_unretained IBOutlet NSTextField* profileNameField; +} @end @implementation GeneralPrefsVC -@synthesize historyChangedLabel; -@synthesize startUpButton; -@synthesize toggleAutomaticUpdateCheck; -@synthesize checkIntervalPopUp; -@synthesize sparkleContainer; -@synthesize historyTextField; -@synthesize historyStepper; -@synthesize historySwitch; - (void)loadView { @@ -74,6 +82,16 @@ [sparkleContainer setHidden:YES]; #endif + [photoView setWantsLayer: YES]; + photoView.layer.cornerRadius = photoView.frame.size.width / 2; + photoView.layer.masksToBounds = YES; + + if (auto pro = ProfileModel::instance().selectedProfile()) { + auto photo = GlobalInstances::pixmapManipulator().contactPhoto(pro->person(), {140,140}); + [photoView setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(photo))]; + [profileNameField setStringValue:pro->person()->formattedName().toNSString()]; + } + } - (void) dealloc @@ -86,7 +104,7 @@ [historyChangedLabel setHidden:NO]; } -- (IBAction)toggleHistory:(id)sender { +- (IBAction)toggleHistory:(NSButton*)sender { CategorizedHistoryModel::instance().setHistoryLimited([sender state]); int historyLimit = CategorizedHistoryModel::instance().historyLimit(); [historyTextField setStringValue:[NSString stringWithFormat:@"%d", historyLimit]]; @@ -171,4 +189,42 @@ return itemRef; } +#pragma mark - Profile Photo edition + +- (IBAction) editPhoto:(id)sender { + auto pictureTaker = [IKPictureTaker pictureTaker]; + [pictureTaker beginPictureTakerSheetForWindow:self.view.window + withDelegate:self + didEndSelector:@selector(pictureTakerDidEnd:returnCode:contextInfo:) + contextInfo:nil]; +} + +- (void) pictureTakerDidEnd:(IKPictureTaker *) picker + returnCode:(NSInteger) code + contextInfo:(void*) contextInfo +{ + if (auto outputImage = [picker outputImage]) { + [photoView setImage:outputImage]; + } else + [photoView setImage:[NSImage imageNamed:@"default_user_icon"]]; + if (auto pro = ProfileModel::instance().selectedProfile()) { + QPixmap p; + auto smallImg = [NSImage imageResize:[photoView image] newSize:{100,100}]; + if (p.loadFromData(QByteArray::fromNSData([smallImg TIFFRepresentation]))) { + pro->person()->setPhoto(QVariant(p)); + } + pro->save(); + } +} + +#pragma mark - NSTextFieldDelegate methods + +-(void)controlTextDidChange:(NSNotification *)notif +{ + if (auto pro = ProfileModel::instance().selectedProfile()) { + pro->person()->setFormattedName(profileNameField.stringValue.UTF8String); + pro->save(); + } +} + @end diff --git a/src/PreferencesWC.mm b/src/PreferencesWC.mm index 2dcb9d7553962963d59a28fcd2af5227fa9efb9a..6bb635a4a11be0e02416d6a30f34a20c5af28ed5 100644 --- a/src/PreferencesWC.mm +++ b/src/PreferencesWC.mm @@ -20,14 +20,17 @@ #import <QuartzCore/QuartzCore.h> +//LRC #import <accountmodel.h> #import <codecmodel.h> +#import <profilemodel.h> +#import <profile.h> +//Ring #import "AccountsVC.h" #import "GeneralPrefsVC.h" #import "AudioPrefsVC.h" #import "VideoPrefsVC.h" -#import "Constants.h" @implementation PreferencesWC { @@ -36,10 +39,11 @@ } -static NSString* const kProfilePrefsIdentifier = @"AccountsPrefsIdentifier"; -static NSString* const kGeneralPrefsIdentifier = @"GeneralPrefsIdentifier"; -static NSString* const kAudioPrefsIdentifer = @"AudioPrefsIdentifer"; -static NSString* const kVideoPrefsIdentifer = @"VideoPrefsIdentifer"; +// Identifiers used in PreferencesWindow.xib for tabs +static auto const kProfilePrefsIdentifier = @"AccountsPrefsIdentifier"; +static auto const kGeneralPrefsIdentifier = @"GeneralPrefsIdentifier"; +static auto const kAudioPrefsIdentifer = @"AudioPrefsIdentifer"; +static auto const kVideoPrefsIdentifer = @"VideoPrefsIdentifer"; - (void)windowDidLoad { @@ -52,6 +56,7 @@ static NSString* const kVideoPrefsIdentifer = @"VideoPrefsIdentifer"; - (void)windowWillClose:(NSNotification *)notification { AccountModel::instance().save(); + ProfileModel::instance().selectedProfile()->save(); } - (IBAction)displayGeneral:(NSToolbarItem *)sender @@ -93,26 +98,39 @@ static NSString* const kVideoPrefsIdentifer = @"VideoPrefsIdentifer"; - (void) resizeWindowWithFrame:(NSRect)fr { - NSToolbar *toolbar = [self.window toolbar]; - CGFloat toolbarHeight = 0.0; - NSRect windowFrame; - - if (toolbar && [toolbar isVisible]) { - windowFrame = [NSWindow contentRectForFrameRect:[self.window frame] - styleMask:[self.window styleMask]]; - toolbarHeight = NSHeight(windowFrame) - NSHeight([[self.window contentView] frame]); - } - auto frame = [self.window frame]; frame.origin.y += frame.size.height; - frame.origin.y -= NSHeight(fr) + toolbarHeight; - frame.size.height = NSHeight(fr) + toolbarHeight; + frame.origin.y -= NSHeight(fr) + [self toolBarHeight] + [self titleBarHeight]; + frame.size.height = NSHeight(fr) + [self toolBarHeight]; frame.size.width = NSWidth(fr); - frame = [NSWindow frameRectForContentRect:frame styleMask:[self.window styleMask]]; [self.window setFrame:frame display:YES animate:YES]; } +- (CGFloat) toolBarHeight +{ + NSRect windowFrame; + NSToolbar *toolbar = [self.window toolbar]; + CGFloat tHeight = 0.0; + if (toolbar && [toolbar isVisible]) { + + windowFrame = [NSWindow contentRectForFrameRect:[self.window frame] + styleMask:[self.window styleMask]]; + tHeight = NSHeight(windowFrame) - NSHeight([[self.window contentView] frame]); + } + return tHeight; +} + +- (float) titleBarHeight +{ + NSRect frame = NSMakeRect (0, 0, 100, 100); + NSRect contentRect; + contentRect = [NSWindow contentRectForFrameRect: frame + styleMask: NSTitledWindowMask]; + + return (frame.size.height - contentRect.size.height); +} + @end diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm index 5f75ef45cbc12a0c91307b13963e09ca48629d8c..3bc54134a8a443e3cb50552f3ccb4255efe71ffb 100644 --- a/src/RingWindowController.mm +++ b/src/RingWindowController.mm @@ -89,6 +89,7 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; &QItemSelectionModel::currentChanged, [=](const QModelIndex ¤t, const QModelIndex &previous) { auto call = RecentModel::instance().getActiveCall(current); + if(!current.isValid()) { [offlineVC animateOut]; [currentCallVC animateOut]; diff --git a/src/RingWizardWC.mm b/src/RingWizardWC.mm index 569ffaf0eedd90617e384273e2044347f6a3db3b..1e4b7b386c7a9a3fdaaa080441433a31035dc729 100644 --- a/src/RingWizardWC.mm +++ b/src/RingWizardWC.mm @@ -39,6 +39,7 @@ #import "AppDelegate.h" #import "Constants.h" +#import "views/NSImage+Extensions.h" #import "views/NSColor+RingTheme.h" @implementation RingWizardWC { @@ -156,7 +157,8 @@ NSInteger const NICKNAME_TAG = 1; if (auto profile = ProfileModel::instance().selectedProfile()) { profile->person()->setFormattedName([[nicknameField stringValue] UTF8String]); QPixmap p; - if (p.loadFromData(QByteArray::fromNSData([[photoView image] TIFFRepresentation]))) { + auto smallImg = [NSImage imageResize:[photoView image] newSize:{100,100}]; + if (p.loadFromData(QByteArray::fromNSData([smallImg TIFFRepresentation]))) { profile->person()->setPhoto(QVariant(p)); } profile->save(); diff --git a/src/main.mm b/src/main.mm index 989e9e995ad201cc35cb33009eceb0f03cbade97..f13b56300e9afc60e9b433427c2949e031a13eb4 100644 --- a/src/main.mm +++ b/src/main.mm @@ -33,6 +33,7 @@ #import <categorizedhistorymodel.h> #import <localhistorycollection.h> #import <localprofilecollection.h> +#import <peerprofilecollection.h> #import <numbercategorymodel.h> #import <callmodel.h> #import <profilemodel.h> @@ -80,6 +81,7 @@ int main(int argc, const char *argv[]) { RecentModel::instance(); // Make sure RecentModel is initialized before showing UI ProfileModel::instance().addCollection<LocalProfileCollection>(LoadOptions::FORCE_ENABLED); + PersonModel::instance().addCollection<PeerProfileCollection>(LoadOptions::FORCE_ENABLED); return NSApplicationMain(argc, argv); } diff --git a/src/views/NSImage+Extensions.h b/src/views/NSImage+Extensions.h new file mode 100644 index 0000000000000000000000000000000000000000..49d5ad1229576d1d157e72bc7c44998368526b9a --- /dev/null +++ b/src/views/NSImage+Extensions.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 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 NSImage (Extensions) + +/** + * @param anImage is the original NSImage + * @param newSize is the desired output size + * @return a resized NSImage + */ ++ (NSImage *)imageResize:(NSImage*)anImage + newSize:(NSSize)newSize; + +@end diff --git a/src/views/NSImage+Extensions.mm b/src/views/NSImage+Extensions.mm new file mode 100644 index 0000000000000000000000000000000000000000..16c10ff028710b70e7f235d7662b8a00e3e21087 --- /dev/null +++ b/src/views/NSImage+Extensions.mm @@ -0,0 +1,43 @@ +/* + * Copyright (C) 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 "NSImage+Extensions.h" + +@implementation NSImage (Extensions) + ++ (NSImage *)imageResize:(NSImage*)anImage + newSize:(NSSize)newSize +{ + auto sourceImage = anImage; + // Report an error if the source isn't a valid image + if (![sourceImage isValid]) { + NSLog(@"Invalid Image"); + } else { + auto smallImage = [[NSImage alloc] initWithSize: newSize]; + [smallImage lockFocus]; + [sourceImage setSize: newSize]; + [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh]; + [sourceImage drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.]; + [smallImage unlockFocus]; + return smallImage; + } + return nil; +} + +@end diff --git a/ui/Base.lproj/GeneralPrefs.xib b/ui/Base.lproj/GeneralPrefs.xib index 0677ddaebf6d2e404c36f0f5e21110a5978f6629..78ef34d70d98be59a7d549e3f72f4db1ad0cc5a5 100644 --- a/ui/Base.lproj/GeneralPrefs.xib +++ b/ui/Base.lproj/GeneralPrefs.xib @@ -11,6 +11,8 @@ <outlet property="historyStepper" destination="QmA-ZI-ZL5" id="dDV-1G-rZs"/> <outlet property="historySwitch" destination="DgD-2y-4g5" id="GYk-pz-jGT"/> <outlet property="historyTextField" destination="tHZ-7Q-5iP" id="keP-y2-7Pg"/> + <outlet property="photoView" destination="L6I-bx-LnN" id="nag-Fb-Uxb"/> + <outlet property="profileNameField" destination="Mjw-8U-dzO" id="IeO-vk-yDC"/> <outlet property="sparkleContainer" destination="yVO-jk-ay3" id="zni-hI-88D"/> <outlet property="startUpButton" destination="1Nr-L4-fcd" id="veu-Hi-c7L"/> <outlet property="toggleAutomaticUpdateCheck" destination="MCd-PD-kd7" id="rSB-ac-Nm2"/> @@ -20,20 +22,31 @@ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> <customView id="c22-O7-iKe"> - <rect key="frame" x="0.0" y="0.0" width="526" height="326"/> + <rect key="frame" x="0.0" y="0.0" width="546" height="421"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <subviews> - <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kYQ-jU-skU"> - <rect key="frame" x="18" y="264" width="182" height="17"/> - <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Desktop Notifications" id="xlz-zw-IJI"> - <font key="font" metaFont="system"/> + <textField toolTip="Profile" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MV1-AC-qE7"> + <rect key="frame" x="30" y="384" width="79" height="17"/> + <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Profile" id="Thg-oC-5Qw"> + <font key="font" metaFont="systemBold"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> + <textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Mjw-8U-dzO"> + <rect key="frame" x="210" y="305" width="197" height="22"/> + <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="blA-9U-jdI"> + <font key="font" metaFont="system"/> + <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + <connections> + <outlet property="delegate" destination="-2" id="SbF-hg-KD0"/> + </connections> + </textField> <button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Oth-up-2k2"> - <rect key="frame" x="204" y="262" width="147" height="18"/> - <buttonCell key="cell" type="check" title="Enable Notifications" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="uCL-ye-tsv"> + <rect key="frame" x="56" y="232" width="197" height="18"/> + <buttonCell key="cell" type="check" title="Enable Desktop Notifications" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="uCL-ye-tsv"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> @@ -41,38 +54,43 @@ <binding destination="Sz0-vm-i3t" name="value" keyPath="values.enable_notifications" id="PuD-KZ-Zat"/> </connections> </button> - <button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Is4-pD-LOT"> - <rect key="frame" x="204" y="227" width="294" height="18"/> - <buttonCell key="cell" type="check" title="Bring Ring to foreground on incoming calls" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="uYI-hA-JHk"> + <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="j3T-5j-Fom"> + <rect key="frame" x="30" y="256" width="162" height="17"/> + <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Behaviours" id="Rzy-Gh-3wQ"> + <font key="font" metaFont="systemBold"/> + <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + </textField> + <button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1Nr-L4-fcd"> + <rect key="frame" x="56" y="178" width="136" height="18"/> + <buttonCell key="cell" type="check" title="Launch on Startup" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="O2C-xR-mHF"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> - <binding destination="Sz0-vm-i3t" name="value" keyPath="values.window_behaviour" id="ZSW-he-LAz"/> + <action selector="toggleLaunchAtStartup:" target="-2" id="Rky-YK-2yk"/> </connections> </button> <button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DgD-2y-4g5"> - <rect key="frame" x="56" y="139" width="153" height="18"/> - <constraints> - <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="149" id="nYR-y5-QxP"/> - </constraints> + <rect key="frame" x="56" y="125" width="153" height="18"/> <buttonCell key="cell" type="check" title="Keep my history for" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="3Pb-Ec-zl5"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> - <action selector="toggleHistory:" target="-2" id="TiP-Pw-MFu"/> + <action selector="toggleHistory:" target="-2" id="2wV-yt-1YG"/> </connections> </button> <stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QmA-ZI-ZL5"> - <rect key="frame" x="251" y="134" width="19" height="27"/> + <rect key="frame" x="251" y="120" width="19" height="27"/> <stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" doubleValue="30" id="30B-YQ-Opa"/> <connections> <binding destination="Sz0-vm-i3t" name="value" keyPath="values.history_limit" id="c2j-mK-kYa"/> </connections> </stepper> <textField verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tHZ-7Q-5iP"> - <rect key="frame" x="206" y="137" width="40" height="22"/> + <rect key="frame" x="206" y="123" width="40" height="22"/> <constraints> <constraint firstAttribute="width" constant="40" id="Qal-Za-gWz"/> </constraints> @@ -90,7 +108,7 @@ </connections> </textField> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nah-Jm-ZYB"> - <rect key="frame" x="273" y="140" width="33" height="17"/> + <rect key="frame" x="273" y="125" width="33" height="17"/> <constraints> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="29" id="08C-IP-5pg"/> </constraints> @@ -101,7 +119,7 @@ </textFieldCell> </textField> <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="U84-le-Iy4"> - <rect key="frame" x="58" y="102" width="122" height="19"/> + <rect key="frame" x="58" y="93" width="122" height="19"/> <buttonCell key="cell" type="roundRect" title="Clear History" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="cd5-9L-Bbb"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="cellTitle"/> @@ -110,32 +128,11 @@ <action selector="clearHistory:" target="-2" id="yN7-bB-7EY"/> </connections> </button> - <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="j3T-5j-Fom"> - <rect key="frame" x="18" y="289" width="94" height="17"/> - <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Interruptions" id="Rzy-Gh-3wQ"> - <font key="font" metaFont="systemBold"/> - <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> - <button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1Nr-L4-fcd"> - <rect key="frame" x="204" y="191" width="136" height="18"/> - <buttonCell key="cell" type="check" title="Launch on Startup" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="O2C-xR-mHF"> - <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> - <font key="font" metaFont="system"/> - </buttonCell> - <connections> - <action selector="toggleLaunchAtStartup:" target="-2" id="Rky-YK-2yk"/> - </connections> - </button> <customView translatesAutoresizingMaskIntoConstraints="NO" id="yVO-jk-ay3"> - <rect key="frame" x="0.0" y="20" width="526" height="75"/> + <rect key="frame" x="20" y="20" width="506" height="61"/> <subviews> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="diX-uH-Ce8"> - <rect key="frame" x="18" y="47" width="52" height="17"/> - <constraints> - <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="48" id="eol-9K-zA2"/> - </constraints> + <rect key="frame" x="18" y="44" width="52" height="17"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Update" id="r4u-t3-gBc"> <font key="font" metaFont="systemBold"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> @@ -143,17 +140,14 @@ </textFieldCell> </textField> <button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MCd-PD-kd7"> - <rect key="frame" x="54" y="21" width="221" height="18"/> - <constraints> - <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="217" id="rY9-iO-Gx2"/> - </constraints> + <rect key="frame" x="43" y="18" width="221" height="18"/> <buttonCell key="cell" type="check" title="Automatically check for updates" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="T3a-yx-ZaW"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <popUpButton verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RYP-3d-PCa" userLabel="Update interval"> - <rect key="frame" x="279" y="15" width="100" height="26"/> + <rect key="frame" x="268" y="12" width="100" height="26"/> <popUpButtonCell key="cell" type="push" title="Monthly" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="2629800" imageScaling="proportionallyDown" inset="2" selectedItem="42E-UY-qlP" id="tTF-gp-Rti"> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="menu"/> @@ -169,24 +163,15 @@ </popUpButton> </subviews> <constraints> - <constraint firstAttribute="height" constant="75" id="1fz-dJ-nDo"/> + <constraint firstAttribute="height" constant="61" id="1fz-dJ-nDo"/> + <constraint firstItem="MCd-PD-kd7" firstAttribute="top" secondItem="diX-uH-Ce8" secondAttribute="bottom" constant="10" id="5Uq-c4-XfL"/> <constraint firstItem="RYP-3d-PCa" firstAttribute="leading" secondItem="MCd-PD-kd7" secondAttribute="trailing" constant="8" id="9c7-7m-udP"/> <constraint firstItem="diX-uH-Ce8" firstAttribute="leading" secondItem="yVO-jk-ay3" secondAttribute="leading" constant="20" id="DWV-bf-QJe"/> + <constraint firstItem="MCd-PD-kd7" firstAttribute="leading" secondItem="yVO-jk-ay3" secondAttribute="leading" constant="45" id="ZO7-pl-ug1"/> </constraints> </customView> - <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lIm-zX-RIV"> - <rect key="frame" x="18" y="228" width="182" height="17"/> - <constraints> - <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="120" id="ECK-NM-TjK"/> - </constraints> - <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Window behaviour" id="sog-Ok-Y0N"> - <font key="font" metaFont="system"/> - <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> - <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> - </textFieldCell> - </textField> <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Gyi-ID-Z3v"> - <rect key="frame" x="310" y="141" width="169" height="14"/> + <rect key="frame" x="310" y="126" width="169" height="14"/> <constraints> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="165" id="wfZ-X2-WX8"/> </constraints> @@ -197,20 +182,42 @@ </textFieldCell> </textField> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fC0-ce-Yiz"> - <rect key="frame" x="18" y="168" width="399" height="17"/> + <rect key="frame" x="18" y="147" width="399" height="17"/> <constraints> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="48" id="JrN-bM-7Wz"/> </constraints> - <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="History" id="DSD-yl-noX"> - <font key="font" metaFont="systemBold"/> - <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> + </textField> + <button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Is4-pD-LOT"> + <rect key="frame" x="56" y="205" width="294" height="18"/> + <buttonCell key="cell" type="check" title="Bring Ring to foreground on incoming calls" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="uYI-hA-JHk"> + <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <binding destination="Sz0-vm-i3t" name="value" keyPath="values.window_behaviour" id="ZSW-he-LAz"/> + </connections> + </button> + <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="L6I-bx-LnN"> + <rect key="frame" x="132" y="281" width="70" height="70"/> + <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSUser" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="8lT-0k-EYB"> + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + <connections> + <action selector="editPhoto:" target="-2" id="VuT-vf-PDV"/> + </connections> + </button> + <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="c9L-Qb-bNK"> + <rect key="frame" x="42" y="359" width="486" height="17"/> + <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="This is shared with your contacts " id="vbU-2S-O58"> + <font key="font" metaFont="system"/> + <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> </subviews> <constraints> <constraint firstItem="fC0-ce-Yiz" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="20" id="2iV-DB-Zna"/> - <constraint firstItem="Is4-pD-LOT" firstAttribute="leading" secondItem="lIm-zX-RIV" secondAttribute="trailing" constant="8" id="Apx-HB-LIX"/> <constraint firstItem="Gyi-ID-Z3v" firstAttribute="leading" secondItem="nah-Jm-ZYB" secondAttribute="trailing" constant="8" id="EYY-WC-fCM"/> <constraint firstItem="Oth-up-2k2" firstAttribute="leading" secondItem="Is4-pD-LOT" secondAttribute="leading" id="Fdb-2p-ULe"/> <constraint firstItem="nah-Jm-ZYB" firstAttribute="leading" secondItem="QmA-ZI-ZL5" secondAttribute="trailing" constant="8" id="JJi-0O-nUi"/> @@ -219,14 +226,34 @@ <constraint firstAttribute="bottom" secondItem="yVO-jk-ay3" secondAttribute="bottom" constant="20" id="bAA-rc-QhB"/> <constraint firstItem="tHZ-7Q-5iP" firstAttribute="leading" secondItem="DgD-2y-4g5" secondAttribute="trailing" constant="3" id="bV5-ZQ-94d"/> <constraint firstItem="Oth-up-2k2" firstAttribute="leading" secondItem="1Nr-L4-fcd" secondAttribute="leading" id="csu-Ug-9sD"/> - <constraint firstItem="yVO-jk-ay3" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="qa3-OH-fvn"/> + <constraint firstItem="yVO-jk-ay3" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="20" id="qa3-OH-fvn"/> <constraint firstItem="fC0-ce-Yiz" firstAttribute="top" secondItem="1Nr-L4-fcd" secondAttribute="bottom" constant="8" id="tQx-o6-feR"/> - <constraint firstItem="j3T-5j-Fom" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="20" id="twb-vI-7Ls"/> - <constraint firstAttribute="trailing" secondItem="yVO-jk-ay3" secondAttribute="trailing" id="wig-B4-OtV"/> + <constraint firstItem="j3T-5j-Fom" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="32" id="twb-vI-7Ls"/> + <constraint firstAttribute="trailing" secondItem="yVO-jk-ay3" secondAttribute="trailing" constant="20" id="wig-B4-OtV"/> </constraints> - <point key="canvasLocation" x="337" y="92"/> + <point key="canvasLocation" x="337" y="81.5"/> </customView> <userDefaultsController representsSharedInstance="YES" id="Sz0-vm-i3t"/> <customObject id="VEJ-ic-3Ub" customClass="SUUpdater"/> + <button id="WkM-0l-ODu"> + <rect key="frame" x="0.0" y="0.0" width="61" height="18"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> + <buttonCell key="cell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="f9K-yg-vBv"> + <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> + <font key="font" metaFont="system"/> + </buttonCell> + </button> + <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="yhY-lt-Sr1"> + <rect key="frame" x="0.0" y="0.0" width="38" height="17"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> + <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="VGe-3c-dbs"> + <font key="font" metaFont="system"/> + <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + </textField> </objects> + <resources> + <image name="NSUser" width="32" height="32"/> + </resources> </document> diff --git a/ui/Base.lproj/RingWindow.xib b/ui/Base.lproj/RingWindow.xib index 4c23f3d92c04f1082a5411370639c075441da47c..e5ef12b9437cc893181f398ddd4aad1725d8635c 100644 --- a/ui/Base.lproj/RingWindow.xib +++ b/ui/Base.lproj/RingWindow.xib @@ -20,7 +20,7 @@ <windowCollectionBehavior key="collectionBehavior" fullScreenPrimary="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> <rect key="contentRect" x="196" y="240" width="1053" height="658"/> - <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1050"/> + <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/> <view key="contentView" autoresizesSubviews="NO" id="se5-gp-TjO"> <rect key="frame" x="0.0" y="0.0" width="1053" height="658"/> <autoresizingMask key="autoresizingMask"/>