diff --git a/FileSets/PageSettingsPackageAdd.qml b/FileSets/PageSettingsPackageAdd.qml index d1e62a0..4873278 100644 --- a/FileSets/PageSettingsPackageAdd.qml +++ b/FileSets/PageSettingsPackageAdd.qml @@ -16,8 +16,6 @@ MbPage { property string packageName: packageNameBox.item.valid ? packageNameBox.item.value : "" property string editAction: editActionItem.valid ? editActionItem.value : '' - property bool showControls: editActionItem.valid - property VBusItem defaultPackageName: VBusItem { bind: Utils.path ( servicePrefix, "/Default/", defaultIndex, "/", "PackageName" ) } property VBusItem defaultGitHubUser: VBusItem { bind: Utils.path ( servicePrefix, "/Default/", defaultIndex, "/", "GitHubUser" ) } property VBusItem defaultGitHubBranch: VBusItem { bind: Utils.path ( servicePrefix, "/Default/", defaultIndex, "/", "GitHubBranch" ) } @@ -89,7 +87,6 @@ MbPage { item.bind: getSettingsBind ("PackageName") overwriteMode: false writeAccessLevel: User.AccessInstaller - visible: showControls } MbEditBox { @@ -99,7 +96,6 @@ MbPage { item.bind: getSettingsBind ("GitHubUser") overwriteMode: false writeAccessLevel: User.AccessInstaller - visible: showControls } MbEditBox { @@ -109,7 +105,6 @@ MbPage { item.bind: getSettingsBind ("GitHubBranch") overwriteMode: false writeAccessLevel: User.AccessInstaller - visible: showControls } MbOK { @@ -119,7 +114,6 @@ MbPage { description: "" value: editAction == '' ? qsTr("Cancel") : qsTr("OK") onClicked: cancelEdit () - visible: showControls } MbOK { @@ -129,7 +123,7 @@ MbPage { description: "" value: qsTr ("Proceed") onClicked: confirm () - visible: showControls && editAction == '' + show: editAction == '' writeAccessLevel: User.AccessInstaller } Text diff --git a/FileSets/PageSettingsPackageEdit.qml b/FileSets/PageSettingsPackageEdit.qml index 79cc848..5fa6664 100644 --- a/FileSets/PageSettingsPackageEdit.qml +++ b/FileSets/PageSettingsPackageEdit.qml @@ -6,7 +6,7 @@ import com.victron.velib 1.0 MbPage { id: root - title: platformItem.valid ? qsTr("Package editor") : qsTr ("Package manager not running") + title: platform.valid ? qsTr("Package editor") : qsTr ("Package manager not running") property string settingsPrefix: "com.victronenergy.settings/Settings/PackageManager" property string servicePrefix: "com.victronenergy.packageManager" property int packageIndex: 0 @@ -20,19 +20,21 @@ MbPage { property VBusItem rebootNeeded: VBusItem { bind: getServiceBind ( "RebootNeeded") } property VBusItem guiRestartNeeded: VBusItem { bind: getServiceBind ( "GuiRestartNeeded") } - property VBusItem incompatibleReason: VBusItem { bind: getServiceBind ( "Incompatible") } + property VBusItem incompatibleReasonItem: VBusItem { bind: getServiceBind ( "Incompatible") } + property string incompatibleReason: incompatibleReasonItem.valid ? incompatibleReasonItem.value : "" + property bool incompatible: incompatibleReason != "" + property VBusItem platform: VBusItem { bind: Utils.path(servicePrefix, "/Platform") } - property bool showControls: editAction.valid property bool gitHubValid: gitHubVersion.item.valid && gitHubVersion.item.value.substring (0,1) === "v" property bool packageValid: packageVersion.item.valid && packageVersion.item.value.substring (0,1) === "v" property bool installedValid: installedVersion.item.valid && installedVersion.item.value.substring (0,1) === "v" property bool downloadOk: gitHubValid && gitHubVersion.item.value != "" - property bool installOk: packageValid && packageVersion.item.value != "" && incompatibleReason.value == "" + property bool installOk: packageValid && packageVersion.item.value != "" && ! incompatible property string requestedAction: '' property bool actionPending: requestedAction != '' - property bool navigate: ! actionPending && ! waitForAction && showControls - property bool waitForAction: showControls && editAction.value != '' - property bool moreActions: showControls && (editAction.value == 'RebootNeeded' || editAction.value == 'GuiRestartNeeded') + property bool navigate: ! actionPending && ! waitForAction + property bool waitForAction: editAction.value != '' + property bool moreActions: editAction.value == 'RebootNeeded' || editAction.value == 'GuiRestartNeeded' property VBusItem defaultPackageName: VBusItem { bind: Utils.path ( servicePrefix, "/Default/", defaultIndex, "/", "PackageName" ) } property VBusItem defaultGitHubUser: VBusItem { bind: Utils.path ( servicePrefix, "/Default/", defaultIndex, "/", "GitHubUser" ) } @@ -41,14 +43,10 @@ MbPage { property VBusItem editGitHubUser: VBusItem { bind: Utils.path ( settingsPrefix, "/Edit/", "GitHubUser" ) } property VBusItem editGitHubBranch: VBusItem { bind: Utils.path ( settingsPrefix, "/Edit/", "GitHubBranch" ) } - VBusItem { id: platformItem; bind: Utils.path("com.victronenergy.packageManager", "/Platform" ) } - property string platform: platformItem.valid ? platformItem.value : "???" // version info may be in platform service or in vePlatform.version VBusItem { id: osVersionItem; bind: Utils.path("com.victronenergy.platform", "/Firmware/Installed/Version" ) } property string osVersion: osVersionItem.valid ? osVersionItem.value : vePlatform.version - - Component.onCompleted: { resetPackageIndex () @@ -78,11 +76,9 @@ MbPage { packageIndex += 1 if (packageIndex >= packageCount.value) packageIndex = packageCount.value - 1 - cancelEdit () } function previousIndex () { - cancelEdit () packageIndex -= 1 if (packageIndex < 0) packageIndex = 0 @@ -147,9 +143,8 @@ MbPage { overwriteMode: false writeAccessLevel: User.AccessInstaller readonly: true - visible: showControls } - MbItemRow + MbRowSmall { description: qsTr ("Versions") height: 25 @@ -157,34 +152,40 @@ MbPage { { text: "GitHub:" font.pixelSize: 10 - visible: showControls } - visible: showControls MbTextBlock { id: gitHubVersion item { bind: getServiceBind("GitHubVersion") } height: 25; width: 80 - visible: showControls } Text { text: qsTr ("stored:") font.pixelSize: 10 - visible: showControls } MbTextBlock { id: packageVersion item { bind: getServiceBind("PackageVersion") } height: 25; width: 80 - visible: showControls } Text { text: { - if (rebootNeeded.value == 1) + if (incompatible) + { + if (incompatibleReason == 'PLATFORM') + return ( qsTr ("not compatible with\n") + platformItem.value ) + else if (incompatibleReason == 'VERSION') + return ( qsTr ("not compatible with\n") + osVersion ) + else if (incompatibleReason == 'CMDLINE') + return qsTr ("must install\nfrom command line" ) + else + return qsTr ("incompatible ???" ) // compatible for unknown reason + } + else if (rebootNeeded.value == 1) return qsTr ("REBOOT:") else if (guiRestartNeeded.value == 1) return qsTr ("GUI\nRestart:") @@ -192,36 +193,16 @@ MbPage { return qsTr ("installed:") } horizontalAlignment: Text.AlignRight - width: 50 + width: incompatible ? 50 + 80 + 3 : 50 font.pixelSize: 10 - visible: showControls && incompatibleReason.value == "" } MbTextBlock { id: installedVersion item { bind: getServiceBind("InstalledVersion") } - height: 25; width: 80 - visible: showControls && incompatibleReason.value == "" + height: 25 + width: incompatible ? 0 : 80 } - Text - { - id: incompatibleText - text: - { - if (incompatibleReason.value == 'PLATFORM') - return ( qsTr ("not compatible with\n") + platform ) - else if (incompatibleReason.value == 'VERSION') - return ( qsTr ("not compatible with\n") + osVersion ) - else if (incompatibleReason.value == 'CMDLINE') - return qsTr ("must install\nfrom command line" ) - else - return qsTr ("not compatible ???" ) // compatible for unknown reason - } - horizontalAlignment: Text.AlignHCenter - width: 50 + 80 + 3 - font.pixelSize: 10 - visible: showControls && ! incompatibleReason.value == "" - } } MbEditBox { @@ -231,7 +212,6 @@ MbPage { item.bind: getSettingsBind ("GitHubUser") overwriteMode: false writeAccessLevel: User.AccessInstaller - visible: showControls } MbEditBox { @@ -241,153 +221,147 @@ MbPage { item.bind: getSettingsBind ("GitHubBranch") overwriteMode: false writeAccessLevel: User.AccessInstaller - visible: showControls } - MbOK // for some reasion must be before removeButton or clicks do not work + MbOK + { + id: removeButton + width: 170 + anchors { right: parent.right; bottom: statusMessage.bottom} + description: "" + value: qsTr("Remove package") + onClicked: remove () + writeAccessLevel: User.AccessInstaller + show: navigate && ! installedValid + } + MbOK { id: cancelButton width: 90 - anchors { right: parent.right } + anchors { right: parent.right; bottom: statusMessage.bottom } description: "" - value: - { - if (editAction.value == 'ERROR') - return qsTr("OK") - else if (moreActions) - return qsTr("Later") - else - return qsTr("Cancel") - } + value: qsTr("Cancel") onClicked: cancelEdit () - visible: showControls && ! navigate || waitForAction + show: ! navigate && ! waitForAction } MbOK { - id: removeButton - width: 170 - anchors { right: parent.right; bottom: cancelButton.bottom} + id: dismissErrorButton + width: 90 + anchors { right: parent.right; bottom: statusMessage.bottom } description: "" - value: qsTr("Remove package") - onClicked: remove () - writeAccessLevel: User.AccessInstaller - opacity: installedValid ? 0.0001 : 1.0 - visible: navigate + value: qsTr("OK") + onClicked: cancelEdit () + show: editAction.value == 'ERROR' + } + MbOK + { + id: laterButton + width: 90 + anchors { right: parent.right; bottom: statusMessage.bottom } + description: "" + value: qsTr("Later") + onClicked: cancelEdit () + show: moreActions } MbOK { id: nowButton width: 90 - anchors { right: cancelButton.left; bottom: cancelButton.bottom } + anchors { right: laterButton.left; bottom: statusMessage.bottom } description: "" value: qsTr("Now") onClicked: signalAdditionalAction () - visible: moreActions + show: moreActions } MbOK { id: confirmButton width: 375 - anchors { left: parent.left; bottom: cancelButton.bottom } + anchors { left: parent.left; bottom: statusMessage.bottom } description: "" value: qsTr ("Proceed") onClicked: confirm () - visible: showControls && ! navigate && actionPending + show: ! navigate && actionPending writeAccessLevel: User.AccessInstaller } - Text - { - id: statusMessage - width: 250 - wrapMode: Text.WordWrap - anchors { left: parent.left; leftMargin: 10; bottom: cancelButton.bottom; bottomMargin: 5 } - font.pixelSize: 12 - color: actionPending && isSetupHelper ? "red" : "black" - text: - { - if (actionPending) - { - if (isSetupHelper && requestedAction == 'uninstall') - return qsTr ("WARNING: SetupHelper is required for these menus - uninstall anyway ?") - else - return (requestedAction + " " + packageName + " ?") - } - else if (editStatus.valid && editStatus.value != "") - return editStatus.value - else - return "" - } - visible: waitForAction || actionPending - } // bottom row of buttons MbOK { id: previousButton width: 100 - anchors { left: parent.left ; top:cancelButton.bottom } + anchors { left: parent.left; top: statusMessage.bottom; topMargin: 5 } description: "" value: qsTr("Previous") onClicked: previousIndex () - visible: - { - if (! showControls) - return false - else if (packageIndex > 0) - return true - else - return false - } + opacity: packageIndex > 0 ? 1.0 : 0.2 } MbOK { id: nextButton width: 75 - anchors { left: previousButton.right; bottom: previousButton.bottom } + anchors { left: previousButton.right; top: statusMessage.bottom; topMargin: 5 } description: "" value: qsTr("Next") onClicked: nextIndex () - visible: - { - if (! showControls) - return false - else if (packageIndex < packageCount.value - 1) - return true - else - return false - } + opacity: (packageIndex < packageCount.value - 1) ? 1.0 : 0.2 } MbOK { id: downloadButton width: 110 - anchors { right: installButton.left; bottom: previousButton.bottom } + anchors { right: installButton.left; top: statusMessage.bottom; topMargin: 5 } description: "" value: qsTr ("Download") onClicked: gitHubDownload () - visible: navigate && downloadOk + show: navigate && downloadOk writeAccessLevel: User.AccessInstaller } MbOK { id: installButton width: 90 - anchors { right: uninstallButton.left; bottom: previousButton.bottom } + anchors { right: uninstallButton.left; top: statusMessage.bottom; topMargin: 5 } description: "" value: qsTr ("Install") onClicked: install () - visible: navigate && installOk + show: navigate && installOk writeAccessLevel: User.AccessInstaller } MbOK { id: uninstallButton width: 100 - anchors { right: parent.right; bottom: previousButton.bottom } + anchors { right: parent.right; top: statusMessage.bottom; topMargin: 5 } description: "" value: qsTr("Uninstall") onClicked: uninstall () - visible: navigate && installedValid + show: navigate && installedValid writeAccessLevel: User.AccessInstaller + } + // at bottom so it's not in the middle of hard button cycle + Text + { + id: statusMessage + width: 250 + wrapMode: Text.WordWrap + anchors { left: parent.left; leftMargin: 10; top: gitHubBranch.bottom; topMargin: 22 } + font.pixelSize: 12 + color: actionPending && isSetupHelper ? "red" : "black" + text: + { + if (actionPending) + { + if (isSetupHelper && requestedAction == 'uninstall') + return qsTr ("WARNING: SetupHelper is required for these menus - uninstall anyway ?") + else + return (requestedAction + " " + packageName + " ?") + } + else if (editStatus.valid && editStatus.value != "") + return editStatus.value + else + return " " + } } } } diff --git a/FileSets/PageSettingsPackageManager.qml b/FileSets/PageSettingsPackageManager.qml index d3f2e16..2397c54 100644 --- a/FileSets/PageSettingsPackageManager.qml +++ b/FileSets/PageSettingsPackageManager.qml @@ -64,13 +64,13 @@ MbPage { { description: qsTr("Active packages") subpage: Component { PageSettingsPackageVersions {} } - visible: showControls + show: showControls } MbSubMenu { description: qsTr("Inactive packages") subpage: Component { PageSettingsAddPackageList {} } - visible: showControls + show: showControls } MbOK { @@ -110,14 +110,14 @@ MbPage { editAction.setValue ( 'restartGui' ) } } - visible: actionNeeded.valid && actionNeeded.value != '' + show: actionNeeded.valid && actionNeeded.value != '' writeAccessLevel: User.AccessInstaller } MbSubMenu { description: qsTr("Backup & restore settings") subpage: Component { PageSettingsPmBackup {} } - visible: showControls + show: showControls } MbOK { property int notMounted: 0 @@ -153,7 +153,7 @@ MbPage { { description: qsTr("Initialize PackageManager ...") subpage: Component { PageSettingsPmInitialize {} } - visible: showControls + show: showControls } } } diff --git a/FileSets/PageSettingsPmBackup.qml b/FileSets/PageSettingsPmBackup.qml index 43a9eeb..b183b8e 100644 --- a/FileSets/PageSettingsPmBackup.qml +++ b/FileSets/PageSettingsPmBackup.qml @@ -47,7 +47,7 @@ MbPage { description: qsTr("Backup settings, logos, logs") value: qsTr("Press to backup settings") onClicked: backupProgressItem.setValue (1) - visible: mediaAvailable.valid && mediaAvailable.value == 1 && backupProgressItem.value == 0 + show: mediaAvailable.valid && mediaAvailable.value == 1 && backupProgressItem.value == 0 writeAccessLevel: User.AccessInstaller } MbOK @@ -55,7 +55,7 @@ MbPage { description: qsTr("Restore settings, logos") value: qsTr("Press to restore settings") onClicked: backupProgressItem.setValue (2) - visible: settingsFileExists.valid && settingsFileExists.value == 1 && backupProgressItem.value == 0 + show: settingsFileExists.valid && settingsFileExists.value == 1 && backupProgressItem.value == 0 writeAccessLevel: User.AccessInstaller } } diff --git a/FileSets/PageSettingsPmInitialize.qml b/FileSets/PageSettingsPmInitialize.qml index f47e8f7..72f4acb 100644 --- a/FileSets/PageSettingsPmInitialize.qml +++ b/FileSets/PageSettingsPmInitialize.qml @@ -38,7 +38,7 @@ MbPage { value: qsTr("Press to Initialize") onClicked: sendInitialize () writeAccessLevel: User.AccessInstaller - visible: ! showInProgress + show: ! showInProgress } MbItemText { @@ -46,7 +46,7 @@ MbPage { text: qsTr ("... initializing and restarting") wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter - visible: showInProgress + show: showInProgress } } } diff --git a/blindInstall/SetupHelperVersion b/blindInstall/SetupHelperVersion index c03de31..1fb061b 100644 --- a/blindInstall/SetupHelperVersion +++ b/blindInstall/SetupHelperVersion @@ -1 +1 @@ -v4.31 +v4.32 diff --git a/setup b/setup index 52c7556..7a6cb9b 100755 --- a/setup +++ b/setup @@ -77,6 +77,7 @@ if [ $scriptAction == 'INSTALL' ] ; then updateActiveFile "/var/volatile/tmp/PageSettings.qml" "$qmlDir/PageSettings.qml" rm -f "/var/volatile/tmp/PageSettings.qml" fi + updateActiveFile "$qmlDir/PageSettingsPackageManager.qml" updateActiveFile "$qmlDir/PageSettingsPackageVersions.qml" updateActiveFile "$qmlDir/PageSettingsPackageEdit.qml" @@ -87,6 +88,23 @@ if [ $scriptAction == 'INSTALL' ] ; then updateActiveFile "$qmlDir/PageSettingsPmBackup.qml" updateActiveFile "$qmlDir/PageSettingsPmInitialize.qml" + # revert to VisualItemModel if before v3.00~14 (v3,00~14 uses VisibleItemModel) + versionStringToNumber "v3.00~14" + if (( $venusVersionNumber < $versionNumber )); then + logMessage "replacing VisibleItemModel with VisualItemModel" + fileList="$qmlDir/PageSettingsPackageManager.qml" + fileList+=" $qmlDir/PageSettingsPackageVersions.qml" + fileList+=" $qmlDir/PageSettingsPackageEdit.qml" + fileList+=" $qmlDir/PageSettingsAddPackageList.qml" + fileList+=" $qmlDir/PageSettingsPackageAdd.qml" + fileList+=" $qmlDir/PageSettingsPmBackup.qml" + fileList+=" $qmlDir/PageSettingsPmInitialize.qml" + for file in $fileList ; do + sed -i -e 's/VisibleItemModel/VisualItemModel/' "$file" + done + fi + + installService PackageManager cleanup diff --git a/venus-data.UninstallPackages.tar.gz b/venus-data.UninstallPackages.tar.gz index b7497cb..eb16e1c 100644 Binary files a/venus-data.UninstallPackages.tar.gz and b/venus-data.UninstallPackages.tar.gz differ diff --git a/venus-data.tgz b/venus-data.tgz index ef83048..e0b8d5c 100644 Binary files a/venus-data.tgz and b/venus-data.tgz differ diff --git a/version b/version index c03de31..1fb061b 100644 --- a/version +++ b/version @@ -1 +1 @@ -v4.31 +v4.32