Reimplement dialog idle state: use separate function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>