Add update for appimages.
This commit is contained in:
parent
949800c781
commit
ecfc0b6ca8
|
@ -183,6 +183,10 @@ MenuBar {
|
||||||
onTriggered: loadDialog.open()
|
onTriggered: loadDialog.open()
|
||||||
shortcut: keybinds.openURI
|
shortcut: keybinds.openURI
|
||||||
}
|
}
|
||||||
|
Action {
|
||||||
|
text: translate.getTranslation("UPDATE_APPIMAGE", i18n.language)
|
||||||
|
onTriggered: utils.updateAppImage()
|
||||||
|
}
|
||||||
Action {
|
Action {
|
||||||
text: translate.getTranslation("EXIT", i18n.language)
|
text: translate.getTranslation("EXIT", i18n.language)
|
||||||
onTriggered: Qt.quit()
|
onTriggered: Qt.quit()
|
||||||
|
|
|
@ -59,7 +59,9 @@ var translations = {
|
||||||
DOUBLE_TAP_TO_SEEK_BY: "Seek by",
|
DOUBLE_TAP_TO_SEEK_BY: "Seek by",
|
||||||
FONT: "Font",
|
FONT: "Font",
|
||||||
SUBTITLES_FONT_SIZE: "Subtitles Font Size",
|
SUBTITLES_FONT_SIZE: "Subtitles Font Size",
|
||||||
UI_FADE_TIME: "UI Fade Time (ms)"
|
UI_FADE_TIME: "UI Fade Time (ms)",
|
||||||
|
UPDATE: "Update (AppImage Only)"
|
||||||
|
|
||||||
},
|
},
|
||||||
spanish: {
|
spanish: {
|
||||||
OPEN_FILE: "Abrir archivo",
|
OPEN_FILE: "Abrir archivo",
|
||||||
|
|
|
@ -36,6 +36,20 @@ launchAboutQt()
|
||||||
qapp->aboutQt();
|
qapp->aboutQt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateAppImage()
|
||||||
|
{
|
||||||
|
QString program =
|
||||||
|
QProcessEnvironment::systemEnvironment().value("APPDIR", "") +
|
||||||
|
"/usr/bin/appimageupdatetool";
|
||||||
|
QProcess updater;
|
||||||
|
updater.setProcessChannelMode(QProcess::ForwardedChannels);
|
||||||
|
updater.start(program,
|
||||||
|
QStringList() << QProcessEnvironment::systemEnvironment().value(
|
||||||
|
"APPIMAGE", ""));
|
||||||
|
updater.waitForFinished();
|
||||||
|
qApp->exit();
|
||||||
|
}
|
||||||
|
|
||||||
// https://www.youtube.com/watch?v=nXaxk27zwlk&feature=youtu.be&t=56m34s
|
// https://www.youtube.com/watch?v=nXaxk27zwlk&feature=youtu.be&t=56m34s
|
||||||
inline int
|
inline int
|
||||||
fast_mod(const int input, const int ceil)
|
fast_mod(const int input, const int ceil)
|
||||||
|
|
|
@ -16,6 +16,8 @@ QString
|
||||||
createTimestamp(int seconds);
|
createTimestamp(int seconds);
|
||||||
void
|
void
|
||||||
launchAboutQt();
|
launchAboutQt();
|
||||||
|
void
|
||||||
|
updateAppImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
class UtilsClass : public QObject
|
class UtilsClass : public QObject
|
||||||
|
@ -25,6 +27,8 @@ public slots:
|
||||||
void SetDPMS(bool on) { Utils::SetDPMS(on); };
|
void SetDPMS(bool on) { Utils::SetDPMS(on); };
|
||||||
void AlwaysOnTop(WId wid, bool on) { Utils::AlwaysOnTop(wid, on); };
|
void AlwaysOnTop(WId wid, bool on) { Utils::AlwaysOnTop(wid, on); };
|
||||||
void launchAboutQt() { Utils::launchAboutQt(); };
|
void launchAboutQt() { Utils::launchAboutQt(); };
|
||||||
|
void updateAppImage() { Utils::updateAppImage(); };
|
||||||
|
|
||||||
|
|
||||||
QString createTimestamp(int seconds)
|
QString createTimestamp(int seconds)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue