// ĠCopyright Ġ 2 0 0 0 - 2 0 1 9 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġorg . jetbrains . settings Repository Ċ Ċ import Ġcom . intellij . openapi . Disposable Ċ import Ġcom . intellij . openapi . application . Application Manager Ċ import Ġcom . intellij . openapi . application . Path Manager Ċ import Ġcom . intellij . openapi . options . Configurable Base Ċ import Ġcom . intellij . openapi . options . Configurable Ui Ċ import Ġcom . intellij . ui . layout .* Ċ import Ġjava . nio . file . Paths Ċ import Ġjavax . swing . J CheckBox Ċ Ċ internal Ġclass ĠI cs Configurable Ġ: ĠConfigur able Base < I cs Configurable Ui , ĠI cs Settings >(" ics ", Ġ ics Message (" ics . settings "), Ġ" reference . settings . ics ") Ġ{ ĊĠ Ġoverride Ġfun Ġget Settings () Ġ= Ġif Ġ( Application Manager . getApplication (). is UnitTest Mode ) ĠI cs Settings () Ġelse Ġ ics Manager . settings ĊĊĠ Ġoverride Ġfun Ġcreate Ui () Ġ= ĠI cs Configurable Ui () Ċ } Ċ Ċ internal Ġclass ĠI cs Configurable Ui Ġ: ĠConfigur able Ui < I cs Settings >, ĠDis posable Ġ{ ĊĠ Ġprivate Ġval Ġ ics Manager Ġ= Ġif Ġ( Application Manager . getApplication (). is UnitTest Mode ) ĠI cs Manager ( Paths . get ( Path Manager . getConfig Path ()). resolve (" settings Repository ")) Ġelse Ġorg . jetbrains . settings Repository . ics Manager ĊĊĠ Ġprivate Ġval Ġrepository List Editor Ġ= Ġcreate Repository List Editor ( ics Manager ) ĊĠ Ġprivate Ġval Ġeditors Ġ= ĠlistOf ( repository List Editor , Ġcreate ReadOnly Sources Editor ()) ĊĠ Ġprivate Ġval Ġauto Sync Ġ= ĠJ CheckBox (" Auto ĠSync ") ĊĠ Ġprivate Ġval Ġinclude Host Into Commit Message Ġ= ĠJ CheckBox (" Include Ġhostname Ġinto Ġcommit Ġmessage ") ĊĊĠ Ġoverride Ġfun Ġdispose () Ġ{ ĊĠĠĠ Ġ ics Manager . auto Sync Manager . enabled Ġ= Ġtrue ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġreset ( settings : ĠI cs Settings ) Ġ{ ĊĠĠĠ Ġ// Ġdo Ġnot Ġset Ġin Ġconstructor Ġto Ġavoid ĊĠĠĠ Ġ ics Manager . auto Sync Manager . enabled Ġ= Ġfalse ĊĊĠĠĠ Ġauto Sync . isSelected Ġ= Ġsettings . auto Sync ĊĠĠĠ Ġinclude Host Into Commit Message . isSelected Ġ= Ġsettings . include Host Into Commit Message ĊĊĠĠĠ Ġeditors . forEach Ġ{ Ġit . reset ( settings ) Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġis Modified ( settings : ĠI cs Settings ): ĠBoolean Ġ{ ĊĠĠĠ Ġreturn Ġauto Sync . isSelected Ġ!= Ġsettings . auto Sync Ġ|| ĊĠĠĠĠĠĠĠĠĠĠ Ġinclude Host Into Commit Message . isSelected Ġ!= Ġsettings . include Host Into Commit Message Ġ|| ĊĠĠĠĠĠĠĠĠĠĠ Ġeditors . any Ġ{ Ġit . is Modified ( settings ) Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġapply ( settings : ĠI cs Settings ) Ġ{ ĊĠĠĠ Ġsettings . auto Sync Ġ= Ġauto Sync . isSelected ĊĠĠĠ Ġsettings . include Host Into Commit Message Ġ= Ġinclude Host Into Commit Message . isSelected ĊĊĠĠĠ Ġeditors . forEach Ġ{ ĊĠĠĠĠĠ Ġif Ġ( it . is Modified ( settings )) Ġ{ ĊĠĠĠĠĠĠĠ Ġit . apply ( settings ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsave Settings ( settings , Ġ ics Manager . settings File ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Component () Ġ= Ġpanel Ġ{ ĊĠĠĠ Ġrepository List Editor . build Ui ( this ) ĊĠĠĠ Ġrow Ġ{ Ġauto Sync ( comment Ġ= Ġ" Use ĠV CS Ġ-> ĠSync ĠSettings Ġto Ġsync Ġwhen Ġyou Ġwant ") Ġ} ĊĠĠĠ Ġrow Ġ{ Ġinclude Host Into Commit Message () Ġ} ĊĠĠĠ Ġrow Ġ{ Ġpanel (" Read - only Ġsources :", Ġeditors . get ( 1 ). component , Ġfalse ) Ġ} ĊĠ Ġ} Ċ }