当您的节能器首选面板无法加载时该怎么办

A few months ago, I started seeing the following problems on my iBook (G3, 800 MHz), running Mac OS X 10.3:

  • 四次,它在我使用它时完全冻结了。
  • 三次,它不会从睡眠中唤醒。
  • 我无法加载“系统偏好设置”中的“节能”面板。

Neither the freezes nor the wake-from-sleep problems were reproducibleEvery few days, however, one or the other would bite me.

The freezes were very deep, but not quite total: I could still move the mouse pointer around the screen, using either my mouse or trackpad. But clicks didn’t register and keystrokes had no effectIt was not merely a problem with my login session, either — when the freezes occurred, I could not even connect using ssh from another machine.

The wake-from-sleep problems were what prompted me to check my Energy Saver settings, which is when I discovered that the Energy Saver panel would not loadI’d click on the Energy Saver icon in the System Preferences window (or choose it from the View menu), and the title of the System Preferences window would change to “Loading Energy Saver…”, but it wouldn’t actually load.

Googling not only didn’t turn up an answer, it didn’t even turn up other instances of the problem.

On a whim, I tried pressing different modifier keys while trying to load the Energy Saver panel选项单击工作,有点When it loaded, after Option-clicking the Energy Saver icon, it looked like this:

我的节能器prefs面板,强制它加载后。

显示的内容有一些问题:

  1. There’s a tab for UPS, but which should only appear if you’re actually using a UPS (uninterruptible power supply)我不是。

  2. The status message under the tab area ought to say something along the lines of “You are using custom optimizationCurrent battery charge is 95 percent.” Instead, mine said “profile_message”That’s obviously just placeholder text, which is supposed to be set to the actual status(And, indeed, if you open up EnergySaver.prefPane’s EnergySaverPref.nib resource file in Interface Builder, you’ll see that “profile_message” is the static text item’s default value.)

  3. You can’t tell from the above screenshot, but my battery statusdisplayed in the menu bar, but the checkbox in the pref panel indicated it wasn’t.

简而言之,我的节能设置得到了严肃的考虑。

I tried logging out and logging in using a newly-created admin account, and Energy Saver worked just fineWhen I logged back in with my regular account, however, I had the same problemsThis narrowed it down to something specific to my main login account, not something system-wide.

I moved the Preferences folder out of my home Library folder, then logged out and logged back inNow, Energy Saver loaded just fine. So I had it narrowed down to something in my Preferences folder.

I put the Preferences folder back in place, and moved half its files out已注销,已登录节能器会加载Moved half the remaining preference files out, logged out/inNope. Repeat, repeat, repeat.

Now I had an empty Preferences folder (other than the files that were recreated automatically each time I logged in), but I still couldn’t load Energy Saver.

I moved the entire Preferences folder out of the Library folder again而且,节能器现在工作得很好。

傻我,试图从Finder做到这一点。

I opened Terminal, cd’d to ~/Library/Preferences/, and an invocation of “ls -AF“发现了一些隐藏的点文件I.e. files with names that start with a dot, the Unix man’s way of turning files “invisible”.

结束错误的是“.GlobalPreferences.plist”I restored all my original pref files, but deleted .GlobalPreferences.plist, and the problem went away.

你去吧I can’t prove that this was related to my wake-from-sleep problems, but it’s been about three weeks since I fixed this, and I haven’t had problems waking from sleep since.

杀死.GlobalPreferences.plist文件的有问题的部分

I was willing to leave it at that — nuke the .GlobalPreferences.plist file (hereafter, for brevity, “.GP file”, and go on my merry wayI did, of course, take a look inside my original .GP file, and while it was full of dozens of entries, none of them looked to be essentialBut nor did any look to be corrupted, and curiously, none seemed to have anything whatsoever to do with Energy Saver.

The only thing I really noticed losing were some, but not all, of my Appearance settingsInstead of Graphite, I was back to Aqua. Instead of my custom text selection color (196/196/204 specified in RGB), I was back to Blue代替双滚动箭头at both ends of a scroll bar, I was back the defaultEasy enough to reconfigure.

但是,昨天又发生了My Energy Saver control panel would not loadThe only reason I even tried loading it was because I’d started writing this article, and I figured I had better check to make sure the damn thing was still cooperating.

This time, I bit the bullet and figured out which setting in .GP was causing the problem with Energy Saver结束它是这样的:

<key>AppleICUDateTimeSymbols</key>
<dict>
    <key>5</key>
    <array>
        <string>a</string>
        <string>p</string>
    </array>
</dict>

Which is the result of my custom time format, as specified in the International System Preferences panelI set my times to look like “11:44p” instead of the U.S标准“11:44 PM”。

这个bug完全可以重现:

  1. 启动系统首选项(It seems to cache successfully loaded prefs panels, so quit and relaunch if it’s already running.)

  2. 单击International,然后单击Formats选项卡。

  3. 单击按钮以自定义时间格式。

  4. 将“AM”改为“A”,将“PM”改为“P”。

  5. 现在尝试加载节能面板。

On the machines here at Fireball Manor, Energy Saver will not load with a custom time format specified as per aboveIt’s the M’s that seem to matterThese formats cause no problems with Energy Saver: ‘11:44 PM’, ‘11:44PM’, ‘11:44 pm’, ‘11:44pm’But these formats do: ‘11:44 P’, ‘11:44P’, ‘11:44 p’, ‘11:44p’.

是的,是的 - 我会向Apple提交一份适当的报告But first things first — blog it so it gets into Google, the world’s best troubleshooting database.