Author: ek.kato
Date: Tue Apr 21 03:57:32 2009
New Revision: 5952
Modified:
trunk/scm/ajax-ime.scm
trunk/scm/social-ime.scm
Log:
* scm/social-ime.scm
* scm/ajax-ime.scm
- (social-ime-prev-warn-connection-time)
- (social-ime-init-handler)
- (ajax-ime-prev-warn-connection-time)
- (ajax-ime-init-handler)
- Prevent showing warnings at once.
Modified: trunk/scm/ajax-ime.scm
==============================================================================
--- trunk/scm/ajax-ime.scm (original)
+++ trunk/scm/ajax-ime.scm Tue Apr 21 03:57:32 2009
@@ -43,6 +43,8 @@
;;; implementations
+(define ajax-ime-prev-warn-connection-time (time))
+
;;
;; canna emulating functions
;;
@@ -512,7 +514,13 @@
(define (ajax-ime-init-handler id im arg)
(if ajax-ime-warn-connection?
- (uim-notify-info (N_ "Caveat: All the request to Ajax-IME/ChaIME
server is not encrypted through the internet.\nIf you want to disable this
message, turn off the option in Ajax-IME (advanced) setting.")))
+ (let ((diff (string->number
+ (difftime (time) ajax-ime-prev-warn-connection-time))))
+ (if (or (not diff)
+ (> diff 5))
+ (begin
+ (uim-notify-info (N_ "Caveat: All the request to Ajax-IME/ChaIME server
is not encrypted through the internet.\nIf you want to disable this
message, turn off the option in Ajax-IME (advanced) setting."))
+ (set! ajax-ime-prev-warn-connection-time (time))))))
(if (not ajax-ime-init-lib-ok?)
(begin
(ajax-ime-lib-init)
Modified: trunk/scm/social-ime.scm
==============================================================================
--- trunk/scm/social-ime.scm (original)
+++ trunk/scm/social-ime.scm Tue Apr 21 03:57:32 2009
@@ -42,6 +42,8 @@
;;; implementations
+(define social-ime-prev-warn-connection-time (time))
+
;;
;; canna emulating functions
;;
@@ -582,7 +584,13 @@
(define (social-ime-init-handler id im arg)
(if social-ime-warn-connection?
- (uim-notify-info (N_ "Caveat: All the request to Social IME server is
not encrypted through the internet.\nIf you want to disable this message,
turn off the option in Social-IME (advanced) setting.")))
+ (let ((diff (string->number
+ (difftime (time) social-ime-prev-warn-connection-time))))
+ (if (or (not diff)
+ (> diff 5))
+ (begin
+ (uim-notify-info (N_ "Caveat: All the request to Social IME server is
not encrypted through the internet.\nIf you want to disable this message,
turn off the option in Social-IME (advanced) setting."))
+ (set! social-ime-prev-warn-connection-time (time))))))
(if (not social-ime-init-lib-ok?)
(begin
(social-ime-lib-init)