[izpack-changes] r1570 - izpack-src/trunk/src/lib/com/izforge/izpack/panels

noreply at berlios.de noreply at berlios.de
Wed Sep 6 22:34:35 CEST 2006


Author: eppelman
Date: 2006-09-06 22:34:33 +0200 (Wed, 06 Sep 2006)
New Revision: 1570

Modified:
   izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutData.java
   izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
Log:
-implemented  the X-KDE subsitute user - shortcut attribute (see Unix_shortcutSpec.xml).
-write Desktop shortcuts to all known local and ypbinded users "desktop" folders.
-write common shortcuts  to the new freedesktop.org common "/usr/share/applications" 
and "/usr/share/pixmaps" folders to display these in the commons [start].menu
Here: Added new Linux Attributes

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutData.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutData.java	2006-09-06 20:33:47 UTC (rev 1569)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutData.java	2006-09-06 20:34:33 UTC (rev 1570)
@@ -70,6 +70,14 @@
     public String deskTopEntryLinux_Encoding;
 
     public String deskTopEntryLinux_X_KDE_SubstituteUID;
+    
+    public String deskTopEntryLinux_X_KDE_UserName;
+    
+    /** Linux Common Menu Categories */
+    public String Categories ;
+    
+    /** Linux Common Menu TryExec */
+    public String TryExec;
 
     public Boolean createForAll;
     
@@ -107,6 +115,11 @@
         result.deskTopEntryLinux_URL = cloneString(deskTopEntryLinux_URL);
         result.deskTopEntryLinux_Encoding = cloneString(deskTopEntryLinux_Encoding);
         result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString(deskTopEntryLinux_X_KDE_SubstituteUID);
+        result.deskTopEntryLinux_X_KDE_UserName = cloneString(deskTopEntryLinux_X_KDE_UserName);
+        
+        result.Categories = cloneString(Categories);
+        result.TryExec = cloneString(TryExec);
+        
         result.createForAll = Boolean.valueOf(createForAll.booleanValue());
         return (result);
     }

Modified: izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutPanel.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutPanel.java	2006-09-06 20:33:47 UTC (rev 1569)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/panels/ShortcutPanel.java	2006-09-06 20:34:33 UTC (rev 1570)
@@ -72,9 +72,9 @@
 import com.izforge.izpack.util.OsVersion;
 import com.izforge.izpack.util.StringTool;
 import com.izforge.izpack.util.TargetFactory;
-import com.izforge.izpack.util.UnixHelper;
 import com.izforge.izpack.util.VariableSubstitutor;
 import com.izforge.izpack.util.os.Shortcut;
+import com.izforge.izpack.util.os.unix.UnixHelper;
 import com.izforge.izpack.util.xml.XMLHelper;
 
 //
@@ -99,7 +99,10 @@
     private static final long serialVersionUID = 3256722870838112311L;
 
     // ~ Static fields/initializers *********************************************************
-
+    
+    /** SPEC_ATTRIBUTE_KDE_USERNAME ="KdeUsername" */
+    public final static String SPEC_ATTRIBUTE_KDE_USERNAME ="KdeUsername";
+    
     /** SPEC_ATTRIBUTE_KDE_SUBST_UID = "KdeSubstUID" */
     public final static String SPEC_ATTRIBUTE_KDE_SUBST_UID = "KdeSubstUID";
 
@@ -126,6 +129,13 @@
 
     /** LOCATION_START_MENU = "startMenu" */
     private static final String LOCATION_START_MENU = "startMenu";
+    
+    /** SPEC_CATEGORIES = "categories" */   
+    private static final String SPEC_CATEGORIES = "categories";
+    
+    /** SPEC_TRYEXEC = "tryexec" */
+    private static final String SPEC_TRYEXEC = "tryexec";
+    
 
     /**
      * SEPARATOR_LINE =
@@ -925,7 +935,16 @@
             data.deskTopEntryLinux_URL = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_URL, "");
 
             data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute(
-                    SPEC_ATTRIBUTE_KDE_SUBST_UID, "");
+                    SPEC_ATTRIBUTE_KDE_SUBST_UID, "false");
+            
+            data.deskTopEntryLinux_X_KDE_UserName = shortcutSpec.getAttribute(
+                    SPEC_ATTRIBUTE_KDE_USERNAME, "root");
+            
+            data.Categories = shortcutSpec.getAttribute(
+                    SPEC_CATEGORIES, "Application;Development");
+            
+            data.TryExec = shortcutSpec.getAttribute(
+                    SPEC_TRYEXEC, "");
 
             data.createForAll = new Boolean(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false"));
 
@@ -1127,8 +1146,13 @@
                 shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions);
                 shortcut.setType(data.deskTopEntryLinux_Type);
                 shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID);
+                shortcut.setKdeUserName(data.deskTopEntryLinux_X_KDE_UserName);
                 shortcut.setURL(data.deskTopEntryLinux_URL);
+                shortcut.setTryExec(data.TryExec);
+                shortcut.setCategories(data.Categories);
                 shortcut.setCreateForAll(data.createForAll);
+                
+                shortcut.setUninstaller( UninstallData.getInstance() );
 
                 if (data.addToGroup)
                 {
@@ -1922,12 +1946,14 @@
             dataElement.setAttribute( SPEC_ATTRIBUTE_URL, data.deskTopEntryLinux_URL );
 
             dataElement.setAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, data.deskTopEntryLinux_X_KDE_SubstituteUID );
+            dataElement.setAttribute( SPEC_CATEGORIES, data.Categories );
+            dataElement.setAttribute( SPEC_TRYEXEC, data.TryExec );
 
             dataElement.setAttribute( CREATE_FOR_ALL, data.createForAll.toString() );// ? Boolean.TRUE : Boolean.FALSE).toString() );
             dataElement.setAttribute( USER_TYPE, Integer.toString( data.userType ) );
-
             
             
+            
             //TODO: Add Linux.Attibutes
 
             // ----------------------------------------------




More information about the izpack-changes mailing list