1
0
Fork 0

Add update for appimages.

This commit is contained in:
namedkitten 2020-05-05 15:28:04 +01:00
parent 949800c781
commit ecfc0b6ca8
4 changed files with 25 additions and 1 deletions

View file

@ -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()

View file

@ -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",

View file

@ -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)

View file

@ -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)
{ {