Commit 52705021 authored by Alexandre Lision's avatar Alexandre Lision

dtmf: add toggle in account settings

Choose between RTP or SIP dtmf. THis is the first step before presenting
a software dialpad during calls, and be able to respond to automated
systems

Change-Id: Ia09cf6a2c4bc2abcf2ca766ab7c760f7cdedd8da
Tuleap: #154
parent 196545b2
......@@ -31,6 +31,8 @@
__unsafe_unretained IBOutlet NSSecureTextField *passwordTextField;
NSTextField *clearTextField;
__unsafe_unretained IBOutlet NSButton *dtmfRTPButton;
__unsafe_unretained IBOutlet NSButton *dtmfSIPButton;
__unsafe_unretained IBOutlet NSButton *upnpButton;
__unsafe_unretained IBOutlet NSButton *autoAnswerButton;
__unsafe_unretained IBOutlet NSButton *userAgentButton;
......@@ -47,6 +49,8 @@ typedef NS_ENUM(NSInteger, TagViews) {
USERNAME = 2,
PASSWORD = 3,
USERAGENT = 4,
DTMF_SIP = 5,
DTMF_RTP = 6,
};
- (void)awakeFromNib
......@@ -57,6 +61,8 @@ typedef NS_ENUM(NSInteger, TagViews) {
[usernameTextField setTag:TagViews::USERNAME];
[passwordTextField setTag:TagViews::PASSWORD];
[userAgentTextField setTag:TagViews::USERAGENT];
[dtmfRTPButton setTag:DTMF_RTP];
[dtmfSIPButton setTag:DTMF_SIP];
QObject::connect(AccountModel::instance().selectionModel(),
&QItemSelectionModel::currentChanged,
......@@ -100,6 +106,8 @@ typedef NS_ENUM(NSInteger, TagViews) {
[userAgentTextField setEnabled:AccountModel::instance().selectedAccount()->hasCustomUserAgent()];
[autoAnswerButton setState:AccountModel::instance().selectedAccount()->isAutoAnswer()];
[userAgentTextField setStringValue:account->userAgent().toNSString()];
(account->DTMFType() == DtmfType::OverRtp) ? [dtmfRTPButton setState:NSOnState] : [dtmfSIPButton setState:NSOnState];
}
- (IBAction)tryRegistration:(id)sender {
......@@ -164,4 +172,17 @@ typedef NS_ENUM(NSInteger, TagViews) {
break;
}
}
- (IBAction)toggleDTMFType:(id)sender
{
switch ([sender tag]) {
case TagViews::DTMF_RTP:
AccountModel::instance().selectedAccount()->setDTMFType(DtmfType::OverRtp);
break;
case TagViews::DTMF_SIP:
AccountModel::instance().selectedAccount()->setDTMFType(DtmfType::OverSip);
break;
}
}
@end
......@@ -8,6 +8,8 @@
<connections>
<outlet property="aliasTextField" destination="Ilk-QS-8PT" id="cGv-as-uy7"/>
<outlet property="autoAnswerButton" destination="T5L-Hx-tAq" id="ybf-2A-4RV"/>
<outlet property="dtmfRTPButton" destination="ATi-aw-lOp" id="jNF-jm-Twl"/>
<outlet property="dtmfSIPButton" destination="TiO-iR-TOU" id="hqu-4l-miw"/>
<outlet property="passwordTextField" destination="POs-9R-DUW" id="WQ2-Dn-Yek"/>
<outlet property="serverHostTextField" destination="VuA-jX-Kqu" id="LQt-Ti-eBW"/>
<outlet property="upnpButton" destination="Rsc-fc-lz8" id="571-Uv-EiD"/>
......@@ -20,11 +22,11 @@
<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="582" height="323"/>
<rect key="frame" x="0.0" y="0.0" width="582" height="380"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0Ej-Lr-p20">
<rect key="frame" x="171" y="157" width="150" height="22"/>
<rect key="frame" x="171" y="214" width="150" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="6wZ-M4-Cnf">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
......@@ -35,7 +37,7 @@
</connections>
</textField>
<secureTextField verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="POs-9R-DUW">
<rect key="frame" x="171" y="117" width="150" height="22"/>
<rect key="frame" x="171" y="174" width="150" height="22"/>
<secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="Cvf-pZ-qe0">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
......@@ -49,7 +51,7 @@
</connections>
</secureTextField>
<textField verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VuA-jX-Kqu">
<rect key="frame" x="171" y="197" width="150" height="22"/>
<rect key="frame" x="171" y="254" width="150" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="37d-ck-pa7">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
......@@ -60,7 +62,7 @@
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3ZB-JI-U6Y">
<rect key="frame" x="103" y="122" width="62" height="17"/>
<rect key="frame" x="103" y="179" width="62" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Password:" id="WCR-30-BX0">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
......@@ -68,7 +70,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Btb-K1-phc">
<rect key="frame" x="56" y="200" width="109" height="17"/>
<rect key="frame" x="56" y="257" width="109" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Server hostname" id="3uy-g0-eCm">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
......@@ -76,7 +78,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1IP-mF-EDC">
<rect key="frame" x="18" y="225" width="81" height="17"/>
<rect key="frame" x="18" y="282" width="81" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Parameters" id="mlN-YG-fLS">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
......@@ -84,7 +86,7 @@
</textFieldCell>
</textField>
<button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Otd-nX-zTh">
<rect key="frame" x="327" y="119" width="129" height="18"/>
<rect key="frame" x="327" y="176" width="129" height="18"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="125" id="9X5-dC-041"/>
</constraints>
......@@ -97,7 +99,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="x2R-Ot-MbT">
<rect key="frame" x="323" y="151" width="137" height="32"/>
<rect key="frame" x="323" y="208" width="137" height="32"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="125" id="YzV-yr-h9S"/>
</constraints>
......@@ -110,7 +112,7 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7fA-3M-fa5">
<rect key="frame" x="98" y="160" width="67" height="17"/>
<rect key="frame" x="98" y="217" width="67" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Username" id="4Nm-hw-379">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
......@@ -118,7 +120,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h5v-jy-4zX">
<rect key="frame" x="18" y="286" width="56" height="17"/>
<rect key="frame" x="18" y="343" width="56" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Account" id="upU-sL-9i3">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
......@@ -126,7 +128,7 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ilk-QS-8PT">
<rect key="frame" x="171" y="258" width="150" height="22"/>
<rect key="frame" x="171" y="315" width="150" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="E5h-w4-Vl2">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
......@@ -137,7 +139,7 @@
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7wz-eU-lJh">
<rect key="frame" x="131" y="261" width="34" height="17"/>
<rect key="frame" x="131" y="318" width="34" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Alias" id="Mxv-Rt-ON6">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
......@@ -145,7 +147,7 @@
</textFieldCell>
</textField>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T5L-Hx-tAq">
<rect key="frame" x="30" y="53" width="426" height="18"/>
<rect key="frame" x="30" y="110" width="426" height="18"/>
<buttonCell key="cell" type="check" title="Auto-answer calls" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="YMy-QE-7A3">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
......@@ -155,7 +157,7 @@
</connections>
</button>
<button ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="a4o-bf-KQu">
<rect key="frame" x="30" y="22" width="168" height="18"/>
<rect key="frame" x="30" y="79" width="168" height="18"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="164" id="jr6-fZ-YC7"/>
</constraints>
......@@ -168,7 +170,7 @@
</connections>
</button>
<textField verticalHuggingPriority="750" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="y8K-Hi-TMC">
<rect key="frame" x="204" y="20" width="131" height="22"/>
<rect key="frame" x="204" y="77" width="131" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="cv3-cR-i3a">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
......@@ -179,7 +181,7 @@
</connections>
</textField>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Rsc-fc-lz8">
<rect key="frame" x="30" y="83" width="426" height="18"/>
<rect key="frame" x="30" y="140" width="426" height="18"/>
<buttonCell key="cell" type="check" title="Upnp enabled" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="N5h-tI-ZLz">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
......@@ -189,7 +191,7 @@
</connections>
</button>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="p00-of-ToC">
<rect key="frame" x="532" y="273" width="30" height="30"/>
<rect key="frame" x="532" y="330" width="30" height="30"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ic_delete" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="u1c-BX-hXL">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
......@@ -198,6 +200,34 @@
<action selector="removeAccount:" target="-2" id="uzp-ub-gsq"/>
</connections>
</button>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="TiO-iR-TOU">
<rect key="frame" x="154" y="19" width="42" height="18"/>
<buttonCell key="cell" type="radio" title="SIP" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="jch-Qt-hTO">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="toggleDTMFType:" target="-2" id="tKb-Id-onp"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5JS-d0-0CC">
<rect key="frame" x="30" y="33" width="121" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="DTMF tone type" id="Rg8-qR-h1X">
<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>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ATi-aw-lOp">
<rect key="frame" x="154" y="41" width="47" height="18"/>
<buttonCell key="cell" type="radio" title="RTP" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="0D8-im-2uM">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="toggleDTMFType:" target="-2" id="Lim-17-Ac7"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="POs-9R-DUW" firstAttribute="leading" secondItem="3ZB-JI-U6Y" secondAttribute="trailing" constant="8" id="I7j-dS-1py"/>
......@@ -207,7 +237,7 @@
<constraint firstItem="POs-9R-DUW" firstAttribute="leading" secondItem="VuA-jX-Kqu" secondAttribute="leading" id="pMK-S0-Fo4"/>
<constraint firstItem="0Ej-Lr-p20" firstAttribute="leading" secondItem="7fA-3M-fa5" secondAttribute="trailing" constant="8" id="zhV-Nm-bmz"/>
</constraints>
<point key="canvasLocation" x="13" y="8.5"/>
<point key="canvasLocation" x="13" y="37"/>
</customView>
</objects>
<resources>
......
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