preferences

Cocoa button opens a System Preference page

依然范特西╮ 提交于 2019-11-29 23:14:24
In a OSX Cocoa app, I would like a button that would open the "speech" preference pane. Is that possible? I'm just trying to save them the time to go System Preferences > Speech > Text to Speech The following is a fairly easy (and reliable) way to at least get System Preferences open to the Speech.prefPane: - (IBAction)openSpeechPrefs:(id)sender { [[NSWorkspace sharedWorkspace] openURL: [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Speech.prefPane"]]; } However, it won't necessarily be switched to the Text to Speech tab, but rather the last tab the user had selected. It is possible

Nested preferences.xml

三世轮回 提交于 2019-11-29 22:55:34
Is it somehow possible to include one preferences.xml into another, like it can be done for layouts with the <include /> tag? Let's say: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen android:title="@string/pref_group_title_visual"> <include preferences_filename="xml/pref_visual"/> </PreferenceScreen> ... Solution here it is to inflate both preference files from PreferencesActivity. For example: addPreferencesFromResource(R.xml.options); addPreferencesFromResource(R.xml.additional_options); The solution

Where are the Java preferences stored in Windows 7?

落爺英雄遲暮 提交于 2019-11-29 22:06:56
We use the Java preferences in some of our apps and haven't really noticed this since the utility that makes the calls is fairly old and was written in Windows XP days. But it seems the Java preferences are no longer stored in the registry in Windows 7 - or they are stored somewhere different. I'm expecting it to be in: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs But I don't see it there. What makes it wierder, is that when I run this app: public static void main( final String[] args ) throws BackingStoreException { Preferences systemRoot = Preferences.systemRoot(); Preferences preferences =

Android preferences summary default color?

北城以北 提交于 2019-11-29 21:46:45
问题 I have installed my app in a real phone, and even though in the emulator all the texts of the preferences summaries seem to be in the same color, in the real phone the color is different (some kind of blue... but I guess it depends on the phone's model). How can I set this color to my custom preference component? (I have implemented my own seek bar, and its summary text color is different from all the other components text color...). Thanks! 回答1: I found these: android:textAppearance="

iPhone - How to detect if a key exists in NSUserDefaults standardUserDefaults

孤者浪人 提交于 2019-11-29 21:03:42
Using NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; , I use calls like BOOL boolFromPrefs = [defaults boolForKey:@"theBoolKey"]; To get a saved BOOL value. If the key is not found, NO is returned (default behaviour of boolForKey). But... NO can be a saved setting. Same thing for intForKey So how can I test if a key exists before trying to get its value ? Matthias Bauch Do it the right way and register default values . NSDictionary *userDefaultsDefaults = @{ @"SomeKey": @NO, @"AnotherKey": @"FooBar", @"NumberKey": @0, }; [NSUserDefaults.standardUserDefaults registerDefaults

about config preferences and js

与世无争的帅哥 提交于 2019-11-29 18:12:52
问题 I wonder if it is possible to get values of certain preferences set in about:config using javascript? Incentive is to get value of preferences set in firefox addon i've created when user lands on addon front end. Basically, I'm trying to identify users landing on FE without asking them to login explicitly. 回答1: Yes, you can. First, you need to know that Mozilla uses the XPCOM interfaces for the preferences system. Three used interfaces are nsIPrefService , nsIPrefBranch and nsIPrefBranch2 .

Writing Eclipse plugin to modify Editor Preferences

我与影子孤独终老i 提交于 2019-11-29 17:41:40
I'd like to develop a plugin (tool bar buttons) for Eclipse CDT where users can easily switch between 8 and 4 spaces tabs and turn on/off soft tabs. (Why bother you asked? Thanks to the coding guideline in my org for tabbing difference between C/C++ legacy and new codes) I managed to create toolbar buttons but I couldn't find information to modify Editor Preferences (The ones you normally find in Workspace preferences General->Editors->Text Editors). The question 4587572 seems to cover a bit but I'm still very new to Plug-in dev so I don't really understand. I guess I want to modify EDITOR_TAB

Android Keep Screen On In App

余生长醉 提交于 2019-11-29 15:39:49
I have an android app which runs a foreground service and while that service is running I would like to give the user the option to keep the screen on. I added to my settings preferences, a checkbox preference and if true, I would like to keep the screen on but have it set to off by default. It's just something my users have asked for. Currently i have the preference on but when I run the service my screen still shuts of here is what I've done global variable private static final String PREFS_DEVICE = "DeviceInfo"; code and if statement SharedPreferences settings = getSharedPreferences(PREFS

iOS 5: Can I have my app “In Notification Center” by default?

我的梦境 提交于 2019-11-29 12:43:42
问题 I have an iPad app in the App Store whose logic relies largely on local notifications. In other words, much that happens inside the app is triggered by the delegate method application didReceiveLocalNotification. With today's release of iOS 5, I see that apps can be placed (via Settings) either "In Notification Center" or "Not In Notification Center." I haven't found anything in the new documentation so far, but I'm hoping there is a way to have my app "In Notification Center" by default,

Can't access preferences set in account-authenticator in Android

梦想与她 提交于 2019-11-29 11:23:32
I'm settings a preference in a checkbox via an account-authenticator: Intent settingsIntent = new Intent("android.settings.ACCOUNT_SYNC_SETTINGS"); settingsIntent.putExtra("account", mActiveAccount); startActivityForResult(settingsIntent, ACCOUNT_COMPLETE); with the xml of: <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android" android:accountType="com.example.auth" android:label="@string/auth_label" android:accountPreferences="@xml/auth_preferences" /> and in auth_preferences.xml I have: <?xml version="1.0" encoding="UTF-8" ?> <PreferenceScreen xmlns:android="http:/