tux-droid-svn Mailing List for Tux Droid CE (Page 35)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
| 2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
| 2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: remi <c2m...@c2...> - 2009-07-28 08:32:03
|
Author: remi
Date: 2009-07-28 10:31:54 +0200 (Tue, 28 Jul 2009)
New Revision: 5180
Modified:
software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py
Log:
* Added an environment variable in the server configuration to avoid the platform check of the plugins. (Needed for the Online gadgets data generation)
Modified: software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py 2009-07-28 08:04:20 UTC (rev 5179)
+++ software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py 2009-07-28 08:31:54 UTC (rev 5180)
@@ -104,3 +104,8 @@
# Resources configuration
# ------------------------------------------------------------------------------
TDS_ONLY_BASE_RESOURCES = False
+
+# ------------------------------------------------------------------------------
+# Misc configurations
+# ------------------------------------------------------------------------------
+os.environ["TDS_PLUGIN_PLATFORM_ALL"] = "True"
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py 2009-07-28 08:04:20 UTC (rev 5179)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py 2009-07-28 08:31:54 UTC (rev 5180)
@@ -324,6 +324,18 @@
# ==========================================================================
# --------------------------------------------------------------------------
+ # Get if the plugins platform must be checked or not.
+ # --------------------------------------------------------------------------
+ def __mustCheckPlatform(self):
+ """Get if the plugins platform must be checked or not.
+ @return: A boolean.
+ """
+ if os.environ.has_key("TDS_PLUGIN_PLATFORM_ALL"):
+ if os.environ["TDS_PLUGIN_PLATFORM_ALL"] == "True":
+ return False
+ return True
+
+ # --------------------------------------------------------------------------
# Format the last traceback.
# --------------------------------------------------------------------------
def __formatException(self):
@@ -374,14 +386,15 @@
error = "Error in 'plugin.xml'\n" + self.__formatException()
return None, error
# Check the plugin platform
- pluginPlatform = plugin.getDescription().getPlatform()
- if pluginPlatform != "all":
- if pluginPlatform == "windows":
- if os.name != "nt":
- return None, "Platform"
- else:
- if os.name == "nt":
- return None, "Platform"
+ if self.__mustCheckPlatform():
+ pluginPlatform = plugin.getDescription().getPlatform()
+ if pluginPlatform != "all":
+ if pluginPlatform == "windows":
+ if os.name != "nt":
+ return None, "Platform"
+ else:
+ if os.name == "nt":
+ return None, "Platform"
def getSplitedPluginVersion(thePlugin):
vList = thePlugin.getDescription().getVersion().split(".")
for i, v in enumerate(vList):
|
|
From: jerome <c2m...@c2...> - 2009-07-28 08:04:38
|
Author: jerome Date: 2009-07-28 10:04:20 +0200 (Tue, 28 Jul 2009) New Revision: 5179 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 Log: * Fixed a bug quitting TuxBox 2.0 when Tux Droid server was not started. 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-28 07:52:26 UTC (rev 5178) +++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas 2009-07-28 08:04:20 UTC (rev 5179) @@ -298,8 +298,15 @@ var request_result : string; begin - request_result := TuxUtils.DownloadHTTP(command_stop); - result := TuxUtils.getResult(request_result); + if TuxUtils.isTuxDroidServerStarted then + begin + request_result := TuxUtils.DownloadHTTP(command_stop); + result := TuxUtils.getResult(request_result); + end + else + begin + result := true; + end; end; Modified: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu =================================================================== (Binary files differ) |
|
From: jerome <c2m...@c2...> - 2009-07-28 07:52:37
|
Author: jerome
Date: 2009-07-28 09:52:26 +0200 (Tue, 28 Jul 2009)
New Revision: 5178
Modified:
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.pas
Log:
* Getting tray icon states only if tuxdroid server is started.
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.pas
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-28 07:36:52 UTC (rev 5177)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-28 07:52:26 UTC (rev 5178)
@@ -159,7 +159,7 @@
//Setting app icon.
AppIcon := TIcon.Create;
- ImageList1.GetIcon(0, AppIcon);
+ ImageList1.GetIcon(1, AppIcon);
Application.Icon := AppIcon;
Form1.Icon := AppIcon;
@@ -403,94 +403,99 @@
temp : TStringList;
begin
- try
- TuxUtils.getStates(temp);
- dongle := TuxUtils.isDongleConnected(temp);
- sound := TuxUtils.isSoundOn(temp);
- radio := TuxUtils.isRadioConnected(temp);
- activity := TuxUtils.isOnActivity(temp);
- except
- on e : Exception do
- begin
- dongle := false;
- sound := true;
- radio := false;
- activity := false;
+ server := TuxUtils.isTuxDroidServerStarted();
+
+ //Trying to get states only if server is started.
+ if server then
+ begin
+ try
+ TuxUtils.getStates(temp);
+ dongle := TuxUtils.isDongleConnected(temp);
+ sound := TuxUtils.isSoundOn(temp);
+ radio := TuxUtils.isRadioConnected(temp);
+ activity := TuxUtils.isOnActivity(temp);
+ except
+ on e : Exception do
+ begin
+ dongle := false;
+ sound := true;
+ radio := false;
+ activity := false;
+ end;
end;
- end;
- temp.Free;
- server := TuxUtils.isTuxDroidServerStarted();
+ temp.Free;
- connection := server and dongle and radio;
+ connection := server and dongle and radio;
- //Changing tray icon 'connection' if server isn't started or no radio detected and
- //State has changed since last knowledge register.
- if connection and sound and ( not activity ) and ( ( TuxUtils.knowed_mute
- and ( not TuxUtils.knowed_activity )) <> ( sound and (not activity) )) then
- begin
- if balloonShowed then
- Form1.HideBalloonTips();
+ //Changing tray icon 'connection' if server isn't started or no radio detected and
+ //State has changed since last knowledge register.
+ if connection and sound and ( not activity ) and ( ( TuxUtils.knowed_mute
+ and ( not TuxUtils.knowed_activity )) <> ( sound and (not activity) )) then
+ begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
- ImageList1.GetIcon(0, AppIcon);
- IconData.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @IconData);
- end
+ ImageList1.GetIcon(0, AppIcon);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
+ end
- //Changing tray icon 'mute' only if last registered values <> new sound and
- //activity values.
- else if connection and ( not sound ) and ( not activity ) and
- ( ( ( not sound ) and ( not activity ) ) <> ( ( not TuxUtils.knowed_mute )
- and ( not TuxUtils.knowed_activity ) ) )then
- begin
- if balloonShowed then
- Form1.HideBalloonTips();
+ //Changing tray icon 'mute' only if last registered values <> new sound and
+ //activity values.
+ else if connection and ( not sound ) and ( not activity ) and
+ ( ( ( not sound ) and ( not activity ) ) <> ( ( not TuxUtils.knowed_mute )
+ and ( not TuxUtils.knowed_activity ) ) )then
+ begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
- ImageList1.GetIcon(4, AppIcon);
- IconData.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @IconData);
- end
+ ImageList1.GetIcon(4, AppIcon);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
+ end
- else if connection and activity and sound and ( ( sound and activity ) <>
- ( TuxUtils.knowed_mute and TuxUtils.knowed_activity ) ) then
- begin
- if balloonShowed then
- Form1.HideBalloonTips();
+ else if connection and activity and sound and ( ( sound and activity ) <>
+ ( TuxUtils.knowed_mute and TuxUtils.knowed_activity ) ) then
+ begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
- ImageList1.GetIcon(3, AppIcon);
- IconData.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @IconData);
- end
+ ImageList1.GetIcon(3, AppIcon);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
+ end
- //Changing icon only if last state <> new state.
- else if connection <> ( TuxUtils.knowed_server and TuxUtils.knowed_radio and TuxUtils.knowed_dongle)
- or ( not started ) then
- begin
- if balloonShowed then
- Form1.HideBalloonTips();
+ //Changing icon only if last state <> new state.
+ else if connection <> ( TuxUtils.knowed_server and TuxUtils.knowed_radio and TuxUtils.knowed_dongle)
+ or ( not started ) then
+ begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
- ImageList1.GetIcon(1, AppIcon);
- IconData.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @IconData);
- end;
+ ImageList1.GetIcon(1, AppIcon);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
+ end;
- if sound then
- //Updating tick from popup menu ( sound on ).
- Mute1.ImageIndex := -1
- else
- //Updating tick from popup menu ( sound off ).
- Mute1.ImageIndex := 5;
+ if sound then
+ //Updating tick from popup menu ( sound on ).
+ Mute1.ImageIndex := -1
+ else
+ //Updating tick from popup menu ( sound off ).
+ Mute1.ImageIndex := 5;
- //Registering new values.
- TuxUtils.knowed_mute := sound;
- TuxUtils.knowed_radio := radio;
- TuxUtils.knowed_dongle := dongle;
- TuxUtils.knowed_server := server;
- TuxUtils.knowed_activity := activity;
+ //Registering new values.
+ TuxUtils.knowed_mute := sound;
+ TuxUtils.knowed_radio := radio;
+ TuxUtils.knowed_dongle := dongle;
+ TuxUtils.knowed_server := server;
+ TuxUtils.knowed_activity := activity;
- if not started then
- started := true;
-
+ if not started then
+ started := true;
+ end;
+
Application.ProcessMessages;
end;
@@ -593,7 +598,7 @@
closeFile(F);
result := strtobool(res);
except
-
+ result := true;
end;
end;
end;
|
|
From: jerome <c2m...@c2...> - 2009-07-28 07:37:10
|
Author: jerome
Date: 2009-07-28 09:36:52 +0200 (Tue, 28 Jul 2009)
New Revision: 5177
Modified:
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
Log:
* Fixed a bug quitting TuxBox 2.0
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-27 19:34:30 UTC (rev 5176)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm 2009-07-28 07:36:52 UTC (rev 5177)
@@ -60,6 +60,7 @@
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-27 19:34:30 UTC (rev 5176)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-28 07:36:52 UTC (rev 5177)
@@ -106,6 +106,7 @@
procedure Quit1Click(Sender: TObject);
procedure Help1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+ procedure WMQueryEndSession(var Message: TWMQueryEndSession); message WM_QUERYENDSESSION;
procedure Mute1Click(Sender: TObject);
procedure EmbeddedWB1DocumentComplete(ASender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
@@ -168,23 +169,41 @@
//states initialization
TuxUtils.initKnowedVars();
//Starting status pooling.
- EmbeddedWB1.Go(url);
+ EmbeddedWB1.Go('about:blank');
end;
//Avoiding close action.
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
- if Form1.isBalloonCanShow() then
- Form1.ShowBalloonTips('TuxBox 2.0 is now hidden in the tray icon' + slinebreak +
- 'To open it again, please double-click the tray icon.' +
- slinebreak +
- 'Click here to make this message disappear.');
- CanClose := False;
- Form1.Hide;
+ if sender.ClassName = 'TForm1' then
+ begin
+ if Form1.isBalloonCanShow() then
+ begin
+ Form1.ShowBalloonTips('TuxBox 2.0 is now hidden in the tray icon' + slinebreak +
+ 'To open it again, please double-click the tray icon.' +
+ slinebreak + 'Click here to make this message disappear.');
+ end;
+ CanClose := False;
+ Form1.Hide;
+ EmbeddedWB1.Go('about:blank');
+ end
+ else
+ CanClose := true;
end;
+procedure TForm1.WMQueryEndSession(var Message: TWMQueryEndSession);
+begin
+ inherited;
+ ConnectionChecker.Enabled := false;
+ TuxUtils.stopServer();
+ Shell_NotifyIcon(Nim_DELETE, @IconData);
+ Application.Terminate;
+ Message.Result:=1;
+end;
+
+
{###############################################}
{####### Tray icon properties and events ######}
{###############################################}
@@ -194,11 +213,13 @@
begin
if Form1.Visible then
begin
+ EmbeddedWB1.Go('about:blank');
Form1.Visible := false;
SetForegroundWindow(Application.Handle);
end
else
begin
+ EmbeddedWB1.Go(url);
Form1.Visible := true;
end;
end;
@@ -256,6 +277,8 @@
begin
if TuxUtils.stopServer() then
begin
+ ConnectionChecker.Enabled := false;
+ ConnectionChecker.Free;
AppIcon.Free;
Form1.DeleteSysTrayIcon;
EmbeddedWB1.Free;
@@ -314,10 +337,12 @@
//Showing application.
if Form1.Visible then
begin
+ EmbeddedWB1.Go('about:blank');
Form1.Visible := false;
end
else
begin
+ EmbeddedWB1.Go(url);
Form1.Visible := true;
SetForegroundWindow(Application.Handle);
end;
|
|
From: remi <c2m...@c2...> - 2009-07-27 19:34:49
|
Author: remi
Date: 2009-07-27 21:34:30 +0200 (Mon, 27 Jul 2009)
New Revision: 5176
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_activate.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_disable.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_enable.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_activate.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_disable.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_enable.png
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl
Log:
* Added button images for download/update gadget in the "Online" page.
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css 2009-07-27 14:52:50 UTC (rev 5175)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css 2009-07-27 19:34:30 UTC (rev 5176)
@@ -287,6 +287,30 @@
background-image:url(/data/web_interface/user_01/img/gadgets_btn_duplicate_disable.png);
}
+.gadgetsBtnDownload{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_download_enable.png);
+}
+
+.gadgetsBtnDownload:hover{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_download_activate.png);
+}
+
+.gadgetsBtnDownloadDisable{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_download_disable.png);
+}
+
+.gadgetsBtnUpdate{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_update_enable.png);
+}
+
+.gadgetsBtnUpdate:hover{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_update_activate.png);
+}
+
+.gadgetsBtnUpdateDisable{
+ background-image:url(/data/web_interface/user_01/img/gadgets_btn_update_disable.png);
+}
+
.gadgetsBtnDelete{
background-image:url(/data/web_interface/user_01/img/gadgets_btn_delete_enable.png);
}
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_activate.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_activate.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_disable.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_disable.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_enable.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_download_enable.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_activate.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_activate.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_disable.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_disable.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_enable.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/gadgets_btn_update_enable.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl 2009-07-27 14:52:50 UTC (rev 5175)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl 2009-07-27 19:34:30 UTC (rev 5176)
@@ -114,11 +114,11 @@
htmlContent += '<div class="gadgetsVSpacer" style="width:8px;"></div>';
if (isAnUpdate == "True")
{
- htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnDuplicate" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmUpdate"></a>';
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnUpdate" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmUpdate"></a>';
}
else
{
- htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnDuplicate" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmDownload"></a>';
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnDownload" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmDownload"></a>';
}
htmlContent += '<div class="frame01Sep2"></div>';
return htmlContent;
|
|
From: remi <c2m...@c2...> - 2009-07-27 14:53:06
|
Author: remi
Date: 2009-07-27 16:52:50 +0200 (Mon, 27 Jul 2009)
New Revision: 5175
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_4.png
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_5.png
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
Log:
* Added "Online" page.
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadgets.css 2009-07-27 14:52:50 UTC (rev 5175)
@@ -76,6 +76,16 @@
overflow: hidden;
}
+div.frame01Bottom2{
+ margin-top:0px;
+ font-family:Verdana, Bitstream Vera Sans;
+ background-image:url(/data/web_interface/user_01/img/frame_01_bottom_4.png);
+ background-repeat:no-repeat;
+ height:20px;
+ width:855px;
+ overflow: hidden;
+}
+
div.gadgetsListScrollbox{
height:465px;
width:845px;
@@ -91,6 +101,21 @@
background-image:url(/data/web_interface/user_01/img/frame_01_middle_3.png);
}
+div.gadgetsListScrollbox2{
+ height:465px;
+ width:845px;
+ border-color:black;
+ border-style:solid;
+ border-width:0px;
+ background-color:#DCDADB;
+ overflow-y:auto;
+ overflow-x:hidden;
+ margin-left:5px;
+ margin-right:5px;
+ margin-top:0px;
+ background-image:url(/data/web_interface/user_01/img/frame_01_middle_5.png);
+}
+
div.gadgetsVSpacer{
height:34px;
width:8px;
@@ -127,6 +152,24 @@
font-family:Verdana, Bitstream Vera Sans;
}
+.gadgetsRowName2{
+ width:680px;
+ height:34px;
+ margin-left:0px;
+ 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;
+}
+
.gadgetsBtnTitle{
width:56px;
_width:72px;
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_4.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_bottom_4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_5.png
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/img/frame_01_middle_5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-27 14:52:50 UTC (rev 5175)
@@ -53,7 +53,16 @@
translationStart = document.getElementById("translationStart").value;
translationStop = document.getElementById("translationStop").value;
translationDelete = document.getElementById("translationDelete").value;
- fillGadgetRows("on_demand");
+ var configureUuid = document.getElementById("configure_uuid").value;
+ if (configureUuid != "NULL")
+ {
+ fillGadgetRows("all_gadgets");
+ clickMe("configureId_" + configureUuid);
+ }
+ else
+ {
+ fillGadgetRows("on_demand");
+ }
updatePlayingGadgetUuid();
}
@@ -519,6 +528,14 @@
<xsl:value-of select="root/language"/>
</xsl:attribute>
</xsl:element>
+ <!-- UUID STORAGE -->
+ <xsl:element name="input">
+ <xsl:attribute name="type">hidden</xsl:attribute>
+ <xsl:attribute name="id">configure_uuid</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="root/uuid"/>
+ </xsl:attribute>
+ </xsl:element>
<!-- SOME TRANSLATIONS FOR JS -->
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/index.xsl 2009-07-27 14:52:50 UTC (rev 5175)
@@ -11,6 +11,8 @@
<script src="/data/web_interface/user_01/js/common.js" type="text/javascript"/>
<script language="javascript">
<![CDATA[
+ var uuid = "NULL";
+
function showContent()
{
var menu = document.getElementById("menu").value;
@@ -28,33 +30,34 @@
if (menu == "livewithtux")
{
menuLeft.className = "menuLeftActivate";
- frameUrl = "/wi_user_01/livewithtux?uuid=NULL";
+ frameUrl = "/wi_user_01/livewithtux?";
}
else if (menu == "gadgets")
{
menuCenter1.className = "menuCenterActivate";
- frameUrl = "/wi_user_01/gadgets?uuid=NULL";
+ frameUrl = "/wi_user_01/gadgets?";
}
else if (menu == "attitunes")
{
menuCenter2.className = "menuCenterActivate";
- frameUrl = "/wi_user_01/attitunes?uuid=NULL";
+ frameUrl = "/wi_user_01/attitunes?";
}
else if (menu == "tools")
{
menuCenter3.className = "menuCenterActivate";
- frameUrl = "/wi_user_01/tools?uuid=NULL";
+ frameUrl = "/wi_user_01/tools?";
}
else if (menu == "online")
{
menuRight.className = "menuRightActivate";
- frameUrl = "/wi_user_01/online?uuid=NULL";
+ frameUrl = "/wi_user_01/online?";
}
else
{
menuLeft.className = "menuLeftActivate";
- frameUrl = "/wi_user_01/page_livewithtux?uuid=NULL";
+ frameUrl = "/wi_user_01/page_livewithtux?";
}
+ frameUrl += "uuid=" + uuid;
frameUrl += "&language=" + document.getElementById('language').value;
frameUrl += "&skin='" + document.getElementById('skin').value + "'";
frameUrl += "&rndParam=" + Math.random();
@@ -67,6 +70,13 @@
document.getElementById("menu").value = menuName;
showContent();
}
+
+ function gotoGadgetsConfigure(thisUuid)
+ {
+ uuid = thisUuid;
+ gotoMenu("gadgets");
+ uuid = "NULL";
+ }
]]>
</script>
</head>
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/online.xsl 2009-07-27 14:52:50 UTC (rev 5175)
@@ -9,6 +9,7 @@
<html>
<head>
<link href="/data/web_interface/user_01/css/online.css" rel="stylesheet" type="text/css"/>
+ <link href="/data/web_interface/user_01/css/gadgets.css" rel="stylesheet" type="text/css"/>
<!-- CSS HACKS FOR BROWSERS -->
<xsl:choose>
<!-- IE -->
@@ -36,9 +37,234 @@
<script type="text/javascript" src="/data/web_interface/user_01/js/lightbox.js"></script>
<script language="javascript">
<![CDATA[
+ var lastGadgetSymbolicNameInAction = "0";
+ var lastGadgetNameInAction = "0";
+ var lastGadgetIconInAction = "0";
+ var knowedGadgetsDict = null;
+ var knowedGadgetsFilter = "all_gadgets";
+
function initialization()
{
+ fillGadgetRows("all_gadgets");
}
+
+ function fillGadgetRows(filter)
+ {
+ var language = document.getElementById("language").value;
+ var gadgets = requestData("/gadgets_server/get_online_gadgets_data",
+ {
+ 'filter' : filter,
+ 'language' : language
+ });
+ if (gadgets != null)
+ {
+ if (!gadgets.containsKey("data0"))
+ {
+ return;
+ }
+ }
+ else
+ {
+ return;
+ }
+ knowedGadgetsDict = gadgets;
+ var htmlContent = "";
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ symbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ name = gadgets.get("data0").get("gadget_" + i + "_name");
+ icon = gadgets.get("data0").get("gadget_" + i + "_iconFile");
+ isAnUpdate = gadgets.get("data0").get("gadget_" + i + "_isAnUpdate");
+ htmlContent += addGadgetRow(symbolicName, name, icon, isAnUpdate);
+ }
+ document.getElementById("gadgetsListScrollbox").innerHTML = htmlContent;
+ // Set png effet for IE6
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ var iconId = "gadgetsRowIcon_" + gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ setpng(document.getElementById(iconId));
+ }
+ // Show correct filter radio button
+ if (filter == 'all_gadgets')
+ {
+ document.getElementById("gadgetsFilterRadioAll").className = "gadgetsFilterRadio gadgetsFilterRadioActivate";
+ }
+ else
+ {
+ document.getElementById("gadgetsFilterRadioAll").className = "gadgetsFilterRadio gadgetsFilterRadioActivate";
+ }
+ knowedGadgetsFilter = filter;
+ initializeLightbox();
+ // Scroll up
+ var objDiv = document.getElementById("gadgetsListScrollbox");
+ objDiv.scrollTop = 0;
+ }
+
+ function addGadgetRow(symbolicName, name, icon, isAnUpdate)
+ {
+ var htmlContent = "";
+ var iconId = "gadgetsRowIcon_" + symbolicName;
+ htmlContent += '<div class="gadgetsVSpacer" style="width:10px;"></div>';
+ htmlContent += '<div class="gadgetsRowIcon"><img src="' + icon + '" height="34" width="34" id="' + iconId + '"></img></div>';
+ htmlContent += '<div class="gadgetsVSpacer" style="width:10px;"></div>';
+ htmlContent += '<span class="gadgetsRowName2">' + name + '</span>';
+ htmlContent += '<div class="gadgetsVSpacer" style="width:18px;"></div>';
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnHelp" id="helpId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="windowGadgetHelp"></a>';
+ htmlContent += '<div class="gadgetsVSpacer" style="width:8px;"></div>';
+ if (isAnUpdate == "True")
+ {
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnDuplicate" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmUpdate"></a>';
+ }
+ else
+ {
+ htmlContent += '<a class="gadgetsBtnNoTitle gadgetsBtnDuplicate" id="downloadId_' + symbolicName + '" onclick="" href="#" name="lbOn" rel="popupConfirmDownload"></a>';
+ }
+ htmlContent += '<div class="frame01Sep2"></div>';
+ return htmlContent;
+ }
+
+ function getGadgetNameFromSymbolicName(symbolicName)
+ {
+ if (knowedGadgetsDict != null)
+ {
+ var gadgets = knowedGadgetsDict;
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ gSymbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ if (gSymbolicName == symbolicName)
+ {
+ return gadgets.get("data0").get("gadget_" + i + "_name");
+ }
+ }
+ }
+ return "";
+ }
+
+ function getGadgetIconFromSymbolicName(symbolicName)
+ {
+ if (knowedGadgetsDict != null)
+ {
+ var gadgets = knowedGadgetsDict;
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ gSymbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ if (gSymbolicName == symbolicName)
+ {
+ return gadgets.get("data0").get("gadget_" + i + "_iconFile");
+ }
+ }
+ }
+ return "";
+ }
+
+ function getGadgetScgFromSymbolicName(symbolicName)
+ {
+ if (knowedGadgetsDict != null)
+ {
+ var gadgets = knowedGadgetsDict;
+ var gadgetsCount = parseInt(gadgets.get("data0").get("gadgets_count"));
+ for (i = 0; i < gadgetsCount; i++)
+ {
+ gSymbolicName = gadgets.get("data0").get("gadget_" + i + "_symbolicName");
+ if (gSymbolicName == symbolicName)
+ {
+ return gadgets.get("data0").get("gadget_" + i + "_scgFile");
+ }
+ }
+ }
+ return "";
+ }
+
+ function setLastGadgetInAction(symbolicName)
+ {
+ var idx = symbolicName.indexOf("_", 0) + 1;
+ symbolicName = symbolicName.slice(idx, symbolicName.length);
+ lastGadgetSymbolicNameInAction = symbolicName;
+ lastGadgetNameInAction = getGadgetNameFromSymbolicName(symbolicName);
+ lastGadgetIconInAction = getGadgetIconFromSymbolicName(symbolicName);
+ return true;
+ }
+
+ function updateWindowGadgetHelpContent(symbolicName)
+ {
+ if (!setLastGadgetInAction(symbolicName))
+ {
+ abortNextLightbox();
+ return;
+ }
+ document.getElementById("windowGadgetHelpIcon").src = lastGadgetIconInAction;
+ setpng(document.getElementById("windowGadgetHelpIcon"));
+ document.getElementById("windowGadgetHelpTitle").firstChild.nodeValue = lastGadgetNameInAction;
+ var skin = document.getElementById("skin").value;
+ var language = document.getElementById("language").value;
+ var src = "/wi_user_01/online_gadget_help?symbolic_name=" + lastGadgetSymbolicNameInAction;
+ src += "&language=" + language;
+ src += "&skin=" + skin;
+ src += "&rndParam=" + Math.random();
+ document.getElementById("windowGadgetHelpContentIFrame").src = src;
+ }
+
+ function updatePopupGadgetDownloadContent(symbolicName)
+ {
+ if (!setLastGadgetInAction(symbolicName))
+ {
+ abortNextLightbox();
+ return;
+ }
+ document.getElementById("popup01GadgetDownloadIcon").src = lastGadgetIconInAction;
+ setpng(document.getElementById("popup01GadgetDownloadIcon"));
+ }
+
+ function updatePopupGadgetUpdateContent(symbolicName)
+ {
+ if (!setLastGadgetInAction(symbolicName))
+ {
+ abortNextLightbox();
+ return;
+ }
+ document.getElementById("popup01GadgetUpdateIcon").src = lastGadgetIconInAction;
+ setpng(document.getElementById("popup01GadgetUpdateIcon"));
+ }
+
+ function downloadGadget()
+ {
+ if (lastGadgetSymbolicNameInAction == "0")
+ {
+ return;
+ }
+ var scgFile = getGadgetScgFromSymbolicName(lastGadgetSymbolicNameInAction);
+ var args = {
+ "path" : scgFile
+ }
+ getRequest("/gadgets_server/insert_gadget", args);
+ symbolicName = lastGadgetSymbolicNameInAction;
+ lastGadgetSymbolicNameInAction = "0";
+ var idx = symbolicName.indexOf("_", 0) + 1;
+ symbolicName = symbolicName.slice(idx, symbolicName.length);
+ if (window.top.gotoGadgetsConfigure)
+ {
+ window.top.gotoGadgetsConfigure(symbolicName);
+ }
+ }
+
+ function updateGadget()
+ {
+ if (lastGadgetSymbolicNameInAction == "0")
+ {
+ return;
+ }
+ var scgFile = getGadgetScgFromSymbolicName(lastGadgetSymbolicNameInAction);
+ var args = {
+ "path" : scgFile
+ }
+ getRequest("/gadgets_server/insert_gadget", args);
+ lastGadgetSymbolicNameInAction = "0";
+ fillGadgetRows(knowedGadgetsFilter);
+ setTimeout('clickMe("popupUpdatedShow")', 500);
+ }
]]>
</script>
</head>
@@ -81,11 +307,131 @@
top:0px;">
<!-- NOTIFICATION VIEW -->
<div class="frame01TopSpace">
+ <div class="gadgetsVSpacer" style="width:35px;height:40px;"></div>
+ <xsl:element name="a">
+ <xsl:attribute name="class">gadgetsFilterRadio gadgetsFilterRadioActivate</xsl:attribute>
+ <xsl:attribute name="id">gadgetsFilterRadioAll</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:fillGadgetRows('all_gadgets'); return false;</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/all"/>
+ </xsl:element>
</div>
- <div class="frame01Middle" style="height:495px;">
+ <div class="frame01Middle" style="height:465px;">
+ <div class="gadgetsListScrollbox2" id="gadgetsListScrollbox"></div>
</div>
- <div class="frame01Bottom"></div>
+ <div class="frame01Bottom2"></div>
</div>
+ <!-- POPUP CONFIRM DOWNLOAD -->
+ <div id="popupConfirmDownload" class="popup01Box" onfocus="updatePopupGadgetDownloadContent(arguments[0]);">
+ <div class="popupFrame01Top"></div>
+ <div class="popupFrame01Middle">
+ <div class="popup01GadgetIcon">
+ <xsl:element name="img">
+ <xsl:attribute name="id">popup01GadgetDownloadIcon</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
+ <xsl:attribute name="height">34</xsl:attribute>
+ <xsl:attribute name="width">34</xsl:attribute>
+ </xsl:element>
+ </div>
+ <span class="popup01Message"><xsl:value-of select="root/translations/popup_confirm_download_gadget"/></span>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:downloadGadget();return false;</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/yes"/>
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="id">closeLightbox</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/no"/>
+ </xsl:element>
+ </div>
+ <div class="popupFrame01Bottom"></div>
+ </div>
+ <!-- POPUP CONFIRM UPDATE -->
+ <div id="popupConfirmUpdate" class="popup01Box" onfocus="updatePopupGadgetUpdateContent(arguments[0]);">
+ <div class="popupFrame01Top"></div>
+ <div class="popupFrame01Middle">
+ <div class="popup01GadgetIcon">
+ <xsl:element name="img">
+ <xsl:attribute name="id">popup01GadgetUpdateIcon</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
+ <xsl:attribute name="height">34</xsl:attribute>
+ <xsl:attribute name="width">34</xsl:attribute>
+ </xsl:element>
+ </div>
+ <span class="popup01Message"><xsl:value-of select="root/translations/popup_confirm_update_gadget"/></span>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:updateGadget();return false;</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/yes"/>
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="id">closeLightbox</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/no"/>
+ </xsl:element>
+ </div>
+ <div class="popupFrame01Bottom"></div>
+ </div>
+ <!-- POPUP GADGET IS UP TO DATE -->
+ <div id="popupGadgetUpToDate" class="popup01Box" onfocus="return true;">
+ <div class="popupFrame01Top"></div>
+ <div class="popupFrame01Middle">
+ <span class="popup01Message" style="width:409px;text-align:center;"><xsl:value-of select="root/translations/popup_gadget_has_been_updated"/></span>
+ <xsl:element name="a">
+ <xsl:attribute name="class">popupBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/close"/>
+ </xsl:element>
+ <xsl:element name="a">
+ <xsl:attribute name="id">popupUpdatedShow</xsl:attribute>
+ <xsl:attribute name="name">lbOn</xsl:attribute>
+ <xsl:attribute name="rel">popupGadgetUpToDate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute>
+ </xsl:element>
+ </div>
+ <div class="popupFrame01Bottom"></div>
+ </div>
+ <!-- WINDOW GADGET HELP -->
+ <div id="windowGadgetHelp" class="window01Box" onfocus="updateWindowGadgetHelpContent(arguments[0]);" style="height:350px; margin-top:65px;">
+ <div class="windowFrame01Top">
+ <div class="windowGadgetIcon">
+ <xsl:element name="img">
+ <xsl:attribute name="id">windowGadgetHelpIcon</xsl:attribute>
+ <xsl:attribute name="src">/data/web_interface/user_01/img/empty.png</xsl:attribute>
+ <xsl:attribute name="height">33</xsl:attribute>
+ <xsl:attribute name="width">33</xsl:attribute>
+ </xsl:element>
+ </div>
+ <span class="windowTitle" id="windowGadgetHelpTitle"> . </span>
+ </div>
+ <div class="windowFrame01Middle" style="height:290px;">
+ <iframe class="windowContentIFrame"
+ id="windowGadgetHelpContentIFrame"
+ name="windowGadgetHelpContentIFrame"
+ frameborder="0"
+ scrolling="no"
+ style="height:240px"
+ src="">
+ </iframe>
+ <div style="display:table;float:left;height:34px;width:370px"></div>
+ <xsl:element name="a">
+ <xsl:attribute name="class">windowBtn</xsl:attribute>
+ <xsl:attribute name="name">lbOff</xsl:attribute>
+ <xsl:attribute name="rel">deactivate</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/close"/>
+ </xsl:element>
+ </div>
+ <div class="windowFrame01Bottom"></div>
+ </div>
</body>
</html>
</xsl:template>
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -301,7 +301,40 @@
# Register the service into the resource
resourceGadgetsServer.addService(TDSServiceGadgetsServerGetGadgetData)
+# ------------------------------------------------------------------------------
+# Declaration of the service "get_online_gadgets_data".
+# ------------------------------------------------------------------------------
+class TDSServiceGadgetsServerGetOnlineGadgetsData(TDSService):
+ def configure(self):
+ self.parametersDict = {
+ 'filter' : 'string',
+ 'language' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "get_online_gadgets_data"
+ self.comment = "Get the data of the online gadgets."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ filter = parameters['filter']
+ language = parameters['language']
+ gadgetsOnlineContainer = resourceGadgetsServer.getGadgetsContainer().getGadgetsOnlineContainer()
+ gadgetsOnlineContainer.update()
+ data = gadgetsOnlineContainer.getData("fr", filter)
+ if data == None:
+ contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
+ else:
+ contentStruct['root']['data'] = data
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceGadgetsServer.addService(TDSServiceGadgetsServerGetOnlineGadgetsData)
+
+
# ------------------------------------------------------------------------------
# Declaration of the service "start_gadget".
# ------------------------------------------------------------------------------
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-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -3,6 +3,7 @@
# ==============================================================================
from translation.Translation import Translation
+from util.misc import URLTools
# ------------------------------------------------------------------------------
# Declaration of the resource "wi_user_01".
@@ -191,6 +192,7 @@
self.parametersDict = {
'language' : 'string',
'skin' : 'string',
+ 'uuid' : 'string',
}
self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
self.exclusiveExecution = False
@@ -203,10 +205,16 @@
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
language = parameters['language']
skin = parameters['skin']
+ uuid = parameters['uuid']
+ for ugc in resourceUgcServer.getUgcContainer().getUgcs():
+ if ugc.getParentGadget().getDescription().getUuid() == uuid:
+ uuid = ugc.getDescription().getUuid()
+ break
contentStruct['root']['data'] = {}
contentStruct['root']['translations'] = resourceWIUser01.translations.getTranslations(language)
contentStruct['root']['skin'] = skin
contentStruct['root']['language'] = language
+ contentStruct['root']['uuid'] = uuid
self.haveXsl = True
self.xslPath = "/data/web_interface/%s/xsl/gadgets.xsl" % skin
return headersStruct, contentStruct
@@ -441,6 +449,54 @@
resourceWIUser01.addService(TDSServiceWIUser01GadgetHelp)
# ------------------------------------------------------------------------------
+# Declaration of the service "online_gadget_help".
+# ------------------------------------------------------------------------------
+class TDSServiceWIUser01OnlineGadgetHelp(TDSService):
+
+ def configure(self):
+ self.parametersDict = {
+ 'symbolic_name' : 'string',
+ 'language' : 'string',
+ 'skin' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "online_gadget_help"
+ self.comment = "Show the online gadget help."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ symbolicName = parameters['symbolic_name']
+ language = parameters['language']
+ skin = parameters['skin']
+ data = None
+ onlineGadget = resourceGadgetsServer.getGadgetsContainer().getGadgetsOnlineContainer().getOnlineGadgetBySymbolicName(symbolicName)
+ if onlineGadget != None:
+ helpUrl = onlineGadget.getHelpFile(language)
+ helpContent = URLTools.URLDownloadToString(helpUrl)
+ if helpContent != None:
+ data = {
+ 'description' : {
+ 'helpFile' : helpContent,
+ }
+ }
+ if data == None:
+ contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
+ else:
+ contentStruct['root']['data'] = data
+ contentStruct['root']['skin'] = skin
+ contentStruct['root']['language'] = language
+ contentStruct['root']['translations'] = resourceWIUser01.translations.getTranslations(language)
+ self.haveXsl = True
+ self.xslPath = "/data/web_interface/%s/xsl/gadget_help.xsl" % skin
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceWIUser01.addService(TDSServiceWIUser01OnlineGadgetHelp)
+
+# ------------------------------------------------------------------------------
# Declaration of the service "apply_gadget".
# ------------------------------------------------------------------------------
class TDSServiceWIUser01ApplyGadget(TDSService):
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-27 14:52:50 UTC (rev 5175)
@@ -46,6 +46,15 @@
msgid "popup_confirm_delete_gadget"
msgstr ""
+msgid "popup_confirm_download_gadget"
+msgstr ""
+
+msgid "popup_confirm_update_gadget"
+msgstr ""
+
+msgid "popup_gadget_has_been_updated"
+msgstr ""
+
msgid "popup_confirm_delete_attitune"
msgstr ""
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-27 14:52:50 UTC (rev 5175)
@@ -44,10 +44,19 @@
msgstr "This functionality is not yet implemented."
msgid "popup_confirm_delete_gadget"
-msgstr "Delete this gadget ?"
+msgstr "Do you want to delete this gadget ?"
+msgid "popup_confirm_download_gadget"
+msgstr "Do you want to download this gadget ?"
+
+msgid "popup_confirm_update_gadget"
+msgstr "Do you want to update this gadget ?"
+
+msgid "popup_gadget_has_been_updated"
+msgstr "The gadget is now up to date."
+
msgid "popup_confirm_delete_attitune"
-msgstr "Delete this attitune ?"
+msgstr "Do you want to delete this attitune ?"
msgid "yes"
msgstr "Yes"
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-27 14:52:50 UTC (rev 5175)
@@ -44,10 +44,19 @@
msgstr "Cette fonctionnalité n'est pas encore implémentée."
msgid "popup_confirm_delete_gadget"
-msgstr "Supprimer ce gadget ?"
+msgstr "Voulez-vous supprimer ce gadget ?"
+msgid "popup_confirm_download_gadget"
+msgstr "Voulez-vous télécharger ce gadget ?"
+
+msgid "popup_confirm_update_gadget"
+msgstr "Voulez-vous mettre à jour ce gadget ?"
+
+msgid "popup_gadget_has_been_updated"
+msgstr "Le gadget a été mis à jour."
+
msgid "popup_confirm_delete_attitune"
-msgstr "Supprimer cette attitune ?"
+msgstr "Voulez-vous supprimer cette attitune ?"
msgid "yes"
msgstr "Oui"
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -121,6 +121,18 @@
return result
# --------------------------------------------------------------------------
+ # Get the target platform.
+ # --------------------------------------------------------------------------
+ def getPlatform(self):
+ """Get the target platform.
+ @return: <all|linux|windows>
+ """
+ if self.__dictionary.has_key('platform'):
+ return self.__dictionary['platform']
+ else:
+ return "all"
+
+ # --------------------------------------------------------------------------
# Get the scg file.
# --------------------------------------------------------------------------
def getScgFile(self):
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -166,6 +166,7 @@
gadgetData['defaultLanguage'] = gadget.getDescription().getDefaultLanguage()
gadgetData['category'] = gadget.getDescription().getCategory()
gadgetData['author'] = gadget.getDescription().getAuthor()
+ gadgetData['platform'] = gadget.getDescription().getPlatform()
gadgetData['name'] = {}
gadgetData['description'] = {}
gadgetData['helpFile'] = {}
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-27 13:02:46 UTC (rev 5174)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-27 14:52:50 UTC (rev 5175)
@@ -26,6 +26,7 @@
"""Constructor of the class.
@param gadgetsContainer: Gadgets container object.
"""
+ self.__gadgetsContainer = gadgetsContainer
self.__gadgetsOnline = []
self.__gadgetsCount = 0
self.__mutex = threading.Lock()
@@ -94,6 +95,23 @@
return result
# --------------------------------------------------------------------------
+ # Get an online gadget by it symbolic name.
+ # --------------------------------------------------------------------------
+ def getOnlineGadgetBySymbolicName(self, symbolicName):
+ """Get an online gadget by it symbolic name.
+ @param symbolicName: Symbolic name of the online gadget.
+ @return: The online gadget or None.
+ """
+ self.__mutex.acquire()
+ result = None
+ for onlineGadget in self.__gadgetsOnline:
+ if onlineGadget.getSymbolicName() == symbolicName:
+ result = onlineGadget
+ break
+ self.__mutex.release()
+ return result
+
+ # --------------------------------------------------------------------------
# Get the online gadgets data dictionary.
# --------------------------------------------------------------------------
def getData(self, language, category = "all_gadgets"):
@@ -102,6 +120,27 @@
@param category: Gadget category as filter.
@return: A dictionary.
"""
+ def getSplitedVersion(version):
+ vList = version.split(".")
+ for i, v in enumerate(vList):
+ try:
+ vList[i] = int(v)
+ except:
+ vList[i] = 0
+ if len(vList) < 3:
+ if len(vList) < 2:
+ if len(vList) < 1:
+ vList.append(0)
+ vList.append(0)
+ vList.append(0)
+ return vList
+ def cmpVersionGt(v1, v2):
+ for i in range(3):
+ if v1[i] > v2[i]:
+ return True
+ elif v1[i] < v2[i]:
+ return False
+ return False
result = {}
onlineGadgets = self.getOnlineGadgets()
i = 0
@@ -109,22 +148,50 @@
for onlineGadget in onlineGadgets:
cat = onlineGadget.getCategory()
if not cat.lower() in categories:
- categories.append(cat)
+ categories.append(cat.lower())
+ # Check the category
if category != "all_gadgets":
if cat.lower() != category.lower():
continue
- data = {}
- data['name'] = onlineGadget.getName(language)
- data['symbolicName'] = onlineGadget.getSymbolicName()
- data['description'] = onlineGadget.getDescription(language)
- data['category'] = onlineGadget.getCategory()
- data['defaultLanguage'] = onlineGadget.getDefaultLanguage()
- data['author'] = onlineGadget.getAuthor()
- data['version'] = onlineGadget.getVersion()
- data['helpFile'] = onlineGadget.getHelpFile(language)
- data['iconFile'] = onlineGadget.getIconFile()
- data['scgFile'] = onlineGadget.getScgFile()
- result["gadget_%d" % i] = data
+ # Check the language
+ if not onlineGadget.getDefaultLanguage() in ["all", "English", language]:
+ continue
+ # Check the platform
+ gadgetPlatform = onlineGadget.getPlatform()
+ if gadgetPlatform != "all":
+ if gadgetPlatform == "windows":
+ if os.name != "nt":
+ continue
+ else:
+ if os.name == "nt":
+ continue
+ # Check for gadget already present
+ isAnUpdate = False
+ abort = False
+ splOnlineGadgetVersion = getSplitedVersion(onlineGadget.getVersion())
+ onlineGadgetUuid = onlineGadget.getSymbolicName().replace("gadget_", "")
+ for gadget in self.__gadgetsContainer.getGadgets():
+ if onlineGadgetUuid == gadget.getDescription().getUuid():
+ splGadgetVersion = getSplitedVersion(gadget.getDescription().getVersion())
+ if cmpVersionGt(splOnlineGadgetVersion, splGadgetVersion):
+ isAnUpdate = True
+ else:
+ abort = True
+ break
+ if abort:
+ continue
+ # Fill info to the result dict
+ result["gadget_%d_name" % i] = onlineGadget.getName(language)
+ result["gadget_%d_symbolicName" % i] = onlineGadget.getSymbolicName()
+ result["gadget_%d_description" % i] = onlineGadget.getDescription(language)
+ result["gadget_%d_category" % i] = onlineGadget.getCategory()
+ result["gadget_%d_defaultLanguage" % i] = onlineGadget.getDefaultLanguage()
+ result["gadget_%d_author" % i] = onlineGadget.getAuthor()
+ result["gadget_%d_version" % i] = onlineGadget.getVersion()
+ result["gadget_%d_helpFile" % i] = onlineGadget.getHelpFile(language)
+ result["gadget_%d_iconFile" % i] = onlineGadget.getIconFile()
+ result["gadget_%d_scgFile" % i] = onlineGadget.getScgFile()
+ result["gadget_%d_isAnUpdate" % i] = isAnUpdate
i += 1
result['gadgets_count'] = i
result['categories_count'] = len(categories)
|
|
From: jerome <c2m...@c2...> - 2009-07-27 13:03:11
|
Author: jerome
Date: 2009-07-27 15:02:46 +0200 (Mon, 27 Jul 2009)
New Revision: 5174
Modified:
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.pas
Log:
* Registering balloon config.
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.pas
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-27 10:24:53 UTC (rev 5173)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-27 13:02:46 UTC (rev 5174)
@@ -110,12 +110,17 @@
procedure EmbeddedWB1DocumentComplete(ASender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
procedure ConnectionCheckerTimer(Sender: TObject);
- procedure AddSysTrayIcon;
+ procedure AddSysTrayIcon();
procedure ShowBalloonTips(mess : string);
- procedure DeleteSysTrayIcon;
+ procedure DeleteSysTrayIcon();
procedure HideBalloonTips();
+ procedure setBalloonCanShow(showable : boolean);
+ function isBalloonCanShow() : boolean;
+ function GetAllUsersDir() : string;
+ function GetTuxDroidDataBaseDirectory() : string;
+
private
{ Darations priv }
IconData: TNewNotifyIconData;
@@ -170,8 +175,11 @@
//Avoiding close action.
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
- Form1.ShowBalloonTips('TuxBox 2.0 is now hidden in the tray icon' + slinebreak +
- 'To open it again, please double-click the tray icon.');
+ if Form1.isBalloonCanShow() then
+ Form1.ShowBalloonTips('TuxBox 2.0 is now hidden in the tray icon' + slinebreak +
+ 'To open it again, please double-click the tray icon.' +
+ slinebreak +
+ 'Click here to make this message disappear.');
CanClose := False;
Form1.Hide;
end;
@@ -323,26 +331,9 @@
PostMessage(Handle, WM_NULL, 0, 0);
end
-
- else if msg.LParam = NIN_BALLOONSHOW then
- begin
- //Sent when the balloon is shown
- end
-
- else if msg.LParam = NIN_BALLOONHIDE then
- begin
- //Sent when the balloon disappears
- end
-
- else if msg.LParam = NIN_BALLOONTIMEOUT then
- begin
- //Sent when the balloon is dismissed because of a timeout.
-
- end
-
else if msg.LParam = NIN_BALLOONUSERCLICK then
begin
- //Sent when the balloon is dismissed because the user clicked the mouse.
+ setBalloonCanShow(false);
end
end;
@@ -537,5 +528,71 @@
ShowMessage('Tray icon deletion failed');
end;
+
+{*
+* \brief Get the all users base directory.
+* \return A string.
+*}
+function TForm1.GetAllUsersDir : string;
+begin
+ result := GetEnvironmentVariable('ALLUSERSPROFILE');
+end;
+
+{ \brief Get the Tux Droid data base directory return A string.}
+function TForm1.GetTuxDroidDataBaseDirectory : string;
+begin
+ result := GetAllUsersDir + '\Kysoh\Tux Droid';
+end;
+
+
+{ Return true if the balloon can be showed. }
+function TForm1.isBalloonCanShow() : boolean;
+var
+ path : string;
+ res : string;
+ F : TextFile;
+begin
+ path := GetTuxDroidDataBaseDirectory + '\configurations\TuxBox2.0.conf';
+ if not FileExists(path) then
+ begin
+ //Creating state file.
+ Form1.setBalloonCanShow(true);
+ result := true;
+ end
+ else
+ begin
+ try
+ AssignFile(F, path);
+ reset(F);
+ readLn(F, res);
+ closeFile(F);
+ result := strtobool(res);
+ except
+
+ end;
+ end;
+end;
+
+
+{ Set the balloon visible or not }
+procedure TForm1.setBalloonCanShow(showable : boolean);
+var
+ path : string;
+ F : TextFile;
+begin
+ {$i+}
+ path := GetTuxDroidDataBaseDirectory + '\configurations\TuxBox2.0.conf';
+ try
+ AssignFile(F, path);
+ rewrite(F);
+ writeLn(F, booltostr(showable));
+ closeFile(F);
+ except
+
+ end;
+ {$i-}
+end;
+
+
end.
|
|
From: jerome <c2m...@c2...> - 2009-07-27 10:25:19
|
Author: jerome
Date: 2009-07-27 12:24:53 +0200 (Mon, 27 Jul 2009)
New Revision: 5173
Modified:
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.pas
Log:
* Added balloon notification area when user try to quit TuxBox 2.0
* Modified the way to display the tray icon.
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.pas
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-26 11:41:30 UTC (rev 5172)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-27 10:24:53 UTC (rev 5173)
@@ -29,10 +29,64 @@
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw_EWB, EwbCore, EmbeddedWB, Menus, ImgList, IEDownload,
ExtCtrls, EwbControlComponent, AppEvnts, StdCtrls, ComCtrls, ShellAPI, TuxUtils,
- Registry, CommCtrl;
+ Registry;
+
+const
+ NIF_INFO = $10;
+ NIF_MESSAGE = 1;
+ NIF_ICON = 2;
+ NOTIFYICON_VERSION = 3;
+ NIF_TIP = 4;
+ NIM_SETVERSION = $00000004;
+ NIM_SETFOCUS = $00000003;
+ NIIF_INFO = $00000001;
+ NIIF_WARNING = $00000002;
+ NIIF_ERROR = $00000003;
+
+ NIN_BALLOONSHOW = WM_USER + 2;
+ NIN_BALLOONHIDE = WM_USER + 3;
+ NIN_BALLOONTIMEOUT = WM_USER + 4;
+ NIN_BALLOONUSERCLICK = WM_USER + 5;
+ NIN_SELECT = WM_USER + 0;
+ NINF_KEY = $1;
+ NIN_KEYSELECT = NIN_SELECT or NINF_KEY;
+
+ {other constants can be found in vs.net---vc7's dir: PlatformSDK\Include\ShellAPI.h}
+
+ {define the callback message}
+ TRAY_CALLBACK = WM_USER + $7258;
+
+ {new NotifyIconData structure definition}
+type
+ PNewNotifyIconData = ^TNewNotifyIconData;
+ TDUMMYUNIONNAME = record
+ case Integer of
+ 0: (uTimeout: UINT);
+ 1: (uVersion: UINT);
+ end;
+
+ TNewNotifyIconData = record
+ cbSize: DWORD;
+ Wnd: HWND;
+ uID: UINT;
+ uFlags: UINT;
+ uCallbackMessage: UINT;
+ hIcon: HICON;
+ //Version 5.0 is 128 chars, old ver is 64 chars
+ szTip: array [0..127] of Char;
+ dwState: DWORD; //Version 5.0
+ dwStateMask: DWORD; //Version 5.0
+ szInfo: array [0..255] of Char; //Version 5.0
+ DUMMYUNIONNAME: TDUMMYUNIONNAME;
+ szInfoTitle: array [0..63] of Char; //Version 5.0
+ dwInfoFlags: DWORD; //Version 5.0
+ end;
+
+
const wm_AppelMessage = wm_user + 1;
+
type
TForm1 = class(TForm)
EmbeddedWB1: TEmbeddedWB;
@@ -56,9 +110,15 @@
procedure EmbeddedWB1DocumentComplete(ASender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
procedure ConnectionCheckerTimer(Sender: TObject);
-
+ procedure AddSysTrayIcon;
+ procedure ShowBalloonTips(mess : string);
+ procedure DeleteSysTrayIcon;
+ procedure HideBalloonTips();
+
+
private
{ Darations priv }
+ IconData: TNewNotifyIconData;
procedure WMAppelMessage(var msg : TMessage); message wm_AppelMessage;
procedure OpenUrl(const url : String);
@@ -67,12 +127,14 @@
{ Darations publiques }
end;
+
var
Form1 : TForm1;
url : String;
Tray : TNotifyIconData;
AppIcon : TIcon;
started : boolean;
+ balloonShowed : boolean;
implementation
@@ -87,38 +149,29 @@
procedure TForm1.FormCreate(Sender: TObject);
begin
url := 'http://127.0.0.1:270/user/';
-
started := false;
- //Tray icon initialization.
- Tray.cbSize := SizeOf(Tray);
- Tray.wnd := Handle;
- Tray.uID := 1;
- Tray.UCallbackMessage := wm_AppelMessage;
-
+ //Setting app icon.
AppIcon := TIcon.Create;
ImageList1.GetIcon(0, AppIcon);
Application.Icon := AppIcon;
Form1.Icon := AppIcon;
- Tray.hIcon := Application.Icon.handle;
- Tray.szTip := 'Show / Hide TuxBox 2.0';
- Tray.uFlags := nif_message or nif_icon or nif_tip;
+ balloonShowed := false;
+ Form1.AddSysTrayIcon;
- //Adding tray icon to the system tray.
- Shell_NotifyIcon(Nim_ADD, @Tray);
-
//states initialization
TuxUtils.initKnowedVars();
//Starting status pooling.
EmbeddedWB1.Go(url);
-
end;
//Avoiding close action.
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
+ Form1.ShowBalloonTips('TuxBox 2.0 is now hidden in the tray icon' + slinebreak +
+ 'To open it again, please double-click the tray icon.');
CanClose := False;
Form1.Hide;
end;
@@ -195,8 +248,8 @@
begin
if TuxUtils.stopServer() then
begin
- Shell_NotifyIcon(Nim_DELETE,@tray);
AppIcon.Free;
+ Form1.DeleteSysTrayIcon;
EmbeddedWB1.Free;
Application.Terminate;
end
@@ -268,8 +321,30 @@
GetCursorPos(Cursor);
PopupMenu1.Popup(Cursor.X, Cursor.Y);
PostMessage(Handle, WM_NULL, 0, 0);
- end;
+ end
+
+ else if msg.LParam = NIN_BALLOONSHOW then
+ begin
+ //Sent when the balloon is shown
+ end
+
+ else if msg.LParam = NIN_BALLOONHIDE then
+ begin
+ //Sent when the balloon disappears
+ end
+
+ else if msg.LParam = NIN_BALLOONTIMEOUT then
+ begin
+ //Sent when the balloon is dismissed because of a timeout.
+
+ end
+
+ else if msg.LParam = NIN_BALLOONUSERCLICK then
+ begin
+ //Sent when the balloon is dismissed because the user clicked the mouse.
+ end
+
end;
@@ -338,9 +413,12 @@
if connection and sound and ( not activity ) and ( ( TuxUtils.knowed_mute
and ( not TuxUtils.knowed_activity )) <> ( sound and (not activity) )) then
begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
+
ImageList1.GetIcon(0, AppIcon);
- Tray.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @tray);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
end
//Changing tray icon 'mute' only if last registered values <> new sound and
@@ -349,26 +427,35 @@
( ( ( not sound ) and ( not activity ) ) <> ( ( not TuxUtils.knowed_mute )
and ( not TuxUtils.knowed_activity ) ) )then
begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
+
ImageList1.GetIcon(4, AppIcon);
- Tray.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @tray);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
end
else if connection and activity and sound and ( ( sound and activity ) <>
( TuxUtils.knowed_mute and TuxUtils.knowed_activity ) ) then
begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
+
ImageList1.GetIcon(3, AppIcon);
- Tray.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @tray);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
end
//Changing icon only if last state <> new state.
else if connection <> ( TuxUtils.knowed_server and TuxUtils.knowed_radio and TuxUtils.knowed_dongle)
or ( not started ) then
begin
+ if balloonShowed then
+ Form1.HideBalloonTips();
+
ImageList1.GetIcon(1, AppIcon);
- Tray.hIcon := AppIcon.Handle;
- Shell_NotifyIcon(Nim_Modify, @tray);
+ IconData.hIcon := AppIcon.Handle;
+ Shell_NotifyIcon(Nim_Modify, @IconData);
end;
if sound then
@@ -376,7 +463,7 @@
Mute1.ImageIndex := -1
else
//Updating tick from popup menu ( sound off ).
- Mute1.ImageIndex := 5;
+ Mute1.ImageIndex := 5;
//Registering new values.
TuxUtils.knowed_mute := sound;
@@ -389,8 +476,66 @@
started := true;
Application.ProcessMessages;
-
+
end;
+
+{AddSysTrayIcon procedure add an icon to notification area}
+procedure TForm1.AddSysTrayIcon();
+begin
+ balloonShowed := false;
+ IconData.cbSize := SizeOf(IconData);
+ IconData.Wnd := AllocateHWnd(WMAppelMessage);
+ {SysTrayIconMsgHandler is then callback message' handler}
+ IconData.uID := 0;
+ IconData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
+ IconData.uCallbackMessage := TRAY_CALLBACK;
+ IconData.hIcon := Application.Icon.Handle; //an Icon's Handle
+ IconData.szTip := 'TuxBox 2.0 Show / Hide';
+ if not Shell_NotifyIcon(NIM_ADD, @IconData) then
+ Application.Terminate;
+end;
+
+
+{ShowBalloonTips procedure carry out the new feature: Balloon Tips}
+procedure TForm1.ShowBalloonTips(mess : string);
+var
+ TipInfo, TipTitle: string;
+begin
+ balloonShowed := true;
+ IconData.cbSize := SizeOf(IconData);
+ IconData.uFlags := NIF_INFO;
+ TipInfo := mess;
+ strPLCopy(IconData.szInfo, TipInfo, SizeOf(IconData.szInfo) - 1);
+ IconData.DUMMYUNIONNAME.uTimeout := 2000;
+ TipTitle := 'TuxBox 2.0 Warning';
+ strPLCopy(IconData.szInfoTitle, TipTitle, SizeOf(IconData.szInfoTitle) - 1);
+ IconData.dwInfoFlags := NIIF_INFO; //NIIF_ERROR; //NIIF_WARNING;
+ Shell_NotifyIcon(NIM_MODIFY, @IconData);
+ {in my testing, the following code has no use}
+ IconData.DUMMYUNIONNAME.uVersion := NOTIFYICON_VERSION;
+ Shell_NotifyIcon(NIM_SETVERSION, @IconData);
+end;
+
+
+{Hide the balloon}
+Procedure TForm1.HideBalloonTips();
+begin
+ balloonShowed := false;
+ IconData.cbSize := SizeOf(IconData);
+ IconData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
+ IconData.szTip := 'TuxBox 2.0 Show / Hide';
+ Shell_NotifyIcon(NIM_MODIFY, @IconData)
+end;
+
+
+{here's the deletion procedure}
+procedure TForm1.DeleteSysTrayIcon;
+begin
+ DeallocateHWnd(IconData.Wnd);
+ if not Shell_NotifyIcon(NIM_DELETE, @IconData) then
+ ShowMessage('Tray icon deletion failed');
+end;
+
end.
|
|
From: remi <c2m...@c2...> - 2009-07-26 11:41:49
|
Author: remi
Date: 2009-07-26 13:41:30 +0200 (Sun, 26 Jul 2009)
New Revision: 5172
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
Log:
* Added the symbolic name of the gadget in the data structure
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-26 11:09:10 UTC (rev 5171)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-26 11:41:30 UTC (rev 5172)
@@ -115,6 +115,7 @@
continue
data = {}
data['name'] = onlineGadget.getName(language)
+ data['symbolicName'] = onlineGadget.getSymbolicName()
data['description'] = onlineGadget.getDescription(language)
data['category'] = onlineGadget.getCategory()
data['defaultLanguage'] = onlineGadget.getDefaultLanguage()
|
|
From: remi <c2m...@c2...> - 2009-07-26 11:09:40
|
Author: remi
Date: 2009-07-26 13:09:10 +0200 (Sun, 26 Jul 2009)
New Revision: 5171
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
Log:
* Added a method to format online gadgets informations to a dictionary with a filter on gadget categories (Further translated to xml data)
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-25 10:19:19 UTC (rev 5170)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-26 11:09:10 UTC (rev 5171)
@@ -92,3 +92,42 @@
result.append(onlineGadget)
self.__mutex.release()
return result
+
+ # --------------------------------------------------------------------------
+ # Get the online gadgets data dictionary.
+ # --------------------------------------------------------------------------
+ def getData(self, language, category = "all_gadgets"):
+ """Get the online gadgets data dictionary.
+ @param language: Language.
+ @param category: Gadget category as filter.
+ @return: A dictionary.
+ """
+ result = {}
+ onlineGadgets = self.getOnlineGadgets()
+ i = 0
+ categories = []
+ for onlineGadget in onlineGadgets:
+ cat = onlineGadget.getCategory()
+ if not cat.lower() in categories:
+ categories.append(cat)
+ if category != "all_gadgets":
+ if cat.lower() != category.lower():
+ continue
+ data = {}
+ data['name'] = onlineGadget.getName(language)
+ data['description'] = onlineGadget.getDescription(language)
+ data['category'] = onlineGadget.getCategory()
+ data['defaultLanguage'] = onlineGadget.getDefaultLanguage()
+ data['author'] = onlineGadget.getAuthor()
+ data['version'] = onlineGadget.getVersion()
+ data['helpFile'] = onlineGadget.getHelpFile(language)
+ data['iconFile'] = onlineGadget.getIconFile()
+ data['scgFile'] = onlineGadget.getScgFile()
+ result["gadget_%d" % i] = data
+ i += 1
+ result['gadgets_count'] = i
+ result['categories_count'] = len(categories)
+ categories.sort()
+ for i, category in enumerate(categories):
+ result["category_%d" % i] = category
+ return result
|
|
From: remi <c2m...@c2...> - 2009-07-25 10:19:38
|
Author: remi
Date: 2009-07-25 12:19:19 +0200 (Sat, 25 Jul 2009)
New Revision: 5170
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
Log:
* Update the online gadgets informations only once.
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-25 10:11:38 UTC (rev 5169)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-25 10:19:19 UTC (rev 5170)
@@ -37,6 +37,10 @@
"""Update gadget structures with dictionary.
"""
self.__mutex.acquire()
+ # Update only once
+ if self.__gadgetsCount != 0:
+ self.__mutex.release()
+ return
self.__gadgetsOnline = []
self.__gadgetsCount = 0
gadgetsXmlFile = os.path.join(DirectoriesAndFilesTools.GetOSTMPDir(),
|
|
From: remi <c2m...@c2...> - 2009-07-25 10:11:53
|
Author: remi
Date: 2009-07-25 12:11:38 +0200 (Sat, 25 Jul 2009)
New Revision: 5169
Modified:
software_suite_v3/smart-core/smart-server/trunk/TDSAutoUpdater.py
Log:
* Updated url to check connection state
Modified: software_suite_v3/smart-core/smart-server/trunk/TDSAutoUpdater.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TDSAutoUpdater.py 2009-07-25 10:09:25 UTC (rev 5168)
+++ software_suite_v3/smart-core/smart-server/trunk/TDSAutoUpdater.py 2009-07-25 10:11:38 UTC (rev 5169)
@@ -197,7 +197,7 @@
"""Check for updates.
"""
# Wait for connection to internet enabled
- while not URLTools.URLCheckConnection():
+ while not URLTools.URLCheckConnection("http://ftp.kysoh.com"):
time.sleep(1.0)
self.__logger.logInfo("Internet connection is detected")
# Download conf files
|
|
From: remi <c2m...@c2...> - 2009-07-25 10:09:47
|
Author: remi Date: 2009-07-25 12:09:25 +0200 (Sat, 25 Jul 2009) New Revision: 5168 Added: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py Log: * Added classes to retrieve online gadgets informations. Added: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py (rev 0) +++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py 2009-07-25 10:09:25 UTC (rev 5168) @@ -0,0 +1,132 @@ +# Copyright (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +ONLINE_GADGETS_BASE_URL = "http://ftp.kysoh.com/ssv3/content/gadgets/" + +# ------------------------------------------------------------------------------ +# Gadget online class. +# ------------------------------------------------------------------------------ +class GadgetOnline(object): + """Gadget online class. + """ + + # -------------------------------------------------------------------------- + # Constructor of the class. + # -------------------------------------------------------------------------- + def __init__(self, gadgetsOnlineContainer, dictionary): + """Constructor of the class. + @param gadgetsOnlineContainer: Gadgets online container object. + @param dictionary: Data dictionary. + """ + self.__dictionary = dictionary + + # -------------------------------------------------------------------------- + # Get the author. + # -------------------------------------------------------------------------- + def getAuthor(self): + """Get the author. + @return: A string. + """ + return self.__dictionary['author'] + + # -------------------------------------------------------------------------- + # Get the category. + # -------------------------------------------------------------------------- + def getCategory(self): + """Get the category. + @return: A string. + """ + return self.__dictionary['category'] + + # -------------------------------------------------------------------------- + # Get the default language. + # -------------------------------------------------------------------------- + def getDefaultLanguage(self): + """Get the default language. + @return: A string. + """ + return self.__dictionary['defaultLanguage'] + + # -------------------------------------------------------------------------- + # Get the symbolic name. + # -------------------------------------------------------------------------- + def getSymbolicName(self): + """Get the symbolic name. + @return: A string. + """ + return self.__dictionary['symbolicName'] + + # -------------------------------------------------------------------------- + # Get the version. + # -------------------------------------------------------------------------- + def getVersion(self): + """Get the version. + @return: A string. + """ + return self.__dictionary['version'] + + # -------------------------------------------------------------------------- + # Get the description. + # -------------------------------------------------------------------------- + def getDescription(self, language): + """Get the description. + @param language: Language. + @return: A string. + """ + if self.__dictionary['description'].has_key(language): + return self.__dictionary['description'][language] + else: + return self.__dictionary['description']['en'] + + # -------------------------------------------------------------------------- + # Get the name. + # -------------------------------------------------------------------------- + def getName(self, language): + """Get the name. + @param language: Language. + @return: A string. + """ + if self.__dictionary['name'].has_key(language): + return self.__dictionary['name'][language] + else: + return self.__dictionary['name']['en'] + + # -------------------------------------------------------------------------- + # Get the help file url. + # -------------------------------------------------------------------------- + def getHelpFile(self, language): + """Get the help file url. + @param language: Language. + @return: A string. + """ + if self.__dictionary['helpFile'].has_key(language): + fileName = self.__dictionary['helpFile'][language] + else: + fileName = self.__dictionary['helpFile']['en'] + result = "%sdeflated/%s/%s" % (ONLINE_GADGETS_BASE_URL, + self.getSymbolicName(), fileName) + return result + + # -------------------------------------------------------------------------- + # Get the icon url. + # -------------------------------------------------------------------------- + def getIconFile(self): + """Get the icon url. + @return: A string. + """ + result = "%sdeflated/%s/gadget.png" % (ONLINE_GADGETS_BASE_URL, + self.getSymbolicName()) + return result + + # -------------------------------------------------------------------------- + # Get the scg file. + # -------------------------------------------------------------------------- + def getScgFile(self): + """Get the scg file. + @return: A string. + """ + result = "%sscg/%s.scg" % (ONLINE_GADGETS_BASE_URL, + self.getSymbolicName()) + return result Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-07-24 12:33:51 UTC (rev 5167) +++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-07-25 10:09:25 UTC (rev 5168) @@ -9,9 +9,11 @@ from util.filesystem.AutoDeployer import AutoDeployer from util.xml.XmlSerializer import XmlSerializer from util.misc import DirectoriesAndFilesTools +from util.misc import URLTools from util.applicationserver.plugin.Plugin import SUPPORTED_LANGUAGES_LIST from Gadget import Gadget from GadgetGenerator import GadgetGenerator +from GadgetsOnlineContainer import GadgetsOnlineContainer # ------------------------------------------------------------------------------ # Gadgets container class. @@ -38,6 +40,7 @@ self.__onGadgetDeployedCallback = None self.__onGadgetDeploymentErrorCallback = None self.__onGadgetUndeployedCallback = None + self.__gadgetsOnlineContainer = GadgetsOnlineContainer(self) # -------------------------------------------------------------------------- # Configure the locale values of the gadgets container. @@ -88,6 +91,15 @@ return self.__pluginsContainer.getPitch() # -------------------------------------------------------------------------- + # Get the online gadgets container. + # -------------------------------------------------------------------------- + def getGadgetsOnlineContainer(self): + """Get the online gadgets container. + @return: A GadgetsOnlineContainer object. + """ + return self.__gadgetsOnlineContainer + + # -------------------------------------------------------------------------- # Generate a single name. # -------------------------------------------------------------------------- def generateSingleName(self, gadgetName, language): Added: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py (rev 0) +++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-07-25 10:09:25 UTC (rev 5168) @@ -0,0 +1,90 @@ +# Copyright (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +import os +import threading + +from util.xml.XmlSerializer import XmlSerializer +from util.misc import DirectoriesAndFilesTools +from util.misc import URLTools +from GadgetOnline import GadgetOnline +from GadgetOnline import ONLINE_GADGETS_BASE_URL + +# ------------------------------------------------------------------------------ +# Gadgets online container class. +# ------------------------------------------------------------------------------ +class GadgetsOnlineContainer(object): + """Gadgets online container class. + """ + + # -------------------------------------------------------------------------- + # Constructor of the class. + # -------------------------------------------------------------------------- + def __init__(self, gadgetsContainer): + """Constructor of the class. + @param gadgetsContainer: Gadgets container object. + """ + self.__gadgetsOnline = [] + self.__gadgetsCount = 0 + self.__mutex = threading.Lock() + + # -------------------------------------------------------------------------- + # Update gadget structures with dictionary. + # -------------------------------------------------------------------------- + def update(self): + """Update gadget structures with dictionary. + """ + self.__mutex.acquire() + self.__gadgetsOnline = [] + self.__gadgetsCount = 0 + gadgetsXmlFile = os.path.join(DirectoriesAndFilesTools.GetOSTMPDir(), + "gadgets.xml") + # Download the xml file from the ftp + gadgetsXmlUrl = ONLINE_GADGETS_BASE_URL + "gadgets.xml" + if not URLTools.URLDownloadToFile(gadgetsXmlUrl, gadgetsXmlFile): + self.__mutex.release() + return + # Parse the xml file + gadgetsXmlFileContent = XmlSerializer.deserializeEx(gadgetsXmlFile) + DirectoriesAndFilesTools.RMFile(gadgetsXmlFile) + if gadgetsXmlFileContent == None: + self.__mutex.release() + return + try: + count = int(gadgetsXmlFileContent['count']) + for i in range(count): + onlineGadget = GadgetOnline(self, + gadgetsXmlFileContent['gadget_%.4d' % i]) + self.__gadgetsOnline.append(onlineGadget) + self.__gadgetsCount = count + except: + pass + self.__mutex.release() + + # -------------------------------------------------------------------------- + # Get the number of online gadgets. + # -------------------------------------------------------------------------- + def getCount(self): + """Get the number of online gadgets. + @return: An integer. + """ + self.__mutex.acquire() + result = self.__gadgetsCount + self.__mutex.release() + return result + + # -------------------------------------------------------------------------- + # Get the online gadgets. + # -------------------------------------------------------------------------- + def getOnlineGadgets(self): + """Get the online gadgets. + @return: A list of OnlineGadget. + """ + self.__mutex.acquire() + result = [] + for onlineGadget in self.__gadgetsOnline: + result.append(onlineGadget) + self.__mutex.release() + return result |
|
From: remi <c2m...@c2...> - 2009-07-24 12:34:04
|
Author: remi
Date: 2009-07-24 14:33:51 +0200 (Fri, 24 Jul 2009)
New Revision: 5167
Modified:
software_suite_v3/smart-core/smart-server/trunk/installer.nsi
software_suite_v3/smart-core/smart-server/trunk/version.py
Log:
* Updated version to 0.4.1-b8
Modified: software_suite_v3/smart-core/smart-server/trunk/installer.nsi
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/installer.nsi 2009-07-24 12:29:22 UTC (rev 5166)
+++ software_suite_v3/smart-core/smart-server/trunk/installer.nsi 2009-07-24 12:33:51 UTC (rev 5167)
@@ -4,7 +4,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Smart Server"
-!define PRODUCT_VERSION "0.4.1-b7"
+!define PRODUCT_VERSION "0.4.1-b8"
; Output names
!define FINAL_INSTALLER_EXE "SmartServerInstaller_${PRODUCT_VERSION}.exe"
Modified: software_suite_v3/smart-core/smart-server/trunk/version.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/version.py 2009-07-24 12:29:22 UTC (rev 5166)
+++ software_suite_v3/smart-core/smart-server/trunk/version.py 2009-07-24 12:33:51 UTC (rev 5167)
@@ -7,7 +7,7 @@
# Distributed under the terms of the GNU General Public License
# http://www.gnu.org/copyleft/gpl.html
-version = '0.4.1-b7'
+version = '0.4.1-b8'
author = "Remi Jocaille (rem...@c2...)"
licence = "GPL"
date = "2009"
|
|
From: remi <c2m...@c2...> - 2009-07-24 12:29:33
|
Author: remi
Date: 2009-07-24 14:29:22 +0200 (Fri, 24 Jul 2009)
New Revision: 5166
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadget-configuration.css
Log:
* Fixed a bug according to the ticket "#162 ?\226?\128?\148 Gadget config text strings requiring more than 1 line"
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadget-configuration.css
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadget-configuration.css 2009-07-24 12:05:26 UTC (rev 5165)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/css/gadget-configuration.css 2009-07-24 12:29:22 UTC (rev 5166)
@@ -113,7 +113,6 @@
color:#000;
text-align:right;
vertical-align:middle;
- overflow:hidden;
text-decoration:none;
font-family:Verdana, Bitstream Vera Sans;
}
|
|
From: remi <c2m...@c2...> - 2009-07-24 12:05:38
|
Author: remi
Date: 2009-07-24 14:05:26 +0200 (Fri, 24 Jul 2009)
New Revision: 5165
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/01_drivers/01_resourceTuxOSL.py
Log:
* Play an attitune when the system is ready
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/01_drivers/01_resourceTuxOSL.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/01_drivers/01_resourceTuxOSL.py 2009-07-24 11:59:43 UTC (rev 5164)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/01_drivers/01_resourceTuxOSL.py 2009-07-24 12:05:26 UTC (rev 5165)
@@ -95,19 +95,23 @@
def startTuxOsl():
self.__tuxOSL.Start("Acapela")
time.sleep(0.5)
+ resourceTuxDriver.ledsBlink("LED_BOTH", 100, 0.5)
self.__initializeStatesInEventsHandler()
- time.sleep(3.0)
+ time.sleep(1.5)
# Load first voice
pitch = resourceUsers.getCurrentUserConfiguration()['pitch']
firstLocutor = resourceUsers.getCurrentUserConfiguration()['locutor1']
self.ttsSpeak(" ", firstLocutor, pitch)
- time.sleep(3.0)
+ time.sleep(1.5)
# Load second voice
secondLocutor = resourceUsers.getCurrentUserConfiguration()['locutor2']
self.ttsSpeak(" ", secondLocutor, pitch)
- time.sleep(3.0)
+ time.sleep(1.5)
# Reference locutors list
resourcePluginsServer.getPluginsContainer().setLocutorsList(self.ttsVoicesList())
+ # Play the opening attitune.
+ resourceTuxDriver.ledsOff("LED_BOTH")
+ resourceAttituneManager.playAttitune("TuxBox Ready", 0.0)
# Start the robot/content interactions
resourceRobotContentInteractions.startMe()
if value:
|
|
From: remi <c2m...@c2...> - 2009-07-24 11:59:57
|
Author: remi Date: 2009-07-24 13:59:43 +0200 (Fri, 24 Jul 2009) New Revision: 5164 Added: software_suite_v3/software/tool/tool-about-tux/trunk/resources/attitunes/ software_suite_v3/software/tool/tool-about-tux/trunk/resources/attitunes/tuxbox_Ready.att Log: * Added an attitune Added: software_suite_v3/software/tool/tool-about-tux/trunk/resources/attitunes/tuxbox_Ready.att =================================================================== (Binary files differ) Property changes on: software_suite_v3/software/tool/tool-about-tux/trunk/resources/attitunes/tuxbox_Ready.att ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
|
From: remi <c2m...@c2...> - 2009-07-24 11:29:08
|
Author: remi
Date: 2009-07-24 13:28:54 +0200 (Fri, 24 Jul 2009)
New Revision: 5163
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
Log:
* Fixed bug in the "gadgets" page. No page refresh when no gadget match with the current filter.
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-24 11:28:21 UTC (rev 5162)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-24 11:28:54 UTC (rev 5163)
@@ -134,13 +134,6 @@
{
return;
}
- else
- {
- if (gadgets.get("data0").get("count") == '0')
- {
- return;
- }
- }
}
else
{
|
|
From: jerome <c2m...@c2...> - 2009-07-24 11:28:34
|
Author: jerome
Date: 2009-07-24 13:28:21 +0200 (Fri, 24 Jul 2009)
New Revision: 5162
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.pas
Log:
* Added based on user language help.
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-24 11:20:51 UTC (rev 5161)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas 2009-07-24 11:28:21 UTC (rev 5162)
@@ -31,6 +31,8 @@
knowed_server : boolean;
knowed_activity : boolean;
+ knowed_language : string;
+
implementation
@@ -42,6 +44,8 @@
knowed_dongle := false;
knowed_server := false;
knowed_activity := false;
+
+ knowed_language := 'en';
end;
//Return true if the tuxdroidserver is started, false if not.
@@ -170,6 +174,17 @@
on e : Exception do
values.Add('off');
end;
+
+ //Getting current user language.
+ try
+ beginPos := Pos('<language>', aString) + Length('<language>');
+ endPos := Pos('</language>', aString);
+ knowed_language := Copy(aString, beginPos, endPos - beginPos);
+ except
+ on e : Exception do
+ knowed_language := 'en';
+ end;
+
end;
@@ -293,7 +308,7 @@
const
command_language = '';
begin
- {TODO}
+ result := knowed_language;
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.pas
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-24 11:20:51 UTC (rev 5161)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-07-24 11:28:21 UTC (rev 5162)
@@ -29,7 +29,7 @@
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw_EWB, EwbCore, EmbeddedWB, Menus, ImgList, IEDownload,
ExtCtrls, EwbControlComponent, AppEvnts, StdCtrls, ComCtrls, ShellAPI, TuxUtils,
- Registry;
+ Registry, CommCtrl;
const wm_AppelMessage = wm_user + 1;
@@ -56,7 +56,7 @@
procedure EmbeddedWB1DocumentComplete(ASender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
procedure ConnectionCheckerTimer(Sender: TObject);
-
+
private
{ Darations priv }
procedure WMAppelMessage(var msg : TMessage); message wm_AppelMessage;
@@ -145,8 +145,25 @@
//Tray icon 'help' click.
procedure TForm1.Help1Click(Sender: TObject);
+var
+ language : string;
+ adress : string;
begin
- Form1.OpenUrl('http://www.kysoh.com/documentation/');
+ language := TuxUtils.getUserLanguage();
+
+ if language = 'nl' then
+ adress := 'http://www.kysoh.com/documentatie?set_language=nl'
+ else if language = 'fr' then
+ adress := 'http://www.kysoh.com/documentation-3?set_language=fr'
+ else if language = 'es' then
+ adress := 'http://www.kysoh.com/documentacion?set_language=es'
+ else if language = 'it' then
+ adress := 'http://www.kysoh.com/documentazione?set_language=it'
+ else
+ adress := 'http://www.kysoh.com/documentation?set_language=en';
+
+ Form1.OpenUrl(adress);
+
end;
|
|
From: remi <c2m...@c2...> - 2009-07-24 11:21:10
|
Author: remi
Date: 2009-07-24 13:20:51 +0200 (Fri, 24 Jul 2009)
New Revision: 5161
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
Log:
* Updated the "Gadgets" page according to the ticket "#159 ?\226?\128?\148 Gadget page filter modification request "
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-24 10:43:17 UTC (rev 5160)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadgets.xsl 2009-07-24 11:20:51 UTC (rev 5161)
@@ -563,18 +563,18 @@
</xsl:element>
<div class="gadgetsVSpacer" style="width:5px;height:40px;"></div>
<xsl:element name="a">
+ <xsl:attribute name="class">gadgetsFilterRadio gadgetsFilterRadioEnable</xsl:attribute>
+ <xsl:attribute name="id">gadgetsFilterRadioAlerts</xsl:attribute>
+ <xsl:attribute name="onclick">javascript:fillGadgetRows('alerts');return false;</xsl:attribute>
+ <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/alerts"/>
+ </xsl:element>
+ <div class="gadgetsVSpacer" style="width:5px;height:40px;"></div>
+ <xsl:element name="a">
<xsl:attribute name="class">gadgetsFilterRadio gadgetsFilterRadioActivate</xsl:attribute>
<xsl:attribute name="id">gadgetsFilterRadioAll</xsl:attribute>
<xsl:attribute name="onclick">javascript:fillGadgetRows('all_gadgets'); return false;</xsl:attribute>
<xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/all"/>
</xsl:element>
- <div class="gadgetsVSpacer" style="width:5px;height:40px;"></div>
- <xsl:element name="a">
- <xsl:attribute name="class">gadgetsFilterRadio gadgetsFilterRadioEnable</xsl:attribute>
- <xsl:attribute name="id">gadgetsFilterRadioAlerts</xsl:attribute>
- <xsl:attribute name="onclick">javascript:fillGadgetRows('alerts');return false;</xsl:attribute>
- <xsl:attribute name="href">#</xsl:attribute><xsl:value-of select="root/translations/alerts"/>
- </xsl:element>
</div>
<div class="frame01Middle" style="height:465px;">
<div class="gadgetsListScrollbox" id="gadgetsListScrollbox"></div>
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-24 10:43:17 UTC (rev 5160)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-24 11:20:51 UTC (rev 5161)
@@ -32,7 +32,7 @@
msgstr "All"
msgid "on_demand"
-msgstr "Favorites"
+msgstr "My favorites"
msgid "alerts"
msgstr "Alerts"
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-24 10:43:17 UTC (rev 5160)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-24 11:20:51 UTC (rev 5161)
@@ -32,7 +32,7 @@
msgstr "Tous"
msgid "on_demand"
-msgstr "Favoris"
+msgstr "Mes favoris"
msgid "alerts"
msgstr "Alertes"
|
|
From: remi <c2m...@c2...> - 2009-07-24 10:43:33
|
Author: remi
Date: 2009-07-24 12:43:17 +0200 (Fri, 24 Jul 2009)
New Revision: 5160
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
Log:
* Updated log messages
* Updated some data protections
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-07-24 10:42:03 UTC (rev 5159)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-07-24 10:43:17 UTC (rev 5160)
@@ -88,7 +88,7 @@
"""
"""
if not self.contextIsComplete():
- print "PGU Context [%s] content is complete" % self.getPguName()
+ print "PGU Context [%s] : content is complete" % self.getPguName()
self.__contextCompleteMutex.acquire()
self.__contextComplete = True
self.__contextCompleteMutex.release()
@@ -112,9 +112,7 @@
'arguments' : arguments,
})
self.__eventStackMutex.release()
- print "Inserted event in PGU context [%s] :" % self.getPguName()
- print " ", eventType
- print " ", arguments
+ print "PGU context [%s] : Insert event (%s)" % (self.getPguName(), eventType)
def __getEvent(self):
"""
@@ -178,7 +176,7 @@
self.__execStarted = True
self.__execPaused = False
self.__startStopPauseMutex.release()
- print "Start execution of PGU context [%s]" % self.getPguName()
+ print "PGU context [%s] : Start execution" % self.getPguName()
self.__executionLoop()
def executionIsStarted(self):
@@ -198,7 +196,7 @@
time.sleep(0.1)
if not self.executionIsStarted():
return
- print "Stop execution of PGU context [%s]" % self.getPguName()
+ print "PGU context [%s] : Stop execution" % self.getPguName()
self.__startStopPauseMutex.acquire()
self.__execStarted = False
self.__execPaused = False
@@ -209,7 +207,7 @@
self.__breakAttitune()
self.__breakMessage()
self.__breakActuation()
- print "Execution of PGU context [%s] stopped" % self.getPguName()
+ print "PGU context [%s] : Execution stopped" % self.getPguName()
if not self.getPluginCommand().isNotifier():
if self.getContextLayer() == PGU_CONTEXT_LAYER_SCHEDULER:
resourceTuxDriver.playSound(15, 100.0)
@@ -224,7 +222,7 @@
return
if self.executionIsPaused():
return
- print "Pause execution of PGU context [%s]" % self.getPguName()
+ print "PGU context [%s] : Pause execution" % self.getPguName()
self.__startStopPauseMutex.acquire()
self.__execPaused = True
self.__startStopPauseMutex.release()
@@ -239,7 +237,7 @@
return
if not self.executionIsPaused():
return
- print "Unpause execution of PGU context [%s]" % self.getPguName()
+ print "PGU context [%s] : Unpause execution" % self.getPguName()
self.__startStopPauseMutex.acquire()
self.__execPaused = False
self.__startStopPauseMutex.release()
@@ -346,7 +344,7 @@
self.__execStarted = False
self.__execPaused = False
self.__startStopPauseMutex.release()
- print "Execution of PGU context [%s] stopped" % self.getPguName()
+ print "PGU context [%s] : Execution stopped" % self.getPguName()
if not self.getPluginCommand().isNotifier():
if self.getContextLayer() == PGU_CONTEXT_LAYER_SCHEDULER:
resourceTuxDriver.playSound(15, 100.0)
@@ -355,9 +353,7 @@
time.sleep(0.5)
return
else:
- print "Execute event from PGU context [%s] :" % self.getPguName()
- print " ", nextEvent['type']
- print " ", nextEvent['arguments']
+ print "PGU context [%s] : Execute event (%s)" % (self.getPguName(), nextEvent['type'])
arguments = nextEvent['arguments']
if not self.executionIsStarted():
continue
@@ -369,7 +365,7 @@
arguments['actuationArguments'])
elif nextEvent['type'] == PGU_EVENT_TYPE_ATTITUNE:
self.__executeAttitune(arguments['attituneName'])
- print "Event finished"
+ print "PGU context [%s] : Event finished (%s)" % (self.getPguName(), nextEvent['type'])
time.sleep(0.1)
class PguContextsManager(object):
@@ -561,12 +557,14 @@
"""
"""
result = {}
- pguContext = self.getForegroundPguContext()
+ self.__bfPguContextMutex.acquire()
+ pguContext = self.__foregroundPguContext
if pguContext != None:
if pguContext.getContextLayer() == PGU_CONTEXT_LAYER_SCHEDULER:
result['icon'] = "/%s/icon.png" % pguContext.getPguObject().getParentGadget().getDescription().getUuid()
result['name'] = pguContext.getPguObject().getDescription().getName()
result['uuid'] = pguContext.getPguObject().getDescription().getUuid()
+ self.__bfPguContextMutex.release()
return result
def getLastStartedOnDemandUgcMessages(self):
@@ -593,11 +591,17 @@
message = String.toUtf8(message)
result['msg_%d' % i] = message
return result
- pguContext = self.getForegroundPguContext()
+ self.__bfPguContextMutex.acquire()
+ pguContext = self.__foregroundPguContext
if pguContext != None:
if pguContext.getContextLayer() != PGU_CONTEXT_LAYER_SCHEDULER:
- return fillResult(pguContext)
- return fillResult(self.getBackgroundPguContext())
+ ret = fillResult(pguContext)
+ else:
+ ret = fillResult(self.__backgroundPguContext)
+ else:
+ ret = fillResult(self.__backgroundPguContext)
+ self.__bfPguContextMutex.release()
+ return ret
def __setStarted(self, value):
"""
|
|
From: remi <c2m...@c2...> - 2009-07-24 10:42:16
|
Author: remi
Date: 2009-07-24 12:42:03 +0200 (Fri, 24 Jul 2009)
New Revision: 5159
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* Added the current language in the "get_states" service.
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-24 10:27:06 UTC (rev 5158)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-07-24 10:42:03 UTC (rev 5159)
@@ -334,6 +334,7 @@
if currentAlertData != {}:
contentStruct['root']['alert'] = currentAlertData
contentStruct['root']['gadget_messages'] = resourceRobotContentInteractions.getPguContextsManager().getLastStartedOnDemandUgcMessages()
+ contentStruct['root']['language'] = resourceUsers.getCurrentFirstLanguage()
return headersStruct, contentStruct
# Register the service into the resource
|
|
From: jerome <c2m...@c2...> - 2009-07-24 10:27:23
|
Author: jerome
Date: 2009-07-24 12:27:06 +0200 (Fri, 24 Jul 2009)
New Revision: 5158
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
Log:
* Fixed a bug releasing a memory stream.
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-24 10:10:14 UTC (rev 5157)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas 2009-07-24 10:27:06 UTC (rev 5158)
@@ -113,7 +113,6 @@
end;
finally
begin
- output.Free;
Free;
end;
end;
@@ -179,12 +178,16 @@
var
res : string;
begin
-
res := TuxUtils.DownloadHTTP('http://127.0.0.1:270/0/wi_user_01/get_states?');
if res <> '' then
begin
- TuxUtils.parseStates(res, values);
+ try
+ TuxUtils.parseStates(res, values);
+ except
+ result := false;
+ end;
+
result := true;
end
else
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-24 10:10:14 UTC (rev 5157)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm 2009-07-24 10:27:06 UTC (rev 5158)
@@ -60,7 +60,6 @@
Width = 955
Height = 619
TabOrder = 0
- Silent = False
RegisterAsBrowser = True
RegisterAsDropTarget = False
OnDocumentComplete = EmbeddedWB1DocumentComplete
|
|
From: jerome <c2m...@c2...> - 2009-07-24 10:10:31
|
Author: jerome
Date: 2009-07-24 12:10:14 +0200 (Fri, 24 Jul 2009)
New Revision: 5157
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
Log:
* Make use of 'knowed_mute' to make sound toggle.
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-24 10:05:05 UTC (rev 5156)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/TuxUtils.pas 2009-07-24 10:10:14 UTC (rev 5157)
@@ -254,18 +254,11 @@
command_mute = 'http://127.0.0.1:270/0/robot_content_interactions/mute?';
command_unmute = 'http://127.0.0.1:270/0/robot_content_interactions/unmute?';
var
- temp : TStringList;
- sound_on : boolean;
request_result : string;
begin
- TuxUtils.getStates(temp);
-
- sound_on := TuxUtils.isSoundOn(temp);
- temp.Free;
-
request_result := '';
- if(sound_on) then
+ if(TuxUtils.knowed_mute) then
begin
//proceeding to unmute;
request_result := TuxUtils.DownloadHTTP(command_mute);
Modified: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
===================================================================
(Binary files differ)
|
Author: remi Date: 2009-07-24 12:05:05 +0200 (Fri, 24 Jul 2009) New Revision: 5156 Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/global_configuration.xsl 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/resources/05_user_configurations/00_resourceUsers.py software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po software_suite_v3/smart-core/smart-server/trunk/util/osl/TuxOSL.py Log: * Added "global settings" functionality in the "tools" page. Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/global_configuration.xsl =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/global_configuration.xsl (rev 0) +++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/global_configuration.xsl 2009-07-24 10:05:05 UTC (rev 5156) @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format"> + +<xsl:template match="/"> +<html> + <head> + <LINK href="/data/web_interface/user_01/css/gadget-configuration.css" rel="stylesheet" type="text/css"/> + <script src="/data/web_interface/user_01/js/hashtable.js" type="text/javascript"/> + <script src="/data/web_interface/user_01/js/common.js" type="text/javascript"/> + <script language="javascript"> + <![CDATA[ + function initialization() + { + } + + /** + * + */ + function applyGlobalConfiguration() + { + var language = document.getElementById("language").value; + var locutor = document.getElementById("voiceValue").value; + var pitch = document.getElementById("pitchValue").value; + var args = { + "language" : language, + "locutor" : locutor, + "pitch" : pitch + } + res = postRequest("/wi_user_01/apply_global_configuration", args); + } + ]]> + </script> + </head> + + <body bgcolor="#dcdadb" onLoad="initialization();"> + <!-- SKIN STORAGE --> + <xsl:element name="input"> + <xsl:attribute name="type">hidden</xsl:attribute> + <xsl:attribute name="id">skin</xsl:attribute> + <xsl:attribute name="value"> + <xsl:value-of select="root/skin"/> + </xsl:attribute> + </xsl:element> + <!-- LANGUAGE STORAGE --> + <xsl:element name="input"> + <xsl:attribute name="type">hidden</xsl:attribute> + <xsl:attribute name="id">language</xsl:attribute> + <xsl:attribute name="value"> + <xsl:value-of select="root/language"/> + </xsl:attribute> + </xsl:element> + <!-- MAIN DIV FRAME --> + <div style="position:absolute; + left:0px; + top:0px; + width:423px; + height:388px; + overflow-y:scroll; + overflow-x:hidden;"> + <!-- SETTINGS BAR --> + <div class="gadgetConfTitleBarSettings"> + <span class="gadgetConfTitleBarLabel"><xsl:value-of select="root/translations/voice_settings"/></span> + </div> + <div class="gadgetConfTitleBarBottom1"></div> + <!-- VOICE --> + <div class="gadgetConfContentFrameMiddle"> + <div class="gadgetConfContentFrameSep"></div> + <span class="gadgetConfParamName"> + <xsl:value-of select="root/translations/voice_param_title"/> + </span> + <span class="gadgetConfParamValue"> + <xsl:element name="select"> + <xsl:attribute name="class">select</xsl:attribute> + <xsl:attribute name="id">voiceValue</xsl:attribute> + <xsl:attribute name="name">voiceValue</xsl:attribute> + <xsl:for-each select="root/data/availableLocutors/*"> + <xsl:element name="option"> + <xsl:attribute name="value"> + <xsl:value-of select="."/> + </xsl:attribute> + <xsl:if test=". = ../../defaultLocutor"> + <xsl:attribute name="selected">true</xsl:attribute> + </xsl:if> + <xsl:value-of select="."/> + </xsl:element> + </xsl:for-each> + </xsl:element> + </span> + </div> + <!-- PITCH --> + <div class="gadgetConfContentFrameMiddle"> + <div class="gadgetConfContentFrameSep"></div> + <span class="gadgetConfParamName"> + <xsl:value-of select="root/translations/pitch_param_title"/> + </span> + <span class="gadgetConfParamValue"> + <xsl:element name="select"> + <xsl:attribute name="class">select</xsl:attribute> + <xsl:attribute name="id">pitchValue</xsl:attribute> + <xsl:attribute name="name">pitchValue</xsl:attribute> + <xsl:element name="option"> + <xsl:attribute name="value">120</xsl:attribute> + <xsl:if test="root/data/defaultPitch = '120'"> + <xsl:attribute name="selected">true</xsl:attribute> + </xsl:if> + <xsl:value-of select="root/translations/pitch_tux_voice"/> + </xsl:element> + <xsl:element name="option"> + <xsl:attribute name="value">100</xsl:attribute> + <xsl:if test="root/data/defaultPitch = '100'"> + <xsl:attribute name="selected">true</xsl:attribute> + </xsl:if> + <xsl:value-of select="root/translations/pitch_normal"/> + </xsl:element> + <xsl:element name="option"> + <xsl:attribute name="value">85</xsl:attribute> + <xsl:if test="root/data/defaultPitch = '85'"> + <xsl:attribute name="selected">true</xsl:attribute> + </xsl:if> + <xsl:value-of select="root/translations/pitch_low"/> + </xsl:element> + </xsl:element> + </span> + </div> + <div class="gadgetConfContentFrameBottom"></div> + </div> + </body> +</html> +</xsl:template> +</xsl:stylesheet> 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-24 10:04:43 UTC (rev 5155) +++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl 2009-07-24 10:05:05 UTC (rev 5156) @@ -88,17 +88,21 @@ icon2AlreadyPng = true; setpng(document.getElementById("windowGadgetConfigurationIcon")); } - /*var skin = document.getElementById("skin").value; + var skin = document.getElementById("skin").value; var language = document.getElementById("language").value; var src = "/wi_user_01/global_configuration?"; src += "language=" + language; src += "&skin=" + skin; - src += "&rndParam=" + Math.random();*/ - document.getElementById("windowGlobalSettingsContentIFrame").src = "http://127.0.0.1:270/"; + src += "&rndParam=" + Math.random(); + document.getElementById("windowGlobalSettingsContentIFrame").src = src; } function applyGlobalSettings() { + if (window.frames.windowGlobalSettingsContentIFrame && window.frames.windowGlobalSettingsContentIFrame.applyGlobalConfiguration) + { + window.frames.windowGlobalSettingsContentIFrame.applyGlobalConfiguration(); + } } ]]> </script> Modified: software_suite_v3/smart-core/smart-server/trunk/resources/05_user_configurations/00_resourceUsers.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/resources/05_user_configurations/00_resourceUsers.py 2009-07-24 10:04:43 UTC (rev 5155) +++ software_suite_v3/smart-core/smart-server/trunk/resources/05_user_configurations/00_resourceUsers.py 2009-07-24 10:05:05 UTC (rev 5156) @@ -2,6 +2,7 @@ # Users resource. # ============================================================================== +from util.osl.TuxOSL import TUX_OSL_ACAPELA_LOCUTORS_BY_LANGUAGE_COUNTRY_DICT from util.misc.tuxPaths import TUXDROID_LANGUAGE from util.misc.tuxPaths import TUXDROID_LANGUAGE2 from util.misc.tuxPaths import TUXDROID_DEFAULT_LOCUTOR @@ -82,7 +83,7 @@ locutor = TUXDROID_DEFAULT_LOCUTOR locutor2 = TUXDROID_SECOND_LOCUTOR # Todo : Get second language and locutor - pitch = 130 + pitch = 120 defaultConfDict = { 'name' : userName, 'login' : None, @@ -136,6 +137,75 @@ userName = self.__userConfiguration['name'] return os.path.join(TDS_USERS_CONF_PATH, userName) + def getCurrentFirstLocutor(self): + """ + """ + return self.__userConfiguration['locutor1'].replace("8k", "") + + def setNewFirstLocutor(self, locutor): + """ + """ + if locutor.find("8k") == -1: + locutor += "8k" + if locutor == self.getCurrentFirstLocutor(): + return + self.__userConfiguration['locutor1'] = locutor + # Set locales in the plugins server + resourcePluginsServer.getPluginsContainer().setLocales( + self.__userConfiguration['language1'], self.__userConfiguration['country'], + self.__userConfiguration['locutor1'], self.__userConfiguration['pitch']) + + def getCurrentFirstLanguage(self): + """ + """ + return self.__userConfiguration['language1'] + + def getCurrentSecondLocutor(self): + """ + """ + return self.__userConfiguration['locutor2'].replace("8k", "") + + def getCurrentSecondLanguage(self): + """ + """ + return self.__userConfiguration['language2'] + + def getLocutorsFromFirstLanguage(self): + """ + """ + firstLocutor = self.getCurrentFirstLocutor() + locDict = TUX_OSL_ACAPELA_LOCUTORS_BY_LANGUAGE_COUNTRY_DICT + for key in locDict.keys(): + if firstLocutor in locDict[key]: + return locDict[key] + return [] + + def getCurrentPitch(self): + """ + """ + return self.__userConfiguration['pitch'] + + def setNewPitch(self, pitch): + """ + """ + if pitch == self.getCurrentPitch(): + return + self.__userConfiguration['pitch'] = pitch + # Set locales in the plugins server + resourcePluginsServer.getPluginsContainer().setLocales( + self.__userConfiguration['language1'], self.__userConfiguration['country'], + self.__userConfiguration['locutor1'], self.__userConfiguration['pitch']) + + def storeUserConfiguration(self): + """ + """ + # Update configuration file + userConfFile = os.path.join(TDS_USERS_CONF_PATH, self.__lastUser, + "user.conf") + f = open(userConfFile, "w") + f.write(str(self.__userConfiguration)) + f.close() + def updateCurrentUserConfiguration(self, userConfiguration): """Update the current user configuration. @param userConfiguration: New configuration as dictionary. 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-24 10:04:43 UTC (rev 5155) +++ software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py 2009-07-24 10:05:05 UTC (rev 5156) @@ -563,3 +563,80 @@ # Register the service into the resource resourceWIUser01.addService(TDSServiceWIUser01EditAttitune) + +# ------------------------------------------------------------------------------ +# Declaration of the service "global_configuration". +# ------------------------------------------------------------------------------ +class TDSServiceWIUser01GlobalConfiguration(TDSService): + + def configure(self): + self.parametersDict = { + 'language' : 'string', + 'skin' : 'string', + } + self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS + self.exclusiveExecution = False + self.name = "global_configuration" + self.comment = "Show the global configuration." + + def execute(self, id, parameters): + headersStruct = self.getDefaultHeadersStruct() + contentStruct = self.getDefaultContentStruct() + contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) + language = parameters['language'] + skin = parameters['skin'] + data = {} + data['availableLocutors'] = {} + for i, locutor in enumerate(resourceUsers.getLocutorsFromFirstLanguage()): + data['availableLocutors']['loc_%d' % i] = locutor + data['defaultLocutor'] = resourceUsers.getCurrentFirstLocutor() + data['defaultPitch'] = resourceUsers.getCurrentPitch() + contentStruct['root']['data'] = data + contentStruct['root']['skin'] = skin + contentStruct['root']['language'] = language + contentStruct['root']['translations'] = resourceWIUser01.translations.getTranslations(language) + self.haveXsl = True + self.xslPath = "/data/web_interface/%s/xsl/global_configuration.xsl" % skin + return headersStruct, contentStruct + +# Register the service into the resource +resourceWIUser01.addService(TDSServiceWIUser01GlobalConfiguration) + +# ------------------------------------------------------------------------------ +# Declaration of the service "apply_global_configuration". +# ------------------------------------------------------------------------------ +class TDSServiceWIUser01ApplyGlobalConfiguration(TDSService): + + def configure(self): + self.parametersDict = { + 'language' : 'string', + 'locutor' : 'string', + 'pitch' : 'uint8', + } + self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS + self.exclusiveExecution = False + self.name = "apply_global_configuration" + self.comment = "Apply the global configuration." + + def execute(self, id, parameters): + headersStruct = self.getDefaultHeadersStruct() + contentStruct = self.getDefaultContentStruct() + contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) + language = parameters['language'] + locutor = parameters['locutor'] + pitch = parameters['pitch'] + oldLocutor = resourceUsers.getCurrentFirstLocutor() + resourceUsers.setNewFirstLocutor(locutor) + resourceUsers.setNewPitch(pitch) + resourceUsers.storeUserConfiguration() + for ugc in resourceUgcServer.getUgcContainer().getUgcs(): + if ugc.getParameter('locutor') != None: + if ugc.getParameter('locutor').getValue() == oldLocutor: + ugc.getParameter('locutor').setValue(locutor) + if ugc.getParameter('pitch') != None: + ugc.getParameter('pitch').setValue(pitch) + return headersStruct, contentStruct + +# Register the service into the resource +resourceWIUser01.addService(TDSServiceWIUser01ApplyGlobalConfiguration) + Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-24 10:04:43 UTC (rev 5155) +++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-24 10:05:05 UTC (rev 5156) @@ -159,3 +159,24 @@ msgid "introduction_alerts" msgstr "" + +msgid "voice_settings" +msgstr "" + +msgid "voice_param_title" +msgstr "" + +msgid "pitch_param_title" +msgstr "" + +msgid "test" +msgstr "" + +msgid "pitch_tux_voice" +msgstr "" + +msgid "pitch_normal" +msgstr "" + +msgid "pitch_low" +msgstr "" Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-24 10:04:43 UTC (rev 5155) +++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-24 10:05:05 UTC (rev 5156) @@ -159,3 +159,24 @@ msgid "introduction_alerts" msgstr "Introduction alerts" + +msgid "voice_settings" +msgstr "Voice settings" + +msgid "voice_param_title" +msgstr "Voice" + +msgid "pitch_param_title" +msgstr "Pitch" + +msgid "test" +msgstr "Test" + +msgid "pitch_tux_voice" +msgstr "Tux voice" + +msgid "pitch_normal" +msgstr "Normal" + +msgid "pitch_low" +msgstr "Low" Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-24 10:04:43 UTC (rev 5155) +++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-24 10:05:05 UTC (rev 5156) @@ -159,3 +159,24 @@ msgid "introduction_alerts" msgstr "Introduction des alertes" + +msgid "voice_settings" +msgstr "Configuration de la voix" + +msgid "voice_param_title" +msgstr "Voix" + +msgid "pitch_param_title" +msgstr "Tonalité" + +msgid "test" +msgstr "Tester" + +msgid "pitch_tux_voice" +msgstr "Voix de Tux" + +msgid "pitch_normal" +msgstr "Voix normale" + +msgid "pitch_low" +msgstr "Voix grave" Modified: software_suite_v3/smart-core/smart-server/trunk/util/osl/TuxOSL.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/util/osl/TuxOSL.py 2009-07-24 10:04:43 UTC (rev 5155) +++ software_suite_v3/smart-core/smart-server/trunk/util/osl/TuxOSL.py 2009-07-24 10:05:05 UTC (rev 5156) @@ -116,6 +116,23 @@ ST_NAME_WAV_CHANNEL_START, ] +# Locutors languages dictionary +TUX_OSL_ACAPELA_LOCUTORS_BY_LANGUAGE_COUNTRY_DICT = { + 'en_US' : ["Ryan", "Heather"], + 'en_GB' : ["Graham", "Lucy"], + 'fr' : ["Bruno", "Julie"], + 'de' : ["Klaus", "Sarah"], + 'nl_BE' : ["Sofie"], + 'nl' : ["Femke"], + 'ar' : ["Salma"], + 'da' : ["Mette"], + 'no' : ["Kari"], + 'pt' : ["Celia"], + 'sv' : ["Erik", "Emma"], + 'it' : ["Chiara"], + 'es' : ["Maria"], +} + # Callback type defines TUX_OSL_STATUS_CALLBACK = CFUNCTYPE(None, c_char_p) TUX_OSL_BUFFER_CALLBACK = CFUNCTYPE(c_int, c_int, c_char_p) @@ -224,7 +241,7 @@ if self.getStarted(): self.__startingMutex.release() return E_TUXOSL_NOERROR - + if self.tux_osl_lib == None: self.__startingMutex.release() return E_TUXOSL_NOTRUNNING |