Skip to content

Commit

Permalink
Addition of dropdown allowing for device selection when running in iO…
Browse files Browse the repository at this point in the history
…S simulator.
  • Loading branch information
sptramer committed Jan 22, 2011
1 parent 7e72722 commit b030c75
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
20 changes: 15 additions & 5 deletions Resources/modules/packaging/js/packaging.js
Expand Up @@ -544,7 +544,7 @@ PackageProject.setupMobileView = function()
{
var runtime = PackageProject.currentProject.runtime;
var sdk = Titanium.Project.getMobileSDKVersions(runtime);

// set scripts for current sdk version
PackageProject.iPhoneEmulatorPath = Titanium.Filesystem.getFile(sdk.getPath(),'/iphone/builder.py');
PackageProject.AndroidEmulatorPath = Titanium.Filesystem.getFile(sdk.getPath(),'/android/builder.py');
Expand Down Expand Up @@ -1303,7 +1303,14 @@ PackageProject.setupMobileView = function()
PackageProject.inConsoleMode = true;

var sdk = $('#iphone_emulator_sdk').val();
var type = (PackageProject.currentProject.type=='mobile') ? 'iphone' : PackageProject.currentProject.type;
var type = (PackageProject.currentProject.type=='mobile') ? 'iphone' : PackageProject.currentProject.type;
var simDevice = $('#iphone_simulator_device').val();
if (type == 'ipad')
{
// Coerce simDevice to ipad for ipad projects
simDevice = 'ipad';
}

Titanium.Analytics.featureEvent(type+'.simulator',{sdk:sdk,appid:PackageProject.currentProject.appid,name:PackageProject.currentProject.name,guid:PackageProject.currentProject.guid});

// kill if still running
Expand All @@ -1316,7 +1323,7 @@ PackageProject.setupMobileView = function()

PackageProject.mobileCompile(Titanium.Filesystem.getFile(PackageProject.currentProject.dir,"Resources").nativePath(),'iphone',function()
{
PackageProject.currentIPhonePID = TiDev.launchPython([Titanium.Filesystem.getFile(PackageProject.iPhoneEmulatorPath).toString(),'simulator', '"'+sdk+'"','"'+ PackageProject.currentProject.dir+ '"',PackageProject.currentProject.appid, '"' + PackageProject.currentProject.name+ '"', deviceFamily]);
PackageProject.currentIPhonePID = TiDev.launchPython([Titanium.Filesystem.getFile(PackageProject.iPhoneEmulatorPath).toString(),'simulator', '"'+sdk+'"','"'+ PackageProject.currentProject.dir+ '"',PackageProject.currentProject.appid, '"' + PackageProject.currentProject.name+ '"', deviceFamily, simDevice]);
PackageProject.logReader(PackageProject.currentIPhonePID,'iphone','simulator');
PackageProject.iphoneEmulatorStartDate = new Date();
PackageProject.currentIPhonePID.setOnExit(function(event)
Expand Down Expand Up @@ -1358,8 +1365,6 @@ PackageProject.setupMobileView = function()

}
});


}
else
{
Expand Down Expand Up @@ -1885,6 +1890,11 @@ PackageProject.setupMobileView = function()
$('#tab_android_package').css('display','none');
$('#mobile_emulator_iphone').css('display','none');
$('#mobile_emulator_android').css('display','none');
// Don't display device selection if iPad; it's always iPad
if (PackageProject.currentProject.type == 'ipad')
{
$('#iphone_simulator_device_container').css('display','none');
}
$('.tab_spacing').css('display', 'block');
$('#mobile_emulator_iphone').click();
$('#tab_iphone_dev').click();
Expand Down
10 changes: 9 additions & 1 deletion Resources/modules/packaging/packaging.html
Expand Up @@ -484,6 +484,15 @@
<option>loading...</option>
</select>
</div>
<!-- DEVICE SELECTION -->
<div style="float:left;margin-top:20px;margin-left:10px;"
id="iphone_simulator_device_container">
<span class="help_text" >Device:</span>
<select style="width:78px;" id="iphone_simulator_device">
<option value="iphone">iPhone</option>
<option value="ipad">iPad</option>
</select>
</div>
<!-- FILTER LEVEL -->
<div style="margin-left:10px;float:left;">
<span class="help_text" >Filter:</span>
Expand All @@ -494,7 +503,6 @@
<option value="error">Error</option>
</select>
</div>

<!-- START BUTTON -->
<div id="iphone_launch_button"
style="width:70px;margin-top:20px;float:left;margin-left:10px">
Expand Down

2 comments on commit b030c75

@sjsingh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is universal support complete? If so, how do i go about compiling TiDev from here?

@sptramer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You build TiDev with the Titanium Desktop tibuild command.

Please sign in to comment.