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
...@@ -2,29 +2,40 @@ ...@@ -2,29 +2,40 @@
#include <QObject> #include <QObject>
namespace appimage {
namespace update {
class Updater;
}
}
class AppImageUpdater : public QObject class AppImageUpdater : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit AppImageUpdater(const QString &id, const QString &path, QObject *parent = nullptr); explicit AppImageUpdater(const QString &id, const QString &path, QObject *parent = nullptr);
~AppImageUpdater();
QString id() const; QString id() const;
QString path() const; QString path() const;
QString describeAppImage() const;
bool checkAppImage() const;
void updateAppImage();
bool isFinishedWithNoError() const; bool isFinishedWithNoError() const;
QString errorString() const; QString errorString() const;
QString describeAppImage() const;
bool checkForChanges() const;
void start();
signals: signals:
void finished(AppImageUpdater *updater); void finished(AppImageUpdater *updater);
void updateProgress(QString id, double progress); void updateProgress(QString id, double progress);
private slots:
void checkProgress();
private: private:
QString id_; QString id_;
QString path_; QString path_;
bool isFinishedWithNoError_; bool isFinishedWithNoError_;
QString errorString_; QString errorString_;
appimage::update::Updater *updater_;
}; };
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <QWebSocketServer> #include <QWebSocketServer>
#include <QWebSocket> #include <QWebSocket>
#include "qtlib_json.h" #include "qtil_json.h"
#include "handlers/confighandler.h" #include "handlers/confighandler.h"
#include "handlers/systemhandler.h" #include "handlers/systemhandler.h"
...@@ -28,22 +28,22 @@ WebSocketServer::WebSocketServer(ConfigHandler *configHandler, const QString &se ...@@ -28,22 +28,22 @@ WebSocketServer::WebSocketServer(ConfigHandler *configHandler, const QString &se
updateHandler_ = new UpdateHandler(configHandler_, this); updateHandler_ = new UpdateHandler(configHandler_, this);
desktopThemeHandler_ = new DesktopThemeHandler(this); desktopThemeHandler_ = new DesktopThemeHandler(this);
connect(itemHandler_, &ItemHandler::metadataSetChanged, this, &WebSocketServer::itemMetadataSetChanged); connect(itemHandler_, &ItemHandler::metadataSetChanged, this, &WebSocketServer::itemHandlerMetadataSetChanged);
connect(itemHandler_, &ItemHandler::downloadStarted, this, &WebSocketServer::itemDownloadStarted); connect(itemHandler_, &ItemHandler::downloadStarted, this, &WebSocketServer::itemHandlerDownloadStarted);
connect(itemHandler_, &ItemHandler::downloadFinished, this, &WebSocketServer::itemDownloadFinished); connect(itemHandler_, &ItemHandler::downloadFinished, this, &WebSocketServer::itemHandlerDownloadFinished);
connect(itemHandler_, &ItemHandler::downloadProgress, this, &WebSocketServer::itemDownloadProgress); connect(itemHandler_, &ItemHandler::downloadProgress, this, &WebSocketServer::itemHandlerDownloadProgress);
connect(itemHandler_, &ItemHandler::saveStarted, this, &WebSocketServer::itemSaveStarted); connect(itemHandler_, &ItemHandler::saveStarted, this, &WebSocketServer::itemHandlerSaveStarted);
connect(itemHandler_, &ItemHandler::saveFinished, this, &WebSocketServer::itemSaveFinished); connect(itemHandler_, &ItemHandler::saveFinished, this, &WebSocketServer::itemHandlerSaveFinished);
connect(itemHandler_, &ItemHandler::installStarted, this, &WebSocketServer::itemInstallStarted); connect(itemHandler_, &ItemHandler::installStarted, this, &WebSocketServer::itemHandlerInstallStarted);
connect(itemHandler_, &ItemHandler::installFinished, this, &WebSocketServer::itemInstallFinished); connect(itemHandler_, &ItemHandler::installFinished, this, &WebSocketServer::itemHandlerInstallFinished);
connect(itemHandler_, &ItemHandler::uninstallStarted, this, &WebSocketServer::itemUninstallStarted); connect(itemHandler_, &ItemHandler::uninstallStarted, this, &WebSocketServer::itemHandlerUninstallStarted);
connect(itemHandler_, &ItemHandler::uninstallFinished, this, &WebSocketServer::itemUninstallFinished); connect(itemHandler_, &ItemHandler::uninstallFinished, this, &WebSocketServer::itemHandlerUninstallFinished);
connect(updateHandler_, &UpdateHandler::checkAllStarted, this, &WebSocketServer::updateCheckAllStarted); connect(updateHandler_, &UpdateHandler::checkAllStarted, this, &WebSocketServer::updateHandlerCheckAllStarted);
connect(updateHandler_, &UpdateHandler::checkAllFinished, this, &WebSocketServer::updateCheckAllFinished); connect(updateHandler_, &UpdateHandler::checkAllFinished, this, &WebSocketServer::updateHandlerCheckAllFinished);
connect(updateHandler_, &UpdateHandler::updateStarted, this, &WebSocketServer::updateUpdateStarted); connect(updateHandler_, &UpdateHandler::updateStarted, this, &WebSocketServer::updateHandlerUpdateStarted);
connect(updateHandler_, &UpdateHandler::updateFinished, this, &WebSocketServer::updateUpdateFinished); connect(updateHandler_, &UpdateHandler::updateFinished, this, &WebSocketServer::updateHandlerUpdateFinished);
connect(updateHandler_, &UpdateHandler::updateProgress, this, &WebSocketServer::updateUpdateProgress); connect(updateHandler_, &UpdateHandler::updateProgress, this, &WebSocketServer::updateHandlerUpdateProgress);
} }
WebSocketServer::~WebSocketServer() WebSocketServer::~WebSocketServer()
...@@ -55,6 +55,10 @@ WebSocketServer::~WebSocketServer() ...@@ -55,6 +55,10 @@ WebSocketServer::~WebSocketServer()
bool WebSocketServer::start() bool WebSocketServer::start()
{ {
if (wsServer_->listen(QHostAddress::Any, serverPort_)) { if (wsServer_->listen(QHostAddress::Any, serverPort_)) {
auto application = configHandler_->getUsrConfigApplication();
application["websocket_url"] = serverUrl().toString();
configHandler_->setUsrConfigApplication(application);
emit started(); emit started();
return true; return true;
} }
...@@ -63,6 +67,10 @@ bool WebSocketServer::start() ...@@ -63,6 +67,10 @@ bool WebSocketServer::start()
void WebSocketServer::stop() void WebSocketServer::stop()
{ {
auto application = configHandler_->getUsrConfigApplication();
application["websocket_url"] = QString("");
configHandler_->setUsrConfigApplication(application);
wsServer_->close(); wsServer_->close();
} }
...@@ -108,7 +116,7 @@ void WebSocketServer::wsTextMessageReceived(const QString &message) ...@@ -108,7 +116,7 @@ void WebSocketServer::wsTextMessageReceived(const QString &message)
{ {
auto *wsClient = qobject_cast<QWebSocket *>(sender()); auto *wsClient = qobject_cast<QWebSocket *>(sender());
if (wsClient) { if (wsClient) {
qtlib::Json json(message.toUtf8()); Qtil::Json json(message.toUtf8());
if (json.isObject()) { if (json.isObject()) {
auto object = json.toObject(); auto object = json.toObject();
receiveMessage(object["id"].toString(), object["func"].toString(), object["data"].toArray()); receiveMessage(object["id"].toString(), object["func"].toString(), object["data"].toArray());
...@@ -120,7 +128,7 @@ void WebSocketServer::wsBinaryMessageReceived(const QByteArray &message) ...@@ -120,7 +128,7 @@ void WebSocketServer::wsBinaryMessageReceived(const QByteArray &message)
{ {
auto *wsClient = qobject_cast<QWebSocket *>(sender()); auto *wsClient = qobject_cast<QWebSocket *>(sender());
if (wsClient) { if (wsClient) {
qtlib::Json json(message); Qtil::Json json(message);
if (json.isObject()) { if (json.isObject()) {
auto object = json.toObject(); auto object = json.toObject();
receiveMessage(object["id"].toString(), object["func"].toString(), object["data"].toArray()); receiveMessage(object["id"].toString(), object["func"].toString(), object["data"].toArray());
...@@ -128,27 +136,27 @@ void WebSocketServer::wsBinaryMessageReceived(const QByteArray &message) ...@@ -128,27 +136,27 @@ void WebSocketServer::wsBinaryMessageReceived(const QByteArray &message)
} }
} }
void WebSocketServer::itemMetadataSetChanged() void WebSocketServer::itemHandlerMetadataSetChanged()
{ {
QJsonArray data; QJsonArray data;
sendMessage("", "ItemHandler::metadataSetChanged", data); sendMessage("", "ItemHandler::metadataSetChanged", data);
} }
void WebSocketServer::itemDownloadStarted(QJsonObject result) void WebSocketServer::itemHandlerDownloadStarted(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::downloadStarted", data); sendMessage("", "ItemHandler::downloadStarted", data);
} }
void WebSocketServer::itemDownloadFinished(QJsonObject result) void WebSocketServer::itemHandlerDownloadFinished(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::downloadFinished", data); sendMessage("", "ItemHandler::downloadFinished", data);
} }
void WebSocketServer::itemDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal) void WebSocketServer::itemHandlerDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal)
{ {
QJsonArray data; QJsonArray data;
data.append(id); data.append(id);
...@@ -157,75 +165,79 @@ void WebSocketServer::itemDownloadProgress(QString id, qint64 bytesReceived, qin ...@@ -157,75 +165,79 @@ void WebSocketServer::itemDownloadProgress(QString id, qint64 bytesReceived, qin
sendMessage("", "ItemHandler::downloadProgress", data); sendMessage("", "ItemHandler::downloadProgress", data);
} }
void WebSocketServer::itemSaveStarted(QJsonObject result) void WebSocketServer::itemHandlerSaveStarted(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::saveStarted", data); sendMessage("", "ItemHandler::saveStarted", data);
} }
void WebSocketServer::itemSaveFinished(QJsonObject result) void WebSocketServer::itemHandlerSaveFinished(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::saveFinished", data); sendMessage("", "ItemHandler::saveFinished", data);
} }
void WebSocketServer::itemInstallStarted(QJsonObject result) void WebSocketServer::itemHandlerInstallStarted(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::installStarted", data); sendMessage("", "ItemHandler::installStarted", data);
} }
void WebSocketServer::itemInstallFinished(QJsonObject result) void WebSocketServer::itemHandlerInstallFinished(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::installFinished", data); sendMessage("", "ItemHandler::installFinished", data);
} }
void WebSocketServer::itemUninstallStarted(QJsonObject result) void WebSocketServer::itemHandlerUninstallStarted(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::uninstallStarted", data); sendMessage("", "ItemHandler::uninstallStarted", data);
} }
void WebSocketServer::itemUninstallFinished(QJsonObject result) void WebSocketServer::itemHandlerUninstallFinished(QJsonObject result)
{ {
QJsonArray data; QJsonArray data;
data.append(result); data.append(result);
sendMessage("", "ItemHandler::uninstallFinished", data); sendMessage("", "ItemHandler::uninstallFinished", data);
} }
void WebSocketServer::updateCheckAllStarted() void WebSocketServer::updateHandlerCheckAllStarted(bool status)
{ {
QJsonArray data; QJsonArray data;
data.append(status);
sendMessage("", "UpdateHandler::checkAllStarted", data); sendMessage("", "UpdateHandler::checkAllStarted", data);
} }
void WebSocketServer::updateCheckAllFinished() void WebSocketServer::updateHandlerCheckAllFinished(bool status)
{ {
QJsonArray data; QJsonArray data;
data.append(status);
sendMessage("", "UpdateHandler::checkAllFinished", data); sendMessage("", "UpdateHandler::checkAllFinished", data);
} }
void WebSocketServer::updateUpdateStarted(QString itemKey) void WebSocketServer::updateHandlerUpdateStarted(QString itemKey, bool status)
{ {
QJsonArray data; QJsonArray data;
data.append(itemKey); data.append(itemKey);
data.append(status);
sendMessage("", "UpdateHandler::updateStarted", data); sendMessage("", "UpdateHandler::updateStarted", data);
} }
void WebSocketServer::updateUpdateFinished(QString itemKey) void WebSocketServer::updateHandlerUpdateFinished(QString itemKey, bool status)
{ {
QJsonArray data; QJsonArray data;
data.append(itemKey); data.append(itemKey);
data.append(status);
sendMessage("", "UpdateHandler::updateFinished", data); sendMessage("", "UpdateHandler::updateFinished", data);
} }
void WebSocketServer::updateUpdateProgress(QString itemKey, int progress) void WebSocketServer::updateHandlerUpdateProgress(QString itemKey, double progress)
{ {
QJsonArray data; QJsonArray data;
data.append(itemKey); data.append(itemKey);
...@@ -323,9 +335,6 @@ void WebSocketServer::receiveMessage(const QString &id, const QString &func, con ...@@ -323,9 +335,6 @@ void WebSocketServer::receiveMessage(const QString &id, const QString &func, con
resultData.append(configHandler_->removeUsrConfigUpdateAvailableItemsItem(data.at(0).toString())); resultData.append(configHandler_->removeUsrConfigUpdateAvailableItemsItem(data.at(0).toString()));
} }
// SystemHandler // SystemHandler
else if (func == "SystemHandler::isUnix") {
resultData.append(systemHandler_->isUnix());
}
else if (func == "SystemHandler::isMobileDevice") { else if (func == "SystemHandler::isMobileDevice") {
resultData.append(systemHandler_->isMobileDevice()); resultData.append(systemHandler_->isMobileDevice());
} }
...@@ -407,7 +416,7 @@ void WebSocketServer::sendMessage(const QString &id, const QString &func, const ...@@ -407,7 +416,7 @@ void WebSocketServer::sendMessage(const QString &id, const QString &func, const
object["func"] = func; object["func"] = func;
object["data"] = data; object["data"] = data;
auto binaryMessage = qtlib::Json(object).toJson(); auto binaryMessage = Qtil::Json(object).toJson();
auto textMessage = QString::fromUtf8(binaryMessage); auto textMessage = QString::fromUtf8(binaryMessage);
for (auto *wsClient : wsClients_) { for (auto *wsClient : wsClients_) {
......
...@@ -40,22 +40,22 @@ private slots: ...@@ -40,22 +40,22 @@ private slots:
void wsTextMessageReceived(const QString &message); void wsTextMessageReceived(const QString &message);
void wsBinaryMessageReceived(const QByteArray &message); void wsBinaryMessageReceived(const QByteArray &message);
void itemMetadataSetChanged(); void itemHandlerMetadataSetChanged();
void itemDownloadStarted(QJsonObject result); void itemHandlerDownloadStarted(QJsonObject result);
void itemDownloadFinished(QJsonObject result); void itemHandlerDownloadFinished(QJsonObject result);
void itemDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal); void itemHandlerDownloadProgress(QString id, qint64 bytesReceived, qint64 bytesTotal);
void itemSaveStarted(QJsonObject result); void itemHandlerSaveStarted(QJsonObject result);
void itemSaveFinished(QJsonObject result); void itemHandlerSaveFinished(QJsonObject result);
void itemInstallStarted(QJsonObject result); void itemHandlerInstallStarted(QJsonObject result);
void itemInstallFinished(QJsonObject result); void itemHandlerInstallFinished(QJsonObject result);
void itemUninstallStarted(QJsonObject result); void itemHandlerUninstallStarted(QJsonObject result);
void itemUninstallFinished(QJsonObject result); void itemHandlerUninstallFinished(QJsonObject result);
void updateCheckAllStarted(); void updateHandlerCheckAllStarted(bool status);
void updateCheckAllFinished(); void updateHandlerCheckAllFinished(bool status);
void updateUpdateStarted(QString itemKey); void updateHandlerUpdateStarted(QString itemKey, bool status);
void updateUpdateFinished(QString itemKey); void updateHandlerUpdateFinished(QString itemKey, bool status);
void updateUpdateProgress(QString itemKey, int progress); void updateHandlerUpdateProgress(QString itemKey, double progress);
private: private:
void receiveMessage(const QString &id, const QString &func, const QJsonArray &data); void receiveMessage(const QString &id, const QString &func, const QJsonArray &data);
......
unix:!ios:!android { contains(DEFINES, APP_DESKTOP) {
isEmpty(PREFIX) { isEmpty(PREFIX) {
PREFIX = /usr/local PREFIX = /usr/local
} }
......
...@@ -6,3 +6,4 @@ Type=Application ...@@ -6,3 +6,4 @@ Type=Application
Terminal=true Terminal=true
NoDisplay=true NoDisplay=true
Categories=Network;Utility; Categories=Network;Utility;
X-AppImage-Integrate=false
...@@ -4,107 +4,112 @@ ...@@ -4,107 +4,112 @@
<context> <context>
<name>ItemHandler</name> <name>ItemHandler</name>
<message> <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> <source>The file already downloading</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="69"/> <location filename="../app/src/handlers/itemhandler.cpp" line="76"/>
<source>Downloading</source> <source>Downloading</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>Invalid OCS-URL</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>Uninstalling</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="197"/> <location filename="../app/src/handlers/itemhandler.cpp" line="212"/>
<source>Uninstalled</source> <source>Uninstalled</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="222"/> <location filename="../app/src/handlers/itemhandler.cpp" line="237"/>
<source>Downloaded</source> <source>Downloaded</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="252"/> <location filename="../app/src/handlers/itemhandler.cpp" line="267"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="291"/> <location filename="../app/src/handlers/itemhandler.cpp" line="311"/>
<source>Saving</source> <source>Saving</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="264"/> <location filename="../app/src/handlers/itemhandler.cpp" line="284"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="306"/> <location filename="../app/src/handlers/itemhandler.cpp" line="328"/>
<source>Failed to save data</source> <source>Failed to save data</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="271"/> <location filename="../app/src/handlers/itemhandler.cpp" line="291"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="314"/> <location filename="../app/src/handlers/itemhandler.cpp" line="336"/>
<source>Saved</source> <source>Saved</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="319"/> <location filename="../app/src/handlers/itemhandler.cpp" line="341"/>
<source>Installing</source> <source>Installing</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The file has been installed as program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The plasmoid has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The plasma look and feel has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="345"/> <location filename="../app/src/handlers/itemhandler.cpp" line="372"/>
<source>The plasma desktop theme has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="350"/>
<source>The KWin effect has been installed</source> <source>The KWin effect has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The KWin script has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The KWin window switcher has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The archive file has been extracted</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="366"/> <location filename="../app/src/handlers/itemhandler.cpp" line="388"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="380"/> <location filename="../app/src/handlers/itemhandler.cpp" line="402"/>
<source>The file has been installed</source> <source>The file has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="370"/> <location filename="../app/src/handlers/itemhandler.cpp" line="392"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="384"/> <location filename="../app/src/handlers/itemhandler.cpp" line="406"/>
<source>Failed to installation</source> <source>Failed to installation</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
......
...@@ -4,107 +4,112 @@ ...@@ -4,107 +4,112 @@
<context> <context>
<name>ItemHandler</name> <name>ItemHandler</name>
<message> <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> <source>The file already downloading</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="69"/> <location filename="../app/src/handlers/itemhandler.cpp" line="76"/>
<source>Downloading</source> <source>Downloading</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>Invalid OCS-URL</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>Uninstalling</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="197"/> <location filename="../app/src/handlers/itemhandler.cpp" line="212"/>
<source>Uninstalled</source> <source>Uninstalled</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="222"/> <location filename="../app/src/handlers/itemhandler.cpp" line="237"/>
<source>Downloaded</source> <source>Downloaded</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="252"/> <location filename="../app/src/handlers/itemhandler.cpp" line="267"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="291"/> <location filename="../app/src/handlers/itemhandler.cpp" line="311"/>
<source>Saving</source> <source>Saving</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="264"/> <location filename="../app/src/handlers/itemhandler.cpp" line="284"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="306"/> <location filename="../app/src/handlers/itemhandler.cpp" line="328"/>
<source>Failed to save data</source> <source>Failed to save data</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="271"/> <location filename="../app/src/handlers/itemhandler.cpp" line="291"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="314"/> <location filename="../app/src/handlers/itemhandler.cpp" line="336"/>
<source>Saved</source> <source>Saved</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="319"/> <location filename="../app/src/handlers/itemhandler.cpp" line="341"/>
<source>Installing</source> <source>Installing</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The file has been installed as program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The plasmoid has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The plasma look and feel has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="345"/> <location filename="../app/src/handlers/itemhandler.cpp" line="372"/>
<source>The plasma desktop theme has been installed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../app/src/handlers/itemhandler.cpp" line="350"/>
<source>The KWin effect has been installed</source> <source>The KWin effect has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The KWin script has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The KWin window switcher has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<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> <source>The archive file has been extracted</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="366"/> <location filename="../app/src/handlers/itemhandler.cpp" line="388"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="380"/> <location filename="../app/src/handlers/itemhandler.cpp" line="402"/>
<source>The file has been installed</source> <source>The file has been installed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../app/src/handlers/itemhandler.cpp" line="370"/> <location filename="../app/src/handlers/itemhandler.cpp" line="392"/>
<location filename="../app/src/handlers/itemhandler.cpp" line="384"/> <location filename="../app/src/handlers/itemhandler.cpp" line="406"/>
<source>Failed to installation</source> <source>Failed to installation</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
......
include($${PWD}/qtlib/qtlib.pri) include($${PWD}/qtil/qtil.pri)
unix:!ios:!android { contains(DEFINES, APP_DESKTOP) {
INCLUDEPATH += $${PWD}/AppImageUpdate/include INCLUDEPATH += $${PWD}/AppImageUpdate/include
DEPENDPATH += $${PWD}/AppImageUpdate/include DEPENDPATH += $${PWD}/AppImageUpdate/include
...@@ -8,18 +8,22 @@ unix:!ios:!android { ...@@ -8,18 +8,22 @@ unix:!ios:!android {
LIBS += \ LIBS += \
-L$${PWD}/AppImageUpdate-prebuilt/src/ -lappimageupdate \ -L$${PWD}/AppImageUpdate-prebuilt/src/ -lappimageupdate \
-L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/src/ -lzsync2 \ -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/libzsync/ -lzsync \
-L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/librcksum/ -lrcksum \ -L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/librcksum/ -lrcksum \
-L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/zlib/ -lz \ -L$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/zlib/ -lzsync2_libz \
-L$${PWD}/AppImageUpdate-prebuilt/lib/ -lcpr -L$${PWD}/AppImageUpdate-prebuilt/lib/libappimage/src/libappimage_shared/ -lappimage_shared
PRE_TARGETDEPS += \ PRE_TARGETDEPS += \
$${PWD}/AppImageUpdate-prebuilt/src/libappimageupdate.a \ $${PWD}/AppImageUpdate-prebuilt/src/libappimageupdate.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/src/libzsync2.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/libzsync/libzsync.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/librcksum/librcksum.a \ $${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/librcksum/librcksum.a \
$${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/zlib/libz.a \ $${PWD}/AppImageUpdate-prebuilt/lib/zsync2/lib/zlib/libzsync2_libz.a \
$${PWD}/AppImageUpdate-prebuilt/lib/libcpr.a $${PWD}/AppImageUpdate-prebuilt/lib/libappimage/src/libappimage_shared/libappimage_shared.a
LIBS += -lcurl LIBS += -lcurl
} }
ios|android|!isEmpty(APP_MOBILE) { ios|android|!isEmpty(APP_MOBILE) {
DEFINES += APP_MOBILE DEFINES += APP_MOBILE
} else { } else:unix:!macx {
DEFINES += APP_DESKTOP DEFINES += APP_DESKTOP
} }
......
#!/bin/sh
PKGNAME='ocs-manager'
PKGVER='0.5.0'
PKGREL='1'
curl -L -o linuxdeployqt "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod 755 linuxdeployqt
./linuxdeployqt --appimage-extract
sh scripts/import.sh
qmake PREFIX="/usr"
make
make INSTALL_ROOT="${PKGNAME}.AppDir" install
./squashfs-root/AppRun ${PKGNAME}.AppDir/usr/share/applications/${PKGNAME}.desktop -bundle-non-qt-libs -no-translations
install -D -m 755 /lib/x86_64-linux-gnu/libssl.so.1.0.0 ${PKGNAME}.AppDir/usr/lib/libssl.so.1.0.0
install -D -m 755 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 ${PKGNAME}.AppDir/usr/lib/libcrypto.so.1.0.0
install -D -m 755 /lib/x86_64-linux-gnu/libz.so.1 ${PKGNAME}.AppDir/usr/lib/libz.so.1
./squashfs-root/AppRun ${PKGNAME}.AppDir/usr/share/applications/${PKGNAME}.desktop -appimage
mv *.AppImage ${PKGNAME}-${PKGVER}-${PKGREL}-x86_64.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
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:17.10
apt update -qq
apt -y install curl git
apt -y install build-essential qt5-default libqt5websockets5-dev
apt -y install cmake libssl-dev libcurl4-gnutls-dev libxpm-dev
apt -y install file
apt -y install libssl1.0.0 zlib1g
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
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() {
cd "${PROJDIR}"
mkdir -p "${BUILDDIR}"
export_srcarchive "${SRCARCHIVE}"
tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
cp "${PROJDIR}/pkg/appimage/appimage.sh" "${BUILDDIR}/${PKGNAME}"
cd "${BUILDDIR}/${PKGNAME}"
sh appimage.sh
}
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
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
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)" PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
if [ ! -d "${PROJDIR}/lib/qtlib" ]; then if [ ! -d "${PROJDIR}/lib/qtil" ]; then
git clone https://github.com/akiraohgaki/qtlib.git -b release-0.2.1 --single-branch --depth=1 "${PROJDIR}/lib/qtlib" git clone https://github.com/akiraohgaki/qtil.git -b release-0.4.0 --single-branch --depth=1 "${PROJDIR}/lib/qtil"
fi fi
if [ ! -d "${PROJDIR}/lib/AppImageUpdate" ]; then if [ ! -d "${PROJDIR}/lib/AppImageUpdate" ]; then
...@@ -14,6 +14,6 @@ fi ...@@ -14,6 +14,6 @@ fi
if [ ! -d "${PROJDIR}/lib/AppImageUpdate-prebuilt" ]; then if [ ! -d "${PROJDIR}/lib/AppImageUpdate-prebuilt" ]; then
mkdir "${PROJDIR}/lib/AppImageUpdate-prebuilt" mkdir "${PROJDIR}/lib/AppImageUpdate-prebuilt"
cd "${PROJDIR}/lib/AppImageUpdate-prebuilt" cd "${PROJDIR}/lib/AppImageUpdate-prebuilt"
cmake "${PROJDIR}/lib/AppImageUpdate" -DUSE_SYSTEM_CURL=ON -DBUILD_CPR_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake "${PROJDIR}/lib/AppImageUpdate" -DBUILD_QT_UI=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo
make libappimageupdate make libappimageupdate_static
fi fi
DISTFILES += \ DISTFILES += \
$${PWD}/build-docker.sh \ $${PWD}/package \
$${PWD}/build.sh \ $${PWD}/prepare
$${PWD}/import.sh