Changed hardware dialog to use a list instead of toolbar. Wired up tab changes between hardware list & panel. Added prototype for memory change

This commit is contained in:
berrange@roquette.boston.redhat.com 2006-04-03 07:13:41 -04:00
parent a4c3da8429
commit ddf0b90fb4
2 changed files with 584 additions and 72 deletions

View File

@ -653,6 +653,7 @@ Inactive virtual machines</property>
<child>
<widget class="GtkNotebook" id="notebook2">
<property name="border_width">3</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
@ -1226,107 +1227,473 @@ Inactive virtual machines</property>
<property name="spacing">0</property>
<child>
<widget class="GtkToolbar" id="toolbar2">
<widget class="GtkScrolledWindow" id="scrolledwindow5">
<property name="border_width">10</property>
<property name="visible">True</property>
<property name="orientation">GTK_ORIENTATION_VERTICAL</property>
<property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
<property name="tooltips">True</property>
<property name="show_arrow">False</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkRadioToolButton" id="hw-processor">
<widget class="GtkTreeView" id="hw-list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkNotebook" id="hw-panel">
<property name="border_width">10</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
<property name="show_border">True</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<child>
<widget class="GtkLabel" id="label64">
<property name="visible">True</property>
<property name="label" translatable="yes">label64</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label53">
<property name="visible">True</property>
<property name="label" translatable="yes">Processor</property>
<property name="use_underline">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<property name="active">False</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkRadioToolButton" id="hw-memory">
<widget class="GtkVBox" id="vbox7">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">15</property>
<child>
<widget class="GtkLabel" id="label58">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Memory&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_START</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label59">
<property name="visible">True</property>
<property name="label" translatable="yes">What is the maximum amount of memory this VM should be able to use?</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHScale" id="config-memory">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="draw_value">True</property>
<property name="value_pos">GTK_POS_TOP</property>
<property name="digits">1</property>
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="inverted">False</property>
<property name="adjustment">10 0 100 0 0 0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table6">
<property name="border_width">3</property>
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
<property name="column_spacing">3</property>
<child>
<widget class="GtkLabel" id="label60">
<property name="visible">True</property>
<property name="label" translatable="yes">Current usage:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label61">
<property name="visible">True</property>
<property name="label" translatable="yes">Total memory on host machine:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="state-vm-memory">
<property name="visible">True</property>
<property name="label" translatable="yes">200 MB</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="state-host-memory">
<property name="visible">True</property>
<property name="label" translatable="yes">2 GB</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label54">
<property name="visible">True</property>
<property name="label" translatable="yes">Memory</property>
<property name="use_underline">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<property name="active">False</property>
<property name="group">hw-processor</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkRadioToolButton" id="hw-disk">
<widget class="GtkLabel" id="label65">
<property name="visible">True</property>
<property name="label" translatable="yes">label65</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label55">
<property name="visible">True</property>
<property name="label" translatable="yes">Disk</property>
<property name="use_underline">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<property name="active">False</property>
<property name="group">hw-processor</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkRadioToolButton" id="hw-network">
<widget class="GtkLabel" id="label66">
<property name="visible">True</property>
<property name="label" translatable="yes">label66</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label56">
<property name="visible">True</property>
<property name="label" translatable="yes">Network</property>
<property name="use_underline">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<property name="active">False</property>
<property name="group">hw-processor</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkRadioToolButton" id="hw-add">
<widget class="GtkLabel" id="label67">
<property name="visible">True</property>
<property name="label" translatable="yes">Add hardware</property>
<property name="use_underline">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<property name="active">False</property>
<property name="group">hw-processor</property>
<property name="label" translatable="yes">label67</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label57">
<property name="visible">True</property>
<property name="label" translatable="yes">Add hardware</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
@ -1736,7 +2103,7 @@ Inactive virtual machines</property>
<widget class="GtkWindow" id="vmm-console">
<property name="visible">True</property>
<property name="title" translatable="yes">window1</property>
<property name="title" translatable="yes">Virtual Machine Console</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
@ -1759,6 +2126,130 @@ Inactive virtual machines</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkMenuBar" id="menubar2">
<property name="visible">True</property>
<property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
<property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
<child>
<widget class="GtkMenuItem" id="menuitem8">
<property name="visible">True</property>
<property name="label" translatable="yes">Virtual _Machine</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menuitem8_menu">
<child>
<widget class="GtkMenuItem" id="menu-vm-run">
<property name="visible">True</property>
<property name="label" translatable="yes">_Run</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu-vm-run_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="menu-vm-pause">
<property name="visible">True</property>
<property name="label" translatable="yes">_Pause</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="on_menu-vm-pause_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu-vm-shutdown">
<property name="visible">True</property>
<property name="label" translatable="yes">_Shutdown</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu-vm-shutdown_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu-vm-details">
<property name="visible">True</property>
<property name="label" translatable="yes">_Details</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu-vm-details_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu-vm-snapshot">
<property name="visible">True</property>
<property name="label" translatable="yes">Take _Snapshot</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu-vm-snapshot_activate" last_modification_time="Mon, 03 Apr 2006 10:15:07 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu-vm-terminal">
<property name="visible">True</property>
<property name="label" translatable="yes">Launch _Terminal</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu-vm-terminal_activate" last_modification_time="Mon, 03 Apr 2006 10:15:07 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator3">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu-vm-close">
<property name="visible">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_menu-vm-close_activate" last_modification_time="Mon, 03 Apr 2006 10:15:07 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menuitem9">
<property name="visible">True</property>
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menuitem9_menu">
<child>
<widget class="GtkImageMenuItem" id="about2">
<property name="visible">True</property>
<property name="label">gtk-about</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_about2_activate" last_modification_time="Mon, 03 Apr 2006 10:15:47 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkToolbar" id="toolbar3">
<property name="visible">True</property>

View File

@ -197,24 +197,32 @@ class vmmDetails:
self.window.get_widget("control-snapshot").set_icon_widget(gtk.Image())
self.window.get_widget("control-snapshot").get_icon_widget().set_from_file(asset_dir + "/pixmaps/icon_snapshot.png")
self.window.get_widget("hw-panel").set_show_tabs(False)
hwListModel = gtk.ListStore(int, str, gtk.gdk.Pixbuf)
self.window.get_widget("hw-list").set_model(hwListModel)
hwListModel.append([0, "Processor", gtk.gdk.pixbuf_new_from_file(asset_dir + "/pixmaps/icon_cpu.png")])
#hwListModel.append([1, "Memory", gtk.gdk.pixbuf_new_from_file(asset_dir + "/pixmaps/icon_ram.png")])
hwListModel.append([1, "Memory", gtk.gdk.pixbuf_new_from_file(asset_dir + "/pixmaps/icon_cpu.png")])
hwListModel.append([2, "Disk", gtk.gdk.pixbuf_new_from_file(asset_dir + "/pixmaps/icon_hdd.png")])
hwListModel.append([3, "Network", gtk.gdk.pixbuf_new_from_file(asset_dir + "/pixmaps/icon_ethernet.png")])
hwListModel.append([4, "Add hardware", gtk.gdk.pixbuf_new_from_file(asset_dir + "/pixmaps/icon_addnew.png")])
self.window.get_widget("hw-list").get_selection().connect("changed", self.hw_selected)
self.window.get_widget("hw-processor").set_icon_widget(gtk.Image())
self.window.get_widget("hw-processor").get_icon_widget().set_from_file(asset_dir + "/pixmaps/icon_cpu.png")
self.window.get_widget("hw-memory").set_icon_widget(gtk.Image())
#self.window.get_widget("hw-memory").get_icon_widget().set_from_file(asset_dir + "/pixmaps/icon_ram.png")
self.window.get_widget("hw-disk").set_icon_widget(gtk.Image())
self.window.get_widget("hw-disk").get_icon_widget().set_from_file(asset_dir + "/pixmaps/icon_hdd.png")
self.window.get_widget("hw-network").set_icon_widget(gtk.Image())
self.window.get_widget("hw-network").get_icon_widget().set_from_file(asset_dir + "/pixmaps/icon_ethernet.png")
self.window.get_widget("hw-add").set_icon_widget(gtk.Image())
self.window.get_widget("hw-add").get_icon_widget().set_from_file(asset_dir + "/pixmaps/icon_addnew.png")
hwCol = gtk.TreeViewColumn("Hardware")
hw_txt = gtk.CellRendererText()
hw_img = gtk.CellRendererPixbuf()
hwCol.pack_start(hw_txt, True)
hwCol.pack_start(hw_img, False)
hwCol.add_attribute(hw_txt, 'text', 1)
hwCol.add_attribute(hw_img, 'pixbuf', 2)
self.window.get_widget("hw-list").append_column(hwCol)
self.cpu_usage_figure = Figure()
self.cpu_usage_graph = self.cpu_usage_figure.add_subplot(111)
self.cpu_usage_line = None
@ -253,6 +261,7 @@ class vmmDetails:
self.stats.connect_to_signal("vm_updated", self.refresh_overview)
self.change_graph_ranges()
self.refresh_overview(vmname)
self.hw_selected()
def show(self):
dialog = self.window.get_widget("vmm-details")
@ -262,6 +271,18 @@ class vmmDetails:
self.window.get_widget("vmm-details").hide()
return 1
def hw_selected(self, src=None):
vmlist = self.window.get_widget("hw-list")
selection = vmlist.get_selection()
active = selection.get_selected()
if active[1] != None:
print "Activate " + str(active[0].get_value(active[1], 0))
self.window.get_widget("hw-panel").set_sensitive(True)
self.window.get_widget("hw-panel").set_current_page(active[0].get_value(active[1], 0))
else:
print "Dactive" + str(active)
self.window.get_widget("hw-panel").set_sensitive(False)
def control_vm_run(self, src):
return 0