Merge the View Options and Display Options dialogs into one.
This commit is contained in:
parent
091fbf80f0
commit
fb830197dd
3 changed files with 179 additions and 195 deletions
|
@ -1,135 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
|
|
||||||
<PropertyList>
|
|
||||||
<name>display</name>
|
|
||||||
<modal>false</modal>
|
|
||||||
<layout>vbox</layout>
|
|
||||||
<padding>20</padding>
|
|
||||||
|
|
||||||
<group>
|
|
||||||
<layout>hbox</layout>
|
|
||||||
<empty><stretch>1</stretch></empty>
|
|
||||||
|
|
||||||
<text>
|
|
||||||
<label>Display Options</label>
|
|
||||||
</text>
|
|
||||||
|
|
||||||
<empty><stretch>1</stretch></empty>
|
|
||||||
|
|
||||||
<button>
|
|
||||||
<pref-width>16</pref-width>
|
|
||||||
<pref-height>16</pref-height>
|
|
||||||
<legend></legend>
|
|
||||||
<keynum>27</keynum>
|
|
||||||
<border>2</border>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-close</command>
|
|
||||||
</binding>
|
|
||||||
</button>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<hrule/>
|
|
||||||
|
|
||||||
<group>
|
|
||||||
<layout>vbox</layout>
|
|
||||||
<halign>center</halign>
|
|
||||||
<padding>4</padding>
|
|
||||||
|
|
||||||
<checkbox>
|
|
||||||
<halign>left</halign>
|
|
||||||
<label>Show frame rate</label>
|
|
||||||
<property>/sim/rendering/fps-display</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
|
|
||||||
<checkbox>
|
|
||||||
<halign>left</halign>
|
|
||||||
<label>Show frame spacing</label>
|
|
||||||
<property>/sim/rendering/frame-latency-display</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
|
|
||||||
<checkbox>
|
|
||||||
<halign>left</halign>
|
|
||||||
<label>Show chat messages</label>
|
|
||||||
<property>/sim/multiplay/chat-display</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
|
|
||||||
<checkbox>
|
|
||||||
<halign>left</halign>
|
|
||||||
<label>Show view name popup</label>
|
|
||||||
<property>/sim/view-name-popup</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
|
|
||||||
<checkbox>
|
|
||||||
<halign>left</halign>
|
|
||||||
<label>Show 2D panel</label>
|
|
||||||
<property>/sim/panel/visibility</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
|
|
||||||
<checkbox>
|
|
||||||
<halign>left</halign>
|
|
||||||
<label>Autohide menubar</label>
|
|
||||||
<property>/sim/menubar/autovisibility/enabled</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
|
|
||||||
<group>
|
|
||||||
<layout>hbox</layout>
|
|
||||||
<padding>0</padding>
|
|
||||||
|
|
||||||
<checkbox>
|
|
||||||
<label>Autohide cursor in</label>
|
|
||||||
<property>/sim/mouse/hide-cursor</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</checkbox>
|
|
||||||
|
|
||||||
<input>
|
|
||||||
<live>true</live>
|
|
||||||
<pref-width>40</pref-width>
|
|
||||||
<pref-height>10</pref-height>
|
|
||||||
<enable>
|
|
||||||
<property>/sim/mouse/hide-cursor</property>
|
|
||||||
</enable>
|
|
||||||
<property>/sim/mouse/cursor-timeout-sec</property>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-apply</command>
|
|
||||||
</binding>
|
|
||||||
</input>
|
|
||||||
|
|
||||||
<text>
|
|
||||||
<label>sec.</label>
|
|
||||||
</text>
|
|
||||||
</group>
|
|
||||||
|
|
||||||
</group>
|
|
||||||
|
|
||||||
<hrule/>
|
|
||||||
|
|
||||||
<button>
|
|
||||||
<legend>Close</legend>
|
|
||||||
<default>true</default>
|
|
||||||
<key>Esc</key>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-close</command>
|
|
||||||
</binding>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</PropertyList>
|
|
|
@ -2,8 +2,62 @@
|
||||||
|
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
<name>view</name>
|
<name>view</name>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<nasal>
|
||||||
|
<open>
|
||||||
|
|
||||||
|
var group = gui.findElementByName(cmdarg(), "active-views");
|
||||||
|
var ac = getprop("/sim/aircraft");
|
||||||
|
group.removeChildren("checkbox");
|
||||||
|
group.removeChildren("hrule");
|
||||||
|
group.removeChildren("text");
|
||||||
|
|
||||||
|
var t = group.getChild("text", 0, 1);
|
||||||
|
t.getNode("label", 1).setValue("Standard Views");
|
||||||
|
t.getNode("halign", 1).setValue("left");
|
||||||
|
|
||||||
|
|
||||||
|
var mode = 0;
|
||||||
|
foreach (var v; view.views) {
|
||||||
|
var index = v.getIndex();
|
||||||
|
var enabled = v.initNode("enabled", 1, "BOOL");
|
||||||
|
var name = v.getNode("name");
|
||||||
|
if (name != nil) {
|
||||||
|
if (index >= 200) {
|
||||||
|
if (mode != 2) {
|
||||||
|
mode = 2;
|
||||||
|
group.getChild("empty", 1, 1).getChild("stretch", 0, 1).setValue(1);
|
||||||
|
var t = group.getChild("text", 1, 1);
|
||||||
|
t.getNode("label", 1).setValue("Other Views");
|
||||||
|
}
|
||||||
|
|
||||||
|
} elsif (index >= 100) {
|
||||||
|
aircraft.data.add(enabled);
|
||||||
|
if (mode != 1) {
|
||||||
|
mode = 1;
|
||||||
|
group.getChild("empty", 0, 1).getChild("stretch", 0, 1).setValue(1);
|
||||||
|
var t = group.getChild("text", 1, 1);
|
||||||
|
t.getNode("label", 1).setValue("\"" ~ ac ~ "\" Specific Views");
|
||||||
|
t.getNode("halign", 1).setValue("left");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var target = group.getChild("checkbox", index, 1);
|
||||||
|
props.copy(group.getNode("checkbox-template"), target);
|
||||||
|
target.getNode("label").setValue(name != nil ? name.getValue() : ("** unnamed view " ~ index ~ " **"));
|
||||||
|
target.getNode("property").setValue(enabled.getPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</open>
|
||||||
|
</nasal>
|
||||||
|
|
||||||
<modal>false</modal>
|
<modal>false</modal>
|
||||||
<layout>vbox</layout>
|
<layout>vbox</layout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
<layout>hbox</layout>
|
<layout>hbox</layout>
|
||||||
|
@ -28,64 +82,137 @@
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<hrule/>
|
<hrule/>
|
||||||
|
|
||||||
|
<group>
|
||||||
|
<layout>hbox</layout>
|
||||||
|
|
||||||
|
<group>
|
||||||
|
<layout>vbox</layout>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>Select Active Views</label>
|
||||||
|
</text>
|
||||||
|
|
||||||
<text>
|
<group>
|
||||||
<label>Select Active Views</label>
|
<layout>vbox</layout>
|
||||||
</text>
|
<halign>center</halign>
|
||||||
|
<name>active-views</name>
|
||||||
|
|
||||||
<nasal>
|
<text>
|
||||||
<open>
|
<halign>left</halign>
|
||||||
var group = cmdarg().getChildren("group")[1];
|
<label>Standard Views</label>
|
||||||
var ac = getprop("/sim/aircraft");
|
</text>
|
||||||
group.removeChildren("checkbox");
|
|
||||||
group.removeChildren("hrule");
|
<checkbox-template>
|
||||||
group.removeChildren("text");
|
<halign>left</halign>
|
||||||
var mode = 0;
|
<label><!----></label>
|
||||||
foreach (var v; view.views) {
|
<property><!----></property>
|
||||||
var index = v.getIndex();
|
<binding>
|
||||||
var enabled = v.initNode("enabled", 1, "BOOL");
|
<command>dialog-apply</command>
|
||||||
var name = v.getNode("name");
|
</binding>
|
||||||
if (name != nil) {
|
</checkbox-template>
|
||||||
if (index >= 200) {
|
</group>
|
||||||
if (mode != 2) {
|
</group>
|
||||||
mode = 2;
|
|
||||||
group.getChild("hrule", 1, 1);
|
<vrule/>
|
||||||
var t = group.getChild("text", 1, 1);
|
|
||||||
t.getNode("label", 1).setValue("Other Views");
|
<group>
|
||||||
}
|
<layout>vbox</layout>
|
||||||
|
<halign>center</halign>
|
||||||
|
<valign>top</valign>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>Display Options</label>
|
||||||
|
</text>
|
||||||
|
|
||||||
} elsif (index >= 100) {
|
<checkbox>
|
||||||
aircraft.data.add(enabled);
|
<halign>left</halign>
|
||||||
if (mode != 1) {
|
<label>Show frame rate</label>
|
||||||
mode = 1;
|
<property>/sim/rendering/fps-display</property>
|
||||||
group.getChild("hrule", 0, 1);
|
<binding>
|
||||||
var t = group.getChild("text", 0, 1);
|
<command>dialog-apply</command>
|
||||||
t.getNode("label", 1).setValue("\"" ~ ac ~ "\" Specific Views");
|
</binding>
|
||||||
}
|
</checkbox>
|
||||||
}
|
|
||||||
|
|
||||||
var target = group.getChild("checkbox", index, 1);
|
<checkbox>
|
||||||
props.copy(group.getNode("checkbox-template"), target);
|
<halign>left</halign>
|
||||||
target.getNode("label").setValue(name != nil ? name.getValue() : ("** unnamed view " ~ index ~ " **"));
|
<label>Show frame spacing</label>
|
||||||
target.getNode("property").setValue(enabled.getPath());
|
<property>/sim/rendering/frame-latency-display</property>
|
||||||
}
|
<binding>
|
||||||
}
|
<command>dialog-apply</command>
|
||||||
</open>
|
</binding>
|
||||||
</nasal>
|
</checkbox>
|
||||||
|
|
||||||
<group>
|
<checkbox>
|
||||||
<layout>vbox</layout>
|
<halign>left</halign>
|
||||||
<halign>center</halign>
|
<label>Show chat messages</label>
|
||||||
|
<property>/sim/multiplay/chat-display</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
</checkbox>
|
||||||
|
|
||||||
<checkbox-template>
|
<checkbox>
|
||||||
<halign>left</halign>
|
<halign>left</halign>
|
||||||
<label><!----></label>
|
<label>Show view name popup</label>
|
||||||
<property><!----></property>
|
<property>/sim/view-name-popup</property>
|
||||||
<binding>
|
<binding>
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
</binding>
|
</binding>
|
||||||
</checkbox-template>
|
</checkbox>
|
||||||
</group>
|
|
||||||
|
<checkbox>
|
||||||
|
<halign>left</halign>
|
||||||
|
<label>Show 2D panel</label>
|
||||||
|
<property>/sim/panel/visibility</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
</checkbox>
|
||||||
|
|
||||||
|
<checkbox>
|
||||||
|
<halign>left</halign>
|
||||||
|
<label>Autohide menubar</label>
|
||||||
|
<property>/sim/menubar/autovisibility/enabled</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
</checkbox>
|
||||||
|
|
||||||
|
<group>
|
||||||
|
<layout>hbox</layout>
|
||||||
|
<padding>0</padding>
|
||||||
|
|
||||||
|
<checkbox>
|
||||||
|
<label>Autohide cursor in</label>
|
||||||
|
<property>/sim/mouse/hide-cursor</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
</checkbox>
|
||||||
|
|
||||||
|
<input>
|
||||||
|
<live>true</live>
|
||||||
|
<pref-width>40</pref-width>
|
||||||
|
<pref-height>10</pref-height>
|
||||||
|
<enable>
|
||||||
|
<property>/sim/mouse/hide-cursor</property>
|
||||||
|
</enable>
|
||||||
|
<property>/sim/mouse/cursor-timeout-sec</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
</input>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>sec.</label>
|
||||||
|
</text>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
</group>
|
||||||
|
|
||||||
|
</group>
|
||||||
|
|
||||||
|
|
||||||
<hrule/>
|
<hrule/>
|
||||||
|
|
||||||
|
|
|
@ -80,14 +80,6 @@
|
||||||
<menu>
|
<menu>
|
||||||
<name>view</name>
|
<name>view</name>
|
||||||
|
|
||||||
<item>
|
|
||||||
<name>display-options</name>
|
|
||||||
<binding>
|
|
||||||
<command>dialog-show</command>
|
|
||||||
<dialog-name>display</dialog-name>
|
|
||||||
</binding>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<name>rendering-options</name>
|
<name>rendering-options</name>
|
||||||
<binding>
|
<binding>
|
||||||
|
|
Loading…
Add table
Reference in a new issue