Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Disable 'Cancel' & 'Close' buttons in install.qs
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 2 Posters 616 Views 1 Watching
  • 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 Offline
    V Offline
    VBScab
    wrote on last edited by VBScab
    #1

    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);
    }
    
    
    RatzzR 1 Reply Last reply
    0
    • V 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);
      }
      
      
      RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      @VBScab
      Did you try disabling button something like this ?

      --Alles ist gut.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        VBScab
        wrote on last edited by VBScab
        #3

        I tried

        buttons.CancelButton.disabled = true;
        

        in each 'Controller' section, to no avail

        1 Reply Last reply
        0
        • V Offline
          V Offline
          VBScab
          wrote on last edited by
          #4

          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
          0
          • V Offline
            V Offline
            VBScab
            wrote on last edited by VBScab
            #5

            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
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved