Skip to content

Commit

Permalink
Check for Titanium SDK version before allowing creation/edit of unive…
Browse files Browse the repository at this point in the history
…rsal iOS project.
  • Loading branch information
sptramer committed Jan 21, 2011
1 parent d2072f2 commit 7e72722
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Resources/modules/project_edit/js/project_edit.js
Expand Up @@ -318,6 +318,18 @@ EditProject.setupView = function()
var version = EditProject.currentProject.version = $('#edit_project_version').val();
var copyright = EditProject.currentProject.copyright = $('#edit_project_copyright').val();

if (EditProject.currentProject.type=='universal')
{
// Perform a Titanium SDK check - we require at minimum 1.6.0
var versions = EditProject.currentProject.runtime.split('.');
if (parseInt(versions[0]) < 1 ||
(parseInt(versions[0]) == 1 && parseInt(versions[1]) < 6))
{
alert('iOS universal development is only supported in Titanium SDK 1.6.0 and later');
return;
}
}

var rubyOn = ($('#language_ruby_checked').css('display') != 'none')?'on':'';
var pythonOn = ($('#language_python_checked').css('display') != 'none')?'on':'';
var phpOn = ($('#language_php_checked').css('display') != 'none')?'on':'';
Expand Down
12 changes: 12 additions & 0 deletions Resources/perspectives/projects/js/projects.js
Expand Up @@ -1322,6 +1322,18 @@ Projects.handleNewProjectClick = function()
options.python = ($('#language_python_checked').css('display') != 'none')?'on':'';
options.php = ($('#language_php_checked').css('display') != 'none')?'on':'';

if (options.type=='universal')
{
// Perform a Titanium SDK check - we require at minimum 1.6.0
var versions = options.runtime.split('.');
if (parseInt(versions[0]) < 1 ||
(parseInt(versions[0]) == 1 && parseInt(versions[1]) < 6))
{
alert('iOS universal development is only supported in Titanium SDK 1.6.0 and later');
return;
}
}

Projects.createProject(options,true);
});

Expand Down

0 comments on commit 7e72722

Please sign in to comment.