add base update in new struct code
This commit is contained in:
69
Main.qml
69
Main.qml
@@ -23,13 +23,13 @@ ApplicationWindow {
|
||||
property string sessionPassword: ""
|
||||
property bool consoleOpen: false
|
||||
|
||||
Component.onCompleted: UpdateManager.checkUpdates()
|
||||
Component.onCompleted: ProcessManager.checkUpdates()
|
||||
|
||||
ColumnLayout {
|
||||
id: mainLayout
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.baseMargins
|
||||
anchors.bottomMargin: Theme.baseMargins + consoleBar.height
|
||||
// anchors.bottomMargin: Theme.baseMargins + consoleBar.height
|
||||
spacing: Theme.baseSpacing
|
||||
|
||||
RowLayout {
|
||||
@@ -40,8 +40,8 @@ ApplicationWindow {
|
||||
id: title
|
||||
Layout.maximumWidth: Number.POSITIVE_INFINITY
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
isChecking: UpdateManager.isChecking
|
||||
packageCount: UpdateManager.packageCount
|
||||
status: ProcessManager.status
|
||||
packageCount: ProcessManager.packageCount
|
||||
}
|
||||
|
||||
Buttons.SettingsBtn {
|
||||
@@ -65,13 +65,16 @@ ApplicationWindow {
|
||||
|
||||
Pages.UpdatePg {
|
||||
id: pgUpdate
|
||||
packageCount: UpdateManager.packageCount
|
||||
isChecking: UpdateManager.isChecking
|
||||
isUpdating: UpdateManager.isUpdating
|
||||
isInstalling: UpdateManager.isInstalling
|
||||
packages: UpdateManager.packages
|
||||
onUpdateRequested: {
|
||||
root.requestPrivileged("update", "")
|
||||
packageCount: ProcessManager.packageCount
|
||||
status: ProcessManager.status
|
||||
packages: ProcessManager.packages
|
||||
onUpdate: {
|
||||
if (ProcessManager.password === "")
|
||||
{
|
||||
passwordDialog.open();
|
||||
return;
|
||||
}
|
||||
ProcessManager.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,32 +88,32 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string consoleTitle: tabs.currentIndex === 0 ? "Консоль обновления" : tabs.currentIndex === 1 ? "Консоль установки" : "Консоль удаления"
|
||||
readonly property string consoleStatus: Utils.statusConsole(tabs.currentIndex, UpdateManager.isUpdating, UpdateManager.isInstalling, UpdateManager.isRemoving)
|
||||
readonly property var consoleLog: tabs.currentIndex === 0 ? UpdateManager.updateLog : tabs.currentIndex === 1 ? UpdateManager.installLog : UpdateManager.removalLog
|
||||
// readonly property string consoleTitle: tabs.currentIndex === 0 ? "Консоль обновления" : tabs.currentIndex === 1 ? "Консоль установки" : "Консоль удаления"
|
||||
// readonly property string consoleStatus: Utils.statusConsole(tabs.currentIndex, UpdateManager.isUpdating, UpdateManager.isInstalling, UpdateManager.isRemoving)
|
||||
// readonly property var consoleLog: tabs.currentIndex === 0 ? UpdateManager.updateLog : tabs.currentIndex === 1 ? UpdateManager.installLog : UpdateManager.removalLog
|
||||
|
||||
Components.ConsoleBar {
|
||||
id: consoleBar
|
||||
title: root.consoleTitle
|
||||
consoleOpen: root.consoleOpen
|
||||
status: root.consoleStatus
|
||||
onToggled: root.consoleOpen = !root.consoleOpen
|
||||
}
|
||||
|
||||
Components.ConsolePanel {
|
||||
id: consolePanel
|
||||
anchors.bottom: consoleBar.top
|
||||
consoleOpen: root.consoleOpen
|
||||
status: root.consoleStatus
|
||||
title: root.consoleTitle
|
||||
consoleLogData: root.consoleLog
|
||||
}
|
||||
// Components.ConsoleBar {
|
||||
// id: consoleBar
|
||||
// title: root.consoleTitle
|
||||
// consoleOpen: root.consoleOpen
|
||||
// status: root.consoleStatus
|
||||
// onToggled: root.consoleOpen = !root.consoleOpen
|
||||
// }
|
||||
//
|
||||
// Components.ConsolePanel {
|
||||
// id: consolePanel
|
||||
// anchors.bottom: consoleBar.top
|
||||
// consoleOpen: root.consoleOpen
|
||||
// status: root.consoleStatus
|
||||
// title: root.consoleTitle
|
||||
// consoleLogData: root.consoleLog
|
||||
// }
|
||||
|
||||
Dialogs.PasswordDialog {
|
||||
id: passwordDialog
|
||||
onPasswordEntered: (password) => {
|
||||
root.sessionPassword = password
|
||||
root.runPrivileged(passwordDialog.action, passwordDialog.packageName)
|
||||
ProcessManager.setPassword(password);
|
||||
ProcessManager.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +129,7 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
function runPrivileged(action, packageName) {
|
||||
if (action == "update") UpdateManager.update(root.sessionPassword, root.packageManager)
|
||||
if (action == "update") ProcessManager.update()
|
||||
// else if (action === "install") UpdateManager.installPackage(packageName, password)
|
||||
// else UpdateManager.removePackage(packageName, password)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user