From d7f0ab067581fdc67e7e9743cc807a44e358a555 Mon Sep 17 00:00:00 2001
From: iaom
Date: Wed, 1 Feb 2023 18:08:11 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=95=E4=BE=8B=E8=BF=90?=
=?UTF-8?q?=E8=A1=8C=E6=9C=BA=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
3rd-parties/qtsingleapplication/INSTALL.TXT | 254 ++++++++++++++
3rd-parties/qtsingleapplication/README.TXT | 33 ++
.../qtsingleapplication/buildlib/buildlib.pro | 13 +
3rd-parties/qtsingleapplication/common.pri | 14 +
3rd-parties/qtsingleapplication/configure | 25 ++
3rd-parties/qtsingleapplication/configure.bat | 43 +++
.../qtsingleapplication/doc/html/classic.css | 284 ++++++++++++++++
.../doc/html/images/qt-logo.png | Bin 0 -> 4075 bytes
.../qtsingleapplication/doc/html/index.html | 48 +++
.../qtsingleapplication-example-loader.html | 175 ++++++++++
.../qtsingleapplication-example-trivial.html | 101 ++++++
.../doc/html/qtsingleapplication-members.html | 235 +++++++++++++
.../html/qtsingleapplication-obsolete.html | 31 ++
.../doc/html/qtsingleapplication.dcf | 40 +++
.../doc/html/qtsingleapplication.html | 162 +++++++++
.../doc/html/qtsingleapplication.index | 90 +++++
.../doc/html/qtsingleapplication.qhp | 53 +++
...singlecoreapplication-example-console.html | 118 +++++++
.../html/qtsinglecoreapplication-members.html | 126 +++++++
.../doc/html/qtsinglecoreapplication.html | 98 ++++++
.../doc/images/qt-logo.png | Bin 0 -> 4075 bytes
.../qtsingleapplication/doc/index.qdoc | 50 +++
.../examples/console/console.pro | 5 +
.../examples/console/console.qdoc | 28 ++
.../examples/console/main.cpp | 52 +++
.../qtsingleapplication/examples/examples.pro | 4 +
.../examples/loader/file1.qsl | 1 +
.../examples/loader/file2.qsl | 1 +
.../examples/loader/loader.pro | 6 +
.../examples/loader/loader.qdoc | 44 +++
.../examples/loader/main.cpp | 115 +++++++
.../examples/trivial/main.cpp | 41 +++
.../examples/trivial/trivial.pro | 5 +
.../examples/trivial/trivial.qdoc | 39 +++
.../qtsingleapplication.pro | 5 +
.../qtsingleapplication/src/CMakeLists.txt | 1 +
.../qtsingleapplication/src/QtLockedFile | 1 +
.../src/QtSingleApplication | 1 +
.../qtsingleapplication/src/qtlocalpeer.cpp | 177 ++++++++++
.../qtsingleapplication/src/qtlocalpeer.h | 40 +++
.../qtsingleapplication/src/qtlockedfile.cpp | 156 +++++++++
.../qtsingleapplication/src/qtlockedfile.h | 60 ++++
.../src/qtlockedfile_unix.cpp | 78 +++++
.../src/qtlockedfile_win.cpp | 174 ++++++++++
.../src/qtsingleapplication.cpp | 310 ++++++++++++++++++
.../src/qtsingleapplication.h | 68 ++++
.../src/qtsingleapplication.pri | 17 +
.../src/qtsinglecoreapplication.cpp | 112 +++++++
.../src/qtsinglecoreapplication.h | 34 ++
.../src/qtsinglecoreapplication.pri | 10 +
CMakeLists.txt | 5 +-
notification-server/CMakeLists.txt | 15 +-
notification-server/main.cpp | 25 +-
.../notification-server-application.cpp | 53 +++
.../notification-server-application.h | 23 ++
.../notification-server-config.h.in | 9 +
notification-server/notification.cpp | 8 +
notification-server/notification.h | 17 +
notification-server/server.cpp | 15 +-
59 files changed, 3726 insertions(+), 22 deletions(-)
create mode 100644 3rd-parties/qtsingleapplication/INSTALL.TXT
create mode 100644 3rd-parties/qtsingleapplication/README.TXT
create mode 100644 3rd-parties/qtsingleapplication/buildlib/buildlib.pro
create mode 100644 3rd-parties/qtsingleapplication/common.pri
create mode 100755 3rd-parties/qtsingleapplication/configure
create mode 100644 3rd-parties/qtsingleapplication/configure.bat
create mode 100644 3rd-parties/qtsingleapplication/doc/html/classic.css
create mode 100644 3rd-parties/qtsingleapplication/doc/html/images/qt-logo.png
create mode 100644 3rd-parties/qtsingleapplication/doc/html/index.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication-example-loader.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication-example-trivial.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication-members.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication-obsolete.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication.dcf
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication.index
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsingleapplication.qhp
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsinglecoreapplication-example-console.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsinglecoreapplication-members.html
create mode 100644 3rd-parties/qtsingleapplication/doc/html/qtsinglecoreapplication.html
create mode 100644 3rd-parties/qtsingleapplication/doc/images/qt-logo.png
create mode 100644 3rd-parties/qtsingleapplication/doc/index.qdoc
create mode 100644 3rd-parties/qtsingleapplication/examples/console/console.pro
create mode 100644 3rd-parties/qtsingleapplication/examples/console/console.qdoc
create mode 100644 3rd-parties/qtsingleapplication/examples/console/main.cpp
create mode 100644 3rd-parties/qtsingleapplication/examples/examples.pro
create mode 100644 3rd-parties/qtsingleapplication/examples/loader/file1.qsl
create mode 100644 3rd-parties/qtsingleapplication/examples/loader/file2.qsl
create mode 100644 3rd-parties/qtsingleapplication/examples/loader/loader.pro
create mode 100644 3rd-parties/qtsingleapplication/examples/loader/loader.qdoc
create mode 100644 3rd-parties/qtsingleapplication/examples/loader/main.cpp
create mode 100644 3rd-parties/qtsingleapplication/examples/trivial/main.cpp
create mode 100644 3rd-parties/qtsingleapplication/examples/trivial/trivial.pro
create mode 100644 3rd-parties/qtsingleapplication/examples/trivial/trivial.qdoc
create mode 100644 3rd-parties/qtsingleapplication/qtsingleapplication.pro
create mode 100644 3rd-parties/qtsingleapplication/src/CMakeLists.txt
create mode 100644 3rd-parties/qtsingleapplication/src/QtLockedFile
create mode 100644 3rd-parties/qtsingleapplication/src/QtSingleApplication
create mode 100644 3rd-parties/qtsingleapplication/src/qtlocalpeer.cpp
create mode 100644 3rd-parties/qtsingleapplication/src/qtlocalpeer.h
create mode 100644 3rd-parties/qtsingleapplication/src/qtlockedfile.cpp
create mode 100644 3rd-parties/qtsingleapplication/src/qtlockedfile.h
create mode 100644 3rd-parties/qtsingleapplication/src/qtlockedfile_unix.cpp
create mode 100644 3rd-parties/qtsingleapplication/src/qtlockedfile_win.cpp
create mode 100644 3rd-parties/qtsingleapplication/src/qtsingleapplication.cpp
create mode 100644 3rd-parties/qtsingleapplication/src/qtsingleapplication.h
create mode 100644 3rd-parties/qtsingleapplication/src/qtsingleapplication.pri
create mode 100644 3rd-parties/qtsingleapplication/src/qtsinglecoreapplication.cpp
create mode 100644 3rd-parties/qtsingleapplication/src/qtsinglecoreapplication.h
create mode 100644 3rd-parties/qtsingleapplication/src/qtsinglecoreapplication.pri
create mode 100644 notification-server/notification-server-application.cpp
create mode 100644 notification-server/notification-server-application.h
create mode 100644 notification-server/notification-server-config.h.in
create mode 100644 notification-server/notification.cpp
create mode 100644 notification-server/notification.h
diff --git a/3rd-parties/qtsingleapplication/INSTALL.TXT b/3rd-parties/qtsingleapplication/INSTALL.TXT
new file mode 100644
index 0000000..bbb74a9
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/INSTALL.TXT
@@ -0,0 +1,254 @@
+INSTALLATION INSTRUCTIONS
+
+These instructions refer to the package you are installing as
+some-package.tar.gz or some-package.zip. The .zip file is intended for use
+on Windows.
+
+The directory you choose for the installation will be referred to as
+your-install-dir.
+
+Note to Qt Visual Studio Integration users: In the instructions below,
+instead of building from command line with nmake, you can use the menu
+command 'Qt->Open Solution from .pro file' on the .pro files in the
+example and plugin directories, and then build from within Visual
+Studio.
+
+Unpacking and installation
+--------------------------
+
+1. Unpacking the archive (if you have not done so already).
+
+ On Unix and Mac OS X (in a terminal window):
+
+ cd your-install-dir
+ gunzip some-package.tar.gz
+ tar xvf some-package.tar
+
+ This creates the subdirectory some-package containing the files.
+
+ On Windows:
+
+ Unpack the .zip archive by right-clicking it in explorer and
+ choosing "Extract All...". If your version of Windows does not
+ have zip support, you can use the infozip tools available
+ from www.info-zip.org.
+
+ If you are using the infozip tools (in a command prompt window):
+ cd your-install-dir
+ unzip some-package.zip
+
+2. Configuring the package.
+
+ The configure script is called "configure" on unix/mac and
+ "configure.bat" on Windows. It should be run from a command line
+ after cd'ing to the package directory.
+
+ You can choose whether you want to use the component by including
+ its source code directly into your project, or build the component
+ as a dynamic shared library (DLL) that is loaded into the
+ application at run-time. The latter may be preferable for
+ technical or licensing (LGPL) reasons. If you want to build a DLL,
+ run the configure script with the argument "-library". Also see
+ the note about usage below.
+
+ (Components that are Qt plugins, e.g. styles and image formats,
+ are by default built as a plugin DLL.)
+
+ The configure script will prompt you in some cases for further
+ information. Answer these questions and carefully read the license text
+ before accepting the license conditions. The package cannot be used if
+ you do not accept the license conditions.
+
+3. Building the component and examples (when required).
+
+ If a DLL is to be built, or if you would like to build the
+ examples, next give the commands
+
+ qmake
+ make [or nmake if your are using Microsoft Visual C++]
+
+ The example program(s) can be found in the directory called
+ "examples" or "example".
+
+ Components that are Qt plugins, e.g. styles and image formats, are
+ ready to be used as soon as they are built, so the rest of this
+ installation instruction can be skipped.
+
+4. Building the Qt Designer plugin (optional).
+
+ Some of the widget components are provided with plugins for Qt
+ Designer. To build and install the plugin, cd into the
+ some-package/plugin directory and give the commands
+
+ qmake
+ make [or nmake if your are using Microsoft Visual C++]
+
+ Restart Qt Designer to make it load the new widget plugin.
+
+ Note: If you are using the built-in Qt Designer from the Qt Visual
+ Studio Integration, you will need to manually copy the plugin DLL
+ file, i.e. copy
+ %QTDIR%\plugins\designer\some-component.dll
+ to the Qt Visual Studio Integration plugin path, typically:
+ C:\Program Files\Trolltech\Qt VS Integration\plugins
+
+ Note: If you for some reason are using a Qt Designer that is built
+ in debug mode, you will need to build the plugin in debug mode
+ also. Edit the file plugin.pro in the plugin directory, changing
+ 'release' to 'debug' in the CONFIG line, before running qmake.
+
+
+
+Solutions components are intended to be used directly from the package
+directory during development, so there is no 'make install' procedure.
+
+
+Using a component in your project
+---------------------------------
+
+To use this component in your project, add the following line to the
+project's .pro file (or do the equivalent in your IDE):
+
+ include(your-install-dir/some-package/src/some-package.pri)
+
+This adds the package's sources and headers to the SOURCES and HEADERS
+project variables respectively (or, if the component has been
+configured as a DLL, it adds that library to the LIBS variable), and
+updates INCLUDEPATH to contain the package's src
+directory. Additionally, the .pri file may include some dependencies
+needed by the package.
+
+To include a header file from the package in your sources, you can now
+simply use:
+
+ #include
+
+or alternatively, in pre-Qt 4 style:
+
+ #include
+
+Refer to the documentation to see the classes and headers this
+components provides.
+
+
+
+Install documentation (optional)
+--------------------------------
+
+The HTML documentation for the package's classes is located in the
+your-install-dir/some-package/doc/html/index.html. You can open this
+file and read the documentation with any web browser.
+
+To install the documentation into Qt Assistant (for Qt version 4.4 and
+later):
+
+1. In Assistant, open the Edit->Preferences dialog and choose the
+ Documentation tab. Click the Add... button and select the file
+ your-install-dir/some-package/doc/html/some-package.qch
+
+For Qt versions prior to 4.4, do instead the following:
+
+1. The directory your-install-dir/some-package/doc/html contains a
+ file called some-package.dcf. Execute the following commands in a
+ shell, command prompt or terminal window:
+
+ cd your-install-dir/some-package/doc/html/
+ assistant -addContentFile some-package.dcf
+
+The next time you start Qt Assistant, you can access the package's
+documentation.
+
+
+Removing the documentation from assistant
+-----------------------------------------
+
+If you have installed the documentation into Qt Assistant, and want to uninstall it, do as follows, for Qt version 4.4 and later:
+
+1. In Assistant, open the Edit->Preferences dialog and choose the
+ Documentation tab. In the list of Registered Documentation, select
+ the item com.nokia.qtsolutions.some-package_version, and click
+ the Remove button.
+
+For Qt versions prior to 4.4, do instead the following:
+
+1. The directory your-install-dir/some-package/doc/html contains a
+ file called some-package.dcf. Execute the following commands in a
+ shell, command prompt or terminal window:
+
+ cd your-install-dir/some-package/doc/html/
+ assistant -removeContentFile some-package.dcf
+
+
+
+Using the component as a DLL
+----------------------------
+
+1. Normal components
+
+ The shared library (DLL) is built and placed in the
+ some-package/lib directory. It is intended to be used directly
+ from there during development. When appropriate, both debug and
+ release versions are built, since the run-time linker will in some
+ cases refuse to load a debug-built DLL into a release-built
+ application or vice versa.
+
+ The following steps are taken by default to help the dynamic
+ linker to locate the DLL at run-time (during development):
+
+ Unix: The some-package.pri file will add linker instructions to
+ add the some-package/lib directory to the rpath of the
+ executable. (When distributing, or if your system does not support
+ rpath, you can copy the shared library to another place that is
+ searched by the dynamic linker, e.g. the "lib" directory of your
+ Qt installation.)
+
+ Mac: The full path to the library is hardcoded into the library
+ itself, from where it is copied into the executable at link time,
+ and ready by the dynamic linker at run-time. (When distributing,
+ you will want to edit these hardcoded paths in the same way as for
+ the Qt DLLs. Refer to the document "Deploying an Application on
+ Mac OS X" in the Qt Reference Documentation.)
+
+ Windows: the .dll file(s) are copied into the "bin" directory of
+ your Qt installation. The Qt installation will already have set up
+ that directory to be searched by the dynamic linker.
+
+
+2. Plugins
+
+ For Qt Solutions plugins (e.g. image formats), both debug and
+ release versions of the plugin are built by default when
+ appropriate, since in some cases the release Qt library will not
+ load a debug plugin, and vice versa. The plugins are automatically
+ copied into the plugins directory of your Qt installation when
+ built, so no further setup is required.
+
+ Plugins may also be built statically, i.e. as a library that will be
+ linked into your application executable, and so will not need to
+ be redistributed as a separate plugin DLL to end users. Static
+ building is required if Qt itself is built statically. To do it,
+ just add "static" to the CONFIG variable in the plugin/plugin.pro
+ file before building. Refer to the "Static Plugins" section in the
+ chapter "How to Create Qt Plugins" for explanation of how to use a
+ static plugin in your application. The source code of the example
+ program(s) will also typically contain the relevant instructions
+ as comments.
+
+
+
+Uninstalling
+------------
+
+ The following command will remove any fils that have been
+ automatically placed outside the package directory itself during
+ installation and building
+
+ make distclean [or nmake if your are using Microsoft Visual C++]
+
+ If Qt Assistant documentation or Qt Designer plugins have been
+ installed, they can be uninstalled manually, ref. above.
+
+
+Enjoy! :)
+
+- The Qt Solutions Team.
diff --git a/3rd-parties/qtsingleapplication/README.TXT b/3rd-parties/qtsingleapplication/README.TXT
new file mode 100644
index 0000000..06abb09
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/README.TXT
@@ -0,0 +1,33 @@
+Qt Solutions Component: Single Application
+
+The QtSingleApplication component provides support for
+applications that can be only started once per user.
+
+
+
+Version history:
+
+2.0: - Version 1.3 ported to Qt 4.
+
+2.1: - Fix compilation problem on Mac.
+
+2.2: - Really fix the Mac compilation problem.
+ - Mac: fix crash due to wrong object releasing.
+ - Mac: Fix memory leak.
+
+2.3: - Windows: Force creation of internal widget to make it work
+ with Qt 4.2.
+
+2.4: - Fix the system for automatic window raising on message
+ reception. NOTE: minor API change.
+
+2.5: - Mac: Fix isRunning() to work and report correctly.
+
+2.6: - - initialize() is now obsolete, no longer necessary to call
+ it
+ - - Fixed race condition where multiple instances migth be started
+ - - QtSingleCoreApplication variant provided for non-GUI (console)
+ usage
+ - Complete reimplementation. Visible changes:
+ - LGPL release.
+
diff --git a/3rd-parties/qtsingleapplication/buildlib/buildlib.pro b/3rd-parties/qtsingleapplication/buildlib/buildlib.pro
new file mode 100644
index 0000000..37dddcd
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/buildlib/buildlib.pro
@@ -0,0 +1,13 @@
+TEMPLATE=lib
+CONFIG += qt dll qtsingleapplication-buildlib
+mac:CONFIG += absolute_library_soname
+win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all
+include(../src/qtsingleapplication.pri)
+TARGET = $$QTSINGLEAPPLICATION_LIBNAME
+DESTDIR = $$QTSINGLEAPPLICATION_LIBDIR
+win32 {
+ DLLDESTDIR = $$[QT_INSTALL_BINS]
+ QMAKE_DISTCLEAN += $$[QT_INSTALL_BINS]\\$${QTSINGLEAPPLICATION_LIBNAME}.dll
+}
+target.path = $$DESTDIR
+INSTALLS += target
diff --git a/3rd-parties/qtsingleapplication/common.pri b/3rd-parties/qtsingleapplication/common.pri
new file mode 100644
index 0000000..924c57c
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/common.pri
@@ -0,0 +1,14 @@
+exists(config.pri):infile(config.pri, SOLUTIONS_LIBRARY, yes): CONFIG += qtsingleapplication-uselib
+
+TEMPLATE += fakelib
+greaterThan(QT_MAJOR_VERSION, 5)|\
+ if(equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 4))|\
+ if(equals(QT_MAJOR_VERSION, 5):equals(QT_MINOR_VERSION, 4):greaterThan(QT_PATCH_VERSION, 1)) {
+ QTSINGLEAPPLICATION_LIBNAME = $$qt5LibraryTarget(QtSolutions_SingleApplication-head)
+} else {
+ QTSINGLEAPPLICATION_LIBNAME = $$qtLibraryTarget(QtSolutions_SingleApplication-head)
+}
+TEMPLATE -= fakelib
+
+QTSINGLEAPPLICATION_LIBDIR = $$PWD/lib
+unix:qtsingleapplication-uselib:!qtsingleapplication-buildlib:QMAKE_RPATHDIR += $$QTSINGLEAPPLICATION_LIBDIR
diff --git a/3rd-parties/qtsingleapplication/configure b/3rd-parties/qtsingleapplication/configure
new file mode 100755
index 0000000..3c4edff
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/configure
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+if [ "x$1" != "x" -a "x$1" != "x-library" ]; then
+ echo "Usage: $0 [-library]"
+ echo
+ echo "-library: Build the component as a dynamic library (DLL). Default is to"
+ echo " include the component source code directly in the application."
+ echo
+ exit 0
+fi
+
+rm -f config.pri
+if [ "x$1" = "x-library" ]; then
+ echo "Configuring to build this component as a dynamic library."
+ echo "SOLUTIONS_LIBRARY = yes" > config.pri
+fi
+
+echo
+echo "This component is now configured."
+echo
+echo "To build the component library (if requested) and example(s),"
+echo "run qmake and your make command."
+echo
+echo "To remove or reconfigure, run make distclean."
+echo
diff --git a/3rd-parties/qtsingleapplication/configure.bat b/3rd-parties/qtsingleapplication/configure.bat
new file mode 100644
index 0000000..2927549
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/configure.bat
@@ -0,0 +1,43 @@
+:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+:: SPDX-License-Identifier: BSD-3-Clause
+
+@echo off
+
+rem
+rem "Main"
+rem
+
+if not "%1"=="" (
+ if not "%1"=="-library" (
+ call :PrintUsage
+ goto EOF
+ )
+)
+
+if exist config.pri. del config.pri
+if "%1"=="-library" (
+ echo Configuring to build this component as a dynamic library.
+ echo SOLUTIONS_LIBRARY = yes > config.pri
+)
+
+echo .
+echo This component is now configured.
+echo .
+echo To build the component library (if requested) and example(s),
+echo run qmake and your make or nmake command.
+echo .
+echo To remove or reconfigure, run make (nmake) distclean.
+echo .
+goto EOF
+
+:PrintUsage
+echo Usage: configure.bat [-library]
+echo .
+echo -library: Build the component as a dynamic library (DLL). Default is to
+echo include the component source directly in the application.
+echo A DLL may be preferable for technical or licensing (LGPL) reasons.
+echo .
+goto EOF
+
+
+:EOF
diff --git a/3rd-parties/qtsingleapplication/doc/html/classic.css b/3rd-parties/qtsingleapplication/doc/html/classic.css
new file mode 100644
index 0000000..b8cae8e
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/doc/html/classic.css
@@ -0,0 +1,284 @@
+BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
+ font-family: Arial, Geneva, Helvetica, sans-serif;
+}
+H1 {
+ text-align: center;
+ font-size: 160%;
+}
+H2 {
+ font-size: 120%;
+}
+H3 {
+ font-size: 100%;
+}
+
+h3.fn,span.fn
+{
+ background-color: #eee;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #ddd;
+ font-weight: bold;
+ padding: 6px 0px 6px 10px;
+ margin: 42px 0px 0px 0px;
+}
+
+hr {
+ border: 0;
+ color: #a0a0a0;
+ background-color: #ccc;
+ height: 1px;
+ width: 100%;
+ text-align: left;
+ margin: 34px 0px 34px 0px;
+}
+
+table.valuelist {
+ border-width: 1px 1px 1px 1px;
+ border-style: solid;
+ border-color: #dddddd;
+ border-collapse: collapse;
+ background-color: #f0f0f0;
+}
+
+table.indextable {
+ border-width: 1px 1px 1px 1px;
+ border-style: solid;
+ border-collapse: collapse;
+ background-color: #f0f0f0;
+ border-color:#555;
+ font-size: 100%;
+}
+
+table td.largeindex {
+ border-width: 1px 1px 1px 1px;
+ border-collapse: collapse;
+ background-color: #f0f0f0;
+ border-color:#555;
+ font-size: 120%;
+}
+
+table.valuelist th {
+ border-width: 1px 1px 1px 2px;
+ padding: 4px;
+ border-style: solid;
+ border-color: #666;
+ color:white;
+ background-color:#666;
+}
+
+th.titleheader {
+ border-width: 1px 0px 1px 0px;
+ padding: 2px;
+ border-style: solid;
+ border-color: #666;
+ color:white;
+ background-color:#555;
+ background-image:url('images/gradient.png')};
+ background-repeat: repeat-x;
+ font-size: 100%;
+}
+
+
+th.largeheader {
+ border-width: 1px 0px 1px 0px;
+ padding: 4px;
+ border-style: solid;
+ border-color: #444;
+ color:white;
+ background-color:#555555;
+ font-size: 120%;
+}
+
+p {
+
+ margin-left: 4px;
+ margin-top: 8px;
+ margin-bottom: 8px;
+}
+
+a:link
+{
+ color: #0046ad;
+ text-decoration: none
+}
+
+a:visited
+{
+ color: #672967;
+ text-decoration: none
+}
+
+a.obsolete
+{
+ color: #661100;
+ text-decoration: none
+}
+
+a.compat
+{
+ color: #661100;
+ text-decoration: none
+}
+
+a.obsolete:visited
+{
+ color: #995500;
+ text-decoration: none
+}
+
+a.compat:visited
+{
+ color: #995500;
+ text-decoration: none
+}
+
+body
+{
+ background: #ffffff;
+ color: black
+}
+
+table.generic, table.annotated
+{
+ border-width: 1px;
+ border-color:#bbb;
+ border-style:solid;
+ border-collapse:collapse;
+}
+
+table td.memItemLeft {
+ width: 180px;
+ padding: 2px 0px 0px 8px;
+ margin: 4px;
+ border-width: 1px;
+ border-color: #E0E0E0;
+ border-style: none;
+ font-size: 100%;
+ white-space: nowrap
+}
+
+table td.memItemRight {
+ padding: 2px 8px 0px 8px;
+ margin: 4px;
+ border-width: 1px;
+ border-color: #E0E0E0;
+ border-style: none;
+ font-size: 100%;
+}
+
+table tr.odd {
+ background: #f0f0f0;
+ color: black;
+}
+
+table tr.even {
+ background: #e4e4e4;
+ color: black;
+}
+
+table.annotated th {
+ padding: 3px;
+ text-align: left
+}
+
+table.annotated td {
+ padding: 3px;
+}
+
+table tr pre
+{
+ padding-top: 0px;
+ padding-bottom: 0px;
+ padding-left: 0px;
+ padding-right: 0px;
+ border: none;
+ background: none
+}
+
+tr.qt-style
+{
+ background: #96E066;
+ color: black
+}
+
+body pre
+{
+ padding: 0.2em;
+ border: #e7e7e7 1px solid;
+ background: #f1f1f1;
+ color: black
+}
+
+table tr.qt-code pre
+{
+ padding: 0.2em;
+ border: #e7e7e7 1px solid;
+ background: #f1f1f1;
+ color: black
+}
+
+span.preprocessor, span.preprocessor a
+{
+ color: darkblue;
+}
+
+span.comment
+{
+ color: darkred;
+ font-style: italic
+}
+
+span.string,span.char
+{
+ color: darkgreen;
+}
+
+.title
+{
+ text-align: center
+}
+
+.subtitle
+{
+ font-size: 0.8em
+}
+
+.small-subtitle
+{
+ font-size: 0.65em
+}
+
+.qmlitem {
+ padding: 0;
+}
+
+.qmlname {
+ white-space: nowrap;
+}
+
+.qmltype {
+ text-align: center;
+ font-size: 160%;
+}
+
+.qmlproto {
+ background-color: #eee;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #ddd;
+ font-weight: bold;
+ padding: 6px 10px 6px 10px;
+ margin: 42px 0px 0px 0px;
+}
+
+.qmlreadonly {
+ float: right;
+ color: red
+}
+
+.qmldoc {
+}
+
+*.qmlitem p {
+}
diff --git a/3rd-parties/qtsingleapplication/doc/html/images/qt-logo.png b/3rd-parties/qtsingleapplication/doc/html/images/qt-logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..794162f5af58e7b38beebf472842fc9703ede19b
GIT binary patch
literal 4075
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
literal 0
HcmV?d00001
diff --git a/3rd-parties/qtsingleapplication/doc/html/index.html b/3rd-parties/qtsingleapplication/doc/html/index.html
new file mode 100644
index 0000000..af9dab1
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/doc/html/index.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+ Single Application
+
+
+
+
The QtSingleApplication component provides support for applications that can be only started once per user.
+
For some applications it is useful or even critical that they are started only once by any user. Future attempts to start the application should activate any already running instance, and possibly perform requested actions, e.g. loading a file, in that instance.
+
The QtSingleApplication class provides an interface to detect a running instance, and to send command strings to that instance. For console (non-GUI) applications, the QtSingleCoreApplication variant is provided, which avoids dependency on QtGui.
The application in this example loads or prints the documents passed as commandline parameters to further instances of this application.
+
/****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the Qt Solutions component.
+ **
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ ** * Redistributions of source code must retain the above copyright
+ ** notice, this list of conditions and the following disclaimer.
+ ** * Redistributions in binary form must reproduce the above copyright
+ ** notice, this list of conditions and the following disclaimer in
+ ** the documentation and/or other materials provided with the
+ ** distribution.
+ ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ ** the names of its contributors may be used to endorse or promote
+ ** products derived from this software without specific prior written
+ ** permission.
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ****************************************************************************/
+
+ #include <qtsingleapplication.h>
+ #include <QtCore/QFile>
+ #include <QtGui/QMainWindow>
+ #include <QtGui/QPrinter>
+ #include <QtGui/QPainter>
+ #include <QtGui/QTextEdit>
+ #include <QtGui/QMdiArea>
+ #include <QtCore/QTextStream>
+
+ class MainWindow : public QMainWindow
+ {
+ Q_OBJECT
+ public:
+ MainWindow();
+
+ public slots:
+ void handleMessage(const QString& message);
+
+ signals:
+ void needToShow();
+
+ private:
+ QMdiArea *workspace;
+ };
+
The user interface in this application is a QMainWindow subclass with a QMdiArea as the central widget. It implements a slot handleMessage() that will be connected to the messageReceived() signal of the QtSingleApplication class.
The handleMessage() slot interprets the message passed in as a filename that can be prepended with /print to indicate that the file should just be printed rather than loaded.
#include "main.moc"
+
+ int main(int argc, char **argv)
+ {
+ QtSingleApplication instance("File loader QtSingleApplication example", argc, argv);
+ QString message;
+ for (int a = 1; a < argc; ++a) {
+ message += argv[a];
+ if (a < argc-1)
+ message += " ";
+ }
+
+ if (instance.sendMessage(message))
+ return 0;
+
The main entry point function creates a QtSingleApplication object, and creates a message to send to a running instance of the application. If the message was sent successfully the process exits immediately.
If the message could not be sent the application starts up. Note that false is passed to the call to setActivationWindow() to prevent automatic activation for every message received, e.g. when the application should just print a file. Instead, the message handling function determines whether activation is requested, and signals that by emitting the needToShow() signal. This is then simply connected directly to QtSingleApplication's activateWindow() slot.
The application in this example has a log-view that displays messages sent by further instances of the same application.
+
The example demonstrates the use of the QtSingleApplication class to detect and communicate with a running instance of the application using the sendMessage() API. The messageReceived() signal is used to display received messages in a QTextEdit log.
+
/****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the Qt Solutions component.
+ **
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ ** * Redistributions of source code must retain the above copyright
+ ** notice, this list of conditions and the following disclaimer.
+ ** * Redistributions in binary form must reproduce the above copyright
+ ** notice, this list of conditions and the following disclaimer in
+ ** the documentation and/or other materials provided with the
+ ** distribution.
+ ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ ** the names of its contributors may be used to endorse or promote
+ ** products derived from this software without specific prior written
+ ** permission.
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ****************************************************************************/
+
+ #include <qtsingleapplication.h>
+ #include <QtGui/QTextEdit>
+
+ class TextEdit : public QTextEdit
+ {
+ Q_OBJECT
+ public:
+ TextEdit(QWidget *parent = 0)
+ : QTextEdit(parent)
+ {}
+ public slots:
+ void append(const QString &str)
+ {
+ QTextEdit::append(str);
+ }
+ };
+
+ #include "main.moc"
+
+ int main(int argc, char **argv)
+ {
+ QtSingleApplication instance(argc, argv);
+
The example has only the main entry point function. A QtSingleApplication object is created immediately.
+
if (instance.sendMessage("Wake up!"))
+ return 0;
+
If another instance of this application is already running, sendMessage() will succeed, and this instance just exits immediately.
The logview object is also set as the application's activation window. Every time a message is received, the window will be raised and activated automatically.
+
The messageReceived() signal is also connected to the QTextEdit's append() slot. Every message received from further instances of this application will be displayed in the log.
+
diff --git a/3rd-parties/qtsingleapplication/doc/html/qtsingleapplication-members.html b/3rd-parties/qtsingleapplication/doc/html/qtsingleapplication-members.html
new file mode 100644
index 0000000..c995ce3
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/doc/html/qtsingleapplication-members.html
@@ -0,0 +1,235 @@
+
+
+
+
+
+ List of All Members for QtSingleApplication
+
+
+
+
The QtSingleApplication class provides an API to detect and communicate with running instances of an application.
+
This class allows you to create applications where only one instance should be running at a time. I.e., if the user tries to launch another instance, the already running instance will be activated instead. Another usecase is a client-server system, where the first started instance will assume the role of server, and the later instances will act as clients of that server.
+
By default, the full path of the executable file is used to determine whether two processes are instances of the same application. You can also provide an explicit identifier string that will be compared instead.
+
The application should create the QtSingleApplication object early in the startup phase, and call isRunning() to find out if another instance of this application is already running. If isRunning() returns false, it means that no other instance is running, and this instance has assumed the role as the running instance. In this case, the application should continue with the initialization of the application user interface before entering the event loop with exec(), as normal.
+
The messageReceived() signal will be emitted when the running application receives messages from another instance of the same application. When a message is received it might be helpful to the user to raise the application so that it becomes visible. To facilitate this, QtSingleApplication provides the setActivationWindow() function and the activateWindow() slot.
+
If isRunning() returns true, another instance is already running. It may be alerted to the fact that another instance has started by using the sendMessage() function. Also data such as startup parameters (e.g. the name of the file the user wanted this new instance to open) can be passed to the running instance with this function. Then, the application should terminate (or enter client mode).
+
If isRunning() returns true, but sendMessage() fails, that is an indication that the running instance is frozen.
+
Here's an example that shows how to convert an existing application to use QtSingleApplication. It is very simple and does not make use of all QtSingleApplication's functionality (see the examples for that).
Once this QtSingleApplication instance is destroyed (normally when the process exits or crashes), when the user next attempts to run the application this instance will not, of course, be encountered. The next instance to call isRunning() or sendMessage() will assume the role as the new running instance.
+
For console (non-GUI) applications, QtSingleCoreApplication may be used instead of this class, to avoid the dependency on the QtGui library.
Special constructor for X11, ref. the documentation of QApplication's corresponding constructor. The application identifier will be QCoreApplication::applicationFilePath(). dpy, argc, argv, visual, and cmap are passed on to the QApplication constructor.
Special constructor for X11, ref. the documentation of QApplication's corresponding constructor. The application identifier will be appId. dpy, argc, argv, visual, and cmap are passed on to the QApplication constructor.
De-minimizes, raises, and activates this application's activation window. This function does nothing if no activation window has been set.
+
This is a convenience function to show the user that this application instance has been activated when he has tried to start another instance.
+
This function should typically be called in response to the messageReceived() signal. By default, that will happen automatically, if an activation window has been set.
Tries to send the text message to the currently running instance. The QtSingleApplication object in the running instance will emit the messageReceived() signal when it receives the message.
+
This function returns true if the message has been sent to, and processed by, the current instance. If there is no instance currently running, or if the running instance fails to process the message within timeout milliseconds, this function return false.
Sets the activation window of this application to aw. The activation window is the widget that will be activated by activateWindow(). This is typically the application's main window.
+
If activateOnMessage is true (the default), the window will be activated automatically every time a message is received, just prior to the messageReceived() signal being emitted.
/****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the Qt Solutions component.
+ **
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ ** * Redistributions of source code must retain the above copyright
+ ** notice, this list of conditions and the following disclaimer.
+ ** * Redistributions in binary form must reproduce the above copyright
+ ** notice, this list of conditions and the following disclaimer in
+ ** the documentation and/or other materials provided with the
+ ** distribution.
+ ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+ ** the names of its contributors may be used to endorse or promote
+ ** products derived from this software without specific prior written
+ ** permission.
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ****************************************************************************/
+
+ #include "qtsinglecoreapplication.h"
+ #include <QtCore/QDebug>
+
+ void report(const QString& msg)
+ {
+ qDebug("[%i] %s", (int)QCoreApplication::applicationPid(), qPrintable(msg));
+ }
+
+ class MainClass : public QObject
+ {
+ Q_OBJECT
+ public:
+ MainClass()
+ : QObject()
+ {}
+
+ public slots:
+ void handleMessage(const QString& message)
+ {
+ report( "Message received: \"" + message + "\"");
+ }
+ };
+
+ int main(int argc, char **argv)
+ {
+ report("Starting up");
+
+ QtSingleCoreApplication app(argc, argv);
+
+ if (app.isRunning()) {
+ QString msg(QString("Hi master, I am %1.").arg(QCoreApplication::applicationPid()));
+ bool sentok = app.sendMessage(msg, 2000);
+ QString rep("Another instance is running, so I will exit.");
+ rep += sentok ? " Message sent ok." : " Message sending failed; the other instance may be frozen.";
+ report(rep);
+ return 0;
+ } else {
+ report("No other instance is running; so I will.");
+ MainClass mainObj;
+ QObject::connect(&app, SIGNAL(messageReceived(const QString&)),
+ &mainObj, SLOT(handleMessage(const QString&)));
+ return app.exec();
+ }
+ }
+
+ #include "main.moc"
+
diff --git a/3rd-parties/qtsingleapplication/doc/html/qtsinglecoreapplication-members.html b/3rd-parties/qtsingleapplication/doc/html/qtsinglecoreapplication-members.html
new file mode 100644
index 0000000..69fb858
--- /dev/null
+++ b/3rd-parties/qtsingleapplication/doc/html/qtsinglecoreapplication-members.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+ List of All Members for QtSingleCoreApplication
+
+
+
+
The API and usage is identical to QtSingleApplication, except that functions relating to the "activation window" are not present, for obvious reasons. Please refer to the QtSingleApplication documentation for explanation of the usage.
+
A QtSingleCoreApplication instance can communicate to a QtSingleApplication instance if they share the same application id. Hence, this class can be used to create a light-weight command-line tool that sends commands to a GUI application.
Tries to send the text message to the currently running instance. The QtSingleCoreApplication object in the running instance will emit the messageReceived() signal when it receives the message.
+
This function returns true if the message has been sent to, and processed by, the current instance. If there is no instance currently running, or if the running instance fails to process the message within timeout milliseconds, this function return false.