diff options
author | kh1 <karsten.heimrich@digia.com> | 2012-11-05 14:52:30 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2012-12-07 15:29:54 +0100 |
commit | b8a26af43474db95ca031a325b864b80812c2def (patch) | |
tree | fb245c415ad6cba64e93ab75a1a10f3faaeb1cd2 /dist/installer | |
parent | d0e055a1f2f8d10adeed5e490774313b91bf7a48 (diff) |
Allow the user to choose to associate common file types.
Especially important if you already assigned the file types
to a different application, or to keep defaults for VS users.
Depends on: https://codereview.qt-project.org/#change,38650
Change-Id: I2b272c25e03bcc264ca73450fd26aa82ec30c296
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'dist/installer')
3 files changed, 79 insertions, 1 deletions
diff --git a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/associatecommonfiletypesform.ui b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/associatecommonfiletypesform.ui new file mode 100644 index 0000000000..5c9646c44f --- /dev/null +++ b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/associatecommonfiletypesform.ui @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AssociateCommonFiletypesForm</class> + <widget class="QWidget" + name="AssociateCommonFiletypesForm"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>557</width> + <height>35</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" + name="verticalLayout"> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" + stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QCheckBox" + name="AssociateCommonFiletypesCheckBox"> + <property name="toolTip"> + <string><html><body>Associate common file types (.c/.h, .cc/.hh, .cxx/.hxx, .c++/.h++, .cpp/.hpp) with Qt Creator.</body></html></string> + </property> + <property name="text"> + <string>Associate common file types with Qt Creator.</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs index 10286b9474..14db59c057 100644 --- a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs +++ b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs @@ -30,10 +30,21 @@ // constructor function Component() { + component.loaded.connect(this, Component.prototype.loaded); installer.finishButtonClicked.connect(this, Component.prototype.installationFinished); installer.setDefaultPageVisible(QInstaller.ComponentSelection, false); } +Component.prototype.loaded = function() +{ + try { + if (installer.value("os") == "win" && installer.isInstaller()) + installer.addWizardPageItem(component, "AssociateCommonFiletypesForm", QInstaller.TargetDirectory); + } catch(e) { + print(e); + } +} + Component.prototype.beginInstallation = function() { if ( installer.value("os") === "win" ) { @@ -43,7 +54,7 @@ Component.prototype.beginInstallation = function() } } -registerWindowsFileTypeExtensions = function() +registerCommonWindowsFileTypeExtensions = function() { var headerExtensions = new Array("h", "hh", "hxx", "h++", "hpp"); @@ -76,6 +87,10 @@ registerWindowsFileTypeExtensions = function() "text/plain", "@TargetDir@\\bin\\qtcreator.exe,1", "ProgId=QtProject.QtCreator.c"); +} + +registerWindowsFileTypeExtensions = function() +{ component.addOperation( "RegisterFileType", "ui", "@TargetDir@\\bin\\qtcreator.exe -client '%1'", @@ -131,6 +146,15 @@ Component.prototype.createOperations = function() "workingDirectory=@homeDir@" ); component.addElevatedOperation("Execute", "{0,3010,1638}", "@TargetDir@\\lib\\vcredist_msvc2010\\vcredist_x86.exe", "/norestart", "/q"); registerWindowsFileTypeExtensions(); + + try { + if (component.userInterface("AssociateCommonFiletypesForm").AssociateCommonFiletypesCheckBox + .checked) { + registerCommonWindowsFileTypeExtensions(); + } + } catch(e) { + print(e); + } } if ( installer.value("os") == "x11" ) { diff --git a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in index ed2cf104c9..0e21746d4e 100644 --- a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in +++ b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in @@ -12,4 +12,7 @@ <ForcedInstallation>true</ForcedInstallation> <Default>true</Default> <AutoDependOn>org.qtproject.qtcreator</AutoDependOn> + <UserInterfaces> + <UserInterface>associatecommonfiletypesform.ui</UserInterface> + </UserInterfaces> </Package> |