moved "auto-start" to options panel;
authorwenzelm
Mon, 27 Sep 2010 21:16:42 +0200
changeset 39734 47f5a8c92666
parent 39733 6d373e9dcb9d
child 39735 969ede84aac0
moved "auto-start" to options panel; tuned;
src/Tools/jEdit/plugin/Isabelle.props
src/Tools/jEdit/src/jedit/isabelle_options.scala
src/Tools/jEdit/src/jedit/session_dockable.scala
--- a/src/Tools/jEdit/plugin/Isabelle.props	Mon Sep 27 20:26:10 2010 +0200
+++ b/src/Tools/jEdit/plugin/Isabelle.props	Mon Sep 27 21:16:42 2010 +0200
@@ -32,6 +32,7 @@
 options.isabelle.tooltip-dismiss-delay.title=Tooltip Dismiss Delay (global)
 options.isabelle.tooltip-dismiss-delay=8000
 options.isabelle.startup-timeout=10000
+options.isabelle.auto-start.title=Auto Start
 options.isabelle.auto-start=true
 
 #menu actions
--- a/src/Tools/jEdit/src/jedit/isabelle_options.scala	Mon Sep 27 20:26:10 2010 +0200
+++ b/src/Tools/jEdit/src/jedit/isabelle_options.scala	Mon Sep 27 21:16:42 2010 +0200
@@ -9,12 +9,15 @@
 
 import javax.swing.JSpinner
 
+import scala.swing.CheckBox
+
 import org.gjt.sp.jedit.AbstractOptionPane
 
 
 class Isabelle_Options extends AbstractOptionPane("isabelle")
 {
   private val logic_selector = Isabelle.logic_selector(Isabelle.Property("logic"))
+  private val auto_start = new CheckBox()
   private val relative_font_size = new JSpinner()
   private val tooltip_font_size = new JSpinner()
   private val tooltip_dismiss_delay = new JSpinner()
@@ -23,26 +26,24 @@
   {
     addComponent(Isabelle.Property("logic.title"), logic_selector.peer)
 
-    addComponent(Isabelle.Property("relative-font-size.title"), {
-      relative_font_size.setValue(Isabelle.Int_Property("relative-font-size", 100))
-      relative_font_size
-    })
+    addComponent(Isabelle.Property("auto-start.title"), auto_start.peer)
+    auto_start.selected = Isabelle.Boolean_Property("auto-start")
+
+    relative_font_size.setValue(Isabelle.Int_Property("relative-font-size", 100))
+    addComponent(Isabelle.Property("relative-font-size.title"), relative_font_size)
 
-    addComponent(Isabelle.Property("tooltip-font-size.title"), {
-      tooltip_font_size.setValue(Isabelle.Int_Property("tooltip-font-size", 10))
-      tooltip_font_size
-    })
+    tooltip_font_size.setValue(Isabelle.Int_Property("tooltip-font-size", 10))
+    addComponent(Isabelle.Property("tooltip-font-size.title"), tooltip_font_size)
 
-    addComponent(Isabelle.Property("tooltip-dismiss-delay.title"), {
-      tooltip_dismiss_delay.setValue(Isabelle.Int_Property("tooltip-dismiss-delay", 8000))
-      tooltip_dismiss_delay
-    })
+    tooltip_dismiss_delay.setValue(Isabelle.Int_Property("tooltip-dismiss-delay", 8000))
+    addComponent(Isabelle.Property("tooltip-dismiss-delay.title"), tooltip_dismiss_delay)
   }
 
   override def _save()
   {
-    Isabelle.Property("logic") =
-      logic_selector.selection.item.name
+    Isabelle.Property("logic") = logic_selector.selection.item.name
+
+    Isabelle.Boolean_Property("auto-start") = auto_start.selected
 
     Isabelle.Int_Property("relative-font-size") =
       relative_font_size.getValue().asInstanceOf[Int]
--- a/src/Tools/jEdit/src/jedit/session_dockable.scala	Mon Sep 27 20:26:10 2010 +0200
+++ b/src/Tools/jEdit/src/jedit/session_dockable.scala	Mon Sep 27 21:16:42 2010 +0200
@@ -10,8 +10,7 @@
 import isabelle._
 
 import scala.actors.Actor._
-import scala.swing.{FlowPanel, Button, TextArea, Label, ScrollPane, TabbedPane,
-  Component, Swing, CheckBox}
+import scala.swing.{FlowPanel, Button, TextArea, Label, ScrollPane, TabbedPane, Component, Swing}
 import scala.swing.event.{ButtonClicked, SelectionChanged}
 
 import java.awt.BorderLayout
@@ -55,14 +54,10 @@
   session_phase.border = new SoftBevelBorder(BevelBorder.LOWERED)
   session_phase.tooltip = "Prover status"
 
-  private val auto_start = new CheckBox("Auto start") {
-    selected = Isabelle.Boolean_Property("auto-start")
-    reactions += {
-      case ButtonClicked(_) =>
-        Isabelle.Boolean_Property("auto-start") = selected
-        if (selected) Isabelle.start_session()
-    }
+  private val interrupt = new Button("Interrupt") {
+    reactions += { case ButtonClicked(_) => Isabelle.session.interrupt }
   }
+  interrupt.tooltip = "Broadcast interrupt to all prover tasks"
 
   private val logic = Isabelle.logic_selector(Isabelle.Property("logic"))
   logic.listenTo(logic.selection)
@@ -70,13 +65,8 @@
     case SelectionChanged(_) => Isabelle.Property("logic") = logic.selection.item.name
   }
 
-  private val interrupt = new Button("Interrupt") {
-    reactions += { case ButtonClicked(_) => Isabelle.session.interrupt }
-  }
-  interrupt.tooltip = "Broadcast interrupt to all prover tasks"
-
   private val controls =
-    new FlowPanel(FlowPanel.Alignment.Right)(session_phase, auto_start, logic, interrupt)
+    new FlowPanel(FlowPanel.Alignment.Right)(session_phase, interrupt, logic)
   add(controls.peer, BorderLayout.NORTH)