From 678a4229f79ca3834e1578ae91a39d7d84cdc302 Mon Sep 17 00:00:00 2001 From: RigoLigoRLC Date: Thu, 1 Oct 2020 02:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E9=80=9A=E7=9F=A5=E7=A7=BB=E8=87=B3?= =?UTF-8?q?=E4=B8=93=E7=94=A8=E5=87=BD=E6=95=B0=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=B8=AD=E6=96=87=E7=BF=BB=E8=AF=91ts=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- downloadlist.cpp | 29 +- main.cpp | 1 + spark-store.pro | 4 +- trans/lang_Chinses.qm | 1 - trans/lang_English.qm | Bin 3310 -> 0 bytes trans/{lang_English.ts => spark-store_en.ts} | 437 ++++++++++-------- .../{lang_Chinses.ts => spark-store_zh_CN.ts} | 361 ++++++++++++--- widget.cpp | 83 ++-- widget.h | 3 + widget.ui | 24 +- 10 files changed, 601 insertions(+), 342 deletions(-) delete mode 100644 trans/lang_Chinses.qm delete mode 100644 trans/lang_English.qm rename trans/{lang_English.ts => spark-store_en.ts} (65%) rename trans/{lang_Chinses.ts => spark-store_zh_CN.ts} (50%) diff --git a/downloadlist.cpp b/downloadlist.cpp index 560bb28..6f75f54 100644 --- a/downloadlist.cpp +++ b/downloadlist.cpp @@ -1,5 +1,6 @@ #include "downloadlist.h" #include "ui_downloadlist.h" +#include "widget.h" #include #include #include @@ -20,9 +21,9 @@ downloadlist::downloadlist(QWidget *parent) : ui->pushButton_3->hide(); ui->widget_spinner->start(); ui->widget_spinner->hide(); - action_dpkg->setText(QObject::tr("dpkg")); - action_gdebi->setText(QObject::tr("gdebi")); - action_deepin->setText(QObject::tr("deepin deb installer")); + action_dpkg->setText(tr("dpkg")); + action_gdebi->setText(tr("gdebi")); + action_deepin->setText(tr("deepin deb installer")); connect(action_dpkg,&QAction::triggered,[=](){downloadlist::install(1);}); connect(action_gdebi,&QAction::triggered,[=](){downloadlist::install(0);}); connect(action_deepin,&QAction::triggered,[=](){downloadlist::install(2);}); @@ -51,7 +52,7 @@ void downloadlist::setValue(long long value) ui->progressBar->setValue(int(value)); ui->label_2->setText(QString::number(double(value)/100)+"% ("+speed+")"); if(ui->label_2->text().left(4)=="100%"){ - ui->label_2->setText(QObject::tr("Downloaded,waiting to Install")); + ui->label_2->setText(tr("Downloaded, waiting to install")); } } @@ -76,8 +77,9 @@ void downloadlist::readyInstall() ui->progressBar->hide(); ui->pushButton_install->show(); ui->pushButton_2->hide(); - system("notify-send \""+ui->label->text().toUtf8()+"Download Failed\"" +" --icon=/tmp/spark-store/icon_"+QString::number(num).toUtf8()+".png"); - ui->label_2->setText(QObject::tr("Download Failed,Check Your Connection")); + Widget::sendNotification(tr("Failed to download %1").arg(ui->label->text()), 5000, + "/tmp/spark-store/icon_"+QString::number(num).toUtf8()+".png"); + ui->label_2->setText(tr("Download Failed,Check Your Connection")); ui->pushButton_install->setEnabled(false); return; @@ -87,7 +89,8 @@ void downloadlist::readyInstall() ui->pushButton_install->setEnabled(true); ui->pushButton_install->show(); ui->pushButton_2->hide(); - system("notify-send \""+ui->label->text().toUtf8()+"Download Finished,waiting to Install\"" +" --icon=/tmp/spark-store/icon_"+QString::number(num).toUtf8()+".png"); + Widget::sendNotification(tr("Finished downloading %1, awaiting to install").arg(ui->label->text()), 5000, + "/tmp/spark-store/icon_"+QString::number(num).toUtf8()+".png"); } } @@ -119,7 +122,7 @@ void downloadlist::install(int t) ui->pushButton_install->hide(); ui->widget_spinner->show(); qDebug()<<"/tmp/spark-store/"+ui->label_filename->text().toUtf8(); - ui->label_2->setText(QObject::tr("Installing...")); + ui->label_2->setText(tr("Installing...")); QtConcurrent::run([=](){ QProcess installer; if(!reinstall){ @@ -166,16 +169,16 @@ void downloadlist::install(int t) int error=QString::fromStdString(isInstall.readAllStandardError().toStdString()).length(); if(error==0){ ui->pushButton_install->hide(); - ui->label_2->setText(QObject::tr("Finish")); + ui->label_2->setText(tr("Finish")); ui->pushButton_3->show(); }else { ui->pushButton_install->show(); - ui->pushButton_install->setText(QObject::tr("Retry")); - ui->label_2->setText(QObject::tr("Error happened in dpkg progress , you can try it again")); + ui->pushButton_install->setText(tr("Retry")); + ui->label_2->setText(tr("Error happened in dpkg progress , you can try it again")); ui->pushButton_3->show(); } if(notRoot){ - ui->label_2->setText(QObject::tr("dpkg progress had been aborted,you can retry installation")); + ui->label_2->setText(tr("dpkg progress had been aborted,you can retry installation")); ui->pushButton_install->show(); ui->pushButton_3->hide(); } @@ -197,7 +200,7 @@ void downloadlist::on_pushButton_install_clicked() void downloadlist::on_pushButton_2_clicked() { - ui->label_2->setText(QObject::tr("Download Canceled")); + ui->label_2->setText(tr("Download canceled")); ui->pushButton_2->setEnabled(false); ui->progressBar->hide(); close=true; diff --git a/main.cpp b/main.cpp index 48a0080..3e3d43b 100644 --- a/main.cpp +++ b/main.cpp @@ -31,6 +31,7 @@ int main(int argc, char *argv[]) dialog.setCompanyLogo(QPixmap(":/Logo-Spark.png")); dialog.setWebsiteName(QObject::tr("The Spark Project")); dialog.setWebsiteLink("https://gitee.com/deepin-community-store"); + Widget w; QDesktopWidget *s=DApplication::desktop(); int d_w=s->width(); diff --git a/spark-store.pro b/spark-store.pro index 750489b..db7c665 100644 --- a/spark-store.pro +++ b/spark-store.pro @@ -7,8 +7,8 @@ QT += core gui network concurrent webenginewidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -TRANSLATIONS = ./trans/lang_English.ts \ - ./trans/lang_Chinses.ts +TRANSLATIONS = ./trans/spark-store_en.ts \ + ./trans/spark-store_zh_CN.ts CONFIG += link_pkgconfig PKGCONFIG += dtkwidget diff --git a/trans/lang_Chinses.qm b/trans/lang_Chinses.qm deleted file mode 100644 index be651ee..0000000 --- a/trans/lang_Chinses.qm +++ /dev/null @@ -1 +0,0 @@ -$=i0A_NI)UBqAl4#dQSV32{LfPBaRA%@Vc1s1w>**X_UOd7CT z%T~tRD1%MM#>YO~2ROHN?YbF$l3YF z=kvbLd+z#}d&%v49p~@7ux$EpSMui~#xi!XJHPK>EazaxgP#sEX6epc@QatROn2sv zP5&@vE6h}yS2LEKpOsPYCeA<1TK)PV#;iqI8#?!6&!6|=DV%4$H1B)Ivygu{@2+J9 z?EYbSYi$g6muIiMy9WD%?4qxmA+KiN-}wye*sT7$m5i~X9Ov@eus@Wu{;$2*i*jNI z`XP5Z=f?`f^VAjFT3;0Ltg&tWa}j=@$jyBt6aGeX6TatQcRcrg0Ddyt?V*>)VUO9r zD+uDeZvMl;4-iL-BRf7Hat)4xWg8fqch9jtpZwi*{JLu!^uBROhZkV~+mYI>BL2gU zls^Lf1CG=!C*E5e55KKP90hsVr$(`F({|gfJZrTJ?l*imaT%G8&8@wKRbbE7v3tdSI^iL=RQ`;Jmf{lmk3EW-aL>kV-=7oMHJ=utHE0t zbWbqb@HCO4YgTQb}81N zCX+mLLG9`_8?dutfaF1O5TouLDv4Bgn=*BlH%84W3(z5ib&W`-#;C@FBU1dV9BP&l z17RM)6k zd;n<@Q4oyi3&O~WTqrz0Rv*p?1frlu56aTX3bB?W>y_+X@m?#6;uTF$B5ahREj-Yz zz)ECxiK0nqGKszC&4cY?t{)OjjDP3WiUgXz9_}|mG&W? zJTE09D1V{9yb>)3;>h8El(@ztBT{l&N7{29b}a7>!$j))cSs1{GjeuhPPq`l4c*Jzr+BiP*3(U96)RL|9#!bIu|QD1 zTyGY1K(OKwZ-J3Pd?>7537W;NqKI>wZ>UX4Hk$=sd&D^Blc@{LwK^02l|cQ3?tKYQ zw(xMoNNJi}eQ~p!6`)%sV4;F)Q}}J{)DBMe9w4KZBG{^Q(|K~Zg+^GkUP_Gds}p96 z1xAX&%0|rKV(fcF+f`Bf>b7#^_OC#^nQ>^CSWo|_-XdL3?uhU+UHoG2y~#`FNNjA= zOk?XFEm~8hi*7-prs*cfVsfa7_uiByv~g{S?^WC@K0%Bb>aEj>R)}_(xm{O@)|h*{ zKCjb2Ne&@yVnSgx-MFi&{k|$sdT>PilT;Huk37u=zuLoZG(9GFD{`lqXqfM~&!qTO z`OD5!;4x4YBOM>$GVntq86UsKgX89ymLh-Z7wVHeSp8y9&>du>&d}{T5O!s<+>dLM%6Hu0G1;snI-YbF?E^0K{o$KcPk7;FAUkDyn!5NJ!FZG52czdcX zs17HT>4Z9*hJ+2H02eqCE7ha4r#eT#3whv*I+`{;skr2at}5e5Y>LWb;^V~b_SIH+ zeJ;1RtXlg-Nyotg1e6|eE2oS9kFlGs83ZlN+5=2JmxjGhK< iiV~XXChelb=pzkNQ&+dB!`J20V))Nh3BgEaM#jHbVv4H( diff --git a/trans/lang_English.ts b/trans/spark-store_en.ts similarity index 65% rename from trans/lang_English.ts rename to trans/spark-store_en.ts index 039b988..37174ff 100644 --- a/trans/lang_English.ts +++ b/trans/spark-store_en.ts @@ -3,24 +3,42 @@ QLabel - - Spark应用商店 - Spark Store - - - 社区驱动的一款为第三方应用商店,为改变而生 -本程序按GPL第三版开源 - A 3-rd party app store powered by deepin community -Spark Store is published under GPL V3 -We born for change. - - + Spark Store + + QObject + + + We publish this program under GPL V3 + + + + + Version 2.0+2 + + + + + + https://gitee.com/deepin-community-store/spark-store + + + + + <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> + + + + + The Spark Project + + + Widget @@ -68,11 +86,6 @@ We born for change. Office - - - 回到分类 - - Translate @@ -108,16 +121,6 @@ We born for change. Network - - - 重新加载 - - - - - The List is empty now.Go and Download some software! - - Name @@ -130,6 +133,7 @@ We born for change. + Install @@ -162,7 +166,12 @@ We born for change. - UB + <html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html> + + + + + <html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html> @@ -171,6 +180,26 @@ We born for change. <html><head/><body><p>Capable to deepin 20</p></body></html> + + + Back to category + + + + + Reload + + + + + The list is currently empty. Go and download some softwares! + + + + + Open download directory + + <html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html> @@ -182,11 +211,6 @@ We born for change. <html><head/><body><p>Capable to UOS home 20</p></body></html> - - - <html><head/><body><p><img src=":/tags/uos.svg"/></p></body></html> - - @@ -230,9 +254,14 @@ We born for change. Info + + + <html><head/><body><p>An app store developed by community enthusiasts</p></body></html> + + - ScreenShots + Screenshots @@ -310,194 +339,152 @@ We born for change. <html><head/><body><p>We are <span style=" font-weight:600;">NOT</span> the official team, just like you, we are just one of the many Linux/deepin system enthusiasts and users, we develop and run the &quot;Spark Store&quot;! &quot;, is to bring the community together to share useful software, or to participate in development together, so that we all use the latest and greatest software. </p><p>We don't make a profit from this, all developers and maintainers don't get paid, and we rely on the community's donations to us for most of our expenses, which we are grateful for and which allow us not to spend too much energy worrying about funding. </p><p>Our service and software are free for everyone to use, communicate, and learn, but you must comply with local laws and regulations in the process of your use, otherwise any problems have nothing to do with us. </p><p>If any part of the store infringes your rights, please tell us &lt;jifengshenmo@outlook.com&gt; we will remove the infringing content as soon as possible. </p><p>If you'd like to get involved with us too, whether you're involved in development, design, pitching or submitting work, we welcome you to join us. </p><p>QQ group:872690351<br/></p></body></html> - - 视频播放 - Video Players and Video Makers - Video - - - 下载列表 - Download list - - - 系统工具 - Tools - - - 主题美化 - Icon theme and other - Themes - - - 音乐欣赏 - Music - icon - - 编程开发 - Development - - - 办公学习 - Office - - - 阅读翻译 - Translate - - - 其他应用 - Others - - - 商店首页 - Home - - - 图形图像 - Images - - - 游戏娱乐 - Games - - - 社交沟通 - Chat - - - 网络应用 - Network - about:blank - - 当前下载列表为空 - The Download list is empty - - - - 打开文件夹 - Open in File Manager - - - 安装 - Install - - - 卸载 - Remove - - - 官网 - Site - - - 软件名 - Name - <html><head/><body><p><br/></p></body></html> - - 图标 - Icon - - - 分享 - Share - TextLabel - - 详细介绍 - Details - - - - <html><head/><body><p>由社区爱好者开发的软件商店</p></body></html> - <html><head/><body><p>software store developed by community enthusiasts</p></body></html> - - - 软件截图 - Screen Shots - - - 线路设置 - Line Settings - - - 线路选择: - Choose - - - 刷新 - Update - - - 重启商店后生效 - Restart to take effect - - - <html><head/><body><p>源服务器的作用是保证软件更新,并且支持使用apt工具获取软件。通常我们更建议你使用第一个线路作为更新源,一般是最稳定的。</p></body></html> - <html><head/><body><p>The role of the source server is to ensure that the software is updated, and supports the use of the apt tool to get the software. We usually prefer that you use the first line as the update source, which is generally the most stable. </p></body></html> - - - 更新源 - Update APT Source - - - 更新源服务器: - APT Source - - - 服务器 - server - - - 缓存目录 - Temp - - - 清空 - Clean - - - 因为这个目录位于/tmp下,所以即使你不手动清空的话,其也将在系统重启时自动清空。 - Since the dictionary is at /tmp,It would be cleaned automatically when system reboot. - - - 目录大小: - Size: - 0B 0B - 目录位置:/tmp/spark-store - Location:/tmp/spark-store + + Spark Store + - 关于我们 - About us + + Search or enter spk:// + - <html><head/><body><p>我们并不是官方团队,和你一样,我们也只是众多Linux/deepin系统爱好者和用户之中的一员,我们开发并且运营这个“Spark应用商店”,是为了让社区的朋友们一起分享好用的软件,或者一起参与开发,让大家都用到最新的,最优秀的软件。</p><p>我们并没有因此盈利,所有开发和维护人员都不会获得报酬,我们的主要支出大部分依赖于社区对我们的捐助,很感谢大家,这部分捐助让我们并不需要耗费太多精力去担心资金问题。</p><p>我们的服务和开发的软件都是免费供给大家使用,交流,学习的,但是在您的使用过程中一定要遵守当地的法律法规,否则出现任何问题和我们无关。</p><p>如果商店中任何一部分有侵犯您权益的行为,请告知我们&lt;jifengshenmo@outlook.com&gt;,我们会第一时间删除侵权内容。</p><p>如果你也想参与我们,不管是参与开发,设计,投递还是投稿作品,我们都欢迎你的加入。</p><p>QQ群:872690351<br/></p></body></html> - <html><head/><body><p>We are not the official team, just like you, we are just one of the many Linux/deepin system enthusiasts and users, we develop and run the "Spark Store"! ", is to bring the community together to share useful software, or to participate in development together, so that we all use the latest and greatest software. </p><p> We don't make a profit from this, all developers and maintainers don't get paid, and we rely on the community's donations to us for most of our expenses, which we are grateful for and which allow us not to spend too much energy worrying about funding. </p><p>Our service and software are free for everyone to use, communicate, and learn, but you must comply with local laws and regulations in the process of your use, otherwise any problems have nothing to do with us. </p><p>If any part of the store infringes your rights, please tell us &lt;jifengshenmo@outlook.com&gt; we will remove the infringing content as soon as possible. </p><p>If you'd like to get involved with us too, whether you're involved in development, design, pitching or submitting work, we welcome you to join us. </p><p>QQ group:872690351<br/></p></body></html> + + Submit App + + + + + Settings + + + + + Not Exist + + + + + + Spark\ Store + + + + + Failed to download app info. Please check internet connection. + + + + + PkgName: + + + + + Version: + + + + + Author: + + + + + Official Site: + + + + + Contributor: + + + + + Update Time: + + + + + Installed Size: + + + + + + Reinstall + + + + + Failed to load application icon. + + + + + Failed to get the name to the file to be downloaded. + + + + + Spark store could only process spk:// links for now. The search feature is coming soon! + + + + + Updating, please wait... + + + + + Apt has reported an error. Please use apt update in terminal to locate the problem. + + + + + Unknown server error! + + + + + Uninstall succeeded + + + + + Temporary cache was cleaned + + + + + The URL has been copied to the clipboard + @@ -543,25 +530,69 @@ We born for change. - 名称 - Name + + dpkg + - 等待开始下载 - Wait to download - Wait to download + + gdebi + - 安装 - Install + + deepin deb installer + - 取消 - Cancel + + Downloaded, waiting to install + - 详情 - Detail + + Failed to download %1 + + + + + Download Failed,Check Your Connection + + + + + Finished downloading %1, awaiting to install + + + + + Installing... + + + + + Finish + + + + + Retry + + + + + Error happened in dpkg progress , you can try it again + + + + + dpkg progress had been aborted,you can retry installation + + + + + Download canceled + diff --git a/trans/lang_Chinses.ts b/trans/spark-store_zh_CN.ts similarity index 50% rename from trans/lang_Chinses.ts rename to trans/spark-store_zh_CN.ts index ccbac24..df2d7ec 100644 --- a/trans/lang_Chinses.ts +++ b/trans/spark-store_zh_CN.ts @@ -5,10 +5,39 @@ QLabel - + Spark Store + Spark 应用商店 + + + + QObject + + + We publish this program under GPL V3 + 本程序按GPL v3开源 + + + + Version 2.0+2 + 版本: 2.0+2 + + + + + https://gitee.com/deepin-community-store/spark-store + + + <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> + <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 + + Widget @@ -25,87 +54,82 @@ Videos - + 视频播放 Download List - + 下载列表 Tools - + 系统工具 Beautify - + 主题美化 Music - + 音乐欣赏 Coding - + 编程开发 Office - - - - - 回到分类 - + 办公学习 Translate - + 阅读翻译 Others - + 其他应用 FrontPage - + 商店首页 Images - + 图形图像 Games - + 游戏娱乐 Chatting - + 社交沟通 Network - - - - - 重新加载 - + 网络应用 - The List is empty now.Go and Download some software! - + The list is currently empty. Go and download some softwares! + 当前下载列表为空 + + + + Open download directory + 打开下载文件夹 @@ -119,18 +143,19 @@ + Install - + 安装 Uninstall - + 卸载 Site - + 官网 @@ -149,11 +174,6 @@ <html><head/><body><p>Capable to Ubuntu 20.04</p></body></html> - - - UB - - @@ -171,11 +191,6 @@ <html><head/><body><p>Capable to UOS home 20</p></body></html> - - - <html><head/><body><p><img src=":/tags/uos.svg"/></p></body></html> - - @@ -212,52 +227,57 @@ Share - + 分享 Info - + 详细 + + + + <html><head/><body><p>An app store developed by community enthusiasts</p></body></html> + <html><head/><body><p>社区爱好者开发的一款应用商店</p></body></html> - ScreenShots - + Screenshots + 屏幕截图 Line Settings - + 线路设置 Choose Line: - + 线路选择: Refresh - + 刷新 Take effect when restart - + 重启商店后生效 <html><head/><body><p>The role of the source server is to ensure that the software is updated, and supports the use of the apt tool to get the software. We usually prefer that you use the first line as the update source, which is generally the most stable. </p></body></html> - + <html><head/><body><p>源服务器的作用是保证软件更新,并且支持使用apt工具获取软件。通常我们更建议你使用第一个线路作为更新源,一般是最稳定的。</p></body></html> Update - + 更新源 Source Server - + 更新源服务器 @@ -267,37 +287,37 @@ Temp - + 缓存目录 Clean - + 清空 Since the dictionary is at /tmp,It would be cleaned automatically when system reboot. - + 因为这个目录位于/tmp下,所以即使你不手动清空的话,其也将在系统重启时自动清空。 Size: - + 目录大小: Location:/tmp/spark-store - + 目录位置:/tmp/spark-store About us - + 关于我们 <html><head/><body><p>We are <span style=" font-weight:600;">NOT</span> the official team, just like you, we are just one of the many Linux/deepin system enthusiasts and users, we develop and run the &quot;Spark Store&quot;! &quot;, is to bring the community together to share useful software, or to participate in development together, so that we all use the latest and greatest software. </p><p>We don't make a profit from this, all developers and maintainers don't get paid, and we rely on the community's donations to us for most of our expenses, which we are grateful for and which allow us not to spend too much energy worrying about funding. </p><p>Our service and software are free for everyone to use, communicate, and learn, but you must comply with local laws and regulations in the process of your use, otherwise any problems have nothing to do with us. </p><p>If any part of the store infringes your rights, please tell us &lt;jifengshenmo@outlook.com&gt; we will remove the infringing content as soon as possible. </p><p>If you'd like to get involved with us too, whether you're involved in development, design, pitching or submitting work, we welcome you to join us. </p><p>QQ group:872690351<br/></p></body></html> - + <html><head/><body><p>我们并<span style=" font-weight:600;">不是</span>官方团队,和你一样,我们也只是众多Linux/deepin系统爱好者和用户之中的一员,我们开发并且运营这个“Spark应用商店”,是为了让社区的朋友们一起分享好用的软件,或者一起参与开发,让大家都用到最新的,最优秀的软件。</p><p>我们并没有因此盈利,所有开发和维护人员都不会获得报酬,我们的主要支出大部分依赖于社区对我们的捐助,很感谢大家,这部分捐助让我们并不需要耗费太多精力去担心资金问题。</p><p>我们的服务和开发的软件都是免费供给大家使用,交流,学习的,但是在您的使用过程中一定要遵守当地的法律法规,否则出现任何问题和我们无关。</p><p>如果商店中任何一部分有侵犯您权益的行为,请告知我们 &lt;jifengshenmo@outlook.com&gt;,我们会第一时间删除侵权内容。</p><p>如果你也想参与我们,不管是参与开发,设计,投递还是投稿作品,我们都欢迎你的加入。</p><p>QQ 群:872690351<br/></p></body></html> @@ -305,13 +325,18 @@ - - about:blank - + + Back to category + 返回分类 - - 打开文件夹 + + Reload + 刷新 + + + + about:blank @@ -320,13 +345,18 @@ - - TextLabel + + <html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html> - - <html><head/><body><p>由社区爱好者开发的软件商店</p></body></html> + + <html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html> + + + + + TextLabel @@ -334,18 +364,140 @@ 0B + + + Spark Store + Spark 应用商店 + + + + Search or enter spk:// + 搜索或打开链接 + + + + Submit App + 软件投稿 + + + + Settings + 设置 + + + + Not Exist + 不存在 + + + + + Spark\ Store + 星火商店 + + + + Failed to download app info. Please check internet connection. + 下载应用程序详细信息失败,请检查网络连接 + + + + PkgName: + 包名: + + + + Version: + 版本: + + + + Author: + 作者: + + + + Official Site: + 官网: + + + + Contributor: + 投稿者: + + + + Update Time: + 更新时间: + + + + Installed Size: + 大小: + + + + + Reinstall + 重新安装 + + + + Failed to load application icon. + 加载应用程序图标失败 + + + + Failed to get the name to the file to be downloaded. + 获取要下载的文件名失败 + + + + Spark store could only process spk:// links for now. The search feature is coming soon! + 目前仅支持商店专用链接的打开,搜索功能正在开发,请期待以后的版本! + + + + Updating, please wait... + 正在更新,请稍候…… + + + + Apt has reported an error. Please use apt update in terminal to locate the problem. + 更新中发生错误,请在终端使用apt update来查看错误原因 + + + + Unknown server error! + 服务器未知错误 + + + + Uninstall succeeded + 卸载成功 + + + + Temporary cache was cleaned + 缓存目录已清空 + + + + The URL has been copied to the clipboard + 链接已复制到剪贴板 + downloadlist Form - + icon - + @@ -360,22 +512,87 @@ Waiting to download - + 正在等待下载 Install - + 安装 Cancel - + 取消 Info + 详细 + + + + dpkg + + + gdebi + + + + + deepin deb installer + 深度安装器 + + + + Downloaded, waiting to install + 已完成,等待安装 + + + + Failed to download %1 + 下载 %1 失败 + + + + Download Failed,Check Your Connection + 下载失败,请检查网络连接 + + + + Finished downloading %1, awaiting to install + %1 下载完成,等待安装 + + + + Installing... + 正在安装 + + + + Finish + 完成 + + + + Retry + 重试重试 + + + + Error happened in dpkg progress , you can try it again + dpkg出现错误,可重新安装 + + + + dpkg progress had been aborted,you can retry installation + dpkg 安装被中止,可重新安装 + + + + Download canceled + 下载已取消 + diff --git a/widget.cpp b/widget.cpp index eb579cd..6940607 100644 --- a/widget.cpp +++ b/widget.cpp @@ -142,15 +142,15 @@ void Widget::initUI() titlebar=ui->titlebar; titlebar->setCustomWidget(w_titlebar); // titlebar->setIcon(QIcon::fromTheme("spark-store")); - titlebar->setTitle(QObject::tr("Spark Store")); - searchEdit->setPlaceholderText(QObject::tr("Search or enter spk://")); + titlebar->setTitle(tr("Spark Store")); + searchEdit->setPlaceholderText(tr("Search or enter spk://")); searchEdit->setFixedWidth(300); titlebar->setSeparatorVisible(false); // titlebar->setAutoHideOnFullscreen(true); // 添加菜单项 - QAction *actionSubmission = new QAction(QObject::tr("Submit App"), this); - QAction *setting=new QAction(QObject::tr("Settings")); + QAction *actionSubmission = new QAction(tr("Submit App"), this); + QAction *setting=new QAction(tr("Settings")); QMenu *menu=new QMenu; @@ -242,7 +242,7 @@ void Widget::initConfig() if(aptserver.isOpen()){ ui->label_aptserver->setText(aptserver.readAll()); }else { - ui->label_aptserver->setText(QObject::tr("Not Exist")); + ui->label_aptserver->setText(tr("Not Exist")); } aptserver.close(); @@ -288,7 +288,23 @@ void Widget::setTheme(bool isDark,QColor color) DTitlebar* Widget::getTitlebar() { - return ui->titlebar; + return ui->titlebar; +} + +void Widget::sendNotification(const QString &message, const int msTimeout, const QString &icon) +{ + system((QString("notify-send --icon=%1 --expire-time=%2 --app-name=").arg(icon).arg(msTimeout) + + tr("Spark\\ Store") + + " '" + message + "'" + ).toUtf8()); +} + +void Widget::sendNotification(const char *message, const int msTimeout, const QString &icon) +{ + system((QString("notify-send --icon=%1 --expire-time=%2 --app-name=").arg(icon).arg(msTimeout) + + tr("Spark\\ Store") + + " '" + message + "'" + ).toUtf8()); } void Widget::updateUI() @@ -458,7 +474,9 @@ int Widget::loadappinfo(QUrl arg1) get_json.start("curl -o app.json "+arg1.toString()); get_json.waitForFinished(); if(get_json.exitCode()) - return 2; + { + sendNotification(tr("Failed to download app info. Please check internet connection.")); + } QFile app_json("app.json"); if(app_json.open(QIODevice::ReadOnly)){ @@ -487,20 +505,20 @@ int Widget::loadappinfo(QUrl arg1) ui->label_show->show(); // 软件信息加载 QString info; - info= QObject::tr("PkgName: ")+json["Pkgname"].toString()+"\n"; - info+=QObject::tr("Version: ")+json["Version"].toString()+"\n"; + info= tr("PkgName: ")+json["Pkgname"].toString()+"\n"; + info+=tr("Version: ")+json["Version"].toString()+"\n"; if(json["Author"].toString()!="" && json["Author"].toString()!=" "){ - info+=QObject::tr("Author: ")+json["Author"].toString()+"\n"; + info+=tr("Author: ")+json["Author"].toString()+"\n"; } if(json["Website"].toString()!="" && json["Website"].toString()!=" "){ - info+=QObject::tr("Official Site: ")+json["Website"].toString()+"\n"; + info+=tr("Official Site: ")+json["Website"].toString()+"\n"; ui->pushButton_website->show(); appweb=json["Website"].toString(); } - info+=QObject::tr("Contributor: ")+json["Contributor"].toString()+"\n"; - info+=QObject::tr("Update Time: ")+json["Update"].toString()+"\n"; - info+=QObject::tr("Installed Size: ")+json["Size"].toString()+"\n"; + info+=tr("Contributor: ")+json["Contributor"].toString()+"\n"; + info+=tr("Update Time: ")+json["Update"].toString()+"\n"; + info+=tr("Installed Size: ")+json["Size"].toString()+"\n"; ui->label_info->setText(info); ui->label_more->setText(json["More"].toString()); QProcess isInstall; @@ -509,11 +527,11 @@ int Widget::loadappinfo(QUrl arg1) isInstall.waitForFinished(); int error=QString::fromStdString(isInstall.readAllStandardError().toStdString()).length(); if(error==0){ - ui->pushButton_download->setText(QObject::tr("Reinstall")); + ui->pushButton_download->setText(tr("Reinstall")); ui->pushButton_uninstall->show(); }else { - ui->pushButton_download->setText(QObject::tr("Install")); + ui->pushButton_download->setText(tr("Install")); } //tag加载 QString tags=json["Tags"].toString(); @@ -545,7 +563,7 @@ int Widget::loadappinfo(QUrl arg1) ui->pushButton_download->setEnabled(true); } else - system("notify-send Failed to load App icon --icon=spark-store");//这一句怎么翻译? + sendNotification(tr("Failed to load application icon.")); // 截图展示加载 @@ -591,7 +609,7 @@ void Widget::on_pushButton_download_clicked() download_list[allDownload-1].pkgName=pkgName; if(fileName.isEmpty()) { - system("notify-send Failed to get file name --icon=spark-store");//??这玩意怎么翻译 + sendNotification(tr("Failed to get the name to the file to be downloaded.")); return; } download_list[allDownload-1].setParent(ui->listWidget); @@ -616,7 +634,7 @@ void Widget::on_pushButton_download_clicked() nowDownload+=1; startRequest(urList.at(nowDownload-1)); // 进行链接请求 } - if(ui->pushButton_download->text()==QObject::tr("Reinstall")){ + if(ui->pushButton_download->text()==tr("Reinstall")){ download_list[allDownload-1].reinstall=true; } } @@ -639,7 +657,7 @@ void Widget::searchApp(QString text) if(text.left(6)=="spk://"){ openUrl(text); }else { - system("notify-send The store can only process spk:// url now.Please look forward to later version! --icon=spark-store"); + sendNotification(tr("Spark store could only process spk:// links for now. The search feature is coming soon!")); // ui->webView->setUrl(QUrl("http://www.baidu.com/s?wd="+text));//这东西对接百度 // ui->stackedWidget->setCurrentIndex(0); } @@ -759,7 +777,7 @@ void Widget::on_pushButton_updateApt_clicked() { QtConcurrent::run([=](){ ui->pushButton_updateApt->setEnabled(false); - ui->label_aptserver->setText(QObject::tr("Updating,PLease wait")); + ui->label_aptserver->setText(tr("Updating, please wait...")); std::fstream sourcesList; QDir tmpdir("/tmp"); tmpdir.mkpath("spark-store"); @@ -788,10 +806,10 @@ void Widget::on_pushButton_updateApt_clicked() if(!haveError){ ui->label_aptserver->setText("deb [by-hash=force] "+ui->comboBox_server->currentText().toUtf8()+" /"); }else { - ui->label_aptserver->setText(QObject::tr("An error occured during the apt process.Please use apt update in terminal to locate problem")); + ui->label_aptserver->setText(tr("Apt has reported an error. Please use apt update in terminal to locate the problem.")); } }else { - ui->label_aptserver->setText(QObject::tr("Unknwon server error!")); + ui->label_aptserver->setText(tr("Unknown server error!")); } ui->pushButton_updateApt->setEnabled(true); @@ -811,7 +829,7 @@ void Widget::on_pushButton_uninstall_clicked() ui->pushButton_uninstall->hide(); ui->pushButton_uninstall->setEnabled(true); updatesEnabled(); - system("notify-send Uninstall Successed --icon=spark-store"); + sendNotification(tr("Uninstall succeeded")); }); } @@ -825,7 +843,7 @@ void Widget::on_pushButton_clear_clicked() // 清空临时缓存目录 for (int i=0;ipushButton_clear->setEnabled(true); Widget::opensetting(); }); @@ -891,8 +909,8 @@ void Widget::on_pushButton_clicked() share_url="spk://store/"+type_name+"/"+pkgName; qDebug()<<"Share"<setText(share_url); + sendNotification(tr("The URL has been copied to the clipboard")); } void Widget::on_btn_openDir_clicked() @@ -933,19 +951,6 @@ void Widget::on_webEngineView_urlChanged(const QUrl &arg1) load = QtConcurrent::run([=](){ int loadresult = loadappinfo(arg1); - if(!loadresult) - return; - else { - switch(loadresult) - { - case 1: // 空的arg1 - //此处不应通知用户 - break; - case 2: // curl下载app.json失败 - system("notify-send Failed to get app info,Please Check your connection to Internet --icon=spark-store"); - break; - } - } }); } } diff --git a/widget.h b/widget.h index ea609f4..45b21b6 100644 --- a/widget.h +++ b/widget.h @@ -47,6 +47,9 @@ public: void setTheme(bool,QColor); DTitlebar* getTitlebar(); + 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"); + private slots: void httpFinished(); diff --git a/widget.ui b/widget.ui index f5341b2..ff8f5ae 100644 --- a/widget.ui +++ b/widget.ui @@ -170,7 +170,7 @@ - 回到分类 + Back to category @@ -287,7 +287,7 @@ - 重新加载 + Reload @@ -377,7 +377,7 @@ 0 - The List is empty now.Go and Download some software! + The list is currently empty. Go and download some softwares! Qt::AlignCenter @@ -409,7 +409,7 @@ Qt::NoFocus - 打开文件夹 + Open download directory @@ -454,8 +454,8 @@ 0 0 - 903 - 849 + 889 + 854 @@ -880,7 +880,7 @@ - <html><head/><body><p>由社区爱好者开发的软件商店</p></body></html> + <html><head/><body><p>An app store developed by community enthusiasts</p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -919,7 +919,7 @@ - ScreenShots + Screenshots @@ -936,8 +936,8 @@ 0 0 - 869 - 325 + 851 + 323 @@ -1066,8 +1066,8 @@ 0 0 - 738 - 896 + 889 + 858