Debian Codegraph @

deploy/installer/controlscript.qs

raw
1 /**
2 * Source: http://stackoverflow.com/questions/21389105/qt-installer-framework-offline-update-how
3 */
4
5 function Controller()
6 {
7 }
8
9 Controller.prototype.TargetDirectoryPageCallback = function()
10 {
11 var widget = gui.currentPageWidget();
12 widget.TargetDirectoryLineEdit.textChanged.connect( this, Controller.prototype.targetChanged );
13 Controller.prototype.targetChanged( widget.TargetDirectoryLineEdit.text );
14 }
15
16 Controller.prototype.targetChanged = function( text )
17 {
18 if( text != "" && installer.fileExists(text + "/components.xml") )
19 {
20 if( QMessageBox.question("PreviousInstallation", "Previous installation detected", "Do you want to uninstall the previous installation?", QMessageBox.Yes | QMessageBox.No) == QMessageBox.Yes )
21 {
22 installer.execute( text+"/maintenancetool.exe", new Array("--script", text+"/uninstall.qs") )
23 }
24 }
25 }