mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
details: Remove UI display fields for egd RNG
In practice no one is using this, so it's not worth maintaining specific UI to show its details
This commit is contained in:
parent
2e9a11b220
commit
8aa01dab78
192
ui/details.ui
192
ui/details.ui
@ -5724,198 +5724,6 @@
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Backend type:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-backend-type">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-backend-type</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Mode:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-mode">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-mode</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Host:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-connect-host">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-connect-host</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Service:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-connect-service">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-connect-service</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Bind Host:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-bind-host">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-bind-host</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label9">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Bind Service:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-bind-service">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-bind-service</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Rate (period):</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-rate-period">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-rate-period</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Rate (bytes):</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rng-rate-bytes">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label">rng-rate-bytes</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -14,7 +14,6 @@ import libvirt
|
||||
|
||||
import virtinst
|
||||
from virtinst import util
|
||||
from virtinst import DeviceRng
|
||||
|
||||
from . import vmmenu
|
||||
from . import uiutil
|
||||
@ -2851,53 +2850,12 @@ class vmmDetails(vmmGObjectUI):
|
||||
|
||||
def refresh_rng_page(self):
|
||||
dev = self.get_hw_selection(HW_LIST_COL_DEVICE)
|
||||
values = {
|
||||
"rng-bind-host": "bind_host",
|
||||
"rng-bind-service": "bind_service",
|
||||
"rng-connect-host": "connect_host",
|
||||
"rng-connect-service": "connect_service",
|
||||
"rng-type": "type",
|
||||
"rng-device": "device",
|
||||
"rng-backend-type": "backend_type",
|
||||
"rng-rate-bytes": "rate_bytes",
|
||||
"rng-rate-period": "rate_period"
|
||||
}
|
||||
rewriter = {
|
||||
"rng-type": lambda x:
|
||||
DeviceRng.get_pretty_type(x),
|
||||
"rng-backend-type": lambda x:
|
||||
DeviceRng.get_pretty_backend_type(x),
|
||||
}
|
||||
|
||||
def set_visible(widget, v):
|
||||
uiutil.set_grid_row_visible(self.widget(widget), v)
|
||||
is_random = dev.type == "random"
|
||||
uiutil.set_grid_row_visible(self.widget("rng-device"), is_random)
|
||||
|
||||
is_egd = dev.type == DeviceRng.TYPE_EGD
|
||||
udp = dev.backend_type == DeviceRng.BACKEND_TYPE_UDP
|
||||
bind = DeviceRng.BACKEND_MODE_BIND in dev.backend_mode()
|
||||
|
||||
set_visible("rng-device", not is_egd)
|
||||
set_visible("rng-mode", is_egd and not udp)
|
||||
set_visible("rng-backend-type", is_egd)
|
||||
set_visible("rng-connect-host", is_egd and (udp or not bind))
|
||||
set_visible("rng-connect-service", is_egd and (udp or not bind))
|
||||
set_visible("rng-bind-host", is_egd and (udp or bind))
|
||||
set_visible("rng-bind-service", is_egd and (udp or bind))
|
||||
|
||||
for k, prop in values.items():
|
||||
val = "-"
|
||||
if dev.supports_property(prop):
|
||||
val = getattr(dev, prop) or "-"
|
||||
r = rewriter.get(k)
|
||||
if r:
|
||||
val = r(val)
|
||||
self.widget(k).set_text(val)
|
||||
if "rate" in k:
|
||||
uiutil.set_grid_row_visible(self.widget(k), val != "-")
|
||||
|
||||
if is_egd and not udp:
|
||||
mode = DeviceRng.get_pretty_mode(dev.backend_mode()[0])
|
||||
self.widget("rng-mode").set_text(mode)
|
||||
self.widget("rng-type").set_text(dev.get_pretty_type(dev.type))
|
||||
self.widget("rng-device").set_text(dev.device or "")
|
||||
|
||||
def refresh_char_page(self):
|
||||
chardev = self.get_hw_selection(HW_LIST_COL_DEVICE)
|
||||
|
Loading…
Reference in New Issue
Block a user