summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-25 08:41:03 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-25 08:41:03 +0000
commit6d7be43cb7f06433dec345270880e440ab7829f6 (patch)
treee11188e6c32351199f617c54c9f5b96803ebf3dc /src/corelib/x11
parent504502abd0c8525a547deabcf890855513d43e4b (diff)
downloadfpGUI-6d7be43cb7f06433dec345270880e440ab7829f6.tar.xz
* Added Antonio Sanguigni new TfpgHyperLabel component to fpGUI. I converted his gui_browser class to a fpgOpenURL function.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/gfx_utils_impl.inc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/corelib/x11/gfx_utils_impl.inc b/src/corelib/x11/gfx_utils_impl.inc
index 0f341df4..41e5233d 100644
--- a/src/corelib/x11/gfx_utils_impl.inc
+++ b/src/corelib/x11/gfx_utils_impl.inc
@@ -1,5 +1,8 @@
{%mainunit gfx_utils.pas}
+uses
+ Unix;
+
// X11 specific filesystem implementations of encoding functions
function fpgToOSEncoding(aString: TfpgString): string;
@@ -12,4 +15,26 @@ begin
Result := aString;
end;
+procedure fpgOpenURL(const aURL: TfpgString);
+var
+ Helper: string;
+begin
+//TODO: Catch "which" command output to run the browser from there
+ Helper := '';
+ if FileExists('/etc/alternatives/x-www-browser') then
+ Helper := '/etc/alternatives/x-www-browser'
+ else
+ begin
+ if fpsystem('which opera') = 0 then
+ Helper := 'opera';
+ if fpsystem('which mozilla') = 0 then
+ Helper := 'mozilla';
+ if fpsystem('which konqueror') = 0 then
+ Helper := 'konqueror';
+ if fpsystem('which firefox') = 0 then
+ Helper := 'firefox';
+ end;
+
+ fpSystem(Helper + ' ' + aURL + '&');
+end;