Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • akiraohgaki/ocs-manager
  • dfn2/ocs-manager
  • azubieta/ocs-manager
  • rws77/ocs-manager
4 results
Show changes
#pragma once
#include <QObject>
namespace appimage {
namespace update {
class Updater;
}
}
class AppImageUpdater : public QObject
{
Q_OBJECT
public:
explicit AppImageUpdater(const QString &id, const QString &path, QObject *parent = nullptr);
~AppImageUpdater();
QString id() const;
QString path() const;
bool isFinishedWithNoError() const;
QString errorString() const;
QString describeAppImage() const;
bool checkForChanges() const;
void start();
signals:
void finished(AppImageUpdater *updater);
void updateProgress(QString id, double progress);
private slots:
void checkProgress();
private:
QString id_;
QString path_;
bool isFinishedWithNoError_;
QString errorString_;
appimage::update::Updater *updater_;
};
......@@ -4,13 +4,14 @@
#include <QWebSocketServer>
#include <QWebSocket>
#include "qtlib_json.h"
#include "qtil_json.h"
#include "handlers/confighandler.h"
#include "handlers/systemhandler.h"
#include "handlers/desktopthemehandler.h"
#include "handlers/ocsapihandler.h"
#include "handlers/itemhandler.h"
#include "handlers/updatehandler.h"
#include "handlers/desktopthemehandler.h"
WebSocketServer::WebSocketServer(ConfigHandler *configHandler, const QString &serverName, quint16 serverPort, QObject *parent)
: QObject(parent), configHandler_(configHandler), serverName_(serverName), serverPort_(serverPort)
......@@ -22,20 +23,27 @@ WebSocketServer::WebSocketServer(ConfigHandler *configHandler, const QString &se
configHandler_->setParent(this);
systemHandler_ = new SystemHandler(this);
desktopThemeHandler_ = new DesktopThemeHandler(this);
ocsApiHandler_ = new OcsApiHandler(configHandler_, this);
itemHandler_ = new ItemHandler(configHandler_, this);
updateHandler_ = new UpdateHandler(configHandler_, this);
desktopThemeHandler_ = new DesktopThemeHandler(this);
connect(itemHandler_, &ItemHandler::metadataSetChanged, this, &WebSocketServer::itemMetadataSetChanged);
connect(itemHandler_, &ItemHandler::downloadStarted, this, &WebSocketServer::itemDownloadStarted);
connect(itemHandler_, &ItemHandler::downloadFinished, this, &WebSocketServer::itemDownloadFinished);
connect(itemHandler_, &ItemHandler::downloadProgress, this, &WebSocketServer::itemDownloadProgress);
connect(itemHandler_, &ItemHandler::saveStarted, this, &WebSocketServer::itemSaveStarted);
connect(itemHandler_, &ItemHandler::saveFinished, this, &WebSocketServer::itemSaveFinished);
connect(itemHandler_, &ItemHandler::installStarted, this, &WebSocketServer::itemInstallStarted);
connect(itemHandler_, &ItemHandler::installFinished, this, &WebSocketServer::itemInstallFinished);
connect(itemHandler_, &ItemHandler::uninstallStarted, this, &WebSocketServer::itemUninstallStarted);
connect(itemHandler_, &ItemHandler::uninstallFinished, this, &WebSocketServer::itemUninstallFinished);
connect(itemHandler_, &ItemHandler::metadataSetChanged, this, &WebSocketServer::itemHandlerMetadataSetChanged);
connect(itemHandler_, &ItemHandler::downloadStarted, this, &WebSocketServer::itemHandlerDownloadStarted);
connect(itemHandler_, &ItemHandler::downloadFinished, this, &WebSocketServer::itemHandlerDownloadFinished);
connect(itemHandler_, &ItemHandler::downloadProgress, this, &WebSocketServer::itemHandlerDownloadProgress);
connect(itemHandler_, &ItemHandler::saveStarted, this, &WebSocketServer::itemHandlerSaveStarted);
connect(itemHandler_, &ItemHandler::saveFinished, this, &WebSocketServer::itemHandlerSaveFinished);
connect(itemHandler_, &ItemHandler::installStarted, this, &WebSocketServer::itemHandlerInstallStarted);
connect(itemHandler_, &ItemHandler::installFinished, this, &WebSocketServer::itemHandlerInstallFinished);
connect(itemHandler_, &ItemHandler::uninstallStarted, this, &WebSocketServer::itemHandlerUninstallStarted);
connect(itemHandler_, &ItemHandler::uninstallFinished, this, &WebSocketServer::itemHandlerUninstallFinished);
connect(updateHandler_, &UpdateHandler::checkAllStarted, this, &WebSocketServer::updateHandlerCheckAllStarted);
connect(updateHandler_, &UpdateHandler::checkAllFinished, this, &WebSocketServer::updateHandlerCheckAllFinished);
connect(updateHandler_, &UpdateHandler::updateStarted, this, &WebSocketServer::updateHandlerUpdateStarted);
connect(updateHandler_, &UpdateHandler::updateFinished, this, &WebSocketServer::updateHandlerUpdateFinished);
connect(updateHandler_, &UpdateHandler::updateProgress, this, &WebSocketServer::updateHandlerUpdateProgress);
}
WebSocketServer::~WebSocketServer()
......@@ -47,6 +55,10 @@ WebSocketServer::~WebSocketServer()
bool WebSocketServer::start()
{
if (wsServer_->listen(QHostAddress::Any, serverPort_)) {
auto application = configHandler_->getUsrConfigApplication();
application["websocket_url"] = serverUrl().toString();
configHandler_->setUsrConfigApplication(application);
emit started();
return true;
}
......@@ -55,6 +67,10 @@ bool WebSocketServer::start()
void WebSocketServer::stop()
{
auto application = configHandler_->getUsrConfigApplication();
application["websocket_url"] = QString("");
configHandler_->setUsrConfigApplication(application);
wsServer_->close();
}
......@@ -100,7 +116,7 @@ void WebSocketServer::wsTextMessageReceived(const QString &message)
{
auto *wsClient = qobject_cast<QWebSocket *>(sender());
if (wsClient) {
qtlib::Json json(message.toUtf8());
Qtil::Json json(message.toUtf8());
if (json.isObject()) {
auto object = json.toObject();
receiveMessage(object["id"].toString(), object["func"].toString(), object["data"].toArray());
......@@ -112,7 +128,7 @@ void WebSocketServer::wsBinaryMessageReceived(const QByteArray &message)
{
auto *wsClient = qobject_cast<QWebSocket *>(sender());
if (wsClient) {
qtlib::Json json(message);
Qtil::Json json(message);
if (json.isObject()) {
auto object = json.toObject();
receiveMessage(object["id"].toString(), object["func"].toString(), object["data"].toArray());
......@@ -120,27 +136,27 @@ void WebSocketServer::wsBinaryMessageReceived(const QByteArray &message)
}
}
void WebSocketServer::itemMetadataSetChanged()
void WebSocketServer::itemHandlerMetadataSetChanged()
{
QJsonArray data;
sendMessage("", "ItemHandler::metadataSetChanged", data);
}
void WebSocketServer::itemDownloadStarted(QJsonObject result)
void WebSocketServer::itemHandlerDownloadStarted(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::downloadStarted", data);
}
void WebSocketServer::itemDownloadFinished(QJsonObject result)
void WebSocketServer::itemHandlerDownloadFinished(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::downloadFinished", data);
}
void WebSocketServer::itemDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal)
void WebSocketServer::itemHandlerDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal)
{
QJsonArray data;
data.append(id);
......@@ -149,48 +165,86 @@ void WebSocketServer::itemDownloadProgress(QString id, qint64 bytesReceived, qin
sendMessage("", "ItemHandler::downloadProgress", data);
}
void WebSocketServer::itemSaveStarted(QJsonObject result)
void WebSocketServer::itemHandlerSaveStarted(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::saveStarted", data);
}
void WebSocketServer::itemSaveFinished(QJsonObject result)
void WebSocketServer::itemHandlerSaveFinished(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::saveFinished", data);
}
void WebSocketServer::itemInstallStarted(QJsonObject result)
void WebSocketServer::itemHandlerInstallStarted(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::installStarted", data);
}
void WebSocketServer::itemInstallFinished(QJsonObject result)
void WebSocketServer::itemHandlerInstallFinished(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::installFinished", data);
}
void WebSocketServer::itemUninstallStarted(QJsonObject result)
void WebSocketServer::itemHandlerUninstallStarted(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::uninstallStarted", data);
}
void WebSocketServer::itemUninstallFinished(QJsonObject result)
void WebSocketServer::itemHandlerUninstallFinished(QJsonObject result)
{
QJsonArray data;
data.append(result);
sendMessage("", "ItemHandler::uninstallFinished", data);
}
void WebSocketServer::updateHandlerCheckAllStarted(bool status)
{
QJsonArray data;
data.append(status);
sendMessage("", "UpdateHandler::checkAllStarted", data);
}
void WebSocketServer::updateHandlerCheckAllFinished(bool status)
{
QJsonArray data;
data.append(status);
sendMessage("", "UpdateHandler::checkAllFinished", data);
}
void WebSocketServer::updateHandlerUpdateStarted(QString itemKey, bool status)
{
QJsonArray data;
data.append(itemKey);
data.append(status);
sendMessage("", "UpdateHandler::updateStarted", data);
}
void WebSocketServer::updateHandlerUpdateFinished(QString itemKey, bool status)
{
QJsonArray data;
data.append(itemKey);
data.append(status);
sendMessage("", "UpdateHandler::updateFinished", data);
}
void WebSocketServer::updateHandlerUpdateProgress(QString itemKey, double progress)
{
QJsonArray data;
data.append(itemKey);
data.append(progress);
sendMessage("", "UpdateHandler::updateProgress", data);
}
void WebSocketServer::receiveMessage(const QString &id, const QString &func, const QJsonArray &data)
{
/* message object format
......@@ -247,6 +301,12 @@ void WebSocketServer::receiveMessage(const QString &id, const QString &func, con
else if (func == "ConfigHandler::setUsrConfigInstalledItems") {
resultData.append(configHandler_->setUsrConfigInstalledItems(data.at(0).toObject()));
}
else if (func == "ConfigHandler::getUsrConfigUpdateAvailableItems") {
resultData.append(configHandler_->getUsrConfigUpdateAvailableItems());
}
else if (func == "ConfigHandler::setUsrConfigUpdateAvailableItems") {
resultData.append(configHandler_->setUsrConfigUpdateAvailableItems(data.at(0).toObject()));
}
else if (func == "ConfigHandler::setUsrConfigProvidersProvider") {
resultData.append(configHandler_->setUsrConfigProvidersProvider(data.at(0).toString(), data.at(1).toObject()));
}
......@@ -268,30 +328,19 @@ void WebSocketServer::receiveMessage(const QString &id, const QString &func, con
else if (func == "ConfigHandler::removeUsrConfigInstalledItemsItem") {
resultData.append(configHandler_->removeUsrConfigInstalledItemsItem(data.at(0).toString()));
}
// SystemHandler
else if (func == "SystemHandler::isUnix") {
resultData.append(systemHandler_->isUnix());
else if (func == "ConfigHandler::setUsrConfigUpdateAvailableItemsItem") {
resultData.append(configHandler_->setUsrConfigUpdateAvailableItemsItem(data.at(0).toString(), data.at(1).toObject()));
}
else if (func == "ConfigHandler::removeUsrConfigUpdateAvailableItemsItem") {
resultData.append(configHandler_->removeUsrConfigUpdateAvailableItemsItem(data.at(0).toString()));
}
// SystemHandler
else if (func == "SystemHandler::isMobileDevice") {
resultData.append(systemHandler_->isMobileDevice());
}
else if (func == "SystemHandler::openUrl") {
resultData.append(systemHandler_->openUrl(data.at(0).toString()));
}
// DesktopThemeHandler
else if (func == "DesktopThemeHandler::desktopEnvironment") {
resultData.append(desktopThemeHandler_->desktopEnvironment());
}
else if (func == "DesktopThemeHandler::isApplicableType") {
resultData.append(desktopThemeHandler_->isApplicableType(data.at(0).toString()));
}
else if (func == "DesktopThemeHandler::applyTheme") {
#ifdef QTLIB_UNIX
resultData.append(desktopThemeHandler_->applyTheme(data.at(0).toString(), data.at(1).toString()));
#else
resultData.append(false);
#endif
}
// OcsApiHandler
else if (func == "OcsApiHandler::addProviders") {
resultData.append(ocsApiHandler_->addProviders(data.at(0).toString()));
......@@ -327,6 +376,23 @@ void WebSocketServer::receiveMessage(const QString &id, const QString &func, con
else if (func == "ItemHandler::uninstall") {
itemHandler_->uninstall(data.at(0).toString());
}
// UpdateHandler
else if (func == "UpdateHandler::checkAll") {
updateHandler_->checkAll();
}
else if (func == "UpdateHandler::update") {
updateHandler_->update(data.at(0).toString());
}
// DesktopThemeHandler
else if (func == "DesktopThemeHandler::desktopEnvironment") {
resultData.append(desktopThemeHandler_->desktopEnvironment());
}
else if (func == "DesktopThemeHandler::isApplicableType") {
resultData.append(desktopThemeHandler_->isApplicableType(data.at(0).toString()));
}
else if (func == "DesktopThemeHandler::applyTheme") {
resultData.append(desktopThemeHandler_->applyTheme(data.at(0).toString(), data.at(1).toString()));
}
// Not supported
else {
return;
......@@ -350,7 +416,7 @@ void WebSocketServer::sendMessage(const QString &id, const QString &func, const
object["func"] = func;
object["data"] = data;
auto binaryMessage = qtlib::Json(object).toJson();
auto binaryMessage = Qtil::Json(object).toJson();
auto textMessage = QString::fromUtf8(binaryMessage);
for (auto *wsClient : wsClients_) {
......
......@@ -10,9 +10,10 @@ class QWebSocket;
class ConfigHandler;
class SystemHandler;
class DesktopThemeHandler;
class OcsApiHandler;
class ItemHandler;
class UpdateHandler;
class DesktopThemeHandler;
class WebSocketServer : public QObject
{
......@@ -39,16 +40,22 @@ private slots:
void wsTextMessageReceived(const QString &message);
void wsBinaryMessageReceived(const QByteArray &message);
void itemMetadataSetChanged();
void itemDownloadStarted(QJsonObject result);
void itemDownloadFinished(QJsonObject result);
void itemDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal);
void itemSaveStarted(QJsonObject result);
void itemSaveFinished(QJsonObject result);
void itemInstallStarted(QJsonObject result);
void itemInstallFinished(QJsonObject result);
void itemUninstallStarted(QJsonObject result);
void itemUninstallFinished(QJsonObject result);
void itemHandlerMetadataSetChanged();
void itemHandlerDownloadStarted(QJsonObject result);
void itemHandlerDownloadFinished(QJsonObject result);
void itemHandlerDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal);
void itemHandlerSaveStarted(QJsonObject result);
void itemHandlerSaveFinished(QJsonObject result);
void itemHandlerInstallStarted(QJsonObject result);
void itemHandlerInstallFinished(QJsonObject result);
void itemHandlerUninstallStarted(QJsonObject result);
void itemHandlerUninstallFinished(QJsonObject result);
void updateHandlerCheckAllStarted(bool status);
void updateHandlerCheckAllFinished(bool status);
void updateHandlerUpdateStarted(QString itemKey, bool status);
void updateHandlerUpdateFinished(QString itemKey, bool status);
void updateHandlerUpdateProgress(QString itemKey, double progress);
private:
void receiveMessage(const QString &id, const QString &func, const QJsonArray &data);
......@@ -56,9 +63,10 @@ private:
ConfigHandler *configHandler_;
SystemHandler *systemHandler_;
DesktopThemeHandler *desktopThemeHandler_;
OcsApiHandler *ocsApiHandler_;
ItemHandler *itemHandler_;
UpdateHandler *updateHandler_;
DesktopThemeHandler *desktopThemeHandler_;
QString serverName_;
quint16 serverPort_;
......
unix:!ios:!android {
contains(DEFINES, APP_DESKTOP) {
isEmpty(PREFIX) {
PREFIX = /usr/local
}
......
......@@ -6,3 +6,4 @@ Type=Application
Terminal=true
NoDisplay=true
Categories=Network;Utility;
X-AppImage-Integrate=false
......@@ -4,107 +4,112 @@
<context>
<name>ItemHandler</name>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="55"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="53"/>
<source>The item already installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="62"/>
<source>The file already downloading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="69"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="76"/>
<source>Downloading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="119"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="125"/>
<source>Invalid OCS-URL</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="128"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="136"/>
<source>The item not installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="142"/>
<source>Uninstalling</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="197"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="212"/>
<source>Uninstalled</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="222"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="237"/>
<source>Downloaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="252"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="291"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="267"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="311"/>
<source>Saving</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="264"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="306"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="284"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="328"/>
<source>Failed to save data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="271"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="314"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="291"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="336"/>
<source>Saved</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="319"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="341"/>
<source>Installing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="330"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="352"/>
<source>The file has been installed as program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="335"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="357"/>
<source>The plasmoid has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="340"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="362"/>
<source>The plasma look and feel has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="345"/>
<source>The plasma desktop theme has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="350"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="372"/>
<source>The KWin effect has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="355"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="377"/>
<source>The KWin script has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="360"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="382"/>
<source>The KWin window switcher has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="363"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="385"/>
<source>The archive file has been extracted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="366"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="380"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="388"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="402"/>
<source>The file has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="370"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="384"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="392"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="406"/>
<source>Failed to installation</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -4,107 +4,112 @@
<context>
<name>ItemHandler</name>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="55"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="53"/>
<source>The item already installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="62"/>
<source>The file already downloading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="69"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="76"/>
<source>Downloading</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="119"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="125"/>
<source>Invalid OCS-URL</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="128"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="136"/>
<source>The item not installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="142"/>
<source>Uninstalling</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="197"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="212"/>
<source>Uninstalled</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="222"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="237"/>
<source>Downloaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="252"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="291"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="267"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="311"/>
<source>Saving</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="264"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="306"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="284"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="328"/>
<source>Failed to save data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="271"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="314"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="291"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="336"/>
<source>Saved</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="319"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="341"/>
<source>Installing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="330"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="352"/>
<source>The file has been installed as program</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="335"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="357"/>
<source>The plasmoid has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="340"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="362"/>
<source>The plasma look and feel has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="345"/>
<source>The plasma desktop theme has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="350"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="372"/>
<source>The KWin effect has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="355"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="377"/>
<source>The KWin script has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="360"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="382"/>
<source>The KWin window switcher has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="363"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="385"/>
<source>The archive file has been extracted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="366"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="380"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="388"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="402"/>
<source>The file has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="370"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="384"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="392"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="406"/>
<source>Failed to installation</source>
<translation type="unfinished"></translation>
</message>
......
include($${PWD}/qtlib/qtlib.pri)
include($${PWD}/qtil/qtil.pri)
contains(DEFINES, APP_DESKTOP) {
INCLUDEPATH += $${PWD}/AppImageUpdate/include
DEPENDPATH += $${PWD}/AppImageUpdate/include
LIBS += \
-L$${PWD}/AppImageUpdate-prebuilt/src/ -lappimageupdate \
-L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/src/ -lzsync2 \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/hashlib/hashlib.a \
-L$${PWD}/AppImageUpdate-prebuilt/lib/ -lcpr \
-L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/libzsync/ -lzsync \
-L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/librcksum/ -lrcksum \
-L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/zlib/ -lzsync2_libz \
-L$${PWD}/AppImageUpdate-prebuilt/lib/libappimage/src/libappimage_shared/ -lappimage_shared
PRE_TARGETDEPS += \
$${PWD}/AppImageUpdate-prebuilt/src/libappimageupdate.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/src/libzsync2.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/hashlib/hashlib.a \
$${PWD}/AppImageUpdate-prebuilt/lib/libcpr.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/libzsync/libzsync.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/librcksum/librcksum.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/zlib/libzsync2_libz.a \
$${PWD}/AppImageUpdate-prebuilt/lib/libappimage/src/libappimage_shared/libappimage_shared.a
LIBS += -lcurl
}
message("Please execute scripts/import.sh for build dependencies")
ios|android|!isEmpty(APP_MOBILE) {
DEFINES += APP_MOBILE
} else {
} else:unix:!macx {
DEFINES += APP_DESKTOP
}
......
#!/bin/bash
sh scripts/import.sh
qmake PREFIX="/usr"
make
make INSTALL_ROOT="ocs-manager.AppDir" install
curl -L -o linuxdeployqt.AppImage "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod 755 linuxdeployqt.AppImage
./linuxdeployqt.AppImage ocs-manager.AppDir/usr/share/applications/ocs-manager.desktop -bundle-non-qt-libs -no-translations
./linuxdeployqt.AppImage ocs-manager.AppDir/usr/share/applications/ocs-manager.desktop -appimage
#!/bin/bash
PKGNAME='ocs-manager'
PKGVER='0.8.1'
PKGREL='1'
#UPDINFO='zsync|http://***/ocs-manager-x86_64.AppImage.zsync'
APPDIR="${PKGNAME}.AppDir"
./scripts/prepare
qmake PREFIX=/usr
make
make INSTALL_ROOT=${APPDIR} install
curl -fsSL -o linuxdeployqt https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod 755 linuxdeployqt
./linuxdeployqt --appimage-extract
./squashfs-root/AppRun ${APPDIR}/usr/share/applications/${PKGNAME}.desktop -bundle-non-qt-libs -no-translations
install -D -m 755 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 ${APPDIR}/usr/lib/libfontconfig.so.1
install -D -m 755 /usr/lib/x86_64-linux-gnu/libfreetype.so.6 ${APPDIR}/usr/lib/libfreetype.so.6
install -D -m 755 /lib/x86_64-linux-gnu/libssl.so.1.0.0 ${APPDIR}/usr/lib/libssl.so.1.0.0
install -D -m 755 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 ${APPDIR}/usr/lib/libcrypto.so.1.0.0
install -D -m 755 /lib/x86_64-linux-gnu/libz.so.1 ${APPDIR}/usr/lib/libz.so.1
install -D -m 755 /usr/bin/unzip ${APPDIR}/usr/bin/unzip
install -D -m 755 /usr/lib/p7zip/7zr ${APPDIR}/usr/bin/7zr
install -D -m 755 /usr/bin/unar ${APPDIR}/usr/bin/unar
./squashfs-root/AppRun ${APPDIR}/usr/share/applications/${PKGNAME}.desktop -appimage
mv *-x86_64.AppImage ../${PKGNAME}-${PKGVER}-${PKGREL}-x86_64.AppImage
DISTFILES += $${PWD}/appimage/appimage.sh
DISTFILES += $${PWD}/appimage/appimagebuild
#!/bin/bash
################################################################################
# This is wrapper script for build.sh use from inside docker container
################################################################################
PKGNAME='ocs-manager'
PKGUSER='pkgbuilder'
BUILDTYPE=''
if [ "${1}" ]; then
BUILDTYPE="${1}"
fi
PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
BUILDSCRIPT="${PROJDIR}/scripts/build.sh"
TRANSFERLOG="${PROJDIR}/transfer.log"
transfer_file() {
filepath="${1}"
if [ -f "${filepath}" ]; then
filename="$(basename "${filepath}")"
echo "Uploading ${filename}" >> "${TRANSFERLOG}"
curl -T "${filepath}" "https://transfer.sh/${filename}" >> "${TRANSFERLOG}"
echo "" >> "${TRANSFERLOG}"
fi
}
build_snap() {
echo 'Not implemented yet'
}
build_flatpak() {
echo 'Not implemented yet'
}
build_appimage() {
# docker-image: ubuntu:16.04
apt update -qq
apt -y install build-essential qt5-default libqt5websockets5-dev
apt -y install git
apt -y install curl
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER}
transfer_file "$(find "${PROJDIR}/build_"*${BUILDTYPE} -type f -name "${PKGNAME}*.AppImage")"
}
if [ "${BUILDTYPE}" = 'snap' ]; then
build_snap
elif [ "${BUILDTYPE}" = 'flatpak' ]; then
build_flatpak
elif [ "${BUILDTYPE}" = 'appimage' ]; then
build_appimage
else
echo "sh $(basename "${0}") [snap|flatpak|appimage]"
exit 1
fi
#!/bin/bash
################################################################################
# This is utility script to build distribution packages
################################################################################
PKGNAME='ocs-manager'
BUILDTYPE=''
if [ "${1}" ]; then
BUILDTYPE="${1}"
fi
PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
BUILDVER="$(cd "${PROJDIR}" && git describe --always)"
BUILDDIR="${PROJDIR}/build_${PKGNAME}_${BUILDVER}_${BUILDTYPE}"
SRCARCHIVE="${BUILDDIR}/${PKGNAME}.tar.gz"
export_srcarchive() {
filepath="${1}"
$(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${filepath}" HEAD)
}
build_snap() {
echo 'Not implemented yet'
}
build_flatpak() {
echo 'Not implemented yet'
}
build_appimage() {
echo 'Not implemented yet'
}
if [ "${BUILDTYPE}" = 'snap' ]; then
build_snap
elif [ "${BUILDTYPE}" = 'flatpak' ]; then
build_flatpak
elif [ "${BUILDTYPE}" = 'appimage' ]; then
build_appimage
else
echo "sh $(basename "${0}") [snap|flatpak|appimage]"
exit 1
fi
#!/bin/bash
################################################################################
# This is utility script to import build dependencies
################################################################################
PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
if [ ! -d "${PROJDIR}/lib/qtlib" ]; then
git clone https://github.com/akiraohgaki/qtlib.git -b release-0.2.1 --single-branch --depth=1 "${PROJDIR}/lib/qtlib"
fi
#!/bin/bash
PKGNAME='ocs-manager'
PKGUSER='pkgbuilder'
PKGSCRIPT="${0}"
PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
BUILDDIR="${PROJDIR}/build_${PKGNAME}"
appimage() { # docker-image: ubuntu:14.04
install_build_deps_appimage
add_pkguser
su -c "export HOME=/home/${PKGUSER} && source /opt/qt59/bin/qt59-env.sh && "${PKGSCRIPT}" build_appimage" ${PKGUSER}
}
install_build_deps_appimage() {
apt update -qq
apt -y install curl git
#apt -y install build-essential qt5-default libqt5websockets5-dev
#apt -y install cmake automake libtool pkg-config wget desktop-file-utils libglib2.0-dev libcairo2-dev libssl-dev libcurl3 libcurl4-openssl-dev libxpm-dev
apt -y install libfontconfig1 libfreetype6 libssl1.0.0 zlib1g unzip p7zip unar
apt -y install software-properties-common
add-apt-repository -y ppa:beineri/opt-qt597-trusty
echo 'deb http://download.opensuse.org/repositories/home:/TheAssassin:/AppImageLibraries/xUbuntu_14.04/ /' > /etc/apt/sources.list.d/curl-httponly.list
curl -fsSL https://download.opensuse.org/repositories/home:TheAssassin:AppImageLibraries/xUbuntu_14.04/Release.key | apt-key add -
apt update -qq
apt -y install build-essential mesa-common-dev libglu1-mesa-dev qt59base qt59websockets
curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.13.3/cmake-3.13.3-Linux-x86_64.tar.gz | tar -xz --strip-components=1 -C /
apt -y install automake libtool pkg-config wget desktop-file-utils libglib2.0-dev libcairo2-dev libssl-dev libcurl3 libcurl4-openssl-dev libxpm-dev
}
build_appimage() {
rm -rf "${BUILDDIR}"
mkdir -p "${BUILDDIR}"
export_srcarchive "${BUILDDIR}/${PKGNAME}.tar.gz"
tar -xzf "${BUILDDIR}/${PKGNAME}.tar.gz" -C "${BUILDDIR}"
cp "${PROJDIR}/pkg/appimage/appimagebuild" "${BUILDDIR}/${PKGNAME}"
cd "${BUILDDIR}/${PKGNAME}"
./appimagebuild
}
add_pkguser() {
useradd -m ${PKGUSER}
chown -R ${PKGUSER} "${PROJDIR}"
}
export_srcarchive() {
if [ "${1}" ]; then
(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${1}" HEAD)
fi
}
if [ "${1}" ]; then
${1}
fi
#!/bin/bash
PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
if [ ! -d "${PROJDIR}/lib/qtil" ]; then
git clone https://github.com/akiraohgaki/qtil.git -b release-0.4.0 --single-branch --depth=1 "${PROJDIR}/lib/qtil"
fi
if [ ! -d "${PROJDIR}/lib/AppImageUpdate" ]; then
git clone https://github.com/AppImage/AppImageUpdate.git -b continuous --single-branch --depth=1 "${PROJDIR}/lib/AppImageUpdate"
git -C "${PROJDIR}/lib/AppImageUpdate" submodule update --init --recursive #--depth=1
fi
if [ ! -d "${PROJDIR}/lib/AppImageUpdate-prebuilt" ]; then
mkdir "${PROJDIR}/lib/AppImageUpdate-prebuilt"
cd "${PROJDIR}/lib/AppImageUpdate-prebuilt"
cmake "${PROJDIR}/lib/AppImageUpdate" -DBUILD_QT_UI=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo
make libappimageupdate_static
fi
DISTFILES += \
$${PWD}/build-docker.sh \
$${PWD}/build.sh \
$${PWD}/import.sh
$${PWD}/package \
$${PWD}/prepare