# Type: Input # Category: Config # Description: Specifies if Orangutan should ask user to add tasks # Author: Andriy Lesyuk use Orangutan::User; new Orangutan::Context( response => [ '^(?:Please )?((?:do(?:n\'t| not)|never)(?: ever)? )?(?:always )?(?:ask|remind)'. '(?: me)? to (?:tell|add|specify|enter)(?: you)? (?:any )?tasks?!*\.*$', '^(Stop) (?:asking|reminding) me to (?:tell|add|specify|enter) tasks?!*\.*$' ], handler => sub { my ($context, $user, $item, $negation) = @_; if (defined($negation)) { if (!$user->IsSet(USER_NOASKTASK)) { $user->Set(USER_NOASKTASK); $user->FireEvent('config', 'flag', USER_NOASKTASK); } } else { if ($user->IsSet(USER_NOASKTASK)) { $user->Unset(USER_NOASKTASK); $user->FireEvent('config', 'flag', USER_NOASKTASK); } } $main::config->Context('Ok')->Tell($user); }, help => { title => 'How can I disable/enable asking to add tasks?', question => '^(?:How )?(?:(?:can|do) I |to )(?:disable(?:/enable)?|turn (?:off|on)|enable) '. 'asking(?: me)? to (?:add|specify|enter) tasks?\?*!*\.*$', answer => "Sometimes Orangutan asks a user to enter tasks. ". "While it is one of the most useful feature it can be disabled.\n". "Sample queries to disable this feature:\n". " o Please do not ever ask me to add tasks!\n". " o Stop reminding me to enter task!\n". "Sample queries to turn it on back:\n". " o Please ask me to specify task.\n". " o Remind me to tell tasks.", weight => 570 } ); # kate: syntax perl