修改 web控件

This commit is contained in:
Maicss 2020-08-26 09:27:34 +08:00
commit 8952be33c4
7 changed files with 178 additions and 448 deletions

View File

@ -9,8 +9,10 @@ web页面部分正在开发当中详情请见[web仓库](https://gitee.com/de
当前服务器线路列表(项目中包含): 当前服务器线路列表(项目中包含):
``` ```
http://dcstore.shenmo.tech/ http://cdn.jerrywang.top/
http://sucdn.jerrywang.top/
http://store.jerrywang.top/ http://store.jerrywang.top/
http://dcstore.shenmo.tech/
``` ```
#### 参数 #### 参数
@ -25,7 +27,7 @@ http://store.jerrywang.top/
可选的web分类 可选的web分类
| 分类名称 | web分类 | | 分类名称 | web分类   |
| -------- | -------------- | | -------- | -------------- |
| 网络应用 | network | | 网络应用 | network |
| 社交沟通 | chat | | 社交沟通 | chat |

View File

@ -16,7 +16,7 @@ int main(int argc, char *argv[])
a.setProductIcon(QIcon::fromTheme("spark-store")); //设置Logo a.setProductIcon(QIcon::fromTheme("spark-store")); //设置Logo
a.setProductName("Spark应用商店"); a.setProductName("Spark应用商店");
a.setApplicationDescription("深度社区驱动的一款为deepin打造的第三方商店"); a.setApplicationDescription("社区驱动的一款为第三方应用商店,为改变而生");
a.setApplicationName("Spark应用商店"); //只有在这儿修改窗口标题才有效 a.setApplicationName("Spark应用商店"); //只有在这儿修改窗口标题才有效
Widget w; Widget w;
QDesktopWidget *s=DApplication::desktop(); QDesktopWidget *s=DApplication::desktop();

View File

@ -1,6 +0,0 @@
#include "progress_load.h"
progress_load::progress_load()
{
}

View File

@ -1,12 +0,0 @@
#ifndef PROGRESS_LOAD_H
#define PROGRESS_LOAD_H
#include <QWidget>
class progress_load
{
public:
progress_load();
};
#endif // PROGRESS_LOAD_H

View File

@ -1,326 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.8.2, 2020-08-26T09:22:50. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{2b2d2f1a-6483-4add-a570-55e1f0a2e40a}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">桌面</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">桌面</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{a42d4e65-62ab-4574-9a07-1c933c50ac5d}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/maicss/git/spark/build-spark-store-unknown-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/maicss/git/spark/build-spark-store-unknown-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/maicss/git/spark/build-spark-store-unknown-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy Configuration</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">spark-store</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/maicss/git/spark/spark-store/spark-store.pro</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">spark-store.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">20</value>
</data>
<data>
<variable>Version</variable>
<value type="int">20</value>
</data>
</qtcreator>

View File

@ -13,7 +13,7 @@
#include <QJsonObject> #include <QJsonObject>
#include <QByteArray> #include <QByteArray>
#include <QPixmap> #include <QPixmap>
#include <QtConcurrent> //并发 #include <QtConcurrent> // 并发
#include <QSettings> #include <QSettings>
#include <QIcon> #include <QIcon>
#include <QWebFrame> #include <QWebFrame>
@ -36,8 +36,12 @@ Widget::Widget(DBlurEffectWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
initUI(); initUI();
initConfig(); initConfig();
<<<<<<< HEAD
manager = new QNetworkAccessManager(this);//下载管理 manager = new QNetworkAccessManager(this);//下载管理
m_loadweb=ui->progressload; m_loadweb=ui->progressload;
=======
manager = new QNetworkAccessManager(this); // 下载管理
>>>>>>> 7af2af64d86d0940fc60b7061485e44e2b2b4f59
connect(ui->menu_main,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(0);}); connect(ui->menu_main,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(0);});
connect(ui->menu_network,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(1);}); connect(ui->menu_network,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(1);});
@ -53,10 +57,9 @@ Widget::Widget(DBlurEffectWidget *parent) :
connect(ui->menu_theme,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(11);}); connect(ui->menu_theme,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(11);});
connect(ui->menu_other,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(12);}); connect(ui->menu_other,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(12);});
connect(ui->menu_download,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(13);}); connect(ui->menu_download,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(13);});
// connect((ui->titlebar)) // connect((ui->titlebar))
// 搜索事件
//搜索事件
connect(searchEdit,&DSearchEdit::editingFinished,this,[=](){ connect(searchEdit,&DSearchEdit::editingFinished,this,[=](){
QString searchtext=searchEdit->text(); QString searchtext=searchEdit->text();
if(searchtext!=""){ if(searchtext!=""){
@ -66,6 +69,7 @@ Widget::Widget(DBlurEffectWidget *parent) :
searchEdit->clearEdit(); searchEdit->clearEdit();
}); });
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) { connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [=](DGuiApplicationHelper::ColorType themeType) {
QColor main_color; QColor main_color;
main_color=DGuiApplicationHelper::instance()->applicationPalette().highlight().color(); main_color=DGuiApplicationHelper::instance()->applicationPalette().highlight().color();
@ -78,7 +82,7 @@ Widget::Widget(DBlurEffectWidget *parent) :
} }
}); });
//计算显示下载速度 // 计算显示下载速度
download_speed.setInterval(1000); download_speed.setInterval(1000);
download_speed.start(); download_speed.start();
connect(&download_speed,&QTimer::timeout,[=](){ connect(&download_speed,&QTimer::timeout,[=](){
@ -107,16 +111,16 @@ Widget::Widget(DBlurEffectWidget *parent) :
m_loadweb->setValue(50); m_loadweb->setValue(50);
} }
Widget::~Widget() Widget::~Widget()
{ {
delete ui; delete ui;
qDebug()<<"exit"; qDebug()<<"exit";
DApplication::quit(); DApplication::quit();
} }
void Widget::initUI() void Widget::initUI()
{ {
//ui初始化 // ui初始化
setMaskAlpha(220); setMaskAlpha(220);
ui->webfoot->setFixedHeight(0); ui->webfoot->setFixedHeight(0);
ui->stackedWidget->setCurrentIndex(0); ui->stackedWidget->setCurrentIndex(0);
@ -127,41 +131,37 @@ void Widget::initUI()
ui->icon->setPixmap(QIcon::fromTheme("spark-store").pixmap(36,36)); ui->icon->setPixmap(QIcon::fromTheme("spark-store").pixmap(36,36));
ui->titlebar->setFixedHeight(50); ui->titlebar->setFixedHeight(50);
// 初始化分界线
//初始化分界线
QGraphicsOpacityEffect *opacityEffect_1=new QGraphicsOpacityEffect; QGraphicsOpacityEffect *opacityEffect_1=new QGraphicsOpacityEffect;
opacityEffect_1->setOpacity(0.1); opacityEffect_1->setOpacity(0.1);
ui->line1_widget->setGraphicsEffect(opacityEffect_1); ui->line1_widget->setGraphicsEffect(opacityEffect_1);
// 搜索框
//搜索框
QWidget *w_titlebar=new QWidget; QWidget *w_titlebar=new QWidget;
QHBoxLayout *ly_titlebar=new QHBoxLayout; QHBoxLayout *ly_titlebar=new QHBoxLayout;
w_titlebar->setLayout(ly_titlebar); w_titlebar->setLayout(ly_titlebar);
// ly_titlebar->addWidget(ui->pushButton_return); // ly_titlebar->addWidget(ui->pushButton_return);
ly_titlebar->addStretch(); ly_titlebar->addStretch();
ly_titlebar->addSpacing(50); ly_titlebar->addSpacing(50);
ly_titlebar->addWidget(searchEdit); ly_titlebar->addWidget(searchEdit);
ly_titlebar->addStretch(); ly_titlebar->addStretch();
titlebar=ui->titlebar; titlebar=ui->titlebar;
titlebar->setCustomWidget(w_titlebar); titlebar->setCustomWidget(w_titlebar);
// titlebar->setIcon(QIcon::fromTheme("spark-store")); // titlebar->setIcon(QIcon::fromTheme("spark-store"));
titlebar->setTitle("星火应用商店"); titlebar->setTitle("星火应用商店");
searchEdit->setPlaceholderText("搜索或打开链接"); searchEdit->setPlaceholderText("搜索或打开链接");
searchEdit->setFixedWidth(300); searchEdit->setFixedWidth(300);
titlebar->setSeparatorVisible(false); titlebar->setSeparatorVisible(false);
// titlebar->setAutoHideOnFullscreen(true); // titlebar->setAutoHideOnFullscreen(true);
//添加菜单项 // 添加菜单项
QAction *setting=new QAction("设置"); QAction *setting=new QAction("设置");
QMenu *menu=new QMenu; QMenu *menu=new QMenu;
menu->addAction(setting); menu->addAction(setting);
titlebar->setMenu(menu); titlebar->setMenu(menu);
connect(setting,&QAction::triggered,this,&Widget::opensetting); connect(setting,&QAction::triggered,this,&Widget::opensetting);
//初始化菜单数组 // 初始化菜单数组
left_list[0]=ui->menu_main; left_list[0]=ui->menu_main;
left_list[1]=ui->menu_network; left_list[1]=ui->menu_network;
left_list[2]=ui->menu_chat; left_list[2]=ui->menu_chat;
@ -177,6 +177,7 @@ void Widget::initUI()
left_list[12]=ui->menu_other; left_list[12]=ui->menu_other;
left_list[13]=ui->menu_download; left_list[13]=ui->menu_download;
<<<<<<< HEAD
//初始化web加载动画 //初始化web加载动画
// QHBoxLayout *m_weblayout=new QHBoxLayout; // QHBoxLayout *m_weblayout=new QHBoxLayout;
@ -194,13 +195,30 @@ void Widget::initUI()
// ui->webEngineView->setLayout(m_weblayout); // ui->webEngineView->setLayout(m_weblayout);
// ui->stackedWidget->setLayout(m_weblayout); // ui->stackedWidget->setLayout(m_weblayout);
=======
// 初始化web加载动画
QHBoxLayout *m_weblayout=new QHBoxLayout;
m_weblayout->addWidget(m_loadweb);
m_weblayout->addWidget(m_loaderror);
m_loadweb->hide();
m_loaderror->hide();
m_loadweb->start();
m_loadweb->setMaximumSize(50,50);
m_loadweb->setMinimumSize(50,50);
m_loadweb->setTextVisible(false);
m_loaderror->setPixmap(QIcon::fromTheme("dialog-error").pixmap(50,50));
m_loaderror->setAlignment(Qt::AlignCenter);
ui->webView->setLayout(m_weblayout);
// ui->stackedWidget->setLayout(m_weblayout);
>>>>>>> 7af2af64d86d0940fc60b7061485e44e2b2b4f59
ui->label_show->hide(); ui->label_show->hide();
} }
void Widget::initConfig() void Widget::initConfig()
{ {
//读取服务器列表并初始化 // 读取服务器列表并初始化
std::fstream serverList; std::fstream serverList;
serverList.open(QDir::homePath().toUtf8()+"/.config/spark-store/server.list",std::ios::in); serverList.open(QDir::homePath().toUtf8()+"/.config/spark-store/server.list",std::ios::in);
std::string lineTmp; std::string lineTmp;
@ -209,22 +227,21 @@ void Widget::initConfig()
ui->comboBox_server->addItem(QString::fromStdString(lineTmp)); ui->comboBox_server->addItem(QString::fromStdString(lineTmp));
} }
}else { }else {
ui->comboBox_server->addItem("http://store.jerrywang.top/"); ui->comboBox_server->addItem("http://sucdn.jerrywang.top/");
} }
// 读取服务器URL并初始化菜单项的链接
//读取服务器URL并初始化菜单项的链接
QSettings readConfig(QDir::homePath()+"/.config/spark-store/config.ini",QSettings::IniFormat); QSettings readConfig(QDir::homePath()+"/.config/spark-store/config.ini",QSettings::IniFormat);
if(readConfig.value("server/choose").toString()!=""){ if(readConfig.value("server/choose").toString()!=""){
ui->comboBox_server->setCurrentText(readConfig.value("server/choose").toString()); ui->comboBox_server->setCurrentText(readConfig.value("server/choose").toString());
serverUrl=readConfig.value("server/choose").toString(); serverUrl=readConfig.value("server/choose").toString();
}else { }else {
serverUrl="http://store.jerrywang.top/";//默认URL serverUrl="http://sucdn.jerrywang.top/"; // 默认URL
} }
configCanSave=true; //防止出发保存配置信号 // by shenmo 在这里换成路径为{cdn/dc}/store/#
configCanSave=true; // 防止触发保存配置信号
menuUrl[0]=serverUrl + "store/#/"; menuUrl[0]=serverUrl + "store/#/";
// menuUrl[0]="http://127.0.0.1:8000/#/darkprogramming"; // menuUrl[0]="http://127.0.0.1:8000/#/darkprogramming";
menuUrl[1]=serverUrl + "store/#/network"; menuUrl[1]=serverUrl + "store/#/network";
menuUrl[2]=serverUrl + "store/#/relations"; menuUrl[2]=serverUrl + "store/#/relations";
menuUrl[3]=serverUrl + "store/#/musicandsound"; menuUrl[3]=serverUrl + "store/#/musicandsound";
@ -238,6 +255,7 @@ void Widget::initConfig()
menuUrl[11]=serverUrl + "store/#/themes"; menuUrl[11]=serverUrl + "store/#/themes";
menuUrl[12]=serverUrl + "store/#/others"; menuUrl[12]=serverUrl + "store/#/others";
<<<<<<< HEAD
//web控件初始化 //web控件初始化
// ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); //用来激活接受linkClicked信号 // ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); //用来激活接受linkClicked信号
@ -247,6 +265,15 @@ void Widget::initConfig()
//初始化首页 //初始化首页
ui->webEngineView->setUrl(menuUrl[0]); ui->webEngineView->setUrl(menuUrl[0]);
// ui->webEngineView->setUrl(menuUrl[1]); // ui->webEngineView->setUrl(menuUrl[1]);
=======
// web控件初始化
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); //用来激活接受linkClicked信号
ui->webView->page()->settings()->setAttribute(QWebSettings::JavascriptEnabled,true);
ui->webfoot->hide();
// 初始化首页
ui->webView->setUrl(menuUrl[0]);
>>>>>>> 7af2af64d86d0940fc60b7061485e44e2b2b4f59
chooseLeftMenu(0); chooseLeftMenu(0);
//给下载列表赋值到数组,方便调用 //给下载列表赋值到数组,方便调用
@ -254,7 +281,7 @@ void Widget::initConfig()
download_list[i].num=i; download_list[i].num=i;
} }
//初始化apt源显示 // 初始化apt源显示
QFile aptserver("/etc/apt/sources.list.d/sparkstore.list"); QFile aptserver("/etc/apt/sources.list.d/sparkstore.list");
aptserver.open(QIODevice::ReadOnly); aptserver.open(QIODevice::ReadOnly);
if(aptserver.isOpen()){ if(aptserver.isOpen()){
@ -264,14 +291,16 @@ void Widget::initConfig()
} }
aptserver.close(); aptserver.close();
//新建临时文件夹 // 新建临时文件夹
QDir dir("/tmp"); QDir dir("/tmp");
dir.mkdir("spark-store"); dir.mkdir("spark-store");
} }
void Widget::setTheme(bool isDark,QColor color) void Widget::setTheme(bool isDark,QColor color)
{ {
// 菜单图标
if(isDark){ if(isDark){
//黑色模式 // 黑色模式
themeIsDark=true; themeIsDark=true;
ui->webEngineView->setStyleSheet("background-color:#282828"); ui->webEngineView->setStyleSheet("background-color:#282828");
ui->btn_openDir->setStyleSheet("color:#8B91A1;background-color:#2E2F30;border:0px"); ui->btn_openDir->setStyleSheet("color:#8B91A1;background-color:#2E2F30;border:0px");
@ -280,11 +309,8 @@ void Widget::setTheme(bool isDark,QColor color)
ui->scrollArea->setStyleSheet("#scrollArea{background-color:#252525}"); ui->scrollArea->setStyleSheet("#scrollArea{background-color:#252525}");
ui->label_show->setStyleSheet("background-color:#252525"); ui->label_show->setStyleSheet("background-color:#252525");
ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active_dark.svg")); ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active_dark.svg"));
//菜单图标
}else { }else {
//亮色模式 // 亮色模式
themeIsDark=false; themeIsDark=false;
ui->webEngineView->setStyleSheet("background-color:#FFFFFF"); ui->webEngineView->setStyleSheet("background-color:#FFFFFF");
ui->webfoot->setStyleSheet("background-color:#FFFFFF"); ui->webfoot->setStyleSheet("background-color:#FFFFFF");
@ -293,7 +319,6 @@ void Widget::setTheme(bool isDark,QColor color)
ui->scrollArea->setStyleSheet("#scrollArea{background-color:#F8F8F8}"); ui->scrollArea->setStyleSheet("#scrollArea{background-color:#F8F8F8}");
ui->label_show->setStyleSheet("background-color:#F8F8F8"); ui->label_show->setStyleSheet("background-color:#F8F8F8");
ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active.svg")); ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active.svg"));
} }
main_color=color; main_color=color;
@ -308,6 +333,39 @@ DTitlebar* Widget::getTitlebar()
{ {
return ui->titlebar; return ui->titlebar;
} }
<<<<<<< HEAD
=======
void Widget::on_webView_loadStarted()
{
m_loadweb->setValue(0);
m_loadweb->show();
m_loaderror->hide();
ui->label_show->hide();
// 分析出服务器中的分类名称
QUrl arg1=ui->webView->page()->mainFrame()->requestedUrl().toString();
QStringList url_=arg1.path().split("/");
if(url_.size()>3){
type_name=url_[2];
}
// 如果是app.json就打开详情页
if(arg1.path().right(8)=="app.json"){
load.cancel(); // 打开并发加载线程前关闭正在执行的线程
ui->label_more->setText(""); // 清空详情介绍
ui->label_info->setText("");
ui->label_appname->setText("");
ui->pushButton_download->setEnabled(false);
ui->stackedWidget->setCurrentIndex(2);
load.cancel(); // 打开并发加载线程前关闭正在执行的线程
load = QtConcurrent::run([=](){
loadappinfo(arg1);
});
}
}
>>>>>>> 7af2af64d86d0940fc60b7061485e44e2b2b4f59
void Widget::updateUI() void Widget::updateUI()
{ {
if(themeIsDark){ if(themeIsDark){
@ -396,12 +454,16 @@ void Widget::updateUI()
break; break;
} }
} }
//菜单切换逻辑
// 菜单切换逻辑
void Widget::chooseLeftMenu(int index) void Widget::chooseLeftMenu(int index)
{ {
nowMenu=index; nowMenu=index;
<<<<<<< HEAD
=======
// setfoot();
// updatefoot();
>>>>>>> 7af2af64d86d0940fc60b7061485e44e2b2b4f59
updateUI(); updateUI();
left_list[index]->setStyleSheet("color:#FFFFFF;background-color:"+main_color.name()+";border-radius:8;border:0px"); left_list[index]->setStyleSheet("color:#FFFFFF;background-color:"+main_color.name()+";border-radius:8;border:0px");
@ -425,7 +487,6 @@ void Widget::chooseLeftMenu(int index)
}else if (index==13) { }else if (index==13) {
ui->stackedWidget->setCurrentIndex(1); ui->stackedWidget->setCurrentIndex(1);
} }
} }
void Widget::setfoot(int h) void Widget::setfoot(int h)
@ -439,15 +500,13 @@ void Widget::updatefoot()
ui->webfoot->setFixedHeight(allh-foot); ui->webfoot->setFixedHeight(allh-foot);
} }
void Widget::loadappinfo(QUrl arg1) void Widget::loadappinfo(QUrl arg1)
{ {
if(arg1.isEmpty()){ if(arg1.isEmpty()){
return; return;
} }
//先隐藏详情页负责显示截图的label // 先隐藏详情页负责显示截图的label
ui->screen_0->hide(); ui->screen_0->hide();
ui->screen_1->hide(); ui->screen_1->hide();
ui->screen_2->hide(); ui->screen_2->hide();
@ -455,7 +514,7 @@ void Widget::loadappinfo(QUrl arg1)
ui->screen_4->hide(); ui->screen_4->hide();
ui->label_appicon->clear(); ui->label_appicon->clear();
//置UI状态 // 重置UI状态
ui->pushButton_uninstall->hide(); ui->pushButton_uninstall->hide();
ui->label_show->setText("正在加载,请稍候"); ui->label_show->setText("正在加载,请稍候");
ui->label_show->show(); ui->label_show->show();
@ -470,22 +529,22 @@ void Widget::loadappinfo(QUrl arg1)
get_json.waitForFinished(); get_json.waitForFinished();
QFile app_json("app.json"); QFile app_json("app.json");
if(app_json.open(QIODevice::ReadOnly)){ if(app_json.open(QIODevice::ReadOnly)){
// //成功得到json文件 // 成功得到json文件
QByteArray json_array=app_json.readAll(); QByteArray json_array=app_json.readAll();
//将路径转化为相应源的下载路径 // 将路径转化为相应源的下载路径
urladdress=arg1.toString().left(arg1.toString().length()-8); urladdress=arg1.toString().left(arg1.toString().length()-8);
QStringList downloadurl=urladdress.split("/"); QStringList downloadurl=urladdress.split("/");
urladdress=ui->comboBox_server->currentText(); urladdress=ui->comboBox_server->currentText();
QString deburl=urladdress; QString deburl=urladdress;
deburl=deburl.left(urladdress.length()-1); deburl=deburl.left(urladdress.length()-1);
urladdress="http://img.shenmo.tech:38324/";//使用图片专用服务器请保留这行,删除后将使用源服务器 urladdress="http://img.jerrywang.top/"; // 使用图片专用服务器请保留这行,删除后将使用源服务器
urladdress=urladdress.left(urladdress.length()-1); urladdress=urladdress.left(urladdress.length()-1);
for (int i=3;i<downloadurl.size();i++) { for (int i=3;i<downloadurl.size();i++) {
urladdress+="/"+downloadurl[i]; urladdress+="/"+downloadurl[i];
deburl+="/"+downloadurl[i]; deburl+="/"+downloadurl[i];
} }
//路径转化完成 // 路径转化完成
QJsonObject json= QJsonDocument::fromJson(json_array).object(); QJsonObject json= QJsonDocument::fromJson(json_array).object();
appName = json["Name"].toString(); appName = json["Name"].toString();
url=deburl + json["Filename"].toString(); url=deburl + json["Filename"].toString();
@ -493,7 +552,7 @@ void Widget::loadappinfo(QUrl arg1)
ui->label_appname->setText(appName); ui->label_appname->setText(appName);
system("rm -r *.png"); system("rm -r *.png");
ui->label_show->show(); ui->label_show->show();
//软件信息加载 // 软件信息加载
QString info; QString info;
info="包名: "+json["Pkgname"].toString()+"\n"; info="包名: "+json["Pkgname"].toString()+"\n";
info+="版本号: "+json["Version"].toString()+"\n"; info+="版本号: "+json["Version"].toString()+"\n";
@ -523,14 +582,14 @@ void Widget::loadappinfo(QUrl arg1)
}else { }else {
ui->pushButton_download->setText("安装"); ui->pushButton_download->setText("安装");
} }
//图标加载 // 图标加载
get_json.start("curl -o icon.png "+urladdress+"icon.png"); get_json.start("curl -o icon.png "+urladdress+"icon.png");
get_json.waitForFinished(); get_json.waitForFinished();
QPixmap appicon(QString::fromUtf8(TMP_PATH)+"/icon.png"); QPixmap appicon(QString::fromUtf8(TMP_PATH)+"/icon.png");
ui->label_appicon->setPixmap(appicon); ui->label_appicon->setPixmap(appicon);
ui->pushButton_download->setEnabled(true); ui->pushButton_download->setEnabled(true);
//截图展示加载
// 截图展示加载
image_show *label_screen[5]; image_show *label_screen[5];
label_screen[0]=ui->screen_0; label_screen[0]=ui->screen_0;
label_screen[1]=ui->screen_1; label_screen[1]=ui->screen_1;
@ -543,7 +602,7 @@ void Widget::loadappinfo(QUrl arg1)
if(screen[i].load("screen_"+QString::number(i+1)+".png")){ if(screen[i].load("screen_"+QString::number(i+1)+".png")){
label_screen[i]->setImage(screen[i]); label_screen[i]->setImage(screen[i]);
label_screen[i]->show(); label_screen[i]->show();
switch(i){ //故意为之,为了清除多余截图 switch(i){ // 故意为之,为了清除多余截图
case 0: case 0:
label_screen[1]->hide(); label_screen[1]->hide();
case 1: case 1:
@ -560,20 +619,15 @@ void Widget::loadappinfo(QUrl arg1)
} }
ui->label_show->setText(""); ui->label_show->setText("");
ui->label_show->hide(); ui->label_show->hide();
} }
} }
void Widget::on_pushButton_download_clicked() void Widget::on_pushButton_download_clicked()
{ {
chooseLeftMenu(13); chooseLeftMenu(13);
allDownload+=1; allDownload+=1;
QFileInfo info(url.path()); QFileInfo info(url.path());
QString fileName(info.fileName()); //获取文件名 QString fileName(info.fileName()); // 获取文件名
download_list[allDownload-1].pkgName=pkgName; download_list[allDownload-1].pkgName=pkgName;
if(fileName.isEmpty()) if(fileName.isEmpty())
{ {
@ -600,7 +654,7 @@ void Widget::on_pushButton_download_clicked()
return ; return ;
} }
nowDownload+=1; nowDownload+=1;
startRequest(urList.at(nowDownload-1)); //进行链接请求 startRequest(urList.at(nowDownload-1)); // 进行链接请求
} }
if(ui->pushButton_download->text()=="重新安装"){ if(ui->pushButton_download->text()=="重新安装"){
download_list[allDownload-1].reinstall=true; download_list[allDownload-1].reinstall=true;
@ -618,7 +672,6 @@ void Widget::startRequest(QUrl url)
connect(reply,SIGNAL(finished()),this,SLOT(httpFinished())); connect(reply,SIGNAL(finished()),this,SLOT(httpFinished()));
connect(reply,SIGNAL(readyRead()),this,SLOT(httpReadyRead())); connect(reply,SIGNAL(readyRead()),this,SLOT(httpReadyRead()));
connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(updateDataReadProgress(qint64,qint64))); connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(updateDataReadProgress(qint64,qint64)));
} }
void Widget::searchApp(QString text) void Widget::searchApp(QString text)
@ -627,14 +680,11 @@ void Widget::searchApp(QString text)
openUrl(text); openUrl(text);
}else { }else {
system("notify-send 目前仅支持商店专用链接的打开,搜索功能正在开发,请期待以后的版本! --icon=spark-store"); system("notify-send 目前仅支持商店专用链接的打开,搜索功能正在开发,请期待以后的版本! --icon=spark-store");
// ui->webView->setUrl(QUrl("http://www.baidu.com/s?wd="+text)); // ui->webView->setUrl(QUrl("http://www.baidu.com/s?wd="+text));
// ui->stackedWidget->setCurrentIndex(0); // ui->stackedWidget->setCurrentIndex(0);
} }
} }
void Widget::httpReadyRead() void Widget::httpReadyRead()
{ {
if(file) if(file)
@ -642,20 +692,20 @@ void Widget::httpReadyRead()
file->write(reply->readAll()); file->write(reply->readAll());
} }
} }
void Widget::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes) void Widget::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes)
{ {
download_list[nowDownload-1].setMax(10000); //最大值 download_list[nowDownload-1].setMax(10000); // 最大值
download_list[nowDownload-1].setValue((bytesRead*10000)/totalBytes); //当前值 download_list[nowDownload-1].setValue((bytesRead*10000)/totalBytes); // 当前值
download_size=bytesRead; download_size=bytesRead;
if(download_list[nowDownload-1].close){ //随时检测下载是否被取消 if(download_list[nowDownload-1].close){ // 随时检测下载是否被取消
download_list[nowDownload-1].closeDownload(); download_list[nowDownload-1].closeDownload();
httpFinished(); httpFinished();
} }
} }
void Widget::httpFinished() //完成下载 void Widget::httpFinished() // 完成下载
{ {
file->flush(); file->flush();
file->close(); file->close();
reply->deleteLater(); reply->deleteLater();
@ -666,7 +716,7 @@ void Widget::httpFinished() //完成下载
isBusy=false; isBusy=false;
download_list[nowDownload-1].readyInstall(); download_list[nowDownload-1].readyInstall();
download_list[nowDownload-1].free=true; download_list[nowDownload-1].free=true;
if(nowDownload<allDownload){ //如果有排队则下载下一个 if(nowDownload<allDownload){ // 如果有排队则下载下一个
nowDownload+=1; nowDownload+=1;
while (download_list[nowDownload-1].close) { while (download_list[nowDownload-1].close) {
nowDownload+=1; nowDownload+=1;
@ -683,29 +733,27 @@ void Widget::httpFinished() //完成下载
} }
} }
void Widget::on_pushButton_return_clicked() void Widget::on_pushButton_return_clicked()
{ {
// ui->stackedWidget->setCurrentIndex(0); // ui->stackedWidget->setCurrentIndex(0);
// if(nowMenu==13){ // if(nowMenu==13){
// chooseLeftMenu(13); // chooseLeftMenu(13);
// return; // return;
// } // }
chooseLeftMenu(nowMenu); chooseLeftMenu(nowMenu);
// if(themeIsDark){ // if(themeIsDark){
// QString darkurl=menuUrl[nowMenu].toString(); // QString darkurl=menuUrl[nowMenu].toString();
// QStringList tmp=darkurl.split("/"); // QStringList tmp=darkurl.split("/");
// darkurl.clear(); // darkurl.clear();
// for (int i=0;i<tmp.size()-1;i++) { // for (int i=0;i<tmp.size()-1;i++) {
// darkurl+=tmp[i]+"/"; // darkurl+=tmp[i]+"/";
// } // }
// darkurl+="dark"+tmp[tmp.size()-1]; // darkurl+="dark"+tmp[tmp.size()-1];
// ui->webView->setUrl(darkurl); // ui->webView->setUrl(darkurl);
// qDebug()<<darkurl; // qDebug()<<darkurl;
// }else { // }else {
// ui->webView->setUrl(menuUrl[nowMenu]); // ui->webView->setUrl(menuUrl[nowMenu]);
// } // }
} }
void Widget::on_comboBox_server_currentIndexChanged(const QString &arg1) void Widget::on_comboBox_server_currentIndexChanged(const QString &arg1)
@ -716,6 +764,7 @@ void Widget::on_comboBox_server_currentIndexChanged(const QString &arg1)
setConfig->setValue("server/choose",arg1); setConfig->setValue("server/choose",arg1);
} }
} }
void Widget::on_pushButton_updateServer_clicked() void Widget::on_pushButton_updateServer_clicked()
{ {
QtConcurrent::run([=](){ QtConcurrent::run([=](){
@ -731,7 +780,7 @@ void Widget::on_pushButton_updateServer_clicked()
ui->comboBox_server->addItem(QString::fromStdString(lineTmp)); ui->comboBox_server->addItem(QString::fromStdString(lineTmp));
} }
}else { }else {
ui->comboBox_server->addItem("http://store.jerrywang.top/"); ui->comboBox_server->addItem("http://sucdn.jerrywang.top/");
} }
ui->pushButton_updateServer->setEnabled(true); ui->pushButton_updateServer->setEnabled(true);
ui->comboBox_server->setCurrentIndex(0); ui->comboBox_server->setCurrentIndex(0);
@ -798,7 +847,7 @@ void Widget::on_pushButton_uninstall_clicked()
}); });
} }
void Widget::on_pushButton_clear_clicked()//清空临时缓存目录 void Widget::on_pushButton_clear_clicked() // 清空临时缓存目录
{ {
QtConcurrent::run([=](){ QtConcurrent::run([=](){
ui->pushButton_clear->setEnabled(false); ui->pushButton_clear->setEnabled(false);
@ -818,16 +867,16 @@ quint64 Widget::dirFileSize(const QString &path)
{ {
QDir dir(path); QDir dir(path);
quint64 size = 0; quint64 size = 0;
//dir.entryInfoList(QDir::Files)返回文件信息 // dir.entryInfoList(QDir::Files)返回文件信息
foreach(QFileInfo fileInfo, dir.entryInfoList(QDir::Files)) foreach(QFileInfo fileInfo, dir.entryInfoList(QDir::Files))
{ {
//计算文件大小 // 计算文件大小
size += quint64(fileInfo.size()); size += quint64(fileInfo.size());
} }
//dir.entryList(QDir::Dirs|QDir::NoDotAndDotDot)返回所有子目录,并进行过滤 // dir.entryList(QDir::Dirs|QDir::NoDotAndDotDot)返回所有子目录,并进行过滤
foreach(QString subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) foreach(QString subDir, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{ {
//若存在子目录则递归调用dirFileSize()函数 // 若存在子目录则递归调用dirFileSize()函数
size += dirFileSize(path + QDir::separator() + subDir); size += dirFileSize(path + QDir::separator() + subDir);
} }
return size; return size;
@ -835,13 +884,13 @@ quint64 Widget::dirFileSize(const QString &path)
void Widget::opensetting() void Widget::opensetting()
{ {
//防止下载时文件被删除 // 防止下载时文件被删除
if(isdownload){ if(isdownload){
ui->pushButton_clear->setEnabled(false); ui->pushButton_clear->setEnabled(false);
}else { }else {
ui->pushButton_clear->setEnabled(true); ui->pushButton_clear->setEnabled(true);
} }
//显示缓存占用空间 // 显示缓存占用空间
quint64 tmp_size=dirFileSize(QString::fromUtf8(TMP_PATH)); quint64 tmp_size=dirFileSize(QString::fromUtf8(TMP_PATH));
QString tmp_size_str; QString tmp_size_str;
if(tmp_size<1024){ if(tmp_size<1024){
@ -863,13 +912,32 @@ void Widget::openUrl(QUrl u)
ui->webEngineView->setUrl(app); ui->webEngineView->setUrl(app);
} }
void Widget::on_pushButton_website_clicked() void Widget::on_pushButton_website_clicked()
{ {
QDesktopServices::openUrl(QUrl(appweb)); QDesktopServices::openUrl(QUrl(appweb));
} }
<<<<<<< HEAD
=======
void Widget::on_webView_loadFinished(bool arg1)
{
if(arg1){
m_loadweb->hide();
}else {
m_loadweb->hide();
m_loaderror->show();
}
}
void Widget::on_webView_loadProgress(int progress)
{
m_loadweb->setValue(progress);
if(progress>=90){
m_loadweb->hide();
}
}
>>>>>>> 7af2af64d86d0940fc60b7061485e44e2b2b4f59
void Widget::on_pushButton_clicked() void Widget::on_pushButton_clicked()
{ {
@ -883,7 +951,6 @@ void Widget::on_pushButton_clicked()
void Widget::on_btn_openDir_clicked() void Widget::on_btn_openDir_clicked()
{ {
QDesktopServices::openUrl(QUrl("file:///tmp/spark-store", QUrl::TolerantMode)); QDesktopServices::openUrl(QUrl("file:///tmp/spark-store", QUrl::TolerantMode));
} }

View File

@ -421,8 +421,13 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<<<<<<< HEAD
<y>-228</y> <y>-228</y>
<width>901</width> <width>901</width>
=======
<y>0</y>
<width>404</width>
>>>>>>> 7af2af64d86d0940fc60b7061485e44e2b2b4f59
<height>849</height> <height>849</height>
</rect> </rect>
</property> </property>
@ -718,7 +723,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>867</width> <width>370</width>
<height>325</height> <height>325</height>
</rect> </rect>
</property> </property>
@ -945,7 +950,7 @@
<string notr="true">color:#808080</string> <string notr="true">color:#808080</string>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;源服务器的作用是保证软件更新并且支持使用apt工具获取软件。通常我们更建议你使用第一个线路作为更新源。虽然它可能偶尔有些慢。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;源服务器的作用是保证软件更新并且支持使用apt工具获取软件。通常我们更建议你使用第一个线路作为更新源,一般是最稳定的&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>