Author: michael
Date: Fri Feb 5 09:00:30 2010
New Revision: 8462
URL: http://svn.slimdevices.com/jive?rev=8462&view=rev
Log:
Bug: n/a
Description: get rid of one more os.execute() call when setting the sharing
user name. We still should catch failure when setting the password.
Modified:
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/SetupStorageApplet.lua
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/strings.txt
Modified:
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/SetupStorageApplet.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/SetupStorageApplet.lua?rev=8462&r1=8461&r2=8462&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/SetupStorageApplet.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/SetupStorageApplet.lua
Fri Feb 5 09:00:30 2010
@@ -150,7 +150,7 @@
function _enableSharing(self, window)
-- enable Samba
log:info("Enabling Samba Access")
- self:_setStatus("enabled")
+ self:_setConfig("/etc/samba/status", "enabled")
local success = os.execute("/etc/init.d/samba restart")
if success ~= 0 then
@@ -182,17 +182,17 @@
-- disable Samba
log:info("Disabling Samba Access")
self:stopFileSharing()
- self:_setStatus("disabled")
-end
-
-function _setStatus(self, status)
- local fi = io.open("/etc/samba/status", "w")
-
- if fi == nil then
+ self:_setConfig("/etc/samba/status", "disabled")
+end
+
+function _setConfig(self, file, value)
+ local fi = io.open(file, "w")
+
+ if fi == nil or value == nil then
return false
end
- fi:write(status)
+ fi:write(value)
fi:close()
return true
@@ -251,7 +251,7 @@
-- Set samba user alias for root
-- Samba daemon doesn't need to be
restarted
- os.execute("echo 'root = " .. value ..
"' > /etc/samba/smbusers")
+ self:_setConfig("/etc/samba/smbusers",
"root = " ..value)
self:_updateSharingHelpText()
@@ -266,9 +266,9 @@
local backspace = Keyboard.backspace()
local group = Group('keyboard_textinput', { textinput = textinput,
backspace = backspace } )
- window:addWidget(group)
+ window:addWidget(group)
window:addWidget(Keyboard("keyboard", 'qwerty', textinput))
- window:focusWidget(group)
+ window:focusWidget(group)
-- _helpAction(self, window, 'NETWORK_NETWORK_NAME_HELP',
'NETWORK_NETWORK_NAME_HELP_BODY', menu)
@@ -308,6 +308,8 @@
-- Samba daemon doesn't need to be
restarted
-- A valid smb.conf file is needed
os.execute("(echo " .. value .. "; echo
" .. value .. ") | smbpasswd -s -a -c /etc/samba/smb.conf.dist root")
+
+ -- TODO: might want to show some error
message to the user if the above call fails
self:_updateSharingHelpText()
@@ -322,9 +324,9 @@
local backspace = Keyboard.backspace()
local group = Group('keyboard_textinput', { textinput = textinput,
backspace = backspace } )
- window:addWidget(group)
+ window:addWidget(group)
window:addWidget(Keyboard("keyboard", 'qwerty', textinput))
- window:focusWidget(group)
+ window:focusWidget(group)
-- _helpAction(self, window, 'NETWORK_NETWORK_NAME_HELP',
'NETWORK_NETWORK_NAME_HELP_BODY', menu)
Modified:
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/strings.txt
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/strings.txt?rev=8462&r1=8461&r2=8462&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/strings.txt
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay_fab4/share/applets/SetupStorage/strings.txt
Fri Feb 5 09:00:30 2010
@@ -250,6 +250,10 @@
DE Warnung: Die Freigabe konnte nicht ordnungsgemäà gestartet
werden. Möglicherweise steht nicht genügend Speicher zur Verfügung.
EN WARNING: The file sharing failed to start properly. This might
be due to a low memory situation.
+SHARING_PASSWORD_FAILURE_INFO
+ DE Warnung: Das Kennwort konnte nicht ordnungsgemäà geändert
werden. Möglicherweise steht nicht genügend Speicher zur Verfügung.
+ EN WARNING: The password change failed. This might be due to a low
memory situation.
+
SHARING_TRY_AGAIN
CS Zkuste to znovu
DA Prøv igen
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins