1- function Controller ( ) {
2- // silent install is not an option until QtIFW v3.0.1
3- // gui.setSilent(true);
1+ function Controller ( ) {
2+ console . log ( "Controller created" ) ;
3+ // gui.setSilent(true); // cannot use until QtIFW v3.0.1, keep commented
44}
55
66Controller . prototype . IntroductionPageCallback = function ( ) {
7- gui . clickButton ( buttons . NextButton ) ;
7+ console . log ( "IntroductionPageCallback" ) ;
8+ gui . clickButton ( buttons . NextButton ) ;
89}
910
1011Controller . prototype . ComponentSelectionPageCallback = function ( ) {
11- var widget = gui . currentPageWidget ( ) ;
12-
13- // to install a subset of components, uncomment the code below and edit as neccesary
14- //widget.deselectAll();
15- //widget.selectComponent('SketchUpPlugin');
16- //widget.selectComponent('CLI');
17- //widget.selectComponent('RubyAPI');
18- //widget.selectComponent('CSharpAPI');
19- //widget.selectComponent('PAT');
20- //widget.selectComponent('OpenStudioApp');
21- //widget.selectComponent('DView');
22- //widget.selectComponent('EnergyPlus');
23- //widget.selectComponent('Radiance');
24- //widget.selectComponent('Resources');
25-
26- gui . clickButton ( buttons . NextButton ) ;
12+ console . log ( "ComponentSelectionPageCallback" ) ;
13+ var widget = gui . currentPageWidget ( ) ;
14+ if ( widget ) {
15+ console . log ( "ComponentSelectionPage widget OK" ) ;
16+ // If you want defaults, do nothing else.
17+ // Example if you ever want to tweak:
18+ // widget.deselectAll();
19+ // widget.selectComponent("CLI");
20+ }
21+ gui . clickButton ( buttons . NextButton ) ;
2722}
2823
2924Controller . prototype . TargetDirectoryPageCallback = function ( ) {
30- // set install directory if needed
31- var widget = gui . currentPageWidget ( ) ;
32- widget . TargetDirectoryLineEdit . setText ( "c:\\openstudio" )
33- gui . clickButton ( buttons . NextButton ) ;
25+ console . log ( "TargetDirectoryPageCallback" ) ;
26+ var widget = gui . currentPageWidget ( ) ;
27+ if ( widget && widget . TargetDirectoryLineEdit ) {
28+ widget . TargetDirectoryLineEdit . setText ( "c:\\openstudio" ) ;
29+ console . log ( "Set target directory to c:\\openstudio" ) ;
30+ } else {
31+ console . log ( "TargetDirectoryLineEdit not found on this page" ) ;
32+ }
33+ gui . clickButton ( buttons . NextButton ) ;
3434}
3535
3636Controller . prototype . StartMenuDirectoryPageCallback = function ( ) {
37- gui . clickButton ( buttons . NextButton ) ;
37+ console . log ( "StartMenuDirectoryPageCallback" ) ;
38+ gui . clickButton ( buttons . NextButton ) ;
3839}
3940
4041Controller . prototype . ReadyForInstallationPageCallback = function ( ) {
41- gui . clickButton ( buttons . NextButton ) ;
42+ console . log ( "ReadyForInstallationPageCallback" ) ;
43+ gui . clickButton ( buttons . NextButton ) ;
4244}
4345
4446Controller . prototype . FinishedPageCallback = function ( ) {
45- gui . clickButton ( buttons . FinishButton ) ;
46- }
47+ console . log ( "FinishedPageCallback" ) ;
48+ gui . clickButton ( buttons . FinishButton ) ;
49+ }
0 commit comments