Author: jerome
Date: 2009-07-29 16:52:06 +0200 (Wed, 29 Jul 2009)
New Revision: 5226

Modified:
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.dcu
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
   
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/gnugettext.dcu
Log:
* Added windows message handler ( launcher ) capability.

Modified: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.dcu
===================================================================
(Binary files differ)

Modified: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas
      2009-07-29 14:50:21 UTC (rev 5225)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas
      2009-07-29 14:52:06 UTC (rev 5226)
@@ -294,8 +294,6 @@
 
 {#### This function stops the tux droid server. ####}
 function stopServer() : boolean;
-var
-  request_result : string;
 begin
   ShellExecute(HWND(nil), 'open', PChar('smart_server_stop'), nil, nil, 
SW_HIDE);
 end;

Modified: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
===================================================================
(Binary files differ)

Modified: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
 2009-07-29 14:50:21 UTC (rev 5225)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
 2009-07-29 14:52:06 UTC (rev 5226)
@@ -60,7 +60,6 @@
     Width = 955
     Height = 619
     TabOrder = 0
-    Silent = False
     RegisterAsBrowser = True
     RegisterAsDropTarget = False
     OnDocumentComplete = EmbeddedWB1DocumentComplete

Modified: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
===================================================================
--- 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
 2009-07-29 14:50:21 UTC (rev 5225)
+++ 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
 2009-07-29 14:52:06 UTC (rev 5226)
@@ -141,13 +141,12 @@
     function GetAllUsersDir() : string;
     function GetTuxDroidDataBaseDirectory() : string;
     procedure saveProperties();
+    procedure DefaultHandler(var Msg); override;
 
-
   private
     { D�clarations priv�es }
     IconData: TNewNotifyIconData;
     procedure WMAppelMessage(var msg : TMessage); message wm_AppelMessage;
-
     procedure OpenUrl(const url : String);
 
   public
@@ -166,6 +165,7 @@
   balloonShowed    : boolean;
   properties       : TStringList;
   reduce_balloon   : boolean;
+  MessageSys       : UInt;
 
 implementation
 
@@ -179,8 +179,11 @@
 //Form initialization.
 procedure TForm1.FormCreate(Sender: TObject);
 begin
+  MessageSys := RegisterWindowMessage('WindowForegroundRequest');
   reduce_balloon := false;
+
   url := 'http://127.0.0.1:270/user/';
+
   TUXBOX_CONF_FILE := Form1.GetTuxDroidDataBaseDirectory
                       + '\configurations\TuxBox2.0.conf';
 
@@ -348,21 +351,25 @@
 //Tray menu 'quit' click.
 procedure TForm1.Quit1Click(Sender: TObject);
 begin
-  if TuxUtils.stopServer() then
-    begin
-      Form1.saveProperties;
-      properties.Free;
-      ConnectionChecker.Enabled := false;
-      ConnectionChecker.Free;
-      AppIcon.Free;
-      Form1.DeleteSysTrayIcon;
-      EmbeddedWB1.Free;
-      Application.Terminate;
-    end
-  else if TuxUtils.isTuxDroidServerStarted() then
-    begin
-      Form1.ShowBalloonTips(gettext(SERVER_STOP_ERROR_0) + slinebreak +
-                            gettext(SERVER_STOP_ERROR_1));
+  try
+    if TuxUtils.stopServer() then
+      begin
+        Form1.saveProperties;
+        properties.Free;
+        ConnectionChecker.Enabled := false;
+        ConnectionChecker.Free;
+        AppIcon.Free;
+        Form1.DeleteSysTrayIcon;
+        Application.Terminate;
+      end
+    else if TuxUtils.isTuxDroidServerStarted() then
+      begin
+        Form1.ShowBalloonTips(gettext(SERVER_STOP_ERROR_0) + slinebreak +
+                              gettext(SERVER_STOP_ERROR_1));
+      end;
+    except
+      on e : Exception do
+        Application.Terminate;
     end;
 end;
 
@@ -479,6 +486,7 @@
   temp : TStringList;
 
 begin
+
   server := TuxUtils.isTuxDroidServerStarted();
 
   //Trying to get states only if server is started.
@@ -687,5 +695,22 @@
 end;
 
 
+{#### Default messages handler ####}
+procedure TForm1.DefaultHandler(var msg);
+begin
+  inherited DefaultHandler(Msg);
+  if (TMessage(Msg).Msg = MessageSys) then
+    begin
+      EmbeddedWB1.Go(url);
+      Form1.Visible := true;
+
+      if (TMessage(Msg).WParam) = 0 then
+        begin
+          SetForegroundWindow(Application.Handle);
+        end
+    end;
+end;
+
+
 end.
 

Modified: 
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/gnugettext.dcu
===================================================================
(Binary files differ)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to