Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Disable 'Cancel' & 'Close' buttons in install.qs

    Installation and Deployment
    2
    5
    196
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      VBScab last edited by VBScab

      Hi. I have an extremely simple requirement.

      I have a working script, which is copied from the sample 'install.qs', for a product called 'OpenStudio' which can be driven by QT script. I However, as the installation time is quite lengthy and our users, like most, are extremely impatient, I want to disable the 'Cancel' and 'Close' buttons, if that's possible.

      Here's the script:

      Controller.prototype.IntroductionPageCallback = function () {
        gui.clickButton(buttons.NextButton)
      }
      
      Controller.prototype.ComponentSelectionPageCallback = function () {
        var widget = gui.currentPageWidget();
        
        if (widget != null) {
          // to install a subset of components, uncomment the code below and edit as neccesary
          //widget.deselectAll();
          //widget.selectComponent('SketchUpPlugin');
          //widget.selectComponent('CLI');
          //widget.selectComponent('RubyAPI');
          //widget.selectComponent('CSharpAPI');
          //widget.selectComponent('PAT');
          //widget.selectComponent('OpenStudioApp');
          //widget.selectComponent('DView');
          //widget.selectComponent('EnergyPlus');
          //widget.selectComponent('Radiance');
          //widget.selectComponent('Resources');
        
          gui.clickButton(buttons.NextButton);
        }
      }
      
      Controller.prototype.TargetDirectoryPageCallback = function () {
        // set install directory if needed
        var widget = gui.currentPageWidget();
        if (widget != null) {
          widget.TargetDirectoryLineEdit.setText("c:\\openstudio-2.9.1")
          gui.clickButton(buttons.NextButton);
        }
      }
      
      Controller.prototype.StartMenuDirectoryPageCallback = function () {
        gui.clickButton(buttons.NextButton);
      }
      
      Controller.prototype.ReadyForInstallationPageCallback = function () {
        gui.clickButton(buttons.NextButton);
      }
      
      Controller.prototype.FinishedPageCallback = function () {
        gui.clickButton(buttons.FinishButton);
      }
      
      
      Ratzz 1 Reply Last reply Reply Quote 0
      • Ratzz
        Ratzz @VBScab last edited by

        @VBScab
        Did you try disabling button something like this ?

        --Alles ist gut.

        1 Reply Last reply Reply Quote 0
        • V
          VBScab last edited by VBScab

          I tried

          buttons.CancelButton.disabled = true;
          

          in each 'Controller' section, to no avail

          1 Reply Last reply Reply Quote 0
          • V
            VBScab last edited by

            I just tried this:

              var widget = gui.currentPageWidget();
              if (widget != null) {
                var cancelButton = gui.findChild(widget, "Cancel");
                if (cancelButton != null) {
                	cancelButton.setEnabled(false);
                }
              }
            

            Again...the Cancel button is still enabled.

            1 Reply Last reply Reply Quote 0
            • V
              VBScab last edited by VBScab

              Just tried this:

              Controller.prototype.ReadyForInstallationPageCallback = function () {
                  var page = gui.pageWidgetByObjectName("ReadyForInstallationPage");
              
                  var cancelButton = gui.findChild(page, "CancelButton");
                  if (cancelButton != null) {
                      console.log("cancelButton found");
                      cancelButton.setEnabled(false);
                      cancelButton.enabled = false;
                  } else {
                      console.log("cancelButton NOT found");
                  }
                  //  gui.clickButton(buttons.NextButton);
              }
              

              Again, the 'Cancel' button is still present/enabled.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post