feat: add system update

pull/55/head
kateleet 4 years ago
parent 8a24e7b64b
commit ef2d8ff5ec

@ -23,6 +23,7 @@
#include <QStorageInfo>
#include <QRegularExpression>
#include <QSettings>
#include <QProcess>
#ifdef Q_OS_LINUX
#include <sys/sysinfo.h>
@ -178,6 +179,11 @@ QString About::cpuInfo()
return QString();
}
void About::openUpdator()
{
QProcess::startDetached("cutefish-updator", QStringList());
}
qlonglong About::calculateTotalRam() const
{
qlonglong ret = -1;

@ -59,6 +59,8 @@ public:
QString internalStorage();
QString cpuInfo();
Q_INVOKABLE void openUpdator();
private:
qlonglong calculateTotalRam() const;
};

@ -122,13 +122,14 @@ ItemPage {
height: FishUI.Units.smallSpacing
}
// StandardButton {
// Layout.fillWidth: true
// text: qsTr("System Update")
// onClicked: {
// rootWindow.stackView.push(Qt.resolvedUrl("qrc:/qml/Update/Main.qml"))
// }
// }
StandardButton {
Layout.fillWidth: true
visible: about.isCutefishOS
text: qsTr("System Update")
onClicked: {
about.openUpdator()
}
}
}
}
}

@ -92,6 +92,11 @@
<source>Internal Storage</source>
<translation>Internal Storage</translation>
</message>
<message>
<location filename="../src/qml/About/Main.qml" line="128"/>
<source>System Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Appearance/Main.qml" line="30"/>
<source>Appearance</source>
@ -783,7 +788,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Sound/Main.qml" line="172"/>
<location filename="../src/qml/Sound/Main.qml" line="173"/>
<source>Input Devices</source>
<translation type="unfinished"></translation>
</message>

@ -92,6 +92,11 @@
<source>Internal Storage</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/About/Main.qml" line="128"/>
<source>System Update</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/Appearance/Main.qml" line="30"/>
<source>Appearance</source>
@ -783,7 +788,7 @@
<translation></translation>
</message>
<message>
<location filename="../src/qml/Sound/Main.qml" line="172"/>
<location filename="../src/qml/Sound/Main.qml" line="173"/>
<source>Input Devices</source>
<translation></translation>
</message>

Loading…
Cancel
Save