mirror of
https://gitee.com/spark-store-project/spark-web-app-runtime.git
synced 2025-06-02 05:09:50 +08:00
Change window sizePolicy
Change window sizePolicy from setFixedSize to setMinimumSize; Change icon name; Update part of translation.
This commit is contained in:
parent
c324f501bb
commit
e86473c650
@ -1,7 +1,7 @@
|
|||||||
# SparkWebAppRuntime
|
# SparkWebAppRuntime
|
||||||
|
|
||||||
#### Description
|
#### Description
|
||||||
星火商店WEBAPP运行时. 旨在简单快捷的将WEB封装为应用模式.
|
Spark-Store WebApp Runtime, intended to package webpages into apps easily.
|
||||||
|
|
||||||
#### Software Architecture
|
#### Software Architecture
|
||||||
Software architecture description
|
Software architecture description
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# SparkWebAppRuntime
|
# SparkWebAppRuntime
|
||||||
|
|
||||||
#### 介绍
|
#### 介绍
|
||||||
星火商店WEBAPP运行时. 旨在简单快捷的将WEB封装为应用模式.
|
星火商店网页应用运行环境,旨在简单快捷的将网页封装为应用模式。
|
||||||
|
|
||||||
#### 软件架构
|
#### 软件架构
|
||||||
软件架构说明
|
软件架构说明
|
||||||
|
@ -8,42 +8,45 @@
|
|||||||
<p><h1>帮助:</h1></p>
|
<p><h1>帮助:</h1></p>
|
||||||
<p>
|
<p>
|
||||||
<h3>第一种用法: </h3><br />
|
<h3>第一种用法: </h3><br />
|
||||||
spark-webapp-runtime 程序标题 程序访问网址 运行宽度 运行高度 <br />
|
spark-webapp-runtime 应用标题 目标网址 应用窗口宽度 应用窗口高度<br />
|
||||||
<p>
|
<p>
|
||||||
|
<br />
|
||||||
<p>
|
<p>
|
||||||
<h3>第二种用法: </h3><br />
|
<h3>第二种用法: </h3><br />
|
||||||
运行 "spark-webapp-runtime -h" 查看命令行帮助信息<br />
|
运行 "spark-webapp-runtime -h" 查看命令行帮助信息<br />
|
||||||
<br />
|
<br />
|
||||||
<xmp>
|
<xmp>
|
||||||
用法:./spark-webapp-runtime [选项]
|
用法:./spark-webapp-runtime [选项]
|
||||||
描述: 星火网页应用运行时
|
描述: 星火网页应用运行环境
|
||||||
|
|
||||||
选项:
|
选项:
|
||||||
-h, --help 显示这个此帮助。
|
-h, --help 显示这个此帮助。
|
||||||
-v, --version 显示版本信息。
|
-v, --version 显示版本信息。
|
||||||
-p, --parser 启用参数解析方式. 默认顺序解析方式.
|
-p, --parser 启用参数解析方式。默认为顺序解析方式。
|
||||||
-t, --title <title> 设置程序的运行标题. 默认是 星火网页应用运行时.
|
-t, --title <title> 设置应用的标题。默认为
|
||||||
-u, --url <url> 设置要打开的目标URL. 默认是空.
|
星火网页应用运行环境。
|
||||||
-w, --width <width> 设置程序运行的宽度. 默认是 1024.
|
-u, --url <url> 设置要打开的目标 URL。默认为空。
|
||||||
-H, --height <height> 设置程序运行的高度. 默认是 768
|
-w, --width <width> 设置应用的窗口宽度。默认为 1024。
|
||||||
-i, --ico <ico> 设置程序运行的图标.
|
-H, --height <height> 设置应用的窗口高度。默认为 768。
|
||||||
-d, --desc <desc> 设置程序的描述信息.
|
-i, --ico <ico> 设置应用的图标。
|
||||||
-c, --cfg <cfg> 设置程序运行的配置文件.
|
-d, --desc <desc> 设置应用的描述信息。
|
||||||
-r, --root <root> 设置内置WebServer的根路径.
|
-c, --cfg <cfg> 设置应用的配置文件。
|
||||||
-P, --port <port> 设置内置WebServer的监听端口号.
|
-r, --root <root> 设置内置 WebServer 的根路径。
|
||||||
|
-P, --port <port> 设置内置 WebServer 的监听端口号。
|
||||||
</xmp>
|
</xmp>
|
||||||
<br/>
|
<br/>
|
||||||
<span style="color: red">需要注意的是, 命令行会覆盖配置文件的配置信息.</span>
|
<span style="color: red">需要注意的是, 命令行会覆盖配置文件信息。</span>
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
<p><h1>How to Usage:</h1></p>
|
<p><h1>How to Usage:</h1></p>
|
||||||
<p>
|
<p>
|
||||||
<h3>The first usage: </h3><br />
|
<h3>The first usage: </h3><br />
|
||||||
SpartWebAppRuntime ApplicationTitle TargetURL ApplicationWidth ApplicationHeight <br />
|
spark-webapp-runtime ApplicationTitle TargetURL ApplicationWidth ApplicationHeight<br />
|
||||||
<p>
|
<p>
|
||||||
|
<br />
|
||||||
<p>
|
<p>
|
||||||
<h3>The second usage: </h3><br />
|
<h3>The second usage: </h3><br />
|
||||||
Using "SpartWebAppRuntime -h" to get help<br />
|
Using "spark-webapp-runtime -h" to get help<br />
|
||||||
<br />
|
<br />
|
||||||
<xmp>
|
<xmp>
|
||||||
Usage: ./spark-webapp-runtime [options]
|
Usage: ./spark-webapp-runtime [options]
|
||||||
@ -57,7 +60,7 @@
|
|||||||
SparkWebAppRuntime.
|
SparkWebAppRuntime.
|
||||||
-u, --url <url> The target URL. Default is Blank.
|
-u, --url <url> The target URL. Default is Blank.
|
||||||
-w, --width <width> The Width of Application. Default is 1024.
|
-w, --width <width> The Width of Application. Default is 1024.
|
||||||
-H, --height <height> The Height of Application. Default is 768
|
-H, --height <height> The Height of Application. Default is 768.
|
||||||
-i, --ico <ico> The ICON of Application.
|
-i, --ico <ico> The ICON of Application.
|
||||||
-d, --desc <desc> The Description of Application.
|
-d, --desc <desc> The Description of Application.
|
||||||
-c, --cfg <cfg> The Configuration file of Application.
|
-c, --cfg <cfg> The Configuration file of Application.
|
||||||
@ -65,7 +68,7 @@
|
|||||||
-P, --port <port> The port number of the program web service.
|
-P, --port <port> The port number of the program web service.
|
||||||
</xmp>
|
</xmp>
|
||||||
<br/>
|
<br/>
|
||||||
<span style="color: red">It should be noted that the command line will overwrite the configuration information of the configuration file.</span>
|
<span style="color: red">It should be noticed that the command line parsers will overwrite the configuration from the config file.</span>
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include "httplib.h"
|
#include "httplib.h"
|
||||||
|
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
using namespace httplib;
|
using namespace httplib;
|
||||||
|
Before (image error) Size: 3.8 KiB After (image error) Size: 3.8 KiB |
@ -1,6 +1,6 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>images/deepin-launcher.svg</file>
|
<file>images/spark-webapp-runtime.svg</file>
|
||||||
<file>images/Logo-Spark.png</file>
|
<file>images/Logo-Spark.png</file>
|
||||||
<file>images/go-previous-24.svg</file>
|
<file>images/go-previous-24.svg</file>
|
||||||
<file>images/go-next-24.svg</file>
|
<file>images/go-next-24.svg</file>
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
|
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QCommandLineOption>
|
#include <QCommandLineOption>
|
||||||
|
|
||||||
#include <QTranslator>
|
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
@ -42,7 +39,7 @@ int main(int argc, char *argv[])
|
|||||||
//descrition
|
//descrition
|
||||||
dialog.setProductName(QString("<span>%1</span>").arg(DEFAULT_TITLE));
|
dialog.setProductName(QString("<span>%1</span>").arg(DEFAULT_TITLE));
|
||||||
//Icons
|
//Icons
|
||||||
dialog.setProductIcon(QIcon(":/images/deepin-launcher.svg"));
|
dialog.setProductIcon(QIcon(":/images/spark-webapp-runtime.svg"));
|
||||||
//Organization logo
|
//Organization logo
|
||||||
dialog.setCompanyLogo(QPixmap(":/images/Logo-Spark.png"));
|
dialog.setCompanyLogo(QPixmap(":/images/Logo-Spark.png"));
|
||||||
//about
|
//about
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include <DMainWindow>
|
#include <DMainWindow>
|
||||||
#include <DTitlebar>
|
#include <DTitlebar>
|
||||||
#include <QtWidgets/QVBoxLayout>
|
|
||||||
#include <DToolButton>
|
#include <DToolButton>
|
||||||
|
|
||||||
|
#include <QLayout>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
DWIDGET_USE_NAMESPACE
|
DWIDGET_USE_NAMESPACE
|
||||||
@ -18,13 +18,16 @@ MainWindow::MainWindow(QString szTitle,
|
|||||||
{
|
{
|
||||||
m_widget = new Widget(szUrl);
|
m_widget = new Widget(szUrl);
|
||||||
|
|
||||||
setFixedSize(nWidth, nHeight);
|
// setFixedSize(nWidth, nHeight);
|
||||||
|
// 应 shenmo 要求改成设置最小尺寸试试效果
|
||||||
|
setMinimumSize(nWidth, nHeight);
|
||||||
|
|
||||||
titlebar()->setTitle(szTitle);
|
titlebar()->setTitle(szTitle);
|
||||||
|
|
||||||
setCentralWidget(m_widget);
|
setCentralWidget(m_widget);
|
||||||
centralWidget()->layout()->setContentsMargins(0, 0, 0, 0);
|
centralWidget()->layout()->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
titlebar()->setIcon(QIcon(":/images/deepin-launcher.svg"));
|
titlebar()->setIcon(QIcon(":/images/spark-webapp-runtime.svg"));
|
||||||
|
|
||||||
DToolButton *btnBack = new DToolButton(titlebar());
|
DToolButton *btnBack = new DToolButton(titlebar());
|
||||||
btnBack->setIcon(QIcon(":/images/go-previous-24.svg"));
|
btnBack->setIcon(QIcon(":/images/go-previous-24.svg"));
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <DMainWindow>
|
#include <DMainWindow>
|
||||||
#include "widget.h"
|
|
||||||
|
|
||||||
|
#include "widget.h"
|
||||||
#include "globaldefine.h"
|
#include "globaldefine.h"
|
||||||
|
|
||||||
DWIDGET_USE_NAMESPACE
|
DWIDGET_USE_NAMESPACE
|
||||||
@ -17,7 +17,7 @@ public:
|
|||||||
QString szUrl = DEFAULT_URL,
|
QString szUrl = DEFAULT_URL,
|
||||||
int nWidth = DEFAULT_WIDTH,
|
int nWidth = DEFAULT_WIDTH,
|
||||||
int nHeight = DEFAULT_HEIGHT,
|
int nHeight = DEFAULT_HEIGHT,
|
||||||
QWidget *parent = 0);
|
QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
void setIcon(QString);
|
void setIcon(QString);
|
||||||
|
@ -27,6 +27,6 @@ FORMS += widget.ui
|
|||||||
RESOURCES += imgs.qrc
|
RESOURCES += imgs.qrc
|
||||||
|
|
||||||
TRANSLATIONS += \
|
TRANSLATIONS += \
|
||||||
translations/SparkWebAppRuntime_zh_CN.ts
|
translations/spark-webapp-runtime_zh_CN.ts
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
BIN
spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.qm
Normal file
BIN
spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.qm
Normal file
Binary file not shown.
@ -4,84 +4,84 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>QObject</name>
|
<name>QObject</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="53"/>
|
<location filename="../main.cpp" line="50"/>
|
||||||
<source>Presented By Spark developers # HadesStudio</source>
|
<source>Presented By Spark developers # HadesStudio</source>
|
||||||
<translation>由 星火开发者联盟 @ 花心胡萝卜 提供</translation>
|
<translation>由 星火开发者联盟 @ 花心胡萝卜 提供</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="38"/>
|
<location filename="../main.cpp" line="35"/>
|
||||||
<source>This program is open source under GPLv3</source>
|
<source>This program is open source under GPLv3</source>
|
||||||
<translation>本程序按GPL第三版开源</translation>
|
<translation>本程序按GPL第三版开源</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="56"/>
|
<location filename="../main.cpp" line="53"/>
|
||||||
<source>Version</source>
|
<source>Version</source>
|
||||||
<translation>版本</translation>
|
<translation>版本</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="64"/>
|
<location filename="../main.cpp" line="61"/>
|
||||||
<source>Description: %1</source>
|
<source>Description: %1</source>
|
||||||
<translation>描述: %1</translation>
|
<translation>描述: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="69"/>
|
<location filename="../main.cpp" line="66"/>
|
||||||
<source>Enable CommandLineParser. Default is false.</source>
|
<source>Enable CommandLineParser. Default is false.</source>
|
||||||
<translation>启用参数解析方式. 默认顺序解析方式.</translation>
|
<translation>启用参数解析方式. 默认顺序解析方式.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="73"/>
|
<location filename="../main.cpp" line="70"/>
|
||||||
<source>The Title of Application. Default is %1.</source>
|
<source>The Title of Application. Default is %1.</source>
|
||||||
<translation>设置程序的运行标题. 默认是 %1.</translation>
|
<translation>设置程序的运行标题. 默认是 %1.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="79"/>
|
<location filename="../main.cpp" line="76"/>
|
||||||
<source>The target URL. Default is Blank.</source>
|
<source>The target URL. Default is Blank.</source>
|
||||||
<translation>设置要打开的目标URL. 默认是空.</translation>
|
<translation>设置要打开的目标URL. 默认是空.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="85"/>
|
<location filename="../main.cpp" line="82"/>
|
||||||
<source>The Width of Application. Default is %1.</source>
|
<source>The Width of Application. Default is %1.</source>
|
||||||
<translation>设置程序运行的宽度. 默认是 %1.</translation>
|
<translation>设置程序运行的宽度. 默认是 %1.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="91"/>
|
<location filename="../main.cpp" line="88"/>
|
||||||
<source>The Height of Application. Default is %1</source>
|
<source>The Height of Application. Default is %1</source>
|
||||||
<translation>设置程序运行的高度. 默认是 %1</translation>
|
<translation>设置程序运行的高度. 默认是 %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="97"/>
|
<location filename="../main.cpp" line="94"/>
|
||||||
<source>The ICON of Application.</source>
|
<source>The ICON of Application.</source>
|
||||||
<translation>设置程序运行的图标.</translation>
|
<translation>设置程序运行的图标.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="103"/>
|
<location filename="../main.cpp" line="100"/>
|
||||||
<source>The Description of Application.</source>
|
<source>The Description of Application.</source>
|
||||||
<translation>设置程序的描述信息.</translation>
|
<translation>设置程序的描述信息.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="109"/>
|
<location filename="../main.cpp" line="106"/>
|
||||||
<source>The Configuration file of Application.</source>
|
<source>The Configuration file of Application.</source>
|
||||||
<translation>设置程序运行的配置文件.</translation>
|
<translation>设置程序运行的配置文件.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="115"/>
|
<location filename="../main.cpp" line="112"/>
|
||||||
<source>The root path of the program web service.</source>
|
<source>The root path of the program web service.</source>
|
||||||
<translation>设置内置WebServer的根路径.</translation>
|
<translation>设置内置WebServer的根路径.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="122"/>
|
<location filename="../main.cpp" line="119"/>
|
||||||
<source>The port number of the program web service.</source>
|
<source>The port number of the program web service.</source>
|
||||||
<translation>设置内置WebServer的监听端口号.</translation>
|
<translation>设置内置WebServer的监听端口号.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="129"/>
|
<location filename="../main.cpp" line="126"/>
|
||||||
<source>The ssl port number of the program web service.</source>
|
<source>The ssl port number of the program web service.</source>
|
||||||
<translation>设置内置WebServer的SSL协议的监听端口号.</translation>
|
<translation>设置内置WebServer的SSL协议的监听端口号.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../globaldefine.h" line="7"/>
|
<location filename="../globaldefine.h" line="7"/>
|
||||||
<source>SparkWebAppRuntime</source>
|
<source>SparkWebAppRuntime</source>
|
||||||
<translation>星火网页应用运行时</translation>
|
<translation>星火网页应用运行环境</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
@ -7,7 +7,7 @@
|
|||||||
class WebEnginePage : public QWebEnginePage
|
class WebEnginePage : public QWebEnginePage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WebEnginePage(QObject *parent = Q_NULLPTR);
|
WebEnginePage(QObject *parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWebEnginePage *createWindow(WebWindowType type) override;
|
QWebEnginePage *createWindow(WebWindowType type) override;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "ui_widget.h"
|
#include "ui_widget.h"
|
||||||
|
|
||||||
#include <QWebEngineView>
|
#include <QWebEngineView>
|
||||||
|
|
||||||
#include "webenginepage.h"
|
#include "webenginepage.h"
|
||||||
|
|
||||||
Widget::Widget(QString szUrl, QWidget *parent) :
|
Widget::Widget(QString szUrl, QWidget *parent) :
|
||||||
|
@ -15,7 +15,7 @@ class Widget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Widget(QString szUrl = QString(), QWidget *parent = 0);
|
explicit Widget(QString szUrl = QString(), QWidget *parent = nullptr);
|
||||||
~Widget();
|
~Widget();
|
||||||
|
|
||||||
void goBack();
|
void goBack();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user