Add update for appimages.
This commit is contained in:
parent
949800c781
commit
ecfc0b6ca8
|
@ -183,6 +183,10 @@ MenuBar {
|
|||
onTriggered: loadDialog.open()
|
||||
shortcut: keybinds.openURI
|
||||
}
|
||||
Action {
|
||||
text: translate.getTranslation("UPDATE_APPIMAGE", i18n.language)
|
||||
onTriggered: utils.updateAppImage()
|
||||
}
|
||||
Action {
|
||||
text: translate.getTranslation("EXIT", i18n.language)
|
||||
onTriggered: Qt.quit()
|
||||
|
|
|
@ -59,7 +59,9 @@ var translations = {
|
|||
DOUBLE_TAP_TO_SEEK_BY: "Seek by",
|
||||
FONT: "Font",
|
||||
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: {
|
||||
OPEN_FILE: "Abrir archivo",
|
||||
|
|
|
@ -36,6 +36,20 @@ launchAboutQt()
|
|||
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
|
||||
inline int
|
||||
fast_mod(const int input, const int ceil)
|
||||
|
|
|
@ -16,6 +16,8 @@ QString
|
|||
createTimestamp(int seconds);
|
||||
void
|
||||
launchAboutQt();
|
||||
void
|
||||
updateAppImage();
|
||||
}
|
||||
|
||||
class UtilsClass : public QObject
|
||||
|
@ -25,6 +27,8 @@ public slots:
|
|||
void SetDPMS(bool on) { Utils::SetDPMS(on); };
|
||||
void AlwaysOnTop(WId wid, bool on) { Utils::AlwaysOnTop(wid, on); };
|
||||
void launchAboutQt() { Utils::launchAboutQt(); };
|
||||
void updateAppImage() { Utils::updateAppImage(); };
|
||||
|
||||
|
||||
QString createTimestamp(int seconds)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue