Skip to content

Commit

Permalink
fixed: PackageManager edit menus not working
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Dec 24, 2022
1 parent 16c21b3 commit 11d9f2b
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 48 deletions.
10 changes: 7 additions & 3 deletions FileSets/MbDisplayPackageVersion.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ MbItem {
property bool rebootNeeded: rebootNeededItem.valid && rebootNeededItem.value == 1
property bool guiRestartNeeded: guiRestartNeededItem.valid && guiRestartNeededItem.value == 1

VBusItem { id: platformItem; bind: Utils.path("com.victronenergy.packageManager", "/Platform" ) }
VBusItem { id: incompatibleItem; bind: getServiceBind ( "Incompatible" ) }
property string incompatibleReason: incompatibleItem.valid ? incompatibleItem.value : ""
property bool compatible: incompatibleReason == ""
property string platform: platformItem.valid ? platformItem.value : "??"
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

onClicked: rootWindow.pageStack.push ("/opt/victronenergy/gui/qml/PageSettingsPackageEdit.qml", {packageIndex: packageIndex})

Expand All @@ -35,7 +39,7 @@ MbItem {
else if (incompatibleReason == 'PLATFORM')
return qsTr ( " not compatible with " + platform )
else if (incompatibleReason == 'VERSION')
return qsTr ( " not compatible with " + vePlatform.version )
return qsTr ( " not compatible with " + osVersion )
else if (incompatibleReason == 'CMDLINE' && installedVersion.item.value == "")
return qsTr ( " must install from command line" )
else
Expand Down
82 changes: 39 additions & 43 deletions FileSets/PageSettingsPackageEdit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.victron.velib 1.0

MbPage {
id: root
title: platform.valid ? qsTr("Package editor") : qsTr ("Package manager not running")
title: platformItem.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
Expand All @@ -21,7 +21,6 @@ MbPage {
property VBusItem rebootNeeded: VBusItem { bind: getServiceBind ( "RebootNeeded") }
property VBusItem guiRestartNeeded: VBusItem { bind: getServiceBind ( "GuiRestartNeeded") }
property VBusItem incompatibleReason: VBusItem { bind: getServiceBind ( "Incompatible") }
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"
Expand All @@ -42,6 +41,13 @@ 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:
{
Expand Down Expand Up @@ -72,9 +78,11 @@ MbPage {
packageIndex += 1
if (packageIndex >= packageCount.value)
packageIndex = packageCount.value - 1
cancelEdit ()
}
function previousIndex ()
{
cancelEdit ()
packageIndex -= 1
if (packageIndex < 0)
packageIndex = 0
Expand Down Expand Up @@ -141,7 +149,7 @@ MbPage {
readonly: true
visible: showControls
}
MbRowSmall
MbItemRow
{
description: qsTr ("Versions")
height: 25
Expand Down Expand Up @@ -201,13 +209,13 @@ MbPage {
text:
{
if (incompatibleReason.value == 'PLATFORM')
return ( qsTr ("not compatible with\n") + platformItem.value )
return ( qsTr ("not compatible with\n") + platform )
else if (incompatibleReason.value == 'VERSION')
return ( qsTr ("not compatible with\n") + vePlatform.version )
return ( qsTr ("not compatible with\n") + osVersion )
else if (incompatibleReason.value == 'CMDLINE')
return qsTr ("must install\nfrom command line" )
else
return qsTr ("compatible ???" ) // compatible for unknown reason
return qsTr ("not compatible ???" ) // compatible for unknown reason
}
horizontalAlignment: Text.AlignHCenter
width: 50 + 80 + 3
Expand Down Expand Up @@ -235,53 +243,41 @@ MbPage {
writeAccessLevel: User.AccessInstaller
visible: showControls
}
MbOK
{
id: removeButton
width: 170
anchors { right: parent.right}
description: ""
value: qsTr("Remove package")
onClicked: remove ()
writeAccessLevel: User.AccessInstaller
opacity: installedValid ? 0.0001 : 1.0
visible: navigate
}
MbOK
MbOK // for some reasion must be before removeButton or clicks do not work
{
id: cancelButton
width: 90
anchors { right: parent.right; bottom: removeButton.bottom }
anchors { right: parent.right }
description: ""
value: qsTr("Cancel")
onClicked: cancelEdit ()
visible: showControls && ! navigate && ! waitForAction
}
MbOK
{
id: dismissErrorButton
width: 90
anchors { right: parent.right; bottom: removeButton.bottom }
description: ""
value: qsTr("OK")
value:
{
if (editAction.value == 'ERROR')
return qsTr("OK")
else if (moreActions)
return qsTr("Later")
else
return qsTr("Cancel")
}
onClicked: cancelEdit ()
visible: showControls && editAction.value == 'ERROR'
visible: showControls && ! navigate || waitForAction
}
MbOK
{
id: laterButton
width: 90
anchors { right: parent.right; bottom: removeButton.bottom }
id: removeButton
width: 170
anchors { right: parent.right; bottom: cancelButton.bottom}
description: ""
value: qsTr("Later")
onClicked: cancelEdit ()
visible: moreActions
value: qsTr("Remove package")
onClicked: remove ()
writeAccessLevel: User.AccessInstaller
opacity: installedValid ? 0.0001 : 1.0
visible: navigate
}
MbOK
{
id: nowButton
width: 90
anchors { right: laterButton.left; bottom: removeButton.bottom }
anchors { right: cancelButton.left; bottom: cancelButton.bottom }
description: ""
value: qsTr("Now")
onClicked: signalAdditionalAction ()
Expand All @@ -291,7 +287,7 @@ MbPage {
{
id: confirmButton
width: 375
anchors { left: parent.left; bottom: removeButton.bottom }
anchors { left: parent.left; bottom: cancelButton.bottom }
description: ""
value: qsTr ("Proceed")
onClicked: confirm ()
Expand All @@ -303,7 +299,7 @@ MbPage {
id: statusMessage
width: 250
wrapMode: Text.WordWrap
anchors { left: parent.left; leftMargin: 10; bottom: removeButton.bottom; bottomMargin: 5 }
anchors { left: parent.left; leftMargin: 10; bottom: cancelButton.bottom; bottomMargin: 5 }
font.pixelSize: 12
color: actionPending && isSetupHelper ? "red" : "black"
text:
Expand All @@ -328,7 +324,7 @@ MbPage {
{
id: previousButton
width: 100
anchors { left: parent.left ; top:removeButton.bottom }
anchors { left: parent.left ; top:cancelButton.bottom }
description: ""
value: qsTr("Previous")
onClicked: previousIndex ()
Expand Down Expand Up @@ -386,7 +382,7 @@ MbPage {
{
id: uninstallButton
width: 100
anchors { right: parent.right; bottom: installButton.bottom }
anchors { right: parent.right; bottom: previousButton.bottom }
description: ""
value: qsTr("Uninstall")
onClicked: uninstall ()
Expand Down
2 changes: 1 addition & 1 deletion blindInstall/SetupHelperVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.30
v4.31
3 changes: 3 additions & 0 deletions changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v4.31:
fixed: PackageManager edit menus not working

v4.30:
fixed: can't select many items in PackageManager menus
add Cerbo SGX platform
Expand Down
Binary file modified venus-data.UninstallPackages.tar.gz
Binary file not shown.
Binary file modified venus-data.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.30
v4.31

0 comments on commit 11d9f2b

Please sign in to comment.