[uim-commit] r3139 - trunk/scm
yamaken at freedesktop.org
yamaken at freedesktop.org
Thu Feb 23 00:13:16 PST 2006
Author: yamaken
Date: 2006-02-23 00:13:12 -0800 (Thu, 23 Feb 2006)
New Revision: 3139
Modified:
trunk/scm/im-custom.scm
trunk/scm/im-switcher.scm
Log:
* This commit fix the startup-time absence of action-based IM
switcher. Thanks nosuke for reporting
* scm/im-switcher.scm
- Remove load-time imsw-register-widget invocation
- (imsw-add-im-switcher-widget): Invoke imsw-register-widget here
* scm/im-custom.scm
- (imsw-reconfigure): New procedure
- Configure the set-hook for
'toolbar-show-action-based-switcher-button? before the custom
variable definition
Modified: trunk/scm/im-custom.scm
===================================================================
--- trunk/scm/im-custom.scm 2006-02-22 15:36:26 UTC (rev 3138)
+++ trunk/scm/im-custom.scm 2006-02-23 08:13:12 UTC (rev 3139)
@@ -352,22 +352,31 @@
(_ "Enable lazy input method loading for fast startup")
(_ "long description will be here."))
+
+;;
;; toolbar buttons
+;;
+
+(define imsw-reconfigure
+ (lambda ()
+ (if toolbar-show-action-based-switcher-button?
+ (require "im-switcher.scm"))
+ (if (symbol-bound? 'context-refresh-switcher-widget!)
+ (for-each context-refresh-switcher-widget!
+ context-list))))
+
+;; must be hooked before 'toolbar-show-action-based-switcher-button?
+;; definition
+(custom-add-hook 'toolbar-show-action-based-switcher-button?
+ 'custom-set-hooks
+ imsw-reconfigure)
+
(define-custom 'toolbar-show-action-based-switcher-button? #t
'(toolbar buttons)
'(boolean)
(_ "menu-based input method switcher")
(_ "Show the menu-based IM switcher on toolbar."))
-(custom-add-hook 'toolbar-show-action-based-switcher-button?
- 'custom-set-hooks
- (lambda ()
- (if toolbar-show-action-based-switcher-button?
- (require "im-switcher.scm"))
- (if (symbol-bound? 'context-refresh-switcher-widget!)
- (for-each context-refresh-switcher-widget!
- context-list))))
-
(define-custom 'toolbar-show-switcher-button? #f
'(toolbar buttons)
'(boolean)
Modified: trunk/scm/im-switcher.scm
===================================================================
--- trunk/scm/im-switcher.scm 2006-02-22 15:36:26 UTC (rev 3138)
+++ trunk/scm/im-switcher.scm 2006-02-23 08:13:12 UTC (rev 3139)
@@ -117,11 +117,14 @@
(define imsw-add-im-switcher-widget
(lambda (widget-id-list)
(if toolbar-show-action-based-switcher-button?
- (if (memq 'widget_im_switcher widget-id-list)
- widget-id-list
- (cons 'widget_im_switcher widget-id-list)
- ;;(append widget-id-list '(widget_im_switcher))
- )
+ (begin
+ (or (assq 'widget_im_switcher widget-proto-list)
+ (imsw-register-widget))
+ (if (memq 'widget_im_switcher widget-id-list)
+ widget-id-list
+ (cons 'widget_im_switcher widget-id-list)
+ ;;(append widget-id-list '(widget_im_switcher))
+ ))
(delete 'widget_im_switcher widget-id-list eq?))))
(define context-init-widgets-orig context-init-widgets!)
@@ -148,5 +151,3 @@
(alist-delete 'widget_im_switcher widgets eq?))))
(context-set-widgets! ctx new-widgets)
(context-propagate-widget-configuration ctx))))
-
-(imsw-register-widget)
More information about the uim-commit
mailing list