2006-02-15  Richard Hughes  <richard@hughsie.com>

	==== Version 2.13.90 ====

2006-02-14  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c: Couple of string fixes noticed by Clytie Siddall.
	Fixes #331120.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-hal-monitor.c (gpm_hash_new_devices_cache,
	gpm_hash_free_devices_cache): Add these so we can simplify our memory
	management. We need to be more careful that what we were, as hal could
	be restarted many times and we could loose lots of memory.

	(hal_monitor_stop): Inline into _finalize, as not called elsewhere.

	* src/gpm-hal.c (gpm_hal_enable_power_save): valgrind (quite rightly)
	warns of use before set. Just initialise ret to zero.

	* src/gpm-power.c (battery_device_cache_entry_free) remove, as broken.

	(gpm_hash_new_kind_cache, gpm_hash_free_kind_cache,
	gpm_hash_new_device_cache, gpm_hash_free_device_cache): Add these so
	we can simplify our memory management, and not forget to free.

	(gpm_power_init): Listen for the hal-disconnected signal so we can
	clear the caches, else the devices think they are initialised.

	Fixes bug #327234.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (get_stock_id): Use the fully charged, not charging
	icon like we used to do.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-main.c: Remove gpm_dbus_init_nlost, signalhandler_noc and
	all the accompanying n-o-c and name-lost stuff as it's not being used,
	and does not belong here. And it was rubbish code.
	This is all to begin to fix #327234, so we can restart hald without
	killing g-p-m.

	* src/gpm-hal-monitor.c: Rename proxy to proxy_hal. Add a second proxy
	called proxy_dbus that will let us get n-o-c signals.

	(gpm_hal_monitor_class_init): Add hal-connected and hal-disconnected
	signal types and descriptions.

	(hal_disconnect_signals): Free the proxy also here, as it's useless.

	(hal_connect_signals): Create the proxy, and reconnect the signals to
	the new proxy.

	(coldplug_all, un_coldplug_all): Begin to do the reconnection
	infrastructure so that devices get the signals from the new proxy.
	THIS IS WORK IN PROGRESS. Restarting hald will appear to work then
	segfault g-p-m.

	(hal_name_owner_changed): Add new callback for name-owner-changed
	signals from the new proxy_dbus objects.

	(hal_monitor_stop): call un_coldplug (), as currently we are just
	loosing memory. un_coldplug is TOFIX.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-main.c, src/gpm-manager.h: Remove GPM_SYSTEM_BUS as we are
	always going to use the session bus.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (tray_icon_update): This function is not now
	responsible for creating and destroying the icon, it is done
	unconditionally at init, and then just hidden and shown as required.
	Rationale: we are showing notifications for lots of power stuff, and
	these break when you choose any other state than "Always Show".
	It also fixes the bug (#331002) as we are not relying on a complex
	chain of events to do the notifications. Most of this stuff is async,
	so it needs to be kept simple.

	(battery_status_changed_primary, battery_status_changed_ups,
	battery_status_changed_misc): Allow notifications without an icon
	showing in the tray.

	(gpm_manager_init): Set up the icon callbacks here, rather than in
	gpm_manager_setup_tray_icon() as this makes it *way* simpler.

	src/gpm-tray-icon.c: Add the is_visible flag so we can have quick
	safe access to the visible property. Bit of a bodge.
	Also convert a metric tonne of spaces to tabs in this file.
	Add the function gpm_tray_icon_show() so we can set the visiblity of
	the icon easily.

	(libnotify_event)'s: Allow notifications to be sent without the icon
	image, where we just use the system default if there is no widget
	present. This is what other program using libnotify do.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-common.h: Add location of FAQ page as GPM_FAQ_URL.

	* src/gpm-manager.c (gpm_manager_suspend, gpm_manager_hibernate):
	Inform the user if the HAL command failed, and point them in the
	direction of the online FAQ page. Fixes bug #330889.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (gpm_manager_init): Don't do tray_icon_update here
	anymore as we havn't got the device list in order yet. This fixes the
	bug where the ac_adapter icon was being shown for a split second,
	and then changing to the required icon.

	* src/gpm-power.c (add_battery): Add in another debug statement.

	* src/gpm-prefs.c (gpm_prefs_setup_sleep_slider,
	gpm_prefs_setup_brightness_slider, setup_page_three): Only connect up
	the value-changed signal once the initial value has been set.
	This prevents the gconf keys from getting written to (if only for a
	split second), so that the icon no longer flickers when somebody
	clicks preferences or loads it from the Desktop menu.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-hal-monitor.c, src/gpm-manager.c, src/gpm-power.c,
	src/gpm-tray-icon.c: Add gpm_debug statements before the signal emit
	so we can trace, and see what's going on internally.

	* src/gpm-main.c (main): Do the gpm_debug_init earlier in the sequence
	else we loose the new signal messages on initialization.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-power.h, src/gpm-power.c (gpm_power_class_init): Add 
	battery removed proxy signal so we can use it in manager.

	(add_battery): Do not query hal again, use the cached values for 
	the capacity check. Also, only do this check if the battery is marked
	as present.

	(power_get_summary_for_battery_kind): Remove the complicated check
	for UPS's, as it's fragile and seems to break.
	Unconditionally display the battery type as a prefix for now, we can
	argue about the tooltip logic in a new bugzilla.

	(battery_device_cache_entry_update_all): Do more careful checking,
	(e.g. don't ask a mouse device for time_remaining) so we don't spew
	so many warnings.

	* src/gpm-manager.c (gpm_manager_init): Add hal_battery_removed_cb so
	we can update the icon and tooltip to fix #329027.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (get_stock_id): Fix a typo where 
	(charging || charging) should be (charging || discharging) so that we
	get the correct icon on discharging battery with UPS attached.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c: Add an extra state GPM_WARNING_DISCHARGING so we
	can make the UPS and primary battery stuff common in the existing
	warning framework.

	(maybe_notify_on_ac_changed): Only clear the notification now, as we
	rely on the trueness of battery.is_discharging to do the warning.

	(gpm_manager_get_warning_type): Add the check for a now-discharging
	battery_status object. Man, this generic code is easy to change.

	(battery_low_get_title): Add a string for GPM_WARNING_DISCHARGING.

	(battery_status_changed_primary): Do the warning 
	"The AC Power has been unplugged." here, for GPM_WARNING_DISCHARGING.
	(battery_status_changed_ups): Do the warning 
	"Your system is running on backup power!" for GPM_WARNING_DISCHARGING.
	(battery_status_changed_misc): Ignore GPM_WARNING_DISCHARGING as this
	is not relevant for pda, mouse or keyboard devices.

	(gpm_manager_init): Set last primary warning to GPM_WARNING_DISCHARGING
	as we don't want to be notified on coldplug if we are on battery power.

2006-02-13  Richard Hughes  <richard@hughsie.com>

	* src/gpm-power.c (battery_device_cache_entry_update_key): Do a
	exponentially weighted average for the rate so that high frequency
	changes are smoothed. This should mean the time_remaining does not
	change drastically between updates.

	(battery_kind_cache_update) Also limit the time_remaining to 100 hours.
	Fixes bug #328927.

2006-02-12  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (get_stock_id): Refactor the code, leaving the
	logic mostly the same as before. Now it's obvious what's happening
	in the selection, and also allows a UPS icon to be chosen.
	(battery_status_changed_primary): Slight rearrangement for logic
	optimisation.
	(battery_status_changed_ups): Add a check for discharging.

	* src/gpm-power.c (battery_kind_cache_update): Make work with UPS's
	as they do not provide rate information, but do provide time
	information.
	(power_get_summary_for_battery_kind): Simplify the logic, and make
	"Unknown time remaining until changed" a thing of the past.
	Also show the primary battery type, if we have a UPS installed in the
	system so we know what the remaining time is refering to.
	(gpm_power_get_status_summary): If we are using a discharging UPS, then
	set our state to "Computer is running on backup power".
	Also remove the enum structure thing as it's only used once, and it's
	easier just to use the defines directly.

	This is all to begin to fix bug : #329027

2006-02-11  Richard Hughes  <richard@hughsie.com>

	* src/gpm-brightness.c, src/gpm-common.h, src/gpm-debug.c, src/debug.h,
	src/gpm-hal-monitor.c, src/gpm-hal.c, src/gpm-idle.c, src/gpm-main.c,
	src/gpm-manager.c, src/gpm-networkmanager.c, src/gpm-power.c,
	src/gpm-prefs.c, src/gpm-screensaver.c, src/gpm-stock-icons.c,
	src/gpm-tray-icon.c: Create gpm-warning so we can also log g_warnings
	in the same way as gpm_debug. Also make a few more #defines better
	named, e.g. GPMURL -> GPM_HOMEPAGE_URL.

2006-02-11  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (battery_low_get_title, battery_status_changed_ups,
	battery_status_changed_misc): gnome-power-manager didn't get into 2.14.
	Celebrate by adding lots of new translatable strings. These can be
	altered by someone with a better grip of English if required.

2006-02-11  Richard Hughes  <richard@hughsie.com>

	* help/C/figures/gpm-charged.png, help/C/figures/gpm-critical.png,
	help/C/figures/gpm-low.png, help/C/figures/gpm-unplugged.png,
	help/C/gnome-power-manager.xml, help/Makefile.am:
	Add yet more screenshots to the yelp file.

2006-02-10  Richard Hughes  <richard@hughsie.com>

	* help/C/figures/gpm-main.png: Update to something more up-to-date.

	* help/C/figures/gpm-unplugged.png, help/C/figures/gpm-options.png,
	help/C/figures/gpm-advanced.png: Add these files to enhance the yelp
	file.

	* help/C/gnome-power-manager.xml: Add the three extra files as
	screenshots, and remove the known-bugs section.

2006-02-10  Richard Hughes  <richard@hughsie.com>

	* src/gpm-debug.{c|h}: Add these files to allow us to use debugging
	that is easy to read. I spend *hours* looking at these traces.
	Copied from gnome-screensaver, (C) 2005 William Jon McCann.

	* SConstruct, src/Makefile.am: Add gpm-debug.c to be built for g-p-m
	and g-p-p.

	* src/gpm-brightness.c, src/gpm-dpms-x11.c, src/gpm-hal-monitor.c,
	src/gpm-hal.c,src/gpm-idle.c, src/gpm-main.c,src/gpm-manager.c,
	src/gpm-power.c, src/gpm-prefs.c, src/gpm-screensaver.c,
	src/gpm-tray-icon.c: Switch to the superior gpm_debug functionality.

	* src/gpm-power.c (battery_kind_cache_debug_print): Reformat so the
	debug information is more compact.

2006-02-10  Lukas Novotny  <lukasnov@cvs.gnome.org>

	* configure.in: Added cs to ALL_LINGUAS.

2006-02-10  Rodrigo Moya <rodrigo@novell.com>

	* src/gpm-hal-monitor.h: removed 'reserved' argument from
	'battery-added' signal.

2006-02-10  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c: Add GpmWarning struct so we can track the warning
	states of all the devices indervidually. Also add 
	BATTERY_ACTION_PERCENTAGE and BATTERY_ACTION_REMAINING_TIME so we
	do the policy action some time after the last critical warning.

	(maybe_notify_battery_status_changed) Removed, as functionality was
	muddled. We need to split this per-batterytype, as we do very different
	things for each device, e.g. warn for mouse low, but policy and
	warnings for the primary battery.

	(gpm_manager_get_warning_type, battery_low_get_title): Abstract out
	the warning type and title generation from the background logic -- so
	we can start to split up the functions per-device.

	(battery_status_changed_primary, battery_status_changed_ups,
	battery_status_changed_misc): Add these different handlers that it's
	clear that these types have different actions and logic.
	These functions are a bit bodged w.r.t message strings, as we are in
	string freeze, and I can't add lots of new strings yet.

	(power_battery_status_changed_cb): Dont do policy here, leave it to the
	indervidual handlers for the type (e.g. battery_status_changed_primary)
	to do the actions. Makes logic lots clearer.

	Begins to fix #329027

2006-02-06  William Jon McCann  <mccann@jhu.edu>

	* src/gpm-manager.xml: Expose actions API.

	* src/gpm-manager.c (gpm_manager_error_quark, manager_policy_do) 
	(gpm_manager_shutdown, gpm_manager_hibernate) 
	(gpm_manager_suspend, power_button_pressed_cb) 
	(gpm_manager_tray_icon_hibernate, gpm_manager_tray_icon_suspend):
	Add GError to public actions.

	* docs/dbus-interface.txt: Added new actions API.

	Fixes #330189.

2006-02-06  Richard Hughes  <richard@hughsie.com>

	* src/*.c, src/*.h: Fix the headers so that they are all the same,
	removing the file doxygen markup, and adding authors to some files.
	Also remove trailing whitespace from *lots* of files.
	Starting to address #327743

2006-02-06  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (lid_button_pressed): Only do lid sleep action
	when on battery power. Fixes bug #329512

2006-02-05  Richard Hughes  <richard@hughsie.com>

	* src/gpm-manager.c (maybe_notify_battery_power_changed): 
	We need to add the check for charging for the 100% charge 
	notification else we get a 100% charged notifications (plural) a few
	times when on battery power (as the flag is cleared) and we are at
	state 100%.

	This is not possible as the is_charging state changes before the
	percentage change goes 99->100. This works this way intermittently on
	my Toshiba, and never works on my iBook. This new code seems to work
	for me in all cases. Plus we don't have to faff around and invalidate
	the "show notification" flag as we are testing the change up always.

2006-01-31 Jaap Haitsma  <jaap@haitsma.org>

	* gpm-power.{c|h}: Introduce an enum GpmPowerBatteryType to denote the 
	type of battery i.s.o. a string

	Introduce a struct GpmPowerBatteryStatus that holds all the battery 
	data.
	This will make future inclusion of extra data that we can process in
	GpmManager trivial

	BATTERY_POWER_CHANGED signal changed to BATTERY_STATUS_CHANGED and now 
	only indicates battery_type. User can obtain battery status by calling 
	gpm_power_get_battery_status.

	Change the other code to reflect these changes

	* gpm-manager.c gpm-marshal.list: Use the new data types of gpm-power

	* gpm-manager.c (power_battery_status_changed_cb)
	Critical action now can also be time based

	(maybe_notify_battery_status_changed) make sure we only notify if
	remaining_time > 0

2006-02-02 Leonid Kanter <leon@asplinux.ru>

	* * configure.in: Added ru to ALL_LINGUAS

2006-01-29 Jaap Haitsma  <jaap@haitsma.org>

	* gpm-power.c: (power_get_summary_for_kind) fully charged is more
	important than charging
	
	(battery_device_cache_entry_update_all) 
	(battery_device_cache_entry_update_key) If charge_rate == 0, charging 
	and discharging should be FALSE
	
	Bug is caused by HAL freedesktop bug #5752
	
	Fixes #328964

2006-01-29  Raphael Higino  <raphaelh@cvs.gnome.org>

	* configure.in: Added pt_BR to ALL_LINGUAS.

2006-01-29  Chao-Hsiung Liao  <j_h_liau@yahoo.com.tw>

	* configure.in: Add "zh_HK" "zh_TW" to ALL_LINGUAS.

2006-01-28 Jaap Haitsma  <jaap@haitsma.org>

	* gpm-manager.c : Oops my previous checkin did not compile

2006-01-28 Jaap Haitsma  <jaap@haitsma.org>

	* gpm-power.c: (battery_kind_cache_update) refactor.
	
	Move percentagecharged to gpm-manager.c. gpm-power.c should just give
	current status. gpm-manager.c should monitor this
	
	* gpm-marshal.list: take into account that percentagechanged is not
	anymore in the signal of power changed

	* gpm-manager.c: Add private variable done_notification_fully_charged to
	prevent fully charged being shown multiple times
	
	Fixes bug #328958

2006-01-28  Christopher Aillon  <caillon@redhat.com>

	* data/Makefile.am:
	* data/gnome-power-manager.spec.in:
	Fix the autostart file location to match the spec

2006-01-28  Richard Hughes  <richard@hughsie.com>

	* SConstruct, sconstools/*: Add the scons build framework.
	BJörn Lindqvist has provied a framework for g-p-m that lets us build
	using the new scons framework (which I've been testing for a few weeks).
	The old autotools system will remain as default, as it works.

2006-01-28 Jaap Haitsma  <jaap@haitsma.org>

	* gpm-manager.c: Remove doxygen comments for functions

	(maybe_notify_battery_power_changed): simplify logic to make sure that
	notifications are shown only once. Move tray_icon_update to 
	power_battery_power_changed_cb

	(maybe_notify_on_ac_changed) move tray_icon_update call to 
	power_on_ac_changed_cb

	(invalidate_notification_warnings) Remove this function
	
	Fixes bug #328759

2006-01-25  Richard Hughes  <richard@hughsie.com>

	* configure.in: Post release bump to 2.13.90