[tuxdroid-svn] r5431 - in software_suite_v3/smart-core/smart-server/branches/user_mode: data/web_i
Status: Beta
Brought to you by:
ks156
|
From: ks156 <c2m...@c2...> - 2009-09-17 09:25:55
|
Author: ks156
Date: 2009-09-17 11:25:43 +0200 (Thu, 17 Sep 2009)
New Revision: 5431
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/attitunes.xsl
software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadgets.xsl
software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetDescription.py
software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/ugc/UgcDescription.py
Log:
* Merged rev 5415 to 5430 from trunk into user_mode
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/attitunes.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/attitunes.xsl 2009-09-17 09:20:42 UTC (rev 5430)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/attitunes.xsl 2009-09-17 09:25:43 UTC (rev 5431)
@@ -230,13 +230,13 @@
function disableEditAttituneButtons(name)
{
document.getElementById("editId_" + name).className = "attitunesBtnNoTitle attitunesBtnEditDisable";
- document.getElementById("deleteId_" + name).className = "attitunesBtnTitle attitunesBtnDeleteDisable";
+ document.getElementById("deleteId_" + name).className = "attitunesBtnNoTitle attitunesBtnDeleteDisable";
}
function enableEditAttituneButtons(name)
{
document.getElementById("editId_" + name).className = "attitunesBtnNoTitle attitunesBtnEdit";
- document.getElementById("deleteId_" + name).className = "attitunesBtnTitle attitunesBtnDelete";
+ document.getElementById("deleteId_" + name).className = "attitunesBtnNoTitle attitunesBtnDelete";
}
function thisAttituneIsPlaying(name)
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadgets.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadgets.xsl 2009-09-17 09:20:42 UTC (rev 5430)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadgets.xsl 2009-09-17 09:25:43 UTC (rev 5431)
@@ -303,7 +303,7 @@
document.getElementById("helpId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnHelpDisable";
document.getElementById("configureId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnConfigureDisable";
document.getElementById("duplicateId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnDuplicateDisable";
- document.getElementById("deleteId_" + uuid).className = "gadgetsBtnTitle gadgetsBtnDeleteDisable";
+ document.getElementById("deleteId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnDeleteDisable";
}
function enableEditGadgetButtons(uuid)
@@ -311,7 +311,7 @@
document.getElementById("helpId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnHelp";
document.getElementById("configureId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnConfigure";
document.getElementById("duplicateId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnDuplicate";
- document.getElementById("deleteId_" + uuid).className = "gadgetsBtnTitle gadgetsBtnDelete";
+ document.getElementById("deleteId_" + uuid).className = "gadgetsBtnNoTitle gadgetsBtnDelete";
}
function thisGadgetIsPlaying(uuid)
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetDescription.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetDescription.py 2009-09-17 09:20:42 UTC (rev 5430)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetDescription.py 2009-09-17 09:25:43 UTC (rev 5431)
@@ -5,6 +5,8 @@
import os
+from util.applicationserver.plugin.Plugin import SUPPORTED_LANGUAGES_LIST
+
# ------------------------------------------------------------------------------
# Gadget description class.
# ------------------------------------------------------------------------------
@@ -105,6 +107,32 @@
return self.__parent.tr2(language, self.__name)
# --------------------------------------------------------------------------
+ # Normalize a gadget name with the correct translation.
+ # --------------------------------------------------------------------------
+ def normalizeName(self, name):
+ """Normalize a gadget name with the correct translation.
+ @param name: Gadget name to normalize.
+ @return: A string.
+ """
+ isTr = False
+ trLang = None
+ for lang in SUPPORTED_LANGUAGES_LIST:
+ trName = self.getTranslatedName(lang)
+ if name.find(trName) == 0:
+ isTr = True
+ trLang = lang
+ break
+ if isTr:
+ tgLang = self.__parent.getContainer().getLanguage()
+ if tgLang != trLang:
+ tgName = self.getTranslatedName(tgLang)
+ return name.replace(trName, tgName)
+ else:
+ return name
+ else:
+ return name
+
+ # --------------------------------------------------------------------------
# Get the TTS name of the gadget.
# --------------------------------------------------------------------------
def getTtsName(self, language = None):
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/ugc/UgcDescription.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/ugc/UgcDescription.py 2009-09-17 09:20:42 UTC (rev 5430)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/ugc/UgcDescription.py 2009-09-17 09:25:43 UTC (rev 5431)
@@ -56,6 +56,7 @@
self.__dictionary = dictionary
# Get the descriptor values
self.__name = dictionary['name']
+ self.__name = self.__parent.getParentGadget().getDescription().normalizeName(self.__name)
self.__ttsName = self.__name
if dictionary.has_key('ttsName'):
self.__ttsName = dictionary['ttsName']
|