Skip to content

Commit 81778ce

Browse files
committed
version 1.1.0
1 parent 750b564 commit 81778ce

39 files changed

+394
-1261
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
archive/
22
build-peb-*/
3-
resources/perl
3+
resources/app/perl
44
src/tmp
55

66
.qmake.stash
@@ -12,7 +12,5 @@ peb
1212
peb.exe
1313
*.AppImage
1414

15-
test.db
16-
1715
backup
1816
upgit

CREDITS.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ wouldn't be created without his assistance.
3535
## Qt
3636

3737
https://github.com/richmoore/qt-examples/tree/master/sitespecificbrowser
38-
https://github.com/OtterBrowser/otter-browser/blob/master/src/modules/backends/web/qtwebengine/QtWebEnginePage.cpp
39-
https://github.com/OtterBrowser/otter-browser/blob/master/src/modules/backends/web/qtwebengine/QtWebEnginePage.h
4038
https://github.com/NixOS/nixpkgs/issues/16327
4139

4240
https://doc.qt.io/archives/qt-5.5/qwebpage.html#windowCloseRequested
@@ -50,14 +48,7 @@ https://doc.qt.io/qt-5/qhash.html
5048
https://doc.qt.io/qt-5/qhash-iterator.html
5149
https://doc.qt.io/qt-5/qdesktopwidget.html
5250
https://doc.qt.io/archives/qt-5.5/qwebview.html
53-
https://doc.qt.io/qt-5/qtwebenginewidgets-qtwebkitportingguide.html
54-
https://doc.qt.io/qt-5/qwebenginepage.html#runJavaScript
55-
https://doc.qt.io/qt-5/qwebenginepage.html#fullScreenRequested
56-
https://doc.qt.io/qt-5/qwebenginepage.html#windowCloseRequested
57-
https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-simplebrowser-example.html#adding-context-menu-items
58-
https://doc.qt.io/qt-5/qwebenginefullscreenrequest.html
5951
https://doc.qt.io/qt-5/qprocess.html#terminate
60-
https://doc.qt.io/qt-5.11/qtwebengine-debugging.html
6152

6253
https://wiki.qt.io/Qt_Coding_Style
6354
https://wiki.qt.io/Open_Web_Page_in_QWebView
@@ -124,6 +115,7 @@ https://stackoverflow.com/questions/15210532/use-utf8-gives-me-wide-character-in
124115

125116
https://perlmaven.com/manipulating-perl-arrays
126117
https://perlmaven.com/how-to-sort-a-hash-in-perl
118+
https://perlmaven.com/sqlite-in-memory
127119

128120
http://lauraliparulo.altervista.org/first-steps-in-sqlite-and-perl/
129121

@@ -190,10 +182,6 @@ https://medium.com/redbubble/running-a-docker-container-as-a-non-root-user-7d2e0
190182
https://docs.docker.com/engine/reference/builder/
191183
https://vsupalov.com/exit-docker-container/
192184

193-
## Mac
194-
195-
http://leonid.shevtsov.me/en/how-to-create-icns-icons-for-os-x
196-
197185
## Git and GitHub
198186

199187
https://github.com/github/linguist#overrides

README.md

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,28 @@ Perl Executing Browser (PEB) is an HTML5 user interface for [Perl 5](https://www
1010

1111
## Contents
1212

13-
* [Quick Start](#quick-start)
1413
* [Design Objectives](#design-objectives)
1514
* [Features](#features)
1615
* [Security](#security)
1716
* [Limitations](#limitations)
18-
* [REQUIREMENTS](./doc/REQUIREMENTS.md)
17+
* REQUIREMENTS
1918
* [Compile-Time Requirements](./doc/REQUIREMENTS.md#compile-time-requirements)
2019
* [Runtime Requirements](./doc/REQUIREMENTS.md#runtime-requirements)
21-
* [CONSTANTS](./doc/CONSTANTS.md)
22-
* [Files and Folders](./doc/CONSTANTS.md#files-and-folders)
23-
* [SETTINGS](./doc/SETTINGS.md)
20+
* [Files and Folders](./doc/FILES.md)
21+
* SETTINGS
2422
* [Application Filename](./doc/SETTINGS.md#application-filename)
2523
* [Global Settings API](./doc/SETTINGS.md#global-settings-api)
2624
* [Perl Scripts API](./doc/SETTINGS.md#perl-scripts-api)
2725
* [Files and Folders Dialogs API](./doc/SETTINGS.md#files-and-folders-dialogs-api)
28-
* [INTERACTIVE PERL SCRIPTS](./doc/INTERACTIVE.md)
26+
* INTERACTIVE PERL SCRIPTS
2927
* [Requirements for Interactive Perl Scripts](./doc/INTERACTIVE.md#requirements-for-interactive-perl-scripts)
3028
* [Examples of Interactive Perl Scripts](./doc/INTERACTIVE.md#examples-of-interactive-perl-scripts)
31-
* [APPIMAGE SUPPORT](./doc/APPIMAGE.md)
29+
* APPIMAGE SUPPORT
3230
* [PEB AppImager](./doc/APPIMAGE.md#peb-appimager)
3331
* [PEB AppImage Configuration Files](./doc/APPIMAGE.md#peb-appimage-configuration-files)
3432
* [PEB AppImage Builder Docker Container](./doc/APPIMAGE.md#peb-appimage-builder-docker-container)
3533
* [AppImageHub](./doc/APPIMAGE.md#appimagehub)
36-
* [Logging](./doc/LOGGING.md)
34+
* [Logging](#logging)
3735
* [History](#history)
3836
* [License](./LICENSE.md)
3937
* [Thanks and Credits](./CREDITS.md)
@@ -43,37 +41,6 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
4341
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL"
4442
in the documentation of this project are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
4543

46-
## Quick Start
47-
48-
* **1.** [Download PEB](https://github.com/ddmitov/perl-executing-browser/releases/latest).
49-
Linux 64-bit single-file [AppImage](https://appimage.org/) executable and
50-
Windows 32-bit zipped executable with its Qt libraries are available.
51-
52-
* **2.** [Select your Perl distribution](./doc/REQUIREMENTS.md#runtime-requirements).
53-
You can choose between a relocatable Perl distribution and the first Perl on PATH.
54-
Linux 64-bit [Relocatable Perl](https://github.com/skaji/relocatable-perl) or
55-
Windows 32-bit [Strawberry Perl](http://strawberryperl.com/) PortableZIP distributions are available by third-party vendors.
56-
57-
Place your relocatable Perl distribution in:
58-
``{PEB_executable_directory}/resources/perl``
59-
Your relocatable Perl interpreter must be:
60-
``{PEB_executable_directory}/resources/perl/bin/perl`` on a Linux or Mac macine or
61-
``{PEB_executable_directory}/resources/perl/bin/wperl.exe`` on a Windows macine.
62-
63-
* **3.** Write your Perl application reading user input on STDIN:
64-
65-
```perl
66-
my $input = <STDIN>;
67-
chomp $input;
68-
```
69-
70-
By default the working directory of all PEB Perl scripts is the directory of the PEB binary.
71-
72-
* **4.** Write a ``{PEB_executable_directory}/resources/app/index.html`` with
73-
a [settings JavaScript object](./doc/SETTINGS.md#perl-scripts-api) for every Perl script you want to use.
74-
Start local Perl scripts by [clicking a link or submitting a form to a special URL](./doc/SETTINGS.md#perl-scripts-api).
75-
[Select files or folders with their full paths by clicking a link to a special URL](./doc/SETTINGS.md#selecting-files-and-folders).
76-
7744
## Design Objectives
7845

7946
* **1. Easy and beautiful graphical user interface for Perl 5 desktop applications**
@@ -92,7 +59,7 @@ in the documentation of this project are to be interpreted as described in [RFC
9259
* [Unified logging of Perl and JavaScript errors in the JavaScript console](./doc/LOGGING.md)
9360
* [Optional warning for unsaved data in HTML forms](./doc/SETTINGS.md#html-page-api)
9461
* [Optional labels for all JavaScript popup boxes and context menus](./doc/SETTINGS.md#html-page-api)
95-
* [Optional icon for the main window and all dialog boxes](./doc/CONSTANTS.md#icon)
62+
* [Optional icon for the main window and all dialog boxes](./doc/FILES.md#icon)
9663

9764
## Security
9865

@@ -110,6 +77,11 @@ in the documentation of this project are to be interpreted as described in [RFC
11077
* No file download
11178
* No printing
11279

80+
## Logging
81+
82+
PEB has unified logging of JavaScript and Perl errors in the JavaScript console.
83+
Press <kbd>Ctrl</kbd> + <kbd>I</kbd> to open the ``QWebInspector`` and go to the ``Console`` tab.
84+
11385
## History
11486

11587
PEB was started in 2013 by Dimitar D. Mitov as a simple GUI for personal database applications.

appimager.sh

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
11
#!/usr/bin/env bash
22

3-
# Version:
4-
export VERSION="1.0.0"
5-
63
# Architecture check:
74
if [ ! "$(arch)" == "x86_64" ]; then
85
printf "\\nAppImage executable can be created only on and for 64-bit Linux distributions.\\n"
96
exit 1
107
fi
118

12-
# Go to to PEB source directory:
13-
cd "$(pwd)/src" || exit
14-
15-
# Remove temporary files:
16-
rm -rf tmp
17-
rm -f .qmake.stash
18-
rm -f Makefile
19-
20-
# Compile PEB:
21-
qmake -qt=qt5
22-
make
23-
24-
# Go back to the PEB root directory:
25-
cd .. || exit
26-
279
# If no 'linuxdeployqt' is found, it is downloaded from the web:
2810
linuxdeployqt="linuxdeployqt-continuous-$(arch).AppImage"
2911
if [ ! -x "$linuxdeployqt" ]; then
@@ -46,14 +28,20 @@ rm -rf "$(pwd)/$appimage_name.app"
4628
mkdir "$(pwd)/$appimage_name.app"
4729

4830
# Main executable:
49-
cp -f "$(pwd)/peb" "$(pwd)/$appimage_name.app/$appimage_name"
31+
if [ -e "$(pwd)/peb" ]; then
32+
cp -f "$(pwd)/peb" "$(pwd)/$appimage_name.app/$appimage_name"
33+
fi
34+
35+
if [ -e "$(pwd)/$appimage_name" ]; then
36+
cp -f "$(pwd)/$appimage_name" "$(pwd)/$appimage_name.app/$appimage_name"
37+
fi
5038

5139
# Desktop file:
5240
cp -f "$package_desktop_file" "$(pwd)/$appimage_name.app/$appimage_name.desktop"
5341

5442
# AppImage icon:
55-
if [ -e "$(pwd)/resources/app.png" ]; then
56-
cp -f "$(pwd)/resources/app.png" "$(pwd)/$appimage_name.app/app.png"
43+
if [ -e "$(pwd)/resources/app/app.png" ]; then
44+
cp -f "$(pwd)/resources/app/app.png" "$(pwd)/$appimage_name.app/app.png"
5745
fi
5846

5947
# AppImage metadata file:
@@ -62,19 +50,18 @@ if [ -e "$(pwd)/resources/app/appimage/$appimage_name.appdata.xml" ]; then
6250
cp -f "$(pwd)/resources/app/appimage/$appimage_name.appdata.xml" "$(pwd)/$appimage_name.app/usr/share/metainfo/$appimage_name.appdata.xml"
6351
fi
6452

53+
# Resources:
54+
cp -r "$(pwd)/resources" "$(pwd)/$appimage_name.app/resources"
55+
56+
# Self-copying:
57+
cp "$(pwd)/appimager.sh" "$(pwd)/$appimage_name.app/appimager.sh"
58+
6559
# Documentation:
6660
cp -r "$(pwd)/doc" "$(pwd)/$appimage_name.app/doc"
6761
cp "$(pwd)/CREDITS.md" "$(pwd)/$appimage_name.app/CREDITS.md"
6862
cp "$(pwd)/LICENSE.md" "$(pwd)/$appimage_name.app/LICENSE.md"
6963
cp "$(pwd)/README.md" "$(pwd)/$appimage_name.app/README.md"
7064

71-
# Resources:
72-
cp -r "$(pwd)/resources" "$(pwd)/$appimage_name.app/resources"
73-
74-
# File cleaning:
75-
rm -f "$(pwd)/$appimage_name.app/resources/app/$appimage_name.desktop"
76-
rm -f "$(pwd)/$appimage_name.app/resources/app/$appimage_name.appdata.xml"
77-
7865
# Extraction of the contents of 'linuxdeployqt' tool -
7966
# it is necessary for operation inside the PEB AppImage Builder Docker Container:
8067
if [ -x "$linuxdeployqt" ]; then

doc/APPIMAGE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Both PEB AppImage configuration files are put on their places in the AppImage di
2525
## PEB AppImage Builder Docker Container
2626

2727
An easy building environment for PEB AppImage executables is the [PEB AppImage Builder Docker Container](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/Dockerfile).
28-
To start it, type the following commands in the ``{PEB_executable_directory}``:
28+
To start it, run the following commands in the ``{PEB_executable_directory}``:
2929

3030
```bash
3131
sudo docker build -t peb-appimage-builder .
@@ -35,7 +35,7 @@ sudo docker container run --rm -it -v $(pwd):/opt --user $(id -u):$(id -g) peb-a
3535
When PEB AppImage Builder Docker Container is running, type:
3636

3737
```bash
38-
cd /opt/ && ./appimager.sh && exit
38+
cd /opt/src && qmake -qt=qt5 && make && cd .. && export VERSION="1.1.0" && ./appimager.sh && exit
3939
```
4040

4141
## AppImageHub

doc/CONSTANTS.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

doc/FILES.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Perl Executing Browser - Files and Folders
2+
3+
PEB is created to work from any directory without installation and all paths used by PEB are relative to the directory of the PEB executable, labeled as ``{PEB_executable_directory}`` within this documentation. Only one folder and two file names are hard-coded in C++ code for compatibility with the [Electron](http://electron.atom.io/) framework.
4+
5+
A minimal ``{PEB_executable_directory}`` looks like this:
6+
7+
```bash
8+
.
9+
├── {PEB_executable}
10+
└── resources
11+
    └── app
12+
        ├── index.html
13+
        └── app.png
14+
```
15+
16+
* **Application Directory:**
17+
The application directory path must be: ``{PEB_executable_directory}/resources/app``
18+
All Perl scripts started by PEB must be located within this directory and its subdirectories.
19+
The working directory of all PEB Perl scripts is the application directory.
20+
21+
* **Start Page:**
22+
Start page pathname must be: ``{PEB_executable_directory}/resources/app/index.html``
23+
If start page is missing, an error message is displayed.
24+
25+
<a name="icon"></a>
26+
* **Icon:**
27+
Icon pathname must be: ``{PEB_executable_directory}/resources/app/app.png``
28+
If icon file is found on application startup, it is used as application icon.
29+
If icon file is not found, the default icon embedded in the resources of the browser binary is used.

doc/INTERACTIVE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ PEB interactive Perl scripts are able to receive user input multiple times after
3232

3333
## Examples of Interactive Perl Scripts
3434

35-
The [index.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index.html) demonstrates how to start automatically one Perl interactive script based on STDIN input in two instances.
35+
The [index.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index.html) demonstrates how to start automatically one Perl interactive script using STDIN input in two instances.
3636

37-
The [interactive.pl script of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive.pl) is an example of a Perl interactive script based on STDIN input.
37+
The [interactive.pl script of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive.pl) is an example of a Perl interactive script using STDIN input.
3838

39-
The [index-windows.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index-windows.html) demonstrates how to start automatically one Perl interactive script based on temporary files in two instances.
39+
The [index-windows.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index-windows.html) demonstrates how to start automatically one Perl interactive script using a temporary file in two instances.
4040

41-
The [interactive-windows.pl script of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive-windows.pl) is an example of a Perl interactive script based on temporary files.
41+
The [interactive-windows.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/interactive-windows.pl) script of the demo package is an example of a Perl interactive script using a temporary file. This script creates a temporary file on startup and sends back to PEB its full path. PEB sends data to the interactive script by forwarding this path and a message text to the STDIN of a helper script, [messenger.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl-scripts/messenger.pl). The helper script writes all data received from PEB in the temporary file. The interactive script checks periodically its temporary file for any new messages.

doc/LOGGING.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)