From dd6780d636042bf12d77414e6f1552cc7d1ed24c Mon Sep 17 00:00:00 2001 From: depend <523633637@qq.com> Date: Sat, 15 Oct 2022 19:55:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0dbus=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=86=8D=E6=AC=A1=E5=90=AF=E5=8A=A8=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=BC=9A=E5=94=A4=E8=B5=B7=E7=AC=AC=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 并且处理spark打开 --- src/dbus/dbussparkstore.cpp | 12 ++++++++++++ src/dbus/dbussparkstore.h | 24 ++++++++++++++++++++++++ src/main.cpp | 14 ++++++++++++++ src/spark-store.pro | 7 +++++-- src/widget.cpp | 22 ++++++++++++++++++++++ src/widget.h | 4 ++++ 6 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 src/dbus/dbussparkstore.cpp create mode 100644 src/dbus/dbussparkstore.h diff --git a/src/dbus/dbussparkstore.cpp b/src/dbus/dbussparkstore.cpp new file mode 100644 index 0000000..09b584f --- /dev/null +++ b/src/dbus/dbussparkstore.cpp @@ -0,0 +1,12 @@ +#include "dbussparkstore.h" +#include +DBusSparkStoreService::DBusSparkStoreService(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + +} + +void DBusSparkStoreService::activeWindow(const QString & arg) +{ + emit sigOpenUrl(arg); +} diff --git a/src/dbus/dbussparkstore.h b/src/dbus/dbussparkstore.h new file mode 100644 index 0000000..a2c447d --- /dev/null +++ b/src/dbus/dbussparkstore.h @@ -0,0 +1,24 @@ +#ifndef DBUSSPARKSTORE_H +#define DBUSSPARKSTORE_H + +#include +#include +#include + +class Wallpaper; +class DBusSparkStoreService : public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "com.gitee.spark.store") +public: + explicit DBusSparkStoreService(QObject *parent); + +signals : + void sigOpenUrl(const QString &url); +public Q_SLOTS: + + void activeWindow(const QString &arg); + +}; + +#endif // DBUSSPARKSTORE_H diff --git a/src/main.cpp b/src/main.cpp index 29ed8f9..8ed3080 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,6 +4,9 @@ #include #include #include +//新增dbus +#include +#include #include "widget.h" @@ -69,6 +72,17 @@ int main(int argc, char *argv[]) // 限制单实例运行 if(!a.setSingleInstance("spark-store")) { + qDebug() << "The application is already running!"; + QDBusInterface iface("com.gitee.spark.store", + "/com/gitee/spark/store", + "com.gitee.spark.store", + QDBusConnection::sessionBus()); + + QString arg1 = argv[1]; + + iface.asyncCall("activeWindow",arg1); + + return -1; } diff --git a/src/spark-store.pro b/src/spark-store.pro index 676372b..b8be015 100644 --- a/src/spark-store.pro +++ b/src/spark-store.pro @@ -8,6 +8,7 @@ QT += core gui network concurrent webenginewidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += dbus TARGET = spark-store TEMPLATE = app @@ -41,7 +42,8 @@ SOURCES += \ main.cpp \ progressload.cpp \ widget.cpp \ - workerthreads.cpp + workerthreads.cpp \ + dbus/dbussparkstore.cpp HEADERS += \ appitem.h \ @@ -52,7 +54,8 @@ HEADERS += \ image_show.h \ progressload.h \ widget.h \ - workerthreads.h + workerthreads.h \ + dbus/dbussparkstore.h FORMS += \ appitem.ui \ diff --git a/src/widget.cpp b/src/widget.cpp index 0faf40b..d171117 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -33,6 +33,7 @@ #include "HttpClient.h" #include "downloadworker.h" +#include "./dbus/dbussparkstore.h" DWIDGET_USE_NAMESPACE Widget::Widget(DBlurEffectWidget *parent) : @@ -138,6 +139,9 @@ Widget::Widget(DBlurEffectWidget *parent) : }); notify_init(tr("Spark\\ Store").toLocal8Bit()); + + //初始化dbus服务 + initDbus(); } Widget::~Widget() @@ -452,6 +456,15 @@ void Widget::sendNotification(const char *message, const int msTimeout, const QS notify_notification_show(_notify, nullptr); } +void Widget::initDbus() +{ + DBusSparkStoreService *dbusInter = new DBusSparkStoreService(this); + + QDBusConnection::sessionBus().registerService("com.gitee.spark.store"); + QDBusConnection::sessionBus().registerObject("/com/gitee/spark/store", "com.gitee.spark.store", this); + connect(dbusInter,&DBusSparkStoreService::sigOpenUrl,this,&Widget::onGetUrl); +} + void Widget::updateUI() { if(themeIsDark) @@ -1354,3 +1367,12 @@ void Widget::on_pushButton_update_clicked() QDesktopServices::openUrl(QUrl("https://www.deepinos.org/")); } +void Widget::onGetUrl(const QString &url) +{ + if(url.left(6)=="spk://") + { + openUrl(QUrl(url)); + } + activateWindow(); +} + diff --git a/src/widget.h b/src/widget.h index 9ec716e..9b7da59 100644 --- a/src/widget.h +++ b/src/widget.h @@ -64,6 +64,7 @@ public: static void sendNotification(const QString &message, const int msTimeout = 5000, const QString &icon = "spark-store"); static void sendNotification(const char *message, const int msTimeout = 5000, const QString &icon = "spark-store"); + void initDbus(); private slots: void httpFinished(); @@ -103,6 +104,9 @@ private slots: void on_pushButton_refresh_clicked(); void on_pushButton_update_clicked(); + //接受来自dbus的url + void onGetUrl(const QString &url); + public: QUrl url; QString cdnSeverUrl; From 458cc49302e8a00167c973cdb8ec3417ed1623f8 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sat, 15 Oct 2022 14:26:04 +0000 Subject: [PATCH 2/4] update debian/changelog. Signed-off-by: shenmo --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2004cfb..7f888c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +spark-store (3.2.4~test4) stable; urgency=medium + + * 现在在商店启动后点击spk链接仍会正常启动 https://gitee.com/deepin-community-store/spark-store/commit/dd6780d636042bf12d77414e6f1552cc7d1ed24c + + + + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.2.4~test3) stable; urgency=medium * 发版,合入到master From fdc95501008e86d2d169bf3be6951a251a1a28c9 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 17 Oct 2022 18:31:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?tag=E7=9B=B8=E5=85=B3=E6=96=87=E6=A1=88?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget.ui | 10 ++--- translations/spark-store_en.ts | 72 +++++++++++++++++-------------- translations/spark-store_fr.ts | 70 +++++++++++++++++------------- translations/spark-store_zh_CN.ts | 72 +++++++++++++++++-------------- 4 files changed, 124 insertions(+), 100 deletions(-) diff --git a/src/widget.ui b/src/widget.ui index e35fede..1605673 100644 --- a/src/widget.ui +++ b/src/widget.ui @@ -345,7 +345,7 @@ 0 - 3 + 2 @@ -365,11 +365,11 @@ 0 - + Qt::DefaultContextMenu - + about:blank @@ -842,7 +842,7 @@ - <html><head/><body><p>A deepin-wine2 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine2 by your self.</p></body></html> + <html><head/><body><p>A deepin-wine2 app. Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> <html><head/><body><p>A deepin-wine2 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine2 by your self.</p></body></html> @@ -861,7 +861,7 @@ - <html><head/><body><p>A deepin-wine5 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine5 by your self.</p></body></html> + <html><head/><body><p>A deepin-wine5 app.Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> <html><head/><body><p>A deepin-wine5 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine5 by your self.</p></body></html> diff --git a/translations/spark-store_en.ts b/translations/spark-store_en.ts index 9794e45..3a5d692 100644 --- a/translations/spark-store_en.ts +++ b/translations/spark-store_en.ts @@ -12,9 +12,9 @@ QLabel - - - + + + Spark Store @@ -22,22 +22,22 @@ QObject - + We publish this program under GPL V3 - + <span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span> - + The Spark Project - + <span style='font-size:10pt;font-weight:60;'>An appstore powered by deepin community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style='font-size:12pt;'>Spark developers</span><br/><br/>Published under GPL V3 @@ -149,8 +149,8 @@ - - + + Install @@ -254,7 +254,6 @@ - <html><head/><body><p>A deepin-wine5 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine5 by your self.</p></body></html> @@ -303,6 +302,10 @@ + <html><head/><body><p>A deepin-wine2 app. Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> + + + <html><head/><body><p>A deepin-wine2 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine2 by your self.</p></body></html> @@ -312,6 +315,11 @@ <html><head/><body><p><img src=":/tags/dwine2-small.png"/></p></body></html> + + + <html><head/><body><p>A deepin-wine5 app.Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> + + <html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html> @@ -438,92 +446,92 @@ 0B - + Spark Store - + Search or enter spk:// - + Submit App - + Submit App with client(Recommanded) - + Settings - + APP Upgrade and Install Settings - + Not Exist - - - - - + + + + + Spark\ Store - - + + Reinstall - + Failed to get the name to the file to be downloaded. - + Upgrade - + Updating, please wait... - + Uninstall succeeded - + Relative apps Not Found! - + Request Error: %1 - + Temporary cache was cleaned - + The URL has been copied to the clipboard diff --git a/translations/spark-store_fr.ts b/translations/spark-store_fr.ts index 6070d1a..ed808ee 100644 --- a/translations/spark-store_fr.ts +++ b/translations/spark-store_fr.ts @@ -23,9 +23,9 @@ Spark Store est publié sous licence GPL V3 Nous sommes nés pour le changement. - - - + + + Spark Store @@ -33,22 +33,22 @@ Nous sommes nés pour le changement. QObject - + We publish this program under GPL V3 - + <span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span> - + The Spark Project - + <span style='font-size:10pt;font-weight:60;'>An appstore powered by deepin community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style='font-size:12pt;'>Spark developers</span><br/><br/>Published under GPL V3 @@ -210,8 +210,8 @@ Nous sommes nés pour le changement. - - + + Install @@ -297,6 +297,10 @@ Nous sommes nés pour le changement. + <html><head/><body><p>A deepin-wine2 app. Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> + + + <html><head/><body><p>A deepin-wine2 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine2 by your self.</p></body></html> @@ -308,6 +312,10 @@ Nous sommes nés pour le changement. + <html><head/><body><p>A deepin-wine5 app.Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> + + + <html><head/><body><p>A deepin-wine5 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine5 by your self.</p></body></html> @@ -611,92 +619,92 @@ Nous sommes nés pour le changement. <html><head/><body><p>Nous ne sommes pas l'équipe officielle, tout comme vous, nous ne sommes qu'un des nombreux passionnés et utilisateurs de systèmes Linux / deepin, nous développons et gérons le "Spark Store"! ", est de rassembler la communauté pour partager des logiciels utiles, ou pour participer au développement ensemble, afin que nous utilisions tous les derniers et meilleurs logiciels. </p><p> Nous n'en tirons aucun profit, tous les développeurs et mainteneurs ne sont pas payés, et nous comptons sur les dons de la communauté pour la plupart de nos dépenses, dont nous sommes reconnaissants et qui nous permettent de ne pas dépenser trop d'énergie se soucier du financement. </p><p>Notre service et nos logiciels sont gratuits pour tout le monde à utiliser, à communiquer et à apprendre, mais vous devez vous conformer aux lois et réglementations locales dans le processus de votre utilisation, sinon tout problème n'a rien à voir avec nous. </p><p>Si une partie du magasin enfreint vos droits, veuillez nous en informer &lt;jifengshenmo@outlook.com&gt; nous retirerons le contenu en infraction dès que possible. </p><p>Si vous souhaitez également vous impliquer avec nous, que vous soyez impliqué dans le développement, la conception, le pitching ou la soumission de travaux, nous vous invitons à nous rejoindre. </p><p>QQ group:872690351<br/></p></body></html> - - - - - + + + + + Spark\ Store - + Spark Store - + Search or enter spk:// - + Submit App - + Submit App with client(Recommanded) - + Settings - + APP Upgrade and Install Settings - + Not Exist - - + + Reinstall - + Failed to get the name to the file to be downloaded. - + Relative apps Not Found! - + Request Error: %1 - + Upgrade - + Updating, please wait... - + Uninstall succeeded - + Temporary cache was cleaned - + The URL has been copied to the clipboard diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 3117674..c9da681 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -12,9 +12,9 @@ QLabel - - - + + + Spark Store Spark 应用商店 @@ -22,12 +22,12 @@ QObject - + We publish this program under GPL V3 本程序按GPL V3开源 - + <span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span> <span style=' font-size:10pt;font-weight:60;'>一款社区维护的应用商店</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>星火计划开发者</span> @@ -40,7 +40,7 @@ <span style=' font-size:10pt;font-weight:60;'>deepin 社区驱动的一款第三方应用商店</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style=' font-size:12pt;'>Spark developers</span> - + The Spark Project 星火计划 The Spark Project @@ -49,7 +49,7 @@ <span style=' font-size:10pt;font-weight:60;'>一款由 深度社区 出品的应用商店</span><br/>""<a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/>""<span style=' font-size:12pt;'>星火开发者联盟</span><br/>本程序遵循 GPL V3 协议发布 - + <span style='font-size:10pt;font-weight:60;'>An appstore powered by deepin community</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style='font-size:12pt;'>Spark developers</span><br/><br/>Published under GPL V3 <span style='font-size:10pt;font-weight:60;'>由 Deepin 社区出品的应用商店</span><br/><a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/><span style='font-size:12pt;'>星火商店开发组</span><br/><br/>遵循 GPL V3 协议发布 @@ -204,8 +204,8 @@ - - + + Install 安装 @@ -284,8 +284,17 @@ <html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html> + + + <html><head/><body><p>A deepin-wine2 app. Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> + 这是一个deepin-wine2应用。星火商店将会为你配置好wine环境,无需担心。 + + <html><head/><body><p>A deepin-wine5 app.Spark Store will configure the wine environment for you, so don‘t worry.</p></body></html> + 这是一个deepin-wine5应用。星火商店将会为你配置好wine环境,无需担心。 + + <html><head/><body><p>A deepin-wine5 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine5 by your self.</p></body></html> <html><head/><body><p>这是一款deepin-wine5应用,如果你并没有在使用深度系列发行版(比如您在使用ubuntu),你需要自行配置deepin-wine5环境</p></body></html> @@ -325,7 +334,6 @@ 社交沟通 - <html><head/><body><p>A deepin-wine2 app.If you are using ubuntu or other non-deepin distro,you should deploy deepin-wine2 by your self.</p></body></html> <html><head/><body><p>这是一款 deepin-wine2 应用,如果你并没有在使用深度系列发行版(比如您在使用ubuntu),你需要自行配置 deepin-wine2 环境</p></body></html> @@ -498,37 +506,37 @@ - + Spark Store Spark 应用商店 - + Search or enter spk:// 搜索或打开链接 - + Submit App 投递应用 - + Submit App with client(Recommanded) 使用本地投稿器投递应用(推荐) - + Settings 设置 - + APP Upgrade and Install Settings 应用更新和安装设置 - + Not Exist 不存在 @@ -537,11 +545,11 @@ 更新完毕 - - - - - + + + + + Spark\ Store 星火应用商店 @@ -578,8 +586,8 @@ 大小: - - + + Reinstall 重新安装 @@ -588,17 +596,17 @@ 加载应用程序图标失败。 - + Failed to get the name to the file to be downloaded. 获取安装包文件名失败。 - + Relative apps Not Found! 相关应用未找到! - + Request Error: %1 请求错误:%1 @@ -607,12 +615,12 @@ 目前仅支持商店专用链接的打开,搜索功能正在开发,请期待以后的版本! - + Upgrade 升级 - + Updating, please wait... 正在更新,请稍候…… @@ -672,17 +680,17 @@ Click yes to continue. 服务器未知错误 - + Uninstall succeeded 卸载成功 - + Temporary cache was cleaned 缓存目录已清空 - + The URL has been copied to the clipboard 链接已复制到剪贴板 From c54c13d82286a47470a62b8301c8c45136f759cd Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 17 Oct 2022 18:33:49 +0800 Subject: [PATCH 4/4] modified: debian/changelog --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7f888c8..3ef6030 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (3.2.4) stable; urgency=medium + + * 修改tag相关的文案内容:wine相关环境已可自动配置了 + * 准备发版 + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.2.4~test4) stable; urgency=medium * 现在在商店启动后点击spk链接仍会正常启动 https://gitee.com/deepin-community-store/spark-store/commit/dd6780d636042bf12d77414e6f1552cc7d1ed24c