static bool getLunaPrefSystemValue(const char* key, std::string& value)
{
#if defined(HAS_LUNA_PREF)

	char* str = 0;
	if (LP_ERR_NONE == LPSystemCopyStringValue(key, &str) && str) {
		value = str;
		g_free((gchar*) str);
		return true;
	}	
#endif

	value = LOCALIZED("Unknown");
	return false;
}
Exemple #2
0
//TODO: Time to start getting rid of "luna" in visible pathnames
Settings::Settings()
	: lunaAppsPath( "/var/luna/applications/" )
	, pendingAppsPath( "/var/palm/data/com.palm.appInstallService" )
	, appInstallBase( "/media/cryptofs/apps" )
	, appInstallRelative( "usr/palm/applications" )
	, packageInstallBase( "/media/cryptofs/apps" )
	, packageInstallRelative( "usr/palm/packages" )
	, serviceInstallBase( "/media/cryptofs/apps" )
	, serviceInstallRelative( "usr/palm/services" )
	, packageManifestsPath("/media/cryptofs/apps/usr/lib/ipkg/info")
	, downloadPathMedia("/media/internal/downloads")
	, appInstallerTmp("/media/cryptofs/tmp")
	, lunaPresetLaunchPointsPath("/usr/luna/launchpoints/")
	, lunaLaunchPointsPath( "/var/luna/launchpoints/" )
	, lunaSystemPath( "/usr/lib/luna/system/luna-systemui/" )
	, lunaAppLauncherPath( "/usr/lib/luna/system/luna-applauncher/" )
	, lunaSystemResourcesPath( "/usr/palm/sysmgr/images/" )
	, lunaSystemLocalePath( "/usr/palm/sysmgr/localization" )
	, lunaCustomizationLocalePath( "/usr/palm/sysmgr-cust/localization")
	, lunaPrefsPath("/var/luna/preferences/")
	, lunaCmdHandlerPath("/usr/palm/command-resource-handlers.json")
	, lunaCmdHandlerSavedPath("/var/usr/palm/command-resource-handlers-active.json")
	, lunaQmlUiComponentsPath("/usr/palm/sysmgr/uiComponents/")
	, cardLimit(16)
	, showReticle(true)
	, lunaSystemSoundsPath("/usr/palm/sounds")
	, lunaDefaultAlertSound("alert.wav")
	, lunaDefaultRingtoneSound("phone.wav")
	, lunaSystemSoundAppClose("appclose")
	, lunaSystemSoundScreenCapture("shutter")
	, notificationSoundDuration(5000)
	, lightbarEnabled (false)
	, coreNaviScaler (75)
	, gestureAnimationSpeed (1000)
        , backlightOutdoorScale (250)
        , backlightDimScale (30)
        , backlightDarkScale (10)
	, displayWidth(320)
	, displayHeight(320)
	, displayNumBuffers(3)
	, ledPulseMaxBrightness (100)
	, ledPulseDarkBrightness (50)
	, enableAls(true)
	, disableLocking(false)
	, lockScreenTimeout(5000)
	, maxPenMoveFreq(30)
	, maxPaintLoad(6)				       // number of ms for paint routine
	, maxGestureChangeFreq(30)
	, maxTouchChangeFreq(30)
	, debug_trackInputEvents(false)
	, debug_enabled(false)
	, debug_piranhaDrawColoredOutlines(false)
	, debug_piranhaDisplayFps(false)
	, debug_showGestures(false)
	, debug_doVerboseCrashLogging(false)
    , debug_loopInCrashHandler(false)
	, tapRadius(12)
	, tapRadiusMin(5)
	, tapRadiusSquared(144)
	, tapRadiusShrinkPercent(10)
	, tapRadiusShrinkGranMs(50)
	, tapDoubleClickDuration(300)
    , enableTouchEventsForWebApps(false)
    , homeDoubleClickDuration(70)
	, dragRadiusSquared(64)
	, h_trackball_pixels_per_move(30)
	, v_trackball_pixels_per_move(40)
	, h_accel_rate1(200)
	, v_accel_rate1(200)
	, h_accel_const1(2)
	, v_accel_const1(1)
	, h_accel_rate2(500)
	, v_accel_rate2(500)
	, h_accel_const2(3)
	, v_accel_const2(2)
	, accelFastPollFreq (33)
	, turnOffAccelWhenDimmed(true)
    , logger_useSyslog(true)
	, logger_useTerminal(false)
	, logger_useColor(false)
    , logger_level(G_LOG_LEVEL_WARNING)
	, defaultLanguage("en_US")
	, launcherDefaultPositions("/etc/palm/default-launcher-page-layout.json")
	, launcherCustomPositions("/usr/lib/luna/customization/default-launcher-page-layout.json")
	, quicklaunchDefaultPositions("/usr/palm/default-dock-positions.json")
	, quicklaunchCustomPositions("/usr/lib/luna/customization/default-dock-positions.json")
	, quicklaunchUserPositions("/var/palm/user-dock-positions.json")
	, launcherScrim("/usr/lib/luna/system/luna-applauncher/images/launcher_scrim.png")
        , firstCardLaunch("/var/luna/preferences/used-first-card")
	, atlasEnabled(false)
	, emulatedCardWidth(320)
	, emulatedCardHeight(480)
	, cardGroupingXDistanceFactor(1.0)
	, atlasMemThreshold(0)
	, launcherAtlasStatistics(false)
	, launcherDumpAtlas(false)
	, launcherSideSwipeThreshold(1.2)
	, launcherUsesHwAA(false)
	, launcherRowSpacingAdjust(0)
	, launcherLabelWidthAdjust(0)
	, launcherLabelXPadding(12)
	, launcherIconReorderPositionThreshold(36.0)
	, statusBarTitleMaxWidth(140)
	, dockModePrelaunchAllApps(false)
	, dockModeCloseOnMinimize(true)
	, dockModeCloseOnExit(true)
	, dockModeMaxApps(3)
	, dockModeNightBrightness(1)
	, dockModeDefaultPositions("/etc/palm/default-exhibition-apps.json")
	, dockModeCustomPositions("/usr/lib/luna/customization/default-exhibition-apps.json")
	, dockModeUserPositions("/var/palm/user-exhibition-apps.json")
	, dockModeMenuHeight (400)
	, virtualKeyboardEnabled(false)
	, virtualCoreNaviEnabled(false)
	, virtualCoreNaviHeight(0)
	, uiType(UI_LUNA)
	, fontBanner("Prelude")
	, fontActiveBanner("Prelude")
	, fontLockWindow("Prelude")
	, fontDockMode("Prelude")
	, fontQuicklaunch("Prelude")
	, fontBootupAnimation("/usr/share/fonts/Prelude-Bold.ttf")
	, fontProgressAnimationBold("/usr/share/fonts/Prelude-Bold.ttf")
	, fontProgressAnimation("Prelude")
	, fontKeyboardKeys("Prelude")
	, fontStatusBar("Prelude")
	, displayUiRotates(false)
	, tabletUi(false)
	, homeButtonOrientationAngle(0)
	, emuModeOrientationAngle(0)
	, positiveSpaceTopPadding(24)
	, positiveSpaceBottomPadding(24)
	, maximumNegativeSpaceHeightRatio(0.55)
	, activeCardWindowRatio(0.659)
	, nonActiveCardWindowRatio(0.61)
    , ghostCardFinalRatio(0.85)
	, cardGroupRotFactor(90)
	, gapBetweenCardGroups(10)
	, overlayNotificationsHeight(83)
	, splashIconSize(128)
    , enableSplashBackgrounds(true)
	, maxDownloadManagerQueueLength(128)
	, maxDownloadManagerConcurrent(2)
	, maxDownloadManagerRecvSpeed(64 * 1024)
	, cesDemoBuild(false)
	, cesGestureRepeaterIp("10.0.0.204")
	, cesGestureRepeaterPort(5001)
	, enableGestureRepeater(false)
	, showAppStats(false)
	, collectUseStats(true)
	, usePartialKeywordAppSearch(true)
	, scanCalculatesAppSizes(false)
	, uiMainCpuShareLow(512)
	, uiOtherCpuShareLow(128)
	, javaCpuShareLow(128)
	, webCpuShareLow(64)
	, gameCpuShareLow(32)
	, cpuShareDefault(1024)
	, cpuShareDefaultLow(512)
	, allowTurboMode(true)
	, wifiInterfaceName("eth0")
	, wanInterfaceName("ppp0")
	, canRestartHeadlessApps(true)
	, forceSoftwareRendering(false)
	, perfTesting(false)
	, debug_appInstallerCleaner(3)
	, modalWindowWidth(320)
	, modalWindowHeight(480)
	, demoMode(false)
    , cardDimmPercentage(0.8f)
    , schemaValidationOption(0)
{

#if !defined(TARGET_DESKTOP)
	// CES -->
	// See if we're running on Nova-Demo.
    // The property to check is "com.palm.properties.buildName".
    char *build = NULL;
    LPErr e = LPSystemCopyStringValue ("com.palm.properties.buildName", &build);
    if (LP_ERR_NONE == e && NULL != build)
    {
        if (0 == strcmp ("Nova-Demo", build))
        {
			cesDemoBuild = true;
            enableGestureRepeater = true;
        }
    }
	// <-- CES
#endif

#if defined(TARGET_DESKTOP)
    {
    	//redirect the manifests dir
    	packageManifestsPath = "/tmp";
	}
#endif

	load(kSettingsFile);
	load(kSettingsFilePlatform);

	postLoad();

}