[sawfish] die capplets, die!



commit 570343c35435c89f6d1d6eb557db5fed7f0c2404
Author: Christopher Roy Bratusek <zanghar freenet de>
Date:   Sun Sep 19 19:23:51 2010 +0200

    die capplets, die!

 lisp/sawfish/cfg/shell.jl |   68 ++++++++-------------------------------------
 1 files changed, 12 insertions(+), 56 deletions(-)
---
diff --git a/lisp/sawfish/cfg/shell.jl b/lisp/sawfish/cfg/shell.jl
index 574e2f6..aece558 100644
--- a/lisp/sawfish/cfg/shell.jl
+++ b/lisp/sawfish/cfg/shell.jl
@@ -49,24 +49,19 @@
   (define ok-widget)
   (define revert-widget)
 
-  (define (initialize-shell #!optional socket-id)
+  (define (initialize-shell)
     (let ((vbox (gtk-vbox-new nil box-spacing))
 	  (hbox (gtk-hbutton-box-new))
-	  (s-scroller (and (not socket-id) (gtk-scrolled-window-new)))
+	  (s-scroller (gtk-scrolled-window-new))
 	  root-container)
 
-      (setq main-window (if socket-id
-			    (gtk-plug-new socket-id)
-			  (gtk-window-new 'toplevel)))
-      (if socket-id
-	  (progn
-	    (gtk-window-set-default-size main-window 550 400)
-	    (setq root-container main-window))
+      (setq main-window (gtk-window-new 'toplevel))
+
 	(gtk-window-set-resizable main-window t)
 	(gtk-window-set-default-size main-window 550 400)
 	(setq root-container (gtk-frame-new))
 	(gtk-frame-set-shadow-type root-container 'etched-in)
-	(gtk-container-add main-window root-container))
+	(gtk-container-add main-window root-container)
 
       (setq slot-box-widget (gtk-vbox-new nil box-spacing))
 
@@ -93,35 +88,28 @@
 						     group-tree-widget))
 	  (gtk-container-add vbox (or s-scroller slot-box-widget))))
 
-      (unless socket-id
+
 	(setq ok-widget (gtk-button-new-from-stock "gtk-close"))
 	(setq revert-widget (gtk-button-new-from-stock "gtk-undo"))
 	(gtk-window-set-title main-window (_ "Sawfish Configurator"))
 	(gtk-widget-set-name main-window (_ "Sawfish Configurator"))
 	(gtk-window-set-wmclass main-window "sawfish-configurator"
-                                "Sawfish-Configurator"))
+                                "Sawfish-Configurator")
 
-      (g-signal-connect main-window "delete_event"
-                        (if (not socket-id) on-quit capplet-delete-event))
+      (g-signal-connect main-window "delete_event" on-quit)
 
-      (unless socket-id
 	(gtk-box-set-spacing hbox button-box-spacing)
 	(gtk-button-box-set-layout hbox 'end)
 	(gtk-box-pack-end vbox hbox)
 	(g-signal-connect ok-widget "clicked" on-ok)
 	(g-signal-connect revert-widget "clicked" on-revert)
 	(gtk-container-add hbox revert-widget)
-	(gtk-container-add hbox ok-widget))
+	(gtk-container-add hbox ok-widget)
 
       (gtk-container-add root-container vbox)
       (gtk-widget-show-all main-window)
       (set-button-states)
 
-      (when socket-id
-	(setq *nokogiri-apply-immediately* nil)
-	(set-input-handler standard-input capplet-input)
-	(add-hook '*nokogiri-slot-changed-hook* capplet-state-changed))
-
       (if group-tree-widget
 	  (progn
 	    (gtk-tree-select-item group-tree-widget 0)
@@ -285,8 +273,7 @@
 usage: sawfish-config [OPTIONS...]\n
 where OPTIONS are any of:\n
   --group=GROUP-NAME
-  --flatten
-  --socket-id=WINDOW-ID\n")
+  --flatten\n")
       (throw 'quit 0))
 
     (let ((group (get-command-line-option "--group" t)))
@@ -302,9 +289,7 @@ where OPTIONS are any of:\n
     (add-widget-prefix 'sawfish.cfg.widgets)
 
     (initialize-configs)
-    (let* ((id (get-command-line-option "--socket-id" t))
-	   (socket-id (when id (string->number id))))
-      (initialize-shell socket-id))
+    (initialize-shell)
 
     (catch 'nokogiri-exit
       (recursive-edit))
@@ -312,33 +297,4 @@ where OPTIONS are any of:\n
 
   (add-hook '*nokogiri-slot-changed-hook* set-button-states t)
   (add-hook '*nokogiri-group-selected-hook* add-group-widgets)
-  (add-hook '*nokogiri-group-deselected-hook* remove-group-widgets)
-
-;;; capplet interfacing
-
-  ;; called when there's input available on stdin
-  (define (capplet-input)
-    (let ((tem (read-line standard-input)))
-      (condition-case nil
-	  (progn
-	    (cond ((string-match "apply" tem) (on-apply))
-		  ((string-match "revert" tem) (on-revert))
-		  ((string-match "ok" tem) (on-ok))
-		  ((string-match "cancel" tem) (on-cancel)))
-	    (write standard-output ?\001)
-	    (flush-file standard-output))
-	(end-of-stream))))
-
-  (define (capplet-delete-event)
-    (gtk-widget-hide main-window)
-    (make-timer on-quit 10)
-    ;; return t so no destroy - if the timer fires we'll destroy then
-    t)
-
-  (define (capplet-state-changed)
-    (write standard-output ?c)
-    (flush-file standard-output))
-
-  (define (capplet-no-group)
-    (write standard-output ?g)
-    (flush-file standard-output)))
+  (add-hook '*nokogiri-group-deselected-hook* remove-group-widgets))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]