Author: remi
Date: 2009-07-05 14:20:07 +0200 (Sun, 05 Jul 2009)
New Revision: 5051

Added:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_sep_3.png
Modified:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/tools.css
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
   
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
   
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* Added "Attitunes Studio" and "Tux Controller" in the "tools" page. (You must 
have these plugins in your plugin directory)

Modified: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/tools.css
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/tools.css
    2009-07-05 10:54:28 UTC (rev 5050)
+++ 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/tools.css
    2009-07-05 12:20:07 UTC (rev 5051)
@@ -26,12 +26,15 @@
 }
 
 div.frame01Sep{
+    margin-top:6px;
+    margin-bottom:6px;
     font-family:Verdana, Bitstream Vera Sans;
     display:table;
-    background-image:url(/data/web_interface/user_01/img/frame_01_sep.png);
+    background-image:url(/data/web_interface/user_01/img/frame_01_sep_3.png);
     background-repeat:repeat;
-    height:4px;
+    height:2px;
     width:855px;
+    overflow: hidden;
 }
 
 div.frame01Bottom{
@@ -66,6 +69,7 @@
 }
 
 .toolsBtnStartEnable{
+    margin-left:10px;
     width:59px;
     _width:72px;
     padding-left:13px;
@@ -90,6 +94,24 @@
     
background-image:url(/data/web_interface/user_01/img/gadgets_btn_play_disable.png);
 }
 
+.toolsRowName{
+    width:390px;
+    height:34px;
+    margin-left:10px;
+    margin-top:2px;
+    display:table;
+    float:left;
+    line-height:34px;
+    font-size:12px;
+    color:#000;
+    text-align:left;
+    vertical-align:middle;
+    font-weight:bold;
+    overflow:hidden;
+    text-decoration:none;
+    font-family:Verdana, Bitstream Vera Sans;
+}
+
 .leightbox {
        color: #333;
        display: none;

Added: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_sep_3.png
===================================================================
(Binary files differ)


Property changes on: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_sep_3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
    2009-07-05 10:54:28 UTC (rev 5050)
+++ 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
    2009-07-05 12:20:07 UTC (rev 5051)
@@ -39,6 +39,18 @@
             function initialization()
             {
             }
+
+            function startATool(uuid)
+            {
+                var language = document.getElementById("language").value;
+                var parametersString = "language=" + language;
+                var args = {
+                    "command" : "run",
+                    "uuid" : uuid,
+                    "parameters" : parametersString
+                }
+                getRequest("/plugins_server/start_plugin", args);
+            }
         ]]>
         </script>
     </head>
@@ -82,7 +94,31 @@
             <!-- NOTIFICATION VIEW -->
             <div class="frame01TopSpace">
             </div>
-            <div class="frame01Middle" style="height:495px;">
+            <div class="frame01Middle">
+                <xsl:for-each select="root/data/*">
+                    <!-- ATTITUNE STUDIO -->
+                    <xsl:if test="name() = 'attitunes_studio'">
+                        <xsl:element name="a">
+                            <xsl:attribute name="class">toolsBtnTitle 
toolsBtnStartEnable</xsl:attribute>
+                            <xsl:attribute 
name="id">toolsStartAttitunesStatudio</xsl:attribute>
+                            <xsl:attribute 
name="onclick">javascript:startATool('<xsl:value-of select="uuid"/>');return 
false;</xsl:attribute>
+                            <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="../../translations/start"/>
+                        </xsl:element>
+                        <span class="toolsRowName"><xsl:value-of 
select="name"/></span>
+                        <div class="frame01Sep"></div>
+                    </xsl:if>
+                    <!-- TUX CONTROLLER -->
+                    <xsl:if test="name() = 'tux_controller'">
+                        <xsl:element name="a">
+                            <xsl:attribute name="class">toolsBtnTitle 
toolsBtnStartEnable</xsl:attribute>
+                            <xsl:attribute 
name="id">toolsStartAttitunesStatudio</xsl:attribute>
+                            <xsl:attribute 
name="onclick">javascript:startATool('<xsl:value-of select="uuid"/>');return 
false;</xsl:attribute>
+                            <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="../../translations/start"/>
+                        </xsl:element>
+                        <span class="toolsRowName"><xsl:value-of 
select="name"/></span>
+                        <!-- <div class="frame01Sep"></div> -->
+                    </xsl:if>
+                </xsl:for-each>
             </div>
             <div class="frame01Bottom"></div>
         </div>

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
    2009-07-05 10:54:28 UTC (rev 5050)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
    2009-07-05 12:20:07 UTC (rev 5051)
@@ -336,6 +336,7 @@
         """
         plugin = self.__pluginsContainer.getPluginByUuid(pluginUuid)
         if plugin != None:
+            plugin
             return plugin.start(command, parameters)
         else:
             return False
@@ -424,8 +425,9 @@
             param = paramStruct.split("=")
             if len(param) == 2:
                 params[param[0]] = param[1]
-        if not resourcePluginsServer.startPlugin(uuid, command, params):
-            contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
+        t = threading.Thread(target = resourcePluginsServer.startPlugin,
+            args = (uuid, command, params))
+        t.start()
         return headersStruct, contentStruct
 
 # Register the service into the resource

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-07-05 10:54:28 UTC (rev 5050)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-07-05 12:20:07 UTC (rev 5051)
@@ -72,20 +72,30 @@
         result['soundState'] = soundState
         return result
 
-    def startTuxController(self):
-        resourcePluginsServer.startPlugin(
-            "548f7a77-567d-773e-a0ef-321fe63a1c88",
-            "run",
-            {})
+    def getAvailableToolsData(self, language):
+        result = {}
+        # Attitunes studio
+        attituneStudioData = resourcePluginsServer.getPluginData(
+            "548f7a9a-567d-773e-a0dd-102fe68a1b49", language)
+        if attituneStudioData != None:
+            result['attitunes_studio'] = {
+                'name' : attituneStudioData['description']['translatedName'],
+                'icon' : attituneStudioData['description']['iconFile'],
+                'uuid' : attituneStudioData['description']['uuid'],
+                'help' : attituneStudioData['description']['helpFile'],
+            }
+        # Tux Controller
+        tuxControllerData = resourcePluginsServer.getPluginData(
+            "548f7a77-567d-773e-a0ef-321fe63a1c88", language)
+        if tuxControllerData != None:
+            result['tux_controller'] = {
+                'name' : tuxControllerData['description']['translatedName'],
+                'icon' : tuxControllerData['description']['iconFile'],
+                'uuid' : tuxControllerData['description']['uuid'],
+                'help' : tuxControllerData['description']['helpFile'],
+            }
+        return result
 
-    def startAttitunesStudio(self, path):
-        resourcePluginsServer.startPlugin(
-            "548f7a9a-567d-773e-a0dd-102fe68a1b49",
-            "run",
-            {
-                'path' : path,
-            })
-
 # Create an instance of the resource
 resourceWIUser01 = TDSResourceWIUser01("resourceWIUser01")
 # Register the resource into the resources manager
@@ -247,7 +257,7 @@
         contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
         language = parameters['language']
         skin = parameters['skin']
-        contentStruct['root']['data'] = {}
+        contentStruct['root']['data'] = 
resourceWIUser01.getAvailableToolsData(language)
         contentStruct['root']['translations'] = 
resourceWIUser01.translations.getTranslations(language)
         contentStruct['root']['skin'] = skin
         contentStruct['root']['language'] = language


------------------------------------------------------------------------------
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to