Author: Paul_R
Date: 2008-08-29 17:35:27 +0200 (Fri, 29 Aug 2008)
New Revision: 1644

Added:
   software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/gadgets.xml
   software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/
   
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/ShortcutManager.png
   
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/en.po
   
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/fr.po
   
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/nl.po
   
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/thread.java
Modified:
   software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/.classpath
   
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/shortcutmanager.java
Log:
* Fixed some bugs
* Internationalized

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/.classpath
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/.classpath    
    2008-08-29 14:31:29 UTC (rev 1643)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/.classpath    
    2008-08-29 15:35:27 UTC (rev 1644)
@@ -2,6 +2,8 @@
 <classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="lib" 
path="D:/test/tuxdroid-gadget-framework-full-0.1.jar"/>
+       <classpathentry kind="lib" path="G:/Projects/tux/Gadget 
Ressources/tuxdroid-gadget-framework_fat.jar"/>
+       <classpathentry kind="lib" path="G:/Projects/tux/Gadget 
Ressources/tuxdroid-gadget-tester_fat.jar"/>
+       <classpathentry kind="lib" path="G:/Projects/tux/Gadget 
Ressources/tux_api.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>

Added: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/gadgets.xml
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/gadgets.xml   
                            (rev 0)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/gadgets.xml   
    2008-08-29 15:35:27 UTC (rev 1644)
@@ -0,0 +1,25 @@
+<gadgets>
+       <gadget>
+               <interpreter
+                       kind="java">
+                       <executable>shortcutmanager</executable>
+               </interpreter>
+               <description>
+                       
+                       <name>Shortcut manager</name>
+                       <description>This program launch an external 
application</description>
+                       <author>Francois Finfe</author>
+                       <version>1.0</version>
+                       <iconFile>resources/ShortcutManager.png</iconFile>
+                       <executionMode>command</executionMode>
+                       <uuid>548f7a9a-567c-773e-a0dd-102ff68a1a42</uuid>
+               </description>
+               <parameters>
+                       <parameter
+                               name="path"
+                               description="Path of the application"
+                               type="string"
+                               defaultValue="c:/windows/notepad.exe" />
+               </parameters>
+       </gadget>
+</gadgets>

Added: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/ShortcutManager.png
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/ShortcutManager.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/en.po
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/en.po
                           (rev 0)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/en.po
   2008-08-29 15:35:27 UTC (rev 1644)
@@ -0,0 +1,8 @@
+msgid "Shortcut manager"
+msgstr "Shortcut manager"
+
+msgid "This program launch an external application"
+msgstr "This program launch an external application"
+
+msgid "Path of the application"
+msgstr "Path of the application"
\ No newline at end of file

Added: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/fr.po
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/fr.po
                           (rev 0)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/fr.po
   2008-08-29 15:35:27 UTC (rev 1644)
@@ -0,0 +1,8 @@
+msgid "Shortcut manager"
+msgstr "Manceur d'applications"
+
+msgid "This program launch an external application"
+msgstr "Ce programme lance une application externe"
+
+msgid "Path of the application"
+msgstr "Chemin de l'application"
\ No newline at end of file

Added: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/nl.po
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/nl.po
                           (rev 0)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/resources/nl.po
   2008-08-29 15:35:27 UTC (rev 1644)
@@ -0,0 +1,8 @@
+msgid "Shortcut manager"
+msgstr "Shortcut manager"
+
+msgid "This program launch an external application"
+msgstr "This program launch an external application"
+
+msgid "Path of the application"
+msgstr "Path of the application"
\ No newline at end of file

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/shortcutmanager.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/shortcutmanager.java
  2008-08-29 14:31:29 UTC (rev 1643)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/shortcutmanager.java
  2008-08-29 15:35:27 UTC (rev 1644)
@@ -5,9 +5,6 @@
 import com.kysoh.tuxdroid.gadget.framework.gadget.SimpleGadgetConfiguration;
 
 
-
-
-
 public class shortcutmanager extends 
SimpleGadget<shortcutmanager.Configuration>{
        
        //public class that manage a simple configuration.
@@ -17,16 +14,13 @@
                private String path = "c:/windows/notepad.exe";
                
                
-          public void setPath(String path){
-                  this.path = path;
-          }
+               public void setPath(String path){
+                       this.path = path;
+               }
           
-          public String getPath(){
-                  return this.path;
-          }
-          
- 
-          
+               public String getPath(){
+                       return this.path;
+               }  
        }
        
        //Configuration object.
@@ -35,44 +29,26 @@
        public void start() throws Exception { //gadget run part.
                        //Send something to say through gadget framework.�
                        
-       
-                       
                        if (this.configuration().isTraces()) 
                        {
-                               throwMessageNotification("Lauching 
"+this.configuration().getPath()+" ...");
+                               throwMessage("Lauching 
"+this.configuration().getPath()+" ...");
                        }
                
-
-                       launchextprogram(this.configuration().getPath());
+                       processCommand(this.configuration().getPath());
                        
-               System.exit(0);
+               //System.exit(0);
        }
        
        public static void main(String[] args) throws InterruptedException, 
IOException {
                //Stand alone behavior.
-               new shortcutmanager().boot(new Configuration());
+               new shortcutmanager().boot(args, new Configuration());
        }
 
-       
-
        // launch an external program
        
-       private void launchextprogram(String cmd){
-               
-               try {
-
-                       if (System.getProperty("os.name") == "Linux")
-                       {
-                               cmd="/bin/bash -c'"+cmd+"'";
-                       }
-
-                       Process p = Runtime.getRuntime().exec(cmd);
-
-               } catch (IOException e) {
-                       throwMessageNotification("Error: ("+e.getMessage()+")");
-               }
+       private void processCommand(String cmd){
+               Thread t = new thread(cmd);
+               t.run();
        }
-
-
-
 }
+

Added: 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/thread.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/thread.java
                           (rev 0)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-shortcut/trunk/src/thread.java
   2008-08-29 15:35:27 UTC (rev 1644)
@@ -0,0 +1,15 @@
+import java.io.IOException;
+
+public class thread extends Thread {
+       private String cmd;
+       public thread(String command) {
+               cmd = command;
+       }
+       
+       public void run() {
+               try {
+                       Runtime.getRuntime().exec(cmd);
+               } catch(IOException e) {
+               }
+       }
+}
\ No newline at end of file


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to