mirror of
https://gitee.com/spark-store-project/spark-web-app-runtime.git
synced 2025-12-15 03:22:05 +08:00
feat: 限制同标题进程单例运行;网页链接调用浏览器打开
使用 DApplication::setSingleInstance,使用 标题_uid 创建进程锁,单例运行时新进程自动退出,并拉起原有进程主窗口显示;重写 QWebEnginePage,createWindow 时若链接与原来不同,则调用浏览器打开 Log: 支持单例运行;支持浏览器打开外部链接;修复访问深度论坛默认语言错误问题
This commit is contained in:
@@ -30,11 +30,11 @@ public:
|
||||
bool nFullScreen = false,
|
||||
bool nFixSize = false,
|
||||
bool nHideButtons = false,
|
||||
QDialog *dialog = nullptr,
|
||||
QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
void setIcon(QString szIconPath);
|
||||
void setDescription(const QString &desc);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
@@ -56,7 +56,10 @@ private:
|
||||
QString saveAs(QString fileName);
|
||||
|
||||
signals:
|
||||
void sigQuit();
|
||||
void sigClose();
|
||||
|
||||
public slots:
|
||||
void slotNewInstanceStarted();
|
||||
|
||||
private slots:
|
||||
void on_trayIconActivated(QSystemTrayIcon::ActivationReason reason);
|
||||
@@ -74,7 +77,6 @@ private:
|
||||
bool m_isTrayEnabled, m_isFullScreen, m_isFixedSize, m_isHideButton;
|
||||
|
||||
Widget *m_widget;
|
||||
DAboutDialog *m_dialog;
|
||||
QSystemTrayIcon *m_tray;
|
||||
|
||||
DToolButton *btnBack;
|
||||
|
||||
Reference in New Issue
Block a user