MunkiStatus.app: more fixes to loginwindow display: now behaves correctly when com.apple.loginwindow DesktopPicture is set to a bogus value.

git-svn-id: http://munki.googlecode.com/svn/trunk@106 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2009-06-24 17:36:42 +00:00
parent a5db4a1b7b
commit dbf031683c
+5 -15
View File
@@ -44,30 +44,20 @@ on awake from nib theObject
copy (call method "mainScreenRect") to screenRect
call method "setFrame:display:" of theObject with parameters {screenRect, true}
try
--tell application "System Events"
--set DesktopPicture to value of property list item "DesktopPicture" of property list file "/Library/Preferences/com.apple.loginwindow.plist"
--end tell
--first check if a custom desktop picture has been set
set DesktopPicture to do shell script "/usr/bin/defaults read /Library/Preferences/com.apple.loginwindow DesktopPicture"
on error
-- no DesktopPicture set for loginwindow, let's use some defaults
try
set DesktopPicture to "/System/Library/CoreServices/DefaultDesktop.jpg"
tell application "System Events"
if exists (POSIX file DesktopPicture as file) then
--do nothing; just trying to trigger an error
end if
end tell
on error
set DesktopPicture to "/Library/Desktop Pictures/Aqua Blue.jpg"
end try
set DesktopPicture to "/System/Library/CoreServices/DefaultDesktop.jpg"
end try
-- now we have a DesktopPicture, try to load the image
try
do shell script "/usr/bin/logger -t MunkiStatus 'Setting background to " & DesktopPicture
set bgPicture to load image DesktopPicture
-- did it work?
get bgPicture
on error
-- failed. just use our internal solid blue background
do shell script "/usr/bin/logger -t MunkiStatus 'Setting background to Solid Aqua Blue'"
set bgPicture to load image "Solid Aqua Blue"
end try
set contents of image view "imageFld" of theObject to bgPicture