2 * Copyright (C) 2014-2016 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23class SystemImage : public QObject
26 Q_DISABLE_COPY(SystemImage)
28 Q_PROPERTY(bool updateAvailable READ updateAvailable NOTIFY updateAvailableStatus)
29 Q_PROPERTY(bool updateDownloading READ updateDownloading NOTIFY updateAvailableStatus)
30 Q_PROPERTY(QString availableVersion READ availableVersion NOTIFY updateAvailableStatus)
31 Q_PROPERTY(QString updateSize READ updateSize NOTIFY updateAvailableStatus)
32 Q_PROPERTY(bool updateApplying READ updateApplying NOTIFY updateApplyingChanged)
33 Q_PROPERTY(bool updateDownloaded READ updateDownloaded NOTIFY updateDownloadedChanged)
36 explicit SystemImage(QObject *parent = nullptr);
37 ~SystemImage() = default;
39 bool updateAvailable() const { return m_updateAvailable; }
40 bool updateDownloading() const { return m_downloading; }
41 QString availableVersion() const { return m_availableVersion; }
42 QString updateSize() const { return m_updateSize; }
43 bool updateApplying() const { return m_updateApplying; }
44 bool updateDownloaded() const { return m_downloaded; }
47 Q_INVOKABLE void checkForUpdate();
48 Q_INVOKABLE void applyUpdate();
49 Q_INVOKABLE void factoryReset();
52 void onUpdateAvailableStatus(bool is_available, bool updateDownloading, const QString &available_version,
53 int update_size, const QString &last_update_date, const QString &error_reason);
54 void onUpdateDownloaded();
55 void onUpdateFailed(int consecutive_failure_count, const QString & last_reason);
56 void onUpdateApplied(bool applied);
57 void onRebooting(bool status);
60 void updateAvailableStatus();
61 void updateDownloadedChanged();
62 void updateApplyingChanged();
65 void setUpdateApplying(bool status);
68 void resetUpdateStatus();
69 QString formatSize(quint64 size) const;
72 bool m_updateAvailable = false;
73 bool m_updateApplying = false;
74 bool m_downloading = false;
75 bool m_downloaded = false;
76 QString m_availableVersion;
78 QString m_lastUpdateDate;
79 QString m_errorReason;
82#endif // SYSTEMIMAGE_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list