Bug 526717 - remove non-working "Set as desktop background" from the UI for unsupported desktops. r=gavin

This commit is contained in:
Wolfgang Rosenauer
2012-04-02 22:43:12 +02:00
parent 6dd560a599
commit 9e0cad1539
5 changed files with 39 additions and 1 deletions

View File

@@ -382,6 +382,21 @@ nsGNOMEShellService::SetShouldCheckDefaultBrowser(bool aShouldCheck)
return NS_OK;
}
NS_IMETHODIMP
nsGNOMEShellService::GetCanSetDesktopBackground(bool* aResult)
{
// setting desktop background is currently only supported
// for Gnome or desktops using the same GSettings and GConf keys
const char* gnomeSession = getenv("GNOME_DESKTOP_SESSION_ID");
if (gnomeSession) {
*aResult = true;
} else {
*aResult = false;
}
return NS_OK;
}
static nsresult
WriteImage(const nsCString& aPath, imgIContainer* aImage)
{