* riece-ruby.el: Implement add-on API.
[riece] / lisp / riece-toolbar.el
index 9c5e693..fc22878 100644 (file)
 
 (require 'riece-menu)
 
+(defconst riece-toolbar-description
+  "Show toolbar icons.")
+
 (defvar riece-toolbar-items
   '(riece-command-quit
     riece-command-join
-    riece-command-part))
+    riece-command-part
+    riece-command-previous-channel
+    riece-command-next-channel
+    riece-command-change-layout
+    riece-submit-bug-report))
 
 (defun riece-toolbar-find-menu-item (command)
   (let ((pointer riece-menu-items)
     item))
 
 (if (featurep 'xemacs)
-    (progn
-      (defun riece-make-toolbar-from-menu (items menu-items map)
-       (let ((pointer items)
-             toolbar
-             file
-             menu-item)
-         (while pointer
-           (setq file (locate-file (symbol-name (car pointer))
-                                   load-path
-                                   '(".xpm" ".pbm" ".xbm"))
-                 menu-item (riece-toolbar-find-menu-item (car pointer)))
-           (if (and file (file-exists-p file))
-               (setq toolbar
-                     (toolbar-add-item
-                      toolbar
-                      (toolbar-new-button
-                       file
-                       (car pointer)
-                       (if menu-item
-                           (aref menu-item 0)
-                         (symbol-name (car pointer)))))))
-           (setq pointer (cdr pointer)))
-         toolbar))
-      (defun riece-set-toolbar (toolbar)
-       (set-specifier default-toolbar toolbar (current-buffer))))
+    (if (featurep 'toolbar)
+       (progn
+         (defun riece-make-toolbar-from-menu (items menu-items map)
+           (let ((pointer items)
+                 toolbar
+                 file
+                 menu-item
+                 (riece-data-directory (locate-data-directory "riece")))
+             (while pointer
+               (setq file (locate-file (symbol-name (car pointer))
+                                       (if riece-data-directory
+                                           (cons riece-data-directory
+                                                 load-path)
+                                         load-path)
+                                       '(".xpm" ".pbm" ".xbm"))
+                     menu-item (riece-toolbar-find-menu-item (car pointer)))
+               (if (and file (file-exists-p file))
+                   (setq toolbar
+                         (toolbar-add-item
+                          toolbar
+                          (toolbar-new-button
+                           file
+                           (car pointer)
+                           (if menu-item
+                               (aref menu-item 0)
+                             (symbol-name (car pointer)))))))
+               (setq pointer (cdr pointer)))
+             toolbar))
+         (defun riece-set-toolbar (toolbar)
+           (set-specifier default-toolbar toolbar (current-buffer))))
+      (defalias 'riece-make-toolbar-from-menu 'ignore)
+      (defalias 'riece-set-toolbar 'ignore))
   (defun riece-make-toolbar-from-menu (items menu-items map)
     (let ((pointer items)
          (tool-bar-map (make-sparse-keymap)))