From 6cc8aeb6975b53aefccf86ca979092029c0506a8 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 12 May 2017 12:58:36 +0000 Subject: [PATCH] examples: removed obsolete openbrowser git-svn-id: trunk@54879 - --- .gitattributes | 10 -- .gitignore | 2 - examples/openbrowser/OpenURLInFirefox.sh | 4 - examples/openbrowser/OpenURLInGaleon.sh | 4 - examples/openbrowser/OpenURLInKonqueror.sh | 4 - examples/openbrowser/OpenURLInMozilla.sh | 4 - examples/openbrowser/OpenURLInNetscape.sh | 4 - examples/openbrowser/OpenURLInOpera.sh | 4 - examples/openbrowser/mainunit.lfm | 50 --------- examples/openbrowser/mainunit.pas | 123 --------------------- examples/openbrowser/testbrowserrmc.lpi | 61 ---------- examples/openbrowser/testbrowserrmc.lpr | 15 --- 12 files changed, 285 deletions(-) delete mode 100755 examples/openbrowser/OpenURLInFirefox.sh delete mode 100755 examples/openbrowser/OpenURLInGaleon.sh delete mode 100755 examples/openbrowser/OpenURLInKonqueror.sh delete mode 100755 examples/openbrowser/OpenURLInMozilla.sh delete mode 100755 examples/openbrowser/OpenURLInNetscape.sh delete mode 100755 examples/openbrowser/OpenURLInOpera.sh delete mode 100644 examples/openbrowser/mainunit.lfm delete mode 100644 examples/openbrowser/mainunit.pas delete mode 100644 examples/openbrowser/testbrowserrmc.lpi delete mode 100644 examples/openbrowser/testbrowserrmc.lpr diff --git a/.gitattributes b/.gitattributes index ef53399a7b..d5474aba3c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5873,16 +5873,6 @@ examples/objectinspector/mainunit.lfm svneol=native#text/plain examples/objectinspector/mainunit.pas svneol=native#text/pascal examples/objectinspector/oiexample.lpi svneol=native#text/plain examples/objectinspector/oiexample.lpr svneol=native#text/pascal -examples/openbrowser/OpenURLInFirefox.sh svneol=native#text/plain -examples/openbrowser/OpenURLInGaleon.sh svneol=native#text/plain -examples/openbrowser/OpenURLInKonqueror.sh svneol=native#text/plain -examples/openbrowser/OpenURLInMozilla.sh svneol=native#text/plain -examples/openbrowser/OpenURLInNetscape.sh svneol=native#text/plain -examples/openbrowser/OpenURLInOpera.sh svneol=native#text/plain -examples/openbrowser/mainunit.lfm svneol=native#text/plain -examples/openbrowser/mainunit.pas svneol=native#text/plain -examples/openbrowser/testbrowserrmc.lpi svneol=native#text/plain -examples/openbrowser/testbrowserrmc.lpr svneol=native#text/plain examples/openglcontrol/data/particle.png -text svneol=unset#image/png examples/openglcontrol/data/texture1.png -text svneol=unset#image/png examples/openglcontrol/data/texture2.png -text svneol=unset#image/png diff --git a/.gitignore b/.gitignore index fff187f6a1..679e036171 100644 --- a/.gitignore +++ b/.gitignore @@ -426,8 +426,6 @@ examples/multithreading/*.bak examples/multithreading/units examples/objectinspector/*.bak examples/objectinspector/units -examples/openbrowser/*.bak -examples/openbrowser/units examples/openglcontrol/*.bak examples/openglcontrol/data/*.bak examples/openglcontrol/data/units diff --git a/examples/openbrowser/OpenURLInFirefox.sh b/examples/openbrowser/OpenURLInFirefox.sh deleted file mode 100755 index d21a9db502..0000000000 --- a/examples/openbrowser/OpenURLInFirefox.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -firefox -remote "openurl($1)" || firefox $1 & - diff --git a/examples/openbrowser/OpenURLInGaleon.sh b/examples/openbrowser/OpenURLInGaleon.sh deleted file mode 100755 index 18661cd2fc..0000000000 --- a/examples/openbrowser/OpenURLInGaleon.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -galeon -x $1 & - diff --git a/examples/openbrowser/OpenURLInKonqueror.sh b/examples/openbrowser/OpenURLInKonqueror.sh deleted file mode 100755 index 853c3c39cf..0000000000 --- a/examples/openbrowser/OpenURLInKonqueror.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -kfmclient openURL $1 & - diff --git a/examples/openbrowser/OpenURLInMozilla.sh b/examples/openbrowser/OpenURLInMozilla.sh deleted file mode 100755 index 45293a13a3..0000000000 --- a/examples/openbrowser/OpenURLInMozilla.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -mozilla -remote "openurl($1)" || mozilla $1 & - diff --git a/examples/openbrowser/OpenURLInNetscape.sh b/examples/openbrowser/OpenURLInNetscape.sh deleted file mode 100755 index e7975aa1ac..0000000000 --- a/examples/openbrowser/OpenURLInNetscape.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -netscape -remote "openurl($1)" || netscape $1 & - diff --git a/examples/openbrowser/OpenURLInOpera.sh b/examples/openbrowser/OpenURLInOpera.sh deleted file mode 100755 index 73d2739873..0000000000 --- a/examples/openbrowser/OpenURLInOpera.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -opera -remote "openURL($1)" || opera $1 & - diff --git a/examples/openbrowser/mainunit.lfm b/examples/openbrowser/mainunit.lfm deleted file mode 100644 index a2a39980f3..0000000000 --- a/examples/openbrowser/mainunit.lfm +++ /dev/null @@ -1,50 +0,0 @@ -object Form1: TForm1 - Left = 302 - Height = 300 - Top = 168 - Width = 439 - Caption = 'Form1' - ClientHeight = 300 - ClientWidth = 439 - OnCreate = FormCreate - LCLVersion = '0.9.25' - object OpenLazarusButton: TButton - Left = 190 - Height = 29 - Top = 80 - Width = 221 - AutoSize = True - Caption = 'Open www.lazarus.freepascal.org' - OnClick = OpenLazarusButtonClick - TabOrder = 0 - end - object BrowserRadioGroup: TRadioGroup - Left = 25 - Height = 267 - Top = 10 - Width = 150 - AutoFill = True - Caption = 'Browser' - ChildSizing.LeftRightSpacing = 6 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 248 - ClientWidth = 146 - ItemIndex = 4 - Items.Strings = ( - 'xdg-open' - 'Firefox' - 'Galeon' - 'Konqueror' - 'Mozilla' - 'Netscape' - 'Opera' - ) - TabOrder = 1 - end -end diff --git a/examples/openbrowser/mainunit.pas b/examples/openbrowser/mainunit.pas deleted file mode 100644 index 66bd4b69f1..0000000000 --- a/examples/openbrowser/mainunit.pas +++ /dev/null @@ -1,123 +0,0 @@ -unit MainUnit; - -{$mode objfpc}{$H+} - -interface - -uses - SysUtils, LCLProc, Forms, Dialogs, - FileUtil, LazFileUtils, LazUTF8, UTF8Process, StdCtrls, Process, ExtCtrls; - -type - { TForm1 } - - TForm1 = class(TForm) - OpenLazarusButton: TButton; - BrowserRadioGroup: TRadioGroup; - procedure FormCreate(Sender: TObject); - procedure OpenLazarusButtonClick(Sender: TObject); - private - public - procedure OpenURL(const URL: string); - procedure GetBrowser(out BrowserName, BrowserFilename, StartScriptFilename: string); - end; - -var - Form1: TForm1; - -implementation - -{$R mainunit.lfm} - -function SearchExecutable(const ShortFilename: string; var Filename: string - ): boolean; -begin - Filename:=SearchFileInPath(ShortFilename,'', - GetEnvironmentVariableUTF8('PATH'),PathSeparator,[]); - Result:=Filename<>''; -end; - -{ TForm1 } - -procedure TForm1.FormCreate(Sender: TObject); -begin -end; - -procedure TForm1.OpenLazarusButtonClick(Sender: TObject); -begin - OpenURL('http://www.lazarus-ide.org/'); -end; - -procedure TForm1.OpenURL(const URL: string); -var - TheProcess: TProcessUTF8; - BrowserFilename: string; - StartScriptFilename: string; - BrowserName: string; -begin - GetBrowser(BrowserName,BrowserFilename,StartScriptFilename); - if BrowserFilename='' then begin - DebugLn('TForm1.OpenURL unable to find browser "',BrowserName,'"'); - MessageDlg('Invalid browser', - 'Unable to find browser executable "'+BrowserName+'"', - mtError,[mbCancel],0); - exit; - end; - - DebugLn('TForm1.OpenURL StartScriptFilename=',StartScriptFilename); - if not FileExistsUTF8(StartScriptFilename) then begin - DebugLn('TForm1.OpenURL unable to find program "',StartScriptFilename,'"'); - MessageDlg('Invalid browser', - 'Unable to find browser "'+StartScriptFilename+'"', - mtError,[mbCancel],0); - exit; - end; - if not FileIsExecutable(StartScriptFilename) then begin - DebugLn('TForm1.OpenURL browserfile is not executable "',StartScriptFilename,'"'); - MessageDlg('Invalid browser', - 'Browserfilename "'+StartScriptFilename+'" is not executable', - mtError,[mbCancel],0); - exit; - end; - - - TheProcess:=TProcessUTF8.Create(nil); - try - TheProcess.InheritHandles := false; - TheProcess.Options:= [poUsePipes, poNoConsole, poStdErrToOutput]; - TheProcess.ShowWindow := swoNone; - TheProcess.CommandLine:=StartScriptFilename+' '+URL; - try - TheProcess.Execute; - TheProcess.WaitOnExit; - if TheProcess.ExitStatus<>0 then begin - MessageDlg('Error', - 'Error executing browser script '+StartScriptFilename+#13 - +'Error code: '+IntToStr(TheProcess.ExitStatus), - mtError,[mbCancel],0); - end; - finally - TheProcess.Free; - end; - except - on E: Exception do begin - DebugLn('TForm1.OpenURL ERROR: ',E.Message); - end; - end; -end; - -procedure TForm1.GetBrowser(out BrowserName, BrowserFilename, - StartScriptFilename: string); -var - i: LongInt; -begin - i:=BrowserRadioGroup.ItemIndex; - if i<0 then i:=4; - BrowserName:=BrowserRadioGroup.Items[i]; - StartScriptFilename:=ExtractFilePath(Application.ExeName)+'OpenURLIn'+BrowserName+'.sh'; - if not SearchExecutable(lowercase(BrowserName),BrowserFilename) then - BrowserFilename:=''; -end; - -end. - diff --git a/examples/openbrowser/testbrowserrmc.lpi b/examples/openbrowser/testbrowserrmc.lpi deleted file mode 100644 index 3978c26831..0000000000 --- a/examples/openbrowser/testbrowserrmc.lpi +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/openbrowser/testbrowserrmc.lpr b/examples/openbrowser/testbrowserrmc.lpr deleted file mode 100644 index f5db0229dc..0000000000 --- a/examples/openbrowser/testbrowserrmc.lpr +++ /dev/null @@ -1,15 +0,0 @@ -program TestBrowserRMC; - -{$mode objfpc}{$H+} - -uses - Interfaces, // this includes the LCL widgetset - Forms - { add your units here }, MainUnit; - -begin - Application.Initialize; - Application.CreateForm(TForm1, Form1); - Application.Run; -end. -