Skip to content

Commit a46d4c9

Browse files
committed
version 0.2
1 parent bbbd754 commit a46d4c9

File tree

8 files changed

+84
-76
lines changed

8 files changed

+84
-76
lines changed

README.md

+24-23
Large diffs are not rendered by default.

REQUIREMENTS

+22-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
2-
Compile-time Requirements:
3-
GCC compiler and Qt5.1 - Qt5.5 headers (including QtWebKit headers).
4-
1+
## Compile-time Requirements
2+
3+
GCC compiler and Qt 5.1 - Qt 5.5 headers (including ```QtWebKit``` headers).
4+
Later versions of Qt are unusable due to the deprecation of ```QtWebKit```.
5+
56
Compiled and tested successfully using:
6-
* Qt Creator 2.8.1 and Qt 5.1.1 on 32-bit Debian Linux,
7-
* Qt Creator 3.0.0 and Qt 5.2.0 on 32-bit Debian Linux,
8-
* Qt Creator 3.0.0 and Qt 5.2.0 on 32-bit Windows XP,
9-
* Qt Creator 3.0.1 and Qt 5.2.1 on 64-bit OS X 10.9.1, i5,
10-
* Qt Creator 3.1.1 and Qt 5.3.0 on 64-bit Lubuntu 14.10 Linux,
11-
* Qt Creator 3.1.1 and Qt 5.4.1 on 64-bit Lubuntu 15.04 Linux,
12-
* Qt Creator 3.5.1 and Qt 5.5.1 on 64-bit Lubuntu 15.04 Linux.
13-
14-
Runtime Requirements:
15-
* Qt 5 libraries - their full Linux list can be found inside the 'start-peb.sh' script,
7+
* [Qt Creator 2.8.1 and Qt 5.1.1] (http://download.qt.io/official_releases/qt/5.1/5.1.1/) on 32-bit Debian Linux,
8+
* [Qt Creator 3.0.0 and Qt 5.2.0] (http://download.qt.io/official_releases/qt/5.2/5.2.0/) on 32-bit Debian Linux,
9+
* [Qt Creator 3.0.0 and Qt 5.2.0] (http://download.qt.io/official_releases/qt/5.2/5.2.0/) on 32-bit Windows XP,
10+
* [Qt Creator 3.0.1 and Qt 5.2.1] (http://download.qt.io/official_releases/qt/5.2/5.2.1/) on 64-bit OS X 10.9.1, i5
11+
(main development and testing platform - Valcho Nedelchev),
12+
* [Qt Creator 3.1.1 and Qt 5.3.0] (http://download.qt.io/official_releases/qt/5.3/5.3.0/) on 64-bit Lubuntu 14.10 Linux,
13+
* [Qt Creator 3.1.1 and Qt 5.4.1] (http://download.qt.io/official_releases/qt/5.4/5.4.1/) on 64-bit Lubuntu 15.04 Linux,
14+
* [Qt Creator 3.5.1 and Qt 5.5.1] (http://download.qt.io/official_releases/qt/5.5/5.5.1/) on 64-bit Lubuntu 15.04 Linux
15+
(main development and testing platform - Dimitar D. Mitov).
16+
17+
## Runtime Requirements
18+
19+
* Qt 5 libraries - their full Linux list can be found inside the ```start-peb.sh``` script,
1620
* Perl 5 distribution - any Linux, Mac or Windows Perl distribution.
17-
Strawberry Perl PortableZIP edition is successfully used with all Windows builds of PEB.
18-
Perlbrew Perl distributions (5.18.4, 5.23.7) are successfully used with many Linux builds of PEB.
19-
Being unable to start scripts with administrative privileges PEB can use, but not abuse, any system Perl on PATH.
21+
[Strawberry Perl] (http://strawberryperl.com/) PortableZIP editions are successfully used with all Windows builds of PEB.
22+
[Perlbrew] (https://perlbrew.pl/) Perl distributions (5.18.4, 5.23.7) are successfully used with many Linux builds of PEB.
23+
Being unable to start scripts with administrative privileges, PEB can use, but not abuse, any system Perl on PATH.
24+

resources/app/main.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
</p>
4040

4141
<p>
42-
<a href="http://local-pseudodomain/perl/cwd-inc.pl"
43-
data-toggle="tooltip" title="http://local-pseudodomain/perl/cwd-inc.pl"
42+
<a href="http://local-pseudodomain/perl/version-cwd-inc.pl"
43+
data-toggle="tooltip" title="http://local-pseudodomain/perl/version-cwd-inc.pl"
4444
data-placement="right">
45-
Working Directory and @INC Array</a>
45+
Perl Version, Working Directory and @INC Array</a>
4646
</p>
4747

4848
<p>
@@ -121,7 +121,7 @@
121121
Unsupported File</a>
122122
</p>
123123

124-
<hr width="50%">
124+
<hr width="75%">
125125

126126
<p>
127127
Web Content

resources/app/perl/cwd-inc.pl renamed to resources/app/perl/version-cwd-inc.pl

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<html>
99
1010
<head>
11-
<title>Perl Executing Browser - Working Directory and \@INC Array</title>
11+
<title>Perl Executing Browser - Perl Version, Working Directory and \@INC Array</title>
1212
<meta name='viewport' content='width=device-width, initial-scale=1'>
1313
<meta charset='utf-8'>
1414
<link rel='stylesheet' type='text/css' href='http://local-pseudodomain/bootstrap/css/themes/darkly-theme.css' media='all'>
@@ -27,14 +27,16 @@
2727
2828
<body>
2929
<p align='center'>
30-
Working Directory and \@INC Array
30+
Perl Version, Working Directory and \@INC Array
3131
</p>
3232
<pre>\n";
3333

34+
print "Perl $^V\n\n";
35+
3436
my $cwd = cwd();
35-
print "WORKING DIRECTORY:\n$cwd\n";
37+
print "Working Directory:\n$cwd\n";
3638

37-
print "\n\@INC ARRAY:\n";
39+
print "\n\@INC Array:\n";
3840

3941
print join "\n", @INC;
4042

src/peb.cpp

+21-22
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ BOOL isUserAdmin()
5757
// READ EMBEDDED HTML TEMPLATE
5858
// FOR ERROR MESSAGES:
5959
// ==============================
60-
QString readHtmlErrorTemplate()
60+
QString readHtmlTemplate(QString fileName)
6161
{
62-
QString htmlErrorFileName(":/html/error.html");
63-
QFile htmlErrorFile(htmlErrorFileName);
64-
htmlErrorFile.open(QIODevice::ReadOnly | QIODevice::Text);
65-
QTextStream htmlErrorStream(&htmlErrorFile);
66-
QString htmlErrorContents = htmlErrorStream.readAll();
67-
htmlErrorFile.close();
68-
69-
return htmlErrorContents;
62+
QString htmlTemplateFileName(":/html/" + fileName);
63+
QFile htmlTemplateFile(htmlTemplateFileName);
64+
htmlTemplateFile.open(QIODevice::ReadOnly | QIODevice::Text);
65+
QTextStream htmlTemplateStream(&htmlTemplateFile);
66+
QString htmlTemplateContents = htmlTemplateStream.readAll();
67+
htmlTemplateFile.close();
68+
69+
return htmlTemplateContents;
7070
}
7171

7272
// ==============================
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
129129
// SET BASIC APPLICATION VARIABLES:
130130
// ==============================
131131
application.setApplicationName("Perl Executing Browser");
132-
application.setApplicationVersion("0.1");
132+
application.setApplicationVersion("0.2");
133133
bool startedAsRoot = false;
134134

135135
// ==============================
@@ -331,7 +331,7 @@ int main(int argc, char **argv)
331331
// Display embedded HTML error message if application is started by
332332
// a user with administrative privileges:
333333
if (startedAsRoot == true) {
334-
QString htmlErrorContents = readHtmlErrorTemplate();
334+
QString htmlErrorContents = readHtmlTemplate("error.html");
335335
QString errorMessage =
336336
"Using "
337337
+ application.applicationName().toLatin1() + " "
@@ -350,7 +350,7 @@ int main(int argc, char **argv)
350350
// Display embedded HTML error message if
351351
// Perl interpreter is not found:
352352
if (perlInterpreterFullPath.length() == 0) {
353-
QString htmlErrorContents = readHtmlErrorTemplate();
353+
QString htmlErrorContents = readHtmlTemplate("error.html");
354354
QString errorMessage = privatePerlInterpreterFullPath + "<br>"
355355
+ "is not found and "
356356
+ "Perl interpreter is not available on PATH.";
@@ -402,7 +402,7 @@ int main(int argc, char **argv)
402402
QUrl("http://" + QString(PSEUDO_DOMAIN)
403403
+ "/index.pl"));
404404
} else {
405-
QString htmlErrorContents = readHtmlErrorTemplate();
405+
QString htmlErrorContents = readHtmlTemplate("error.html");
406406
QString errorMessage = "Start page was not found.";
407407
htmlErrorContents.replace("ERROR_MESSAGE", errorMessage);
408408
mainWindow.webViewWidget->setHtml(htmlErrorContents);
@@ -835,7 +835,12 @@ bool QPage::acceptNavigationRequest(QWebFrame *frame,
835835
request.url().fileName() == "about.function" and
836836
request.url().query() == "type=browser") {
837837

838-
frame->load(QUrl("qrc:/html/about.html"));
838+
QString aboutPageContents = readHtmlTemplate("about.html");
839+
aboutPageContents
840+
.replace("VERSION_STRING",
841+
QApplication::applicationVersion().toLatin1());
842+
843+
frame->setHtml(aboutPageContents);
839844

840845
return false;
841846
}
@@ -877,18 +882,15 @@ bool QPage::acceptNavigationRequest(QWebFrame *frame,
877882
selectScriptToDebugDialog.deleteLater();
878883

879884
if (debuggerScriptToDebug.length() > 1) {
880-
qDebug() << "File to load in the Perl Debugger:"
881-
<< debuggerScriptToDebug;
885+
debuggerScriptToDebug =
886+
QDir::toNativeSeparators(debuggerScriptToDebug);
882887

883888
// Get Perl debugger command (if any):
884889
debuggerLastCommand = request.url().query().toLatin1()
885890
.replace("action=select-file", "")
886891
.replace("&command=", "")
887892
.replace("+", " ");
888893

889-
qDebug() << "Debugger command:"
890-
<< debuggerLastCommand;
891-
892894
// Close any still open Perl debugger session:
893895
debuggerHandler.close();
894896

@@ -904,9 +906,6 @@ bool QPage::acceptNavigationRequest(QWebFrame *frame,
904906
.replace("command=", "")
905907
.replace("+", " ");
906908

907-
qDebug() << "Debugger command:"
908-
<< debuggerLastCommand;
909-
910909
qStartPerlDebuggerSlot();
911910
return false;
912911
}

src/peb.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ public slots:
629629
debuggerOutputFormatterFile.close();
630630

631631
qDebug() << "File passed to Perl debugger:"
632-
<< QDir::toNativeSeparators(debuggerScriptToDebug);
632+
<< debuggerScriptToDebug;
633633

634634
// Clean accumulated debugger output from previous debugger session:
635635
debuggerAccumulatedOutput = "";

src/resources/html/about.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525

2626
<body>
2727
<br>
28-
About Perl Executing Browser
29-
<br><br>
28+
About Perl Executing Browser<br>
29+
version VERSION_STRING<br>
30+
<br>
3031
This program is free software;<br>
3132
you can redistribute it and/or modify it<br>
3233
under the terms of

src/resources/peb.rc

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ IDI_ICON1 ICON DISCARDABLE "icons/camel.ico"
33
# include <winver.h>
44

55
VS_VERSION_INFO VERSIONINFO
6-
FILEVERSION 0,1,0,0
7-
PRODUCTVERSION 0,1,0,0
6+
FILEVERSION 0,2,0,0
7+
PRODUCTVERSION 0,2,0,0
88
FILEFLAGSMASK 0x3fL
99
#ifdef _DEBUG
1010
FILEFLAGS VS_FF_DEBUG
@@ -21,7 +21,7 @@ VS_VERSION_INFO VERSIONINFO
2121
BEGIN
2222
VALUE "CompanyName", "PEB Dev Team\0"
2323
VALUE "FileDescription", "Perl Executing Browser\0"
24-
VALUE "FileVersion", "0.1.0.0\0"
24+
VALUE "FileVersion", "0.2.0.0\0"
2525
VALUE "LegalCopyright", "GPL v.3\0"
2626
VALUE "OriginalFilename", "peb.exe\0"
2727
VALUE "ProductName", "Perl Executing Browser\0"

0 commit comments

Comments
 (0)