Compare commits

...

10 commits

Author SHA1 Message Date
Roman Telezhynskyi 4b6f68ff80 Module macdeployqt. 2023-01-27 12:08:47 -08:00
Roman Telezhynskyi 766aae447d Define bundle prefix for dynamic library. 2023-01-27 09:20:43 -08:00
Roman Telezhynskyi e6c7051b6f Multi bundle support. 2023-01-27 09:07:34 -08:00
Roman Telezhynskyi 038afda6ed Fix installing tool applications. 2023-01-25 08:31:35 -08:00
Roman Telezhynskyi 272089074d Building ICNS. 2023-01-25 08:31:35 -08:00
Roman Telezhynskyi 53650d6223 Building Info.plist file. 2023-01-25 08:31:35 -08:00
Roman Telezhynskyi 6e4ec3e69f Installing app bundle on macos. 2023-01-25 08:31:35 -08:00
Roman Telezhynskyi d3f9ed80e7 Installing translations on macos. 2023-01-25 08:31:35 -08:00
Roman Telezhynskyi e0558dcc28 RC files only for Windows. 2023-01-21 07:12:53 -08:00
Roman Telezhynskyi 38d15cdd41 Fix build on MacOS. 2023-01-21 05:01:21 -08:00
97 changed files with 875 additions and 107 deletions

View file

@ -9,19 +9,19 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2022, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>io.bitbucket.valentinaproject.@EXECUTABLE@</string>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>0.7.52</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>0.7.52.0</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>layout.incs</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina layout</string>
@ -54,7 +54,7 @@
<key>UTTypeIconFile</key>
<string>layout.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>

View file

@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View file

@ -9,19 +9,19 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2022, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>io.bitbucket.valentinaproject.@EXECUTABLE@</string>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>0.7.52</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>0.7.52.0</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>i-measurements.incs</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina individual measurements</string>
@ -47,10 +47,10 @@
<string>s-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina multisize measurements</string>
<string>Valentina multisize measurements</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
@ -68,7 +68,7 @@
<key>UTTypeIconFile</key>
<string>i-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -76,7 +76,7 @@
<string>vit</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
<dict>
@ -86,11 +86,11 @@
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>Valentina multisize measurements</string>
<string>Valentina multisize measurements</string>
<key>UTTypeIconFile</key>
<string>s-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -98,7 +98,7 @@
<string>vst</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
</array>

View file

@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

View file

@ -9,19 +9,19 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2022, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>io.bitbucket.valentinaproject.@EXECUTABLE@</string>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>0.7.52</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>0.7.52.0</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>pattern.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.val</string>
<string>ua.com.smart-pattern.val</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina pattern file</string>
@ -47,7 +47,7 @@
<string>i-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina individual measurements</string>
@ -61,7 +61,7 @@
<string>s-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina multisize measurements</string>
@ -80,9 +80,9 @@
<key>UTTypeDescription</key>
<string>Valentina pattern file</string>
<key>UTTypeIconFile</key>
<string>pattern</string>
<string>pattern.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.val</string>
<string>ua.com.smart-pattern.val</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -104,7 +104,7 @@
<key>UTTypeIconFile</key>
<string>i-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -126,7 +126,7 @@
<key>UTTypeIconFile</key>
<string>s-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -148,7 +148,7 @@
<key>UTTypeIconFile</key>
<string>layout.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>

View file

@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View file

@ -6,8 +6,18 @@ VLib {
windeployqt.noVirtualkeyboard: true
bundle.identifierPrefix: 'ua.com.smart-pattern'
Properties {
condition: i18nconfig.limitDeploymentOfQtTranslations
windeployqt.languages: i18nconfig.qtTranslationLocales.join(',')
}
installDebugInformation: qbs.buildVariant !== "release"
Properties {
condition: !qbs.targetOS.contains("macos") || (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle)
install: true
installDir: buildconfig.installLibraryPath
}
}

View file

@ -7,7 +7,7 @@ Library {
type: buildconfig.staticBuild ? "staticlibrary" : "dynamiclibrary"
buildconfig.appTarget: "valentina"
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina"
bundle.isBundle: buildconfig.frameworksBuild
cpp.includePaths: [".."]
@ -24,9 +24,8 @@ Library {
cpp.compilerWrapper: "ccache"
}
install: !buildconfig.staticBuild
installDir: buildconfig.installLibraryPath
installDebugInformation: !buildconfig.staticBuild
install: false
installDebugInformation: false
Properties {
condition: qbs.targetOS.contains("macos")

View file

@ -1,23 +1,28 @@
import qbs.FileInfo
import qbs.File
VApp {
Depends { name: "freedesktop2" }
Depends { name: "tenv" }
Depends { name: "windeployqt"; }
Depends { name: "windeployqt"; condition: qbs.targetOS.contains("windows") }
Depends { name: "i18nconfig"; }
Depends { name: "i18n"; }
Depends { name: "ib"; condition: qbs.targetOS.contains("macos") }
Depends { name: "macdeployqt"; condition: qbs.targetOS.contains("macos") }
version: "0.7.52"
install: true
installDir: buildconfig.installAppPath
installDebugInformation: true
installDir: buildconfig.installBinaryPath
installDebugInformation: qbs.buildVariant !== "release"
consoleApplication: false
bundle.isBundle: qbs.buildVariant === "release"
bundle.identifierPrefix: 'ua.com.smart-pattern'
Properties {
// Breakpoints do not work if debug the app inside of bundle. In debug mode we turn off creating a bundle.
// Probably it will breake some dependencies. Version for Mac designed to work inside an app bundle.
condition: qbs.targetOS.contains("macos") && qbs.buildVariant == "debug"
bundle.isBundle: false
}
property bool primaryApp: false
bundle.infoPlist:({
"NSHumanReadableCopyright": buildconfig.valentina_copyright_string
})
Properties {
condition: buildconfig.enableAppImage && qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")
@ -54,7 +59,6 @@ VApp {
var pmSystems = i18nconfig.pmSystems;
for (var i = 0; i < pmSystems.length; i++) {
files.push("measurements_" + pmSystems[i] + ".ts");
for (var j = 0; j < locales.length; j++) {
files.push("measurements_" + pmSystems[i] + "_" + locales[j] + ".ts");
}
@ -64,10 +68,149 @@ VApp {
}
}
windeployqt.noVirtualkeyboard: true
Group {
condition: !qbs.targetOS.contains("macos") || (qbs.targetOS.contains("macos") && !bundle.isBundle)
fileTagsFilter: "qm"
qbs.install: true
qbs.installDir: buildconfig.installDataPath + "/translations"
}
Rule {
multiplex: true
condition: qbs.targetOS.contains("macos") && bundle.isBundle && (buildconfig.enableMultiBundle || primaryApp)
inputs: ["qm"]
outputFileTags: ["bundle.qm", "bundle.content"]
outputArtifacts: {
var locales = product.i18nconfig.translationLocales;
var artifactNames = [];
for (var i = 0; i < locales.length; i++) {
const lprojDir = FileInfo.joinPaths(product.buildDirectory, product.bundle.bundleName,
"Contents", "Resources", "translations", locales[i] + product.bundle.localizedResourcesFolderSuffix);
var qmRex = new RegExp('.*_' + locales[i] + '\.qm$', 'g');
artifactNames = artifactNames.concat((inputs["qm"] || []).filter(function(file){
return qmRex.exec(file.fileName);
}).map(function(file){
return FileInfo.joinPaths(lprojDir, file.fileName);
}));
artifactNames.push(FileInfo.joinPaths(lprojDir, "Localizable.strings"));
const qtTranslationsMask = [
"qt_",
"qtbase_",
"qtxmlpatterns_"
];
qtTranslationsMask.forEach(function(mask) {
var qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + locales[i] + ".qm");
if (File.exists(qmFile)) {
artifactNames.push(FileInfo.joinPaths(lprojDir, mask + locales[i] + ".qm"));
} else {
const lang = locales[i].split('_')[0];
qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + lang + ".qm");
if (File.exists(qmFile))
artifactNames.push(FileInfo.joinPaths(lprojDir, mask + lang + ".qm"));
}
});
}
var artifacts = artifactNames.map(function(art){
var a = {
filePath: art,
fileTags: ["bundle.qm", "bundle.content"]
}
return a;
});
return artifacts;
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "Preparing Valentina translations";
cmd.highlight = "filegen";
var data = [];
const locales = product.i18nconfig.translationLocales;
for (var i = 0; i < locales.length; i++) {
const qmRex = new RegExp('.*_' + locales[i] + '.qm$', 'g');
const src = (inputs["qm"] || []).filter(function(file){
return qmRex.exec(file.fileName);
});
const lprojDir = FileInfo.joinPaths(product.buildDirectory, product.bundle.bundleName,
"Contents", "Resources", "translations", locales[i] + product.bundle.localizedResourcesFolderSuffix);
for (var j = 0; j < src.length; j++) {
data.push({
"source" : src[j].filePath,
"destination": FileInfo.joinPaths(lprojDir, src[j].fileName)
});
}
data.push({
"source" : FileInfo.joinPaths(project.sourceDirectory, "share", "translations", "Localizable.strings"),
"destination": FileInfo.joinPaths(lprojDir, "Localizable.strings")
});
const qtTranslationsMask = [
"qt_",
"qtbase_",
"qtxmlpatterns_"
];
qtTranslationsMask.forEach(function(mask) {
var qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + locales[i] + ".qm");
if (File.exists(qmFile)) {
data.push({
"source" : qmFile,
"destination": FileInfo.joinPaths(lprojDir, mask + locales[i] + ".qm")
});
} else {
const lang = locales[i].split('_')[0];
qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + lang + ".qm");
if (File.exists(qmFile)) {
data.push({
"source" : qmFile,
"destination": FileInfo.joinPaths(lprojDir, mask + lang + ".qm")
});
}
}
});
}
cmd.data = data;
cmd.sourceCode = function() {
data.forEach(function(copyData) {
File.copy(copyData.source, copyData.destination);
});
};
return [cmd];
}
}
Properties {
condition: qbs.targetOS.contains("windows")
windeployqt.noVirtualkeyboard: true
}
Properties {
condition: qbs.targetOS.contains("macos")
ib.appIconName: targetName
macdeployqt.targetApps: ["Tape", "Puzzle"]
}
Properties {
condition: i18nconfig.limitDeploymentOfQtTranslations
windeployqt.languages: i18nconfig.qtTranslationLocales.join(',')
}
Group {
condition: qbs.targetOS.contains("macos") && bundle.isBundle
fileTagsFilter: "bundle.content"
qbs.install: true
qbs.installDir: buildconfig.installAppPath
qbs.installSourceBase: destinationDirectory
}
}

View file

@ -22,6 +22,11 @@ Module {
property bool enableAppImage: false
property bool enableMultiBundle: false
property string valentina_copyright_year: { return new Date().getFullYear().toString(); }
property string valentina_copyright_string: "(C) 2013-" + valentina_copyright_year + ", Valentina project"
Depends { name: "ccache"; }
// Use this property to disable the use of ccache.
@ -114,6 +119,9 @@ Module {
if (enableAppImage && qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos"))
defines.push('APPIMAGE');
if (enableMultiBundle)
defines.push('MULTI_BUNDLE');
return defines;
}

View file

@ -1,6 +1,7 @@
import qbs.File
import qbs.FileInfo
import qbs.TextFile
import qbs.Process
/**
This module generates 'i18n.pro' artifact, which then acts as an input for 'lupdate' program, which in turn produces
@ -26,6 +27,8 @@ Module {
property string lupdateName: "lupdate"
readonly property string qtTranslationsPath: qtTranslationsProbe.qtTranslationsPath
Rule {
condition: update && buildWithPro
multiplex: true
@ -202,4 +205,39 @@ Module {
outputFileTags: ["i18n"]
}
Probe {
id: qtTranslationsProbe
readonly property string binPath: product.Qt.core.binPath
property string qtTranslationsPath
configure: {
var qmakeProcess = new Process();
try {
var suffix = FileInfo.executableSuffix();
var qmakePath = FileInfo.joinPaths(binPath, "qmake" + suffix);
qmakeProcess.exec(qmakePath, ["-query"]);
if (qmakeProcess.exitCode() !== 0) {
throw "The qmake executable '" + FileInfo.toNativeSeparators(qmakePath) + "' failed with exit code " +
qmakeProcess.exitCode() + ".";
}
while (!qmakeProcess.atEnd()) {
var line = qmakeProcess.readLine();
var index = (line || "").indexOf(":");
if (index !== -1) {
if (line.slice(0, index) === "QT_INSTALL_TRANSLATIONS") {
var path = line.slice(index + 1).trim();
if (path)
qtTranslationsPath = FileInfo.fromNativeSeparators(path);
break;
}
}
}
} finally {
qmakeProcess.close();
}
}
}
}

View file

@ -0,0 +1,106 @@
import qbs.File
import qbs.FileInfo
import qbs.Environment
import qbs.Utilities
import qbs.ModUtils
/**
This module uses _macdeployqt_ program to collect Qt runtime for MacOS deployment.
*/
Module {
additionalProductTypes: ["macdeployqt"]
property bool artifacts: true
property string macdeployqtArtifact: artifacts ? "maceployqt.txt" : undefined
property string macdeployqtProgram: "macdeployqt"
property bool noPlugins: false
property int verbose: undefined
property bool noStrip: true
property bool useDebugLibs: false
property bool alwaysOverwrite: false
property bool appstoreCompliant: false
property string libpath: undefined
property stringList targetApps: undefined
Rule {
// alwaysRun: true
multiplex: true
condition: product.qbs.targetOS.contains("macos") && product.bundle.isBundle && (product.buildconfig.enableMultiBundle || (!product.buildconfig.enableMultiBundle && product.primaryApp))
inputs: ["bundle.content"]
prepare: {
var macdeployqtProgram = product.macdeployqt.macdeployqtProgram;
// Checking if directory exists as a dirty workaround to check if `--no-install` options has been set from command line.
if (!File.exists(product.qbs.installRoot)) {
var cmd = new JavaScriptCommand();
cmd.macdeployqtProgram = macdeployqtProgram;
cmd.description = "can not invoke '" + macdeployqtProgram + "' when '--no-install` options has been set from command line";
cmd.sourceCode = function () {
console.warn("Can not invoke '" + macdeployqtProgram + "' when '--no-install` options has been set from command line (tip: remove your build directory entirely after unchecking '--no-install' option)");
}
} else {
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
var cmdArgs = [installRoot + "/" + product.targetName + ".app"];
if (product.macdeployqt.noPlugins)
cmdArgs.push("--no-plugins");
if (product.macdeployqt.verbose !== undefined)
cmdArgs.push("--verbose", product.macdeployqt.verbose);
if (product.macdeployqt.noStrip)
cmdArgs.push("-no-strip");
if (product.macdeployqt.useDebugLibs)
cmdArgs.push("-use-debug-libs");
if (product.macdeployqt.alwaysOverwrite)
cmdArgs.push("-always-overwrite");
if (product.macdeployqt.appstoreCompliant)
cmdArgs.push("-appstore-compliant");
if (product.macdeployqt.libpath !== undefined)
cmdArgs.push("--libpath", product.macdeployqt.libpath);
if (product.macdeployqt.targetApps !== undefined && !product.buildconfig.enableMultiBundle && product.primaryApp)
{
product.macdeployqt.targetApps.forEach(function(targetApp) {
cmdArgs.push("-executable=\"" + installRoot + "/" + product.targetName + ".app/Contents/MacOS/" + targetApp + "\"");
});
}
var cmd = new Command(product.Qt.core.binPath + "/" + macdeployqtProgram, cmdArgs);
cmd.jobPool = "macdeployqt";
cmd.description = "invoking '" + macdeployqtProgram;
cmd.stdoutFilePath = product.buildDirectory + "/" + product.macdeployqt.macdeployqtArtifact;
}
cmd.workingDirectory = product.qbs.installRoot;
cmd.highlight = "filegen";
return [cmd]
}
Artifact {
filePath: product.buildDirectory + "/" + product.macdeployqt.macdeployqtArtifact
fileTags: ["macdeployqt"]
}
}
JobLimit {
jobPool: "macdeployqt"
jobCount: 1
}
}

View file

@ -0,0 +1,130 @@
import qbs.File
Module {
additionalProductTypes: ["multibundle"]
property stringList targetApps: undefined
Rule {
// alwaysRun: true
multiplex: true
condition: product.qbs.targetOS.contains("macos") && product.buildconfig.enableMultiBundle && product.type.contains("dynamiclibrary")
inputs: product.bundle.isBundle ? ["bundle.content"] : ["dynamiclibrary"]
outputFileTags: ["multibundle"]
outputArtifacts: {
var artifactNames = [];
const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName;
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
product.multibundle.targetApps.forEach(function(targetApp) {
artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName);
if (product.installDebugInformation)
artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName +
product.cpp.debugInfoBundleSuffix);
});
var artifacts = artifactNames.map(function(art){
var a = {
filePath: art,
fileTags: ["multibundle"]
}
return a;
});
return artifacts;
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "Copying dynamic library into bundles";
cmd.highlight = "filegen";
const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName;
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
var data = [];
product.multibundle.targetApps.forEach(function(targetApp) {
data.push({
"source" : product.buildDirectory + "/" + fileName,
"destination": installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName
});
if (product.installDebugInformation)
data.push({
"source" : product.buildDirectory + "/" + fileName + product.cpp.debugInfoBundleSuffix,
"destination": installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName +
product.cpp.debugInfoBundleSuffix
});
});
cmd.data = data;
cmd.sourceCode = function() {
data.forEach(function(copyData) {
File.copy(copyData.source, copyData.destination);
});
};
return [cmd];
}
}
Rule {
// alwaysRun: true
condition: product.qbs.targetOS.contains("macos") && !product.buildconfig.enableMultiBundle && product.type.contains("application")
inputs: ["application"]
outputFileTags: ["multibundle"]
outputArtifacts: {
var artifactNames = [];
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
product.multibundle.targetApps.forEach(function(targetApp) {
artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/MacOS/" + input.fileName);
if (product.installDebugInformation)
artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/MacOS/" + input.fileName +
product.cpp.debugInfoBundleSuffix);
});
var artifacts = artifactNames.map(function(art){
var a = {
filePath: art,
fileTags: ["multibundle"]
}
return a;
});
return artifacts;
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "Copying auxiliary binary into bundle";
cmd.highlight = "filegen";
const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName;
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
var data = [];
product.multibundle.targetApps.forEach(function(targetApp) {
data.push({
"source" : input.filePath,
"destination": installRoot + "/" + targetApp + ".app/Contents/MacOS/" + input.fileName
});
if (product.installDebugInformation)
data.push({
"source" : product.buildDirectory + "/" + input.fileName + product.cpp.debugInfoBundleSuffix,
"destination": installRoot + "/" + targetApp + ".app/Contents/MacOS/" + fileName +
product.cpp.debugInfoBundleSuffix
});
});
cmd.data = data;
cmd.sourceCode = function() {
data.forEach(function(copyData) {
console.info("Dynamic source: " + copyData.source);
console.info("Dynamic destination: " + copyData.destination);
File.copy(copyData.source, copyData.destination);
});
};
return [cmd];
}
}
}

View file

@ -12,6 +12,8 @@ QT += core gui widgets network xml svg xmlpatterns printsupport concurrent
# Name of binary file
TARGET = puzzle
VERSION = 0.7.52
# We want create executable file
TEMPLATE = app

View file

@ -10,10 +10,12 @@ VToolApp {
Depends { name: "VFormatLib" }
Depends { name: "VWidgetsLib" }
Depends { name: "FervorLib" }
Depends { name: "multibundle"; }
name: "Puzzle"
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Puzzle" : "puzzle"
targetName: buildconfig.appTarget
multibundle.targetApps: ["Valentina"]
files: [
"main.cpp",
@ -176,7 +178,7 @@ VToolApp {
}
Group {
condition: qbs.targetOS.contains("macos") && qbs.architecture.contains("x86_64")
condition: qbs.targetOS.contains("macos") && qbs.architecture.contains("x86_64") && buildconfig.enableMultiBundle
name: "pdftops MacOS"
prefix: project.sourceDirectory + "/dist/macx/bin64/"
files: ["pdftops"]
@ -255,15 +257,9 @@ VToolApp {
fileTags: "freedesktop.512x512MimetypesIcons"
}
Group {
condition: qbs.targetOS.contains("macos")
fileTagsFilter: "qm"
qbs.install: true
qbs.installDir: buildconfig.installDataPath + "/translations"
}
Group {
name: "Puzzle RC"
condition: qbs.targetOS.contains("windows")
prefix: product.sourceDirectory + "/share/resources/"
files: "puzzle.rc"
}
@ -278,4 +274,21 @@ VToolApp {
qbs.install: true
qbs.installDir: buildconfig.installAppPath
}
Group {
name: "MacOS assets"
condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle
prefix: project.sourceDirectory + "/dist/macx/puzzle/"
files: [
"Info.plist",
"puzzle.xcassets"
]
}
Group {
name: "ICNS"
condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle
prefix: project.sourceDirectory + "/dist/macx/valentina-project.xcassets/"
files: "layout.iconset"
}
}

View file

@ -62,7 +62,9 @@ QT_WARNING_POP
namespace
{
QT_WARNING_PUSH
#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG)
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
#endif
Q_GLOBAL_STATIC_WITH_ARGS(const QKeySequence, restoreOriginShortcut, // NOLINT
(QKeySequence(Qt::ControlModifier + Qt::Key_Asterisk)))

View file

@ -1527,7 +1527,9 @@ void VPMainWindow::InitZoomToolBar()
delete m_mouseCoordinate;
QT_WARNING_PUSH
#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG)
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
#endif
// connect the zoom buttons and shortcuts to the slots
QList<QKeySequence> zoomInShortcuts;

View file

@ -12,6 +12,8 @@ QT += core gui widgets network xml xmlpatterns printsupport svg concurrent
# Name of binary file
TARGET = tape
VERSION = 0.7.52
# We want create executable file
TEMPLATE = app

View file

@ -12,10 +12,12 @@ VToolApp {
Depends { name: "VWidgetsLib"; }
Depends { name: "VToolsLib"; }
Depends { name: "ebr" }
Depends { name: "multibundle"; }
name: "Tape"
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Tape" : "tape"
targetName: buildconfig.appTarget
multibundle.targetApps: ["Valentina"]
files: [
"main.cpp",
@ -96,7 +98,12 @@ VToolApp {
]
fileTags: ["multisize_tables"]
qbs.install: true
qbs.installDir: buildconfig.installDataPath + "/tables/multisize"
qbs.installDir: {
if (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle)
return buildconfig.installAppPath + "/Valentina.app/Contents/Resources/tables/multisize"
return buildconfig.installDataPath + "/tables/multisize"
}
}
Group {
@ -108,7 +115,12 @@ VToolApp {
]
fileTags: ["measurements_templates"]
qbs.install: true
qbs.installDir: buildconfig.installDataPath + "/tables/templates"
qbs.installDir: {
if (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle)
return buildconfig.installAppPath + "/Valentina.app/Contents/Resources/tables/templates"
return buildconfig.installDataPath + "/tables/templates"
}
}
Group {
@ -181,13 +193,6 @@ VToolApp {
fileTags: "freedesktop.512x512MimetypesIcons"
}
Group {
condition: qbs.targetOS.contains("macos")
fileTagsFilter: "qm"
qbs.install: true
qbs.installDir: buildconfig.installDataPath + "/translations"
}
Group {
name: "Diagrams"
prefix: product.sourceDirectory + "/share/resources/"
@ -201,13 +206,17 @@ VToolApp {
qbs.installDir: {
if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos"))
return "share/valentina/";
else
return buildconfig.installDataPath + "/";
if (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle)
return buildconfig.installAppPath + "/Valentina.app/Contents/Resources"
return buildconfig.installDataPath + "/";
}
}
Group {
name: "Tape RC"
condition: qbs.targetOS.contains("windows")
prefix: product.sourceDirectory + "/share/resources/"
files: "tape.rc"
}
@ -223,4 +232,24 @@ VToolApp {
qbs.install: true
qbs.installDir: buildconfig.installAppPath
}
Group {
name: "MacOS assets"
condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle
prefix: project.sourceDirectory + "/dist/macx/tape/"
files: [
"Info.plist",
"tape.xcassets"
]
}
Group {
name: "ICNS"
condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle
prefix: project.sourceDirectory + "/dist/macx/valentina-project.xcassets/"
files: [
"i-measurements.iconset",
"s-measurements.iconset"
]
}
}

View file

@ -78,19 +78,42 @@ namespace
{
auto AppFilePath(const QString &appName) -> QString
{
QString appNameExe = appName; // NOLINT(performance-unnecessary-copy-initialization)
#ifdef Q_OS_WIN
appNameExe += ".exe";
const QString executableSuffix = QStringLiteral(".exe");
#else
const QString executableSuffix;
#endif
QFileInfo canonicalFile(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(), appNameExe));
QFileInfo canonicalFile(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(),
appName + executableSuffix));
if (canonicalFile.exists())
{
return canonicalFile.absoluteFilePath();
}
#if defined(Q_OS_MACOS) && defined(QBS_BUILD) && defined(MULTI_BUNDLE)
QFileInfo multiBundleFile(QStringLiteral("%1/../../../%2.app/Contents/MacOS/%2")
.arg(QCoreApplication::applicationDirPath(), appName));
if (multiBundleFile.exists())
{
return multiBundleFile.absoluteFilePath();
}
#endif
#if !defined(QBS_BUILD)
QFileInfo debugFile(QStringLiteral("%1/../../%2/bin/%3")
.arg(QCoreApplication::applicationDirPath(), appName, appNameExe));
return debugFile.exists() ? debugFile.absoluteFilePath() : appNameExe;
.arg(QCoreApplication::applicationDirPath(), appName, appName + executableSuffix));
if (debugFile.exists())
{
return debugFile.absoluteFilePath();
}
#endif
#if !defined(Q_OS_MACOS)
return appName + executableSuffix;
#else
return appName + QStringLiteral(".app");
#endif
}
} // namespace
@ -489,13 +512,23 @@ void VApplication::ActivateDarkMode()
//---------------------------------------------------------------------------------------------------------------------
auto VApplication::TapeFilePath() -> QString
{
return AppFilePath(QStringLiteral("tape"));
#ifdef Q_OS_MACOS
const QString appName = QStringLiteral("Tape");
#else
const QString appName = QStringLiteral("tape");
#endif
return AppFilePath(appName);
}
//---------------------------------------------------------------------------------------------------------------------
auto VApplication::PuzzleFilePath() -> QString
{
return AppFilePath(QStringLiteral("puzzle"));
#ifdef Q_OS_MACOS
const QString appName = QStringLiteral("Puzzle");
#else
const QString appName = QStringLiteral("puzzle");
#endif
return AppFilePath(appName);
}
//---------------------------------------------------------------------------------------------------------------------
@ -642,6 +675,32 @@ void VApplication::InitOptions()
ActivateDarkMode();
}
//---------------------------------------------------------------------------------------------------------------------
void VApplication::StartDetachedProcess(const QString &program, const QStringList &arguments)
{
#if !defined(Q_OS_MACOS)
const QString workingDirectory = QFileInfo(program).absoluteDir().absolutePath();
QProcess::startDetached(program, arguments, workingDirectory);
#else
if (not program.endsWith(".app"))
{
const QString workingDirectory = QFileInfo(program).absoluteDir().absolutePath();
QProcess::startDetached(program, arguments, workingDirectory);
}
else
{
QStringList openArguments {"-n", QStringLiteral("/Applications/%1").arg(program)};
if (not arguments.isEmpty())
{
openArguments.append("--args");
openArguments += arguments;
}
QProcess::startDetached("open", openArguments);
}
#endif
}
//---------------------------------------------------------------------------------------------------------------------
auto VApplication::LabelLanguages() -> QStringList
{

View file

@ -51,6 +51,8 @@ public:
void InitOptions();
static void StartDetachedProcess(const QString &program, const QStringList &arguments);
static auto TapeFilePath() -> QString;
static auto PuzzleFilePath() -> QString;

View file

@ -2127,9 +2127,7 @@ void MainWindow::ShowMeasurements()
arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING);
}
const QString tape = VApplication::TapeFilePath();
const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath();
QProcess::startDetached(tape, arguments, workingDirectory);
VApplication::StartDetachedProcess(VApplication::TapeFilePath(), arguments);
}
else
{
@ -2894,7 +2892,9 @@ void MainWindow::ToolBarTools()
Also for me don't work Qt:CTRL and work Qt::ControlModifier.*/
QT_WARNING_PUSH
#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG)
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
#endif
QList<QKeySequence> zoomInShortcuts;
zoomInShortcuts.append(QKeySequence(QKeySequence::ZoomIn));
@ -3801,16 +3801,13 @@ void MainWindow::on_actionOpen_triggered()
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::on_actionOpenPuzzle_triggered()
{
const QString puzzle = VApplication::PuzzleFilePath();
const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath();
QStringList arguments;
if (isNoScaling)
{
arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING);
}
QProcess::startDetached(puzzle, arguments, workingDirectory);
VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments);
}
//---------------------------------------------------------------------------------------------------------------------
@ -3861,9 +3858,7 @@ void MainWindow::on_actionCreateManualLayout_triggered()
rldFile.setAutoRemove(false);
const QString puzzle = VApplication::PuzzleFilePath();
const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath();
QProcess::startDetached(puzzle, arguments, workingDirectory);
VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments);
}
else
{
@ -3948,9 +3943,7 @@ void MainWindow::on_actionUpdateManualLayout_triggered()
rldFile.setAutoRemove(false);
const QString puzzle = VApplication::PuzzleFilePath();
const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath();
QProcess::startDetached(puzzle, arguments, workingDirectory);
VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments);
}
else
{
@ -4740,16 +4733,13 @@ void MainWindow::ActionShowMainPath_triggered(bool checked)
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::ActionOpenTape_triggered()
{
const QString tape = VApplication::TapeFilePath();
const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath();
QStringList arguments;
if (isNoScaling)
{
arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING);
}
QProcess::startDetached(tape, arguments, workingDirectory);
VApplication::StartDetachedProcess(VApplication::TapeFilePath(), arguments);
}
//---------------------------------------------------------------------------------------------------------------------
@ -5831,16 +5821,13 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
if (m.Type() == MeasurementsType::Multisize || m.Type() == MeasurementsType::Individual)
{
const QString tape = VApplication::TapeFilePath();
const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath();
QStringList arguments = QStringList() << fileName;
QStringList arguments {fileName};
if (isNoScaling)
{
arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING);
}
QProcess::startDetached(tape, arguments, workingDirectory);
VApplication::StartDetachedProcess(VApplication::TapeFilePath(), arguments);
QCoreApplication::exit(V_EX_OK);
return false; // stop continue processing
}
@ -5862,16 +5849,13 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
{
// Here comes undocumented Valentina's feature.
// Because app bundle in Mac OS X doesn't allow setup assosiation for Puzzle we must do this through Valentina
const QString puzzle = VApplication::PuzzleFilePath();
const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath();
QStringList arguments = QStringList() << fileName;
QStringList arguments {fileName};
if (isNoScaling)
{
arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING);
}
QProcess::startDetached(puzzle, arguments, workingDirectory);
VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments);
QCoreApplication::exit(V_EX_OK);
return false; // stop continue processing
}

View file

@ -28,6 +28,8 @@ macx{
TARGET = valentina
}
VERSION = 0.7.52
# Use out-of-source builds (shadow builds)
CONFIG -= debug_and_release debug_and_release_target

View file

@ -13,6 +13,8 @@ VToolApp {
Depends { name: "VFormatLib"; }
Depends { name: "VMiscLib"; }
primaryApp: true
Depends {
name: "Qt.winextras"
condition: qbs.targetOS.contains("windows")
@ -304,15 +306,32 @@ VToolApp {
qbs.installDir: buildconfig.installAppPath
}
Group {
fileTagsFilter: "qm"
qbs.install: true
qbs.installDir: buildconfig.installDataPath + "/translations"
}
Group {
name: "Valentina RC"
condition: qbs.targetOS.contains("windows")
prefix: product.sourceDirectory + "/share/resources/"
files: "valentina.rc"
}
Group {
name: "MacOS assets"
condition: qbs.targetOS.contains("macos")
prefix: project.sourceDirectory + "/dist/macx/valentina/"
files: [
"Info.plist",
"valentina.xcassets"
]
}
Group {
name: "ICNS"
condition: qbs.targetOS.contains("macos")
prefix: project.sourceDirectory + "/dist/macx/valentina-project.xcassets/"
files: [
"pattern.iconset",
"layout.iconset",
"i-measurements.iconset",
"s-measurements.iconset"
]
}
}

View file

@ -1,4 +1,6 @@
VDynamicLib {
Depends { name: "multibundle"; }
name: "QMUParserLib"
version: "2.7.0"
files: [
@ -49,4 +51,6 @@ VDynamicLib {
qbs.install: true
qbs.installDir: buildconfig.installAppPath
}
multibundle.targetApps: ["Valentina", "Tape", "Puzzle"]
}

View file

@ -44,7 +44,9 @@ enum CustomEventType {
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG)
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
#endif
// Define undo event identifier
const QEvent::Type UNDO_EVENT = static_cast<QEvent::Type>(QEvent::User + CustomEventType::UndoEventType);
@ -63,7 +65,9 @@ public:
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG)
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
#endif
const QEvent::Type LITE_PARSE_EVENT = static_cast<QEvent::Type>(QEvent::User + CustomEventType::LiteParseEventType);
@ -81,7 +85,9 @@ public:
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG)
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
#endif
const QEvent::Type FIT_BEST_CURRENT_EVENT = static_cast<QEvent::Type>(QEvent::User +
CustomEventType::FitBestCurrentEventType);
@ -100,7 +106,9 @@ public:
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG)
QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion")
#endif
const QEvent::Type WARNING_MESSAGE_EVENT = static_cast<QEvent::Type>(QEvent::User +
CustomEventType::WarningMessageEventType);

View file

@ -1,6 +1,7 @@
VDynamicLib {
Depends { name: "Qt"; submodules: ["gui", "widgets"] }
Depends { name: "VMiscLib" }
Depends { name: "multibundle"; }
name: "VPropertyExplorerLib"
version: "1.0.0"
@ -92,4 +93,5 @@ VDynamicLib {
}
cpp.defines: "VPROPERTYEXPLORER_LIBRARY"
multibundle.targetApps: ["Valentina", "Tape", "Puzzle"]
}