src/Tools/jEdit/src/jedit_options.scala
changeset 60844 f7f2bc0e4293
parent 60843 9980f3bcdea2
child 61607 a99125aa964f
equal deleted inserted replaced
60843:9980f3bcdea2 60844:f7f2bc0e4293
    34   {
    34   {
    35     tooltip = description
    35     tooltip = description
    36     reactions += { case ButtonClicked(_) => update(selected) }
    36     reactions += { case ButtonClicked(_) => update(selected) }
    37 
    37 
    38     def stored: Boolean = PIDE.options.bool(name)
    38     def stored: Boolean = PIDE.options.bool(name)
    39     def load() { selected = stored }
       
    40     def update(b: Boolean): Unit =
    39     def update(b: Boolean): Unit =
    41       GUI_Thread.require {
    40       GUI_Thread.require {
    42         if (selected != b) selected = b
    41         if (selected != b) selected = b
    43         if (stored != b) {
    42         if (stored != b) {
    44           PIDE.options.bool(name) = b
    43           PIDE.options.bool(name) = b
    45           PIDE.session.update_options(PIDE.options.value)
    44           PIDE.session.update_options(PIDE.options.value)
    46         }
    45         }
    47       }
    46       }
       
    47     def load() { selected = stored }
       
    48     load()
    48   }
    49   }
    49 }
    50 }
    50 
    51 
    51 class JEdit_Options extends Options_Variable
    52 class JEdit_Options extends Options_Variable
    52 {
    53 {