Commit e1cf4465 authored by Alexandre Lision's avatar Alexandre Lision

fix video prefs

we were using string ids to identify menus, that got exported and translated

Tuleap: #63
Change-Id: I857e0b5954ca2b41a67004c8952a3e7099cf4b34
parent d3aa3ade
......@@ -214,17 +214,17 @@ QMetaObject::Connection previewStopped;
- (BOOL)menu:(NSMenu *)menu updateItem:(NSMenuItem *)item atIndex:(NSInteger)index shouldCancel:(BOOL)shouldCancel
{
QModelIndex qIdx;
if([menu.title isEqualToString:@"devices"]) {
if(self.videoDevicesList.menu == menu) {
qIdx = Video::ConfigurationProxy::deviceModel().index(index, 0);
[item setTitle:Video::ConfigurationProxy::deviceModel().data(qIdx, Qt::DisplayRole).toString().toNSString()];
} else if([menu.title isEqualToString:@"sizes"]) {
} else if(self.sizesList.menu == menu) {
qIdx = Video::ConfigurationProxy::resolutionModel().index(index, 0);
[item setTitle:Video::ConfigurationProxy::resolutionModel().data(qIdx, Qt::DisplayRole).toString().toNSString()];
} else if([menu.title isEqualToString:@"rates"]) {
} else if(self.ratesList.menu == menu) {
qIdx = Video::ConfigurationProxy::rateModel().index(index, 0);
[item setTitle:Video::ConfigurationProxy::rateModel().data(qIdx, Qt::DisplayRole).toString().toNSString()];
......@@ -235,13 +235,14 @@ QMetaObject::Connection previewStopped;
- (NSInteger)numberOfItemsInMenu:(NSMenu *)menu
{
if([menu.title isEqualToString:@"devices"]) {
if(self.videoDevicesList.menu == menu) {
return Video::ConfigurationProxy::deviceModel().rowCount();
} else if([menu.title isEqualToString:@"sizes"]) {
} else if(self.sizesList.menu == menu) {
return Video::ConfigurationProxy::resolutionModel().rowCount();
} else if([menu.title isEqualToString:@"rates"]) {
} else if(self.ratesList.menu == menu) {
return Video::ConfigurationProxy::rateModel().rowCount();
}
return 0;
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VideoPrefsVC">
......@@ -64,7 +64,7 @@
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="6Vf-hb-26C">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="devices" id="zJ9-1a-cpr">
<menu key="menu" id="zJ9-1a-cpr">
<connections>
<outlet property="delegate" destination="-2" id="mF2-Zc-wNP"/>
</connections>
......@@ -101,7 +101,7 @@
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="6ly-dX-MT4">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="sizes" id="ykd-50-las">
<menu key="menu" id="ykd-50-las">
<connections>
<outlet property="delegate" destination="-2" id="5cI-wH-0AT"/>
</connections>
......@@ -116,7 +116,7 @@
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="pDt-c4-Fhs">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="rates" id="aKL-76-vSP">
<menu key="menu" id="aKL-76-vSP">
<connections>
<outlet property="delegate" destination="-2" id="5Gu-bg-y3C"/>
</connections>
......
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