Move dialog functions into functions.sh rather than duplicating everywhere.
Dialog functions now try:
- kdialog if found and either kdeinit or kdeinit4 are running, or zenity is not found
- zenity if found
- dialog if found
- text-only (and question defaults to no, or a passed value)
Kinda fixes issue 3078 (if a dialog isn't shown, then kdialog, zenity and dialog are not installed, or user is not in an X session.)
Fixes issue 3042
Change-Id: I7678233a9e9af75bcf97d6b47ae925636334b2e3
Reviewed-on: http://gerrit.dmdirc.com/38
Reviewed-by: Gregory Holmes <greboid@dmdirc.com>
Tested-by: Gregory Holmes <greboid@dmdirc.com>