@@ -16,6 +16,7 @@ public class CSharpierSettingsComponent implements SearchableConfigurable {
1616
1717 private final Project project ;
1818 private JBCheckBox runOnSaveCheckBox = new JBCheckBox ("Run on Save" );
19+ private JBCheckBox globalRunOnSaveCheckBox = new JBCheckBox ("Run on Save (Global)" );
1920 private JBCheckBox disableCSharpierServerCheckBox = new JBCheckBox ("Disable CSharpier Server" );
2021 private JBCheckBox useCustomPath = new JBCheckBox ("Override CSharpier Executable" );
2122 private JBTextField customPathTextField = new JBTextField ();
@@ -68,6 +69,10 @@ private JComponent createSectionHeader(String label) {
6869 .setFormLeftIndent (leftIndent )
6970 .addComponent (this .runOnSaveCheckBox , topInset )
7071 .setFormLeftIndent (0 )
72+ .addComponent (createSectionHeader ("Global Settings" ), 20 )
73+ .setFormLeftIndent (leftIndent )
74+ .addComponent (this .globalRunOnSaveCheckBox , topInset )
75+ .setFormLeftIndent (0 )
7176 .addComponent (createSectionHeader ("Developer Settings" ), 20 )
7277 .setFormLeftIndent (leftIndent )
7378 .addComponent (this .useCustomPath , topInset )
@@ -87,6 +92,8 @@ public boolean isModified() {
8792 return (
8893 CSharpierSettings .getInstance (this .project ).getRunOnSave () !=
8994 this .runOnSaveCheckBox .isSelected () ||
95+ CSharpierGlobalSettings .getInstance (this .project ).getRunOnSave () !=
96+ this .globalRunOnSaveCheckBox .isSelected () ||
9097 CSharpierSettings .getInstance (this .project ).getCustomPath () !=
9198 this .customPathTextField .getText () ||
9299 CSharpierSettings .getInstance (this .project ).getUseCustomPath () !=
@@ -104,6 +111,9 @@ public void apply() {
104111 settings .setCustomPath (this .customPathTextField .getText ());
105112 settings .setDisableCSharpierServer (this .disableCSharpierServerCheckBox .isSelected ());
106113 settings .setUseCustomPath (this .useCustomPath .isSelected ());
114+
115+ var globalSettings = CSharpierGlobalSettings .getInstance (this .project );
116+ globalSettings .setRunOnSave (this .globalRunOnSaveCheckBox .isSelected ());
107117 }
108118
109119 @ Override
@@ -113,5 +123,8 @@ public void reset() {
113123 this .useCustomPath .setSelected (settings .getUseCustomPath ());
114124 this .customPathTextField .setText (settings .getCustomPath ());
115125 this .disableCSharpierServerCheckBox .setSelected (settings .getDisableCSharpierServer ());
126+
127+ var globalSettings = CSharpierGlobalSettings .getInstance (this .project );
128+ this .globalRunOnSaveCheckBox .setSelected (globalSettings .getRunOnSave ());
116129 }
117130}
0 commit comments