

GTKMM Notes:

To transfer an ownership from your local code to a container, use
Gtk::Button* pButton = Gtk::manage(new Gtk::Button("Test"));
container->add(*pButton);
(add() takes an object by reference).
otherwise, you will need to delete() it.

local scope destruction also works if using stack variables.
{
	Gtk::Button aButton;
	// destroyed here
}


A treeview (also iconview, combobox) from glade comes
with existing model, which should be unset.


Bugs / patches:
	Patch pangomm for Pango::strip_markup().



--------------------------------------------------------

TODO:


Investiage the new "-l ssd" and "-l devstat" options (since 5.42)


Add menu item - "update drive database" (not sure about linux, should
	check if it's supported first; also need to run it in terminal).


Testing:
	If ETA time has elapsed, but it's still only at 10% completion,
		ETA 0 is displayed. Fix.
	If smartctl -t ... returns an error, testing=true should not be set.
		Can't reproduce it?
	Detect running tests on launch (maybe ask the user too? some tests
		may be stuck due to bad firmware, e.g. 3ware/windows).



48-bit ATA command support:
	'-l xerror' -> Extended Comprehensive Error log: An multi-sector and
	LBA48 capable version of '-l error'. Output is similar, except more
	entries can exists and the high bytes of the registers are also printed.
	Some newer drives (Samsung) only write to this log.

	'-l xselftest' -> Extended Self Test Log: An multi-sector and LBA48
	capable version of '-l selftest'. Output will be similar, except more
	entries can exists and the LBA values can be somewhat longer.

	"smartctl -l this_wont_exist" gives the list of supported logs - this
		is needed to detect xerror / xselftest support in smartctl.


Rework drive properties UI:
	use 48-bit or not or auto.
	Enable/disable/dont_touch SMART on startup for this drive.
	Enable/disable/dont_touch AODC on startup for this drive.
	Add --init-smart-only option to only apply the SMART/AODC enabling status
		from the drive properties.
		Add also --no-init-smart to avoid doing that on GUI startup.

Notifications:
	Tied to (drive::subdrive, notif_key, exact_value(optional)).
		If exact_value isn't specified when ignoring, notify on every value change.
	Ignore options:
		Per-drive: Ignore all notifications for this key, ignore only this value.
	Don't generate multiple notifications for the same drive/key combo.
	Clearing in preferences: Clear all ignored, clear ignored for this drive, clear individual.
	Soft-warnings require "-a" by default, tricky for scsi (maybe try -a, then -i?).

Monitor:
	Needs root access, so not gonna happen until the dbus/udisks stuff
		is finalized.
	Same program, add --tray option to start in tray only.
	Option to enable the tray icon.
	Option to continue running in the tray on window close.
	Use freedesktop notifications when notifications are generated
		and we're running in tray only.
		Don't generate the same notification at a single run time if it was
			ignored (untouched) by the user; Change the tray icon and
			show them in the main window instead.
	Periodically re-run smartctl to refresh the notifications.
	Periodically see if drives were added / removed (possibly use OS callbacks
		instead of polling?)

Win7 widget:
	Can be done in html/js.
	Shows temperature
	Detects drives
	Opens GSmartControl

If a drive is not recognized, suggest using -d (sat, sat,12, ...)
	Refer the user to
	http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_USB-Devices



RAID:
	http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_RAID-Controllers

	Areca FreeBSD: since 5.42.
		Call as: smartctl -a -d areca,[1-24] /dev/arcmsr1

	3ware FreeBSD:
		Call as: smartctl -i -d 3ware,[0-127] /dev/twa0  (or twe0)
		Detection: unknown.

	LSI MegaRAID (SCSI/SAS), Linux:
		Call as: smartctl -i -d megaraid,[0-?] /dev/sda
			We should differentiate between ordinary sda and RAID one (not sure if sda is detected).
		Detection: unknown.

	HighPoint RocketRAID ((S)ATA) Linux:
		Call as: smartctl -i -d hpt,[1-8]/[1-8] /dev/sda
		Call as: smartctl -i -d hpt,[1-8]/[1-8]/[1-15] /dev/sda
		Note: /dev/sda should be derived from this controller.
			We should differentiate between ordinary sda and RAID one (not sure if sda is detected).
		Smartctl docs specify smaller limits, but the code says these are the ones.
		Detection: unknown.

	HighPoint RocketRAID ((S)ATA) FreeBSD:
		Call as: smartctl -i -d hpt,[1-8]/[1-8] /dev/hptrr
		Call as: smartctl -i -d hpt,[1-8]/[1-8]/[1-15] /dev/hptrr
		Note: /dev/hptrr should be derived from this controller.
		Smartctl docs specify smaller limits, but the code says these are the ones.
		Detection: unknown.
		TODO: Analyze sent info.

	CCISS (HP (Compaq) Smart Array Controller) Linux:
		Call as: smartctl -a -d cciss,[0-127] /dev/cciss/c0d0
		c0d0 is the controller (d0 seems to be a logical drive, doesn't matter?).
		/dev/cciss/c0d0p1 is the first ordinary partition (used in mount, etc...).
		The port limit had a brief regression in 5.39.x (limited to 15).
		5.39 doesn't seem to work at all (prereleases work with P400 controller)?
			Possibly a 64-bit-only issue?
		To detect controller presence: cat /proc/devices, contains "cciss0"
			for controller 0.
		There is a cciss_vol_status utility but it doesn't report anything except "OK" status.
		It may not return the "SMART Health Status: OK" line in smartctl -i for some reason?
			(It returns it in -a though, and in some freebsd output I found).
		If no /dev/cciss exists, you may need to run "cd /dev; ./MAKEDEV cciss".
		Smartctl SVN has some /dev/sg* stuff, check it out. (?)
			May need "-d sat+cciss,N" for SATA.

	CCISS (HP (Compaq) Smart Array Controller) FreeBSD:
		Seems to be the same as Linux (uses the same driver?).
		Detection: unknown.




libdebug:
	per-channel disabling.
	per-channel formatting.
	all flags should be per-channel.
	bug: if -q is passed, Execution log doesn't contain libdebug log. (requires per-channel status control).
	use format_time() instead of ctime() and friends, with ISO formatting.



'-l sataphy' -> SATA Phy event counters: Non-SMART feature, useful to detect SATA cabling problems.


SCT Temperatures
	-l scttemp prints temperature and history.
	-t scttempint,N[,p] (N - count, p - preserve across reset or not).
		This configures temperature logging interval (1 min by default) and clears the history.
	-l scterc[,...] to get/set the SCT Error Recovery Control time limit (5.40 and newer).


Add detection for Interix (i586-pc-interix3), maybe with debian?




----------- SMART stuff ----------


Run one-time Immediate Offline test (-t offline).
	Offline tests only update Attributes, and if errors are found they will
	appear in SMART error log. Self-test logs are unaffected.
	Abort (-X). Abort works with Offline only if there's
	"Abort Offline collection upon new command" capability.
	If the drive has "Suspend Offline collection upon new  command" capability,
	immediate offline test may be tracked through --capabilities (not on mine!).
	If it's "Abort Offline collection upon new command", then the test
	will abort on --capabilities or --abort.


Polling time
The self-test routine recommended polling time shall be equal to the number of minutes that is the minimum
recommended time before which the host should first poll for test completion status. Actual test time could
be several times this value. Polling before this time could extend the self-test execution time or abort the test
depending on the state of bit 2 of the off-line data capability bits.

Autosave
This command enables and disables the optional attribute autosave feature of the device. This command
may either allow the device, after some vendor specified event, to save the device updated attribute values
to non-volatile memory; or this command may cause the autosave feature to be disabled. The state of the
attribute autosave feature (either enabled or disabled) shall be preserved by the device across power cycles.
A value of zero written by the host into the device’s Sector Count register before issuing this command shall
cause this feature to be disabled. Disabling this feature does not preclude the device from saving SMART
data to non-volatile memory during some other normal operation such as during a power-on or power-off
sequence or during an error recovery sequence.
A value of F1h written by the host into the device’s Sector Count register before issuing this command shall
cause this feature to be enabled. Any other meaning of this value or any other non-zero value written by the
host into this register before issuing this command may differ from device to device. The meaning of any
non-zero value written to this register at this time shall be preserved by the device across power cycles.



