add listview in consolt log
This commit is contained in:
23
Main.qml
23
Main.qml
@@ -87,10 +87,9 @@ 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 var consoleLog: tabs.currentIndex === 0 ? UpdateManager.updateLog
|
||||
: tabs.currentIndex === 1 ? UpdateManager.installLog
|
||||
: UpdateManager.removalLog
|
||||
|
||||
Components.ConsoleBar {
|
||||
id: consoleBar
|
||||
@@ -100,14 +99,14 @@ ApplicationWindow {
|
||||
onToggled: root.consoleOpen = !root.consoleOpen
|
||||
}
|
||||
|
||||
// Components.ConsolePanel {
|
||||
// id: consolePanel
|
||||
// anchors.bottom: consoleBar.top
|
||||
// consoleOpen: root.consoleOpen
|
||||
// status: root.consoleStatus
|
||||
// title: root.consoleTitle
|
||||
// consoleLogData: root.consoleLogData
|
||||
// }
|
||||
Components.ConsolePanel {
|
||||
id: consolePanel
|
||||
anchors.bottom: consoleBar.top
|
||||
consoleOpen: root.consoleOpen
|
||||
status: root.consoleStatus
|
||||
title: root.consoleTitle
|
||||
consoleLogData: root.consoleLog
|
||||
}
|
||||
|
||||
Dialogs.PasswordDialog {
|
||||
id: passwordDialog
|
||||
|
||||
@@ -39,3 +39,18 @@ QVariantList UpdateManager::packages() const
|
||||
{
|
||||
return m_packages;
|
||||
}
|
||||
|
||||
QStringList UpdateManager::updateLog() const
|
||||
{
|
||||
return m_update_log;
|
||||
}
|
||||
|
||||
QStringList UpdateManager::installLog() const
|
||||
{
|
||||
return m_install_log;
|
||||
}
|
||||
|
||||
QStringList UpdateManager::removalLog() const
|
||||
{
|
||||
return m_removal_log;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ class UpdateManager : public QObject
|
||||
Q_PROPERTY(bool isUpdating READ isUpdating NOTIFY isUpdatingChanged)
|
||||
Q_PROPERTY(bool isInstalling READ isInstalling NOTIFY isInstallingChanged)
|
||||
Q_PROPERTY(bool isRemoving READ isRemoving NOTIFY isRemovingChanged)
|
||||
Q_PROPERTY(QStringList removalLog READ removalLog NOTIFY removalLogChanged)
|
||||
Q_PROPERTY(QStringList updateLog READ updateLog NOTIFY updateLogChanged)
|
||||
Q_PROPERTY(QStringList installLog READ installLog NOTIFY installLogChanged)
|
||||
Q_PROPERTY(QVariantList packages READ packages NOTIFY packagesChanged)
|
||||
|
||||
public:
|
||||
@@ -31,6 +34,9 @@ class UpdateManager : public QObject
|
||||
bool isUpdating() const;
|
||||
bool isInstalling() const;
|
||||
bool isRemoving() const;
|
||||
QStringList updateLog() const;
|
||||
QStringList installLog() const;
|
||||
QStringList removalLog() const;
|
||||
QVariantList packages() const;
|
||||
|
||||
public:
|
||||
@@ -67,6 +73,8 @@ class UpdateManager : public QObject
|
||||
std::unique_ptr<QTemporaryDir> m_askpass_dir;
|
||||
QByteArray m_update_output;
|
||||
QStringList m_update_log;
|
||||
QStringList m_install_log;
|
||||
QStringList m_removal_log;
|
||||
QTimer m_update_watchdog;
|
||||
|
||||
signals:
|
||||
@@ -77,5 +85,7 @@ class UpdateManager : public QObject
|
||||
void isRemovingChanged();
|
||||
void packagesChanged();
|
||||
void updateLogChanged();
|
||||
void installLogChanged();
|
||||
void removalLogChanged();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user