Skip to content

Commit a1b6f40

Browse files
committed
feat: support export of system default settings
1 parent daae595 commit a1b6f40

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

cls/SourceControl/Git/Extension.cls

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ XData Menu
2929
<MenuItem Name="NewBranch" />
3030
<MenuItem Name="SwitchBranch" />
3131
<MenuItem Separator="true"/>
32+
<MenuItem Name="ExportSystemDefaults" />
3233
<MenuItem Name="Export" />
3334
<MenuItem Name="ExportForce" />
3435
<MenuItem Name="Import" />
@@ -125,6 +126,7 @@ Method LocalizeName(name As %String) As %String
125126
"Settings":$$$Text("@Settings@Settings"),
126127
"Init":$$$Text("@Init@Initialize"),
127128
"GitWebUI":$$$Text("@GitWebUI@Launch Git UI"),
129+
"ExportSystemDefaults":$$$Text("@ExportSystemDefaults@Export System Default Settings"),
128130
"Export":$$$Text("@Export@Export All"),
129131
"ExportForce":$$$Text("@ExportForce@Export All (Force)"),
130132
"Import":$$$Text("@Import@Import All"),
@@ -160,6 +162,11 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
160162
quit ..OnSourceMenuContextItem(InternalName,name,.Enabled,.DisplayName)
161163
}
162164

165+
if name = "ExportSystemDefaults" {
166+
set Enabled = ##class(%Library.EnsembleMgr).IsEnsembleNamespace()
167+
quit $$$OK
168+
}
169+
163170
if ##class(SourceControl.Git.Utils).BasicMode() {
164171
set Enabled = $CASE(name,
165172
"Status": 1,
@@ -171,7 +178,6 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
171178
"Sync": 1,
172179
"": 1,
173180
:-1
174-
175181
)
176182
} else {
177183
set Enabled = $CASE(name,

cls/SourceControl/Git/Utils.cls

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ ClassMethod UserAction(InternalName As %String, MenuName As %String, ByRef Targe
251251
if ec {
252252
write !,"==export done==",!
253253
}
254+
} elseif (menuItemName = "ExportSystemDefaults") {
255+
set ec = ..ExportSystemDefaults()
254256
} elseif (menuItemName = "Import") {
255257
set ec = ..ImportAll()
256258
set Reload = 1
@@ -1615,6 +1617,13 @@ ClassMethod ExportAll(force As %Boolean = 0) As %Status
16151617
quit ..ExportRoutines(force)
16161618
}
16171619

1620+
ClassMethod ExportSystemDefaults() As %Status
1621+
{
1622+
new %SourceControl
1623+
do ##class(%Studio.SourceControl.Interface).SourceControlCreate()
1624+
quit %SourceControl.OnAfterSave("Ens.Config.DefaultSettings.ESD")
1625+
}
1626+
16181627
/// if <var>force</var> = 1 then we import item even if timestamp in system is newer
16191628
ClassMethod ImportAll(force As %Boolean = 0) As %Status
16201629
{

0 commit comments

Comments
 (0)