ui: Set non-stock button images in glade, not explicitly in code

This commit is contained in:
Cole Robinson 2013-09-22 12:18:49 -04:00
parent a7834f5d6c
commit 1683d56b8d
29 changed files with 142 additions and 125 deletions

View File

@ -35,6 +35,11 @@
<property name="step_increment">0.10000000000000001</property>
<property name="page_increment">10</property>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-apply</property>
</object>
<object class="GtkWindow" id="vmm-add-hardware">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Add New Virtual Hardware</property>
@ -2248,6 +2253,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_create_finish_clicked" swapped="no"/>
</object>

View File

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkDialog" id="vmm-change-mac">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@ -583,16 +588,15 @@
<property name="border_width">6</property>
<property name="spacing">10</property>
<child>
<object class="GtkHBox" id="clone-vm-icon-box">
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<property name="icon_name">vm_clone_wizard</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@ -973,6 +977,7 @@ uses the existing disk image for both the original and the new machine.&lt;/span
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_clone_ok_clicked" swapped="no"/>
</object>

View File

@ -800,6 +800,11 @@
<action-widget response="0">bridge-ok</action-widget>
</action-widgets>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkDialog" id="ip-config">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@ -1458,16 +1463,15 @@
<property name="border_width">6</property>
<property name="spacing">10</property>
<child>
<object class="GtkHBox" id="header-icon-box">
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<property name="icon_name">network-idle</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@ -2110,6 +2114,7 @@
<property name="label" translatable="yes">_Finish</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_finish_clicked" swapped="no"/>
</object>

View File

@ -2,6 +2,11 @@
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkWindow" id="vmm-create-net">
<property name="can_focus">False</property>
<property name="border_width">12</property>
@ -3207,6 +3212,7 @@ A typical IPv6 network address will look something like: fd00:dead:beef:55::/64
<property name="label" translatable="yes">_Finish</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image2</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_create_finish_clicked" swapped="no"/>
</object>

View File

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkImage" id="image100">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkWindow" id="vmm-create-pool">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Add a New Storage Pool</property>
@ -806,6 +811,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image100</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_pool_finish_clicked" swapped="no"/>
</object>

View File

@ -13,6 +13,11 @@
<property name="step_increment">1</property>
<property name="page_increment">1000</property>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkWindow" id="vmm-create-vol">
<property name="can_focus">False</property>
<property name="border_width">12</property>
@ -494,6 +499,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_vol_create_clicked" swapped="no"/>
</object>

View File

@ -16,6 +16,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkImage" id="image20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkWindow" id="vmm-create">
<property name="can_focus">False</property>
<property name="title" translatable="yes">New VM</property>
@ -38,16 +43,15 @@
<property name="border_width">6</property>
<property name="spacing">10</property>
<child>
<object class="GtkHBox" id="create-vm-icon-box">
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<property name="icon_name">vm_new_wizard</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
@ -2399,6 +2403,21 @@ is not yet supported.&lt;/small&gt;</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
@ -2677,6 +2696,7 @@ is not yet supported.&lt;/small&gt;</property>
<property name="label" translatable="yes">_Finish</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image20</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_create_finish_clicked" swapped="no"/>
</object>

View File

@ -81,16 +81,15 @@
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkHBox" id="icon-box">
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<property name="icon_name">vm_delete_wizard</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>

View File

@ -110,6 +110,16 @@
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<object class="GtkImage" id="image70">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-apply</property>
</object>
<object class="GtkImage" id="image80">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-add</property>
</object>
<object class="GtkWindow" id="vmm-details">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Virtual Machine</property>
@ -733,6 +743,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">image80</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_add_hardware_button_clicked" swapped="no"/>
</object>
@ -7207,6 +7218,7 @@ I/O:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">image70</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_console_auth_login_clicked" swapped="no"/>
</object>

View File

@ -7,6 +7,16 @@
<property name="can_focus">False</property>
<property name="stock">gtk-open</property>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-delete</property>
</object>
<object class="GtkImage" id="image22">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkWindow" id="vmm-host">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Connection Details</property>
@ -1711,6 +1721,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">image22</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_vol_add_clicked" swapped="no"/>
</object>
@ -1726,6 +1737,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_vol_delete_clicked" swapped="no"/>
</object>

View File

@ -42,16 +42,15 @@
<property name="border_width">6</property>
<property name="spacing">10</property>
<child>
<object class="GtkHBox" id="migrate-vm-icon-box">
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<property name="icon_name">vm_clone_wizard</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>

View File

@ -35,6 +35,11 @@
</row>
</data>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-connect</property>
</object>
<object class="GtkDialog" id="vmm-open-connection">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@ -77,6 +82,7 @@
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_connect_clicked" swapped="no"/>
</object>

View File

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.6 -->
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkDialog" id="snapshot-new">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@ -37,6 +42,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image2</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_snapshot_new_ok_clicked" swapped="no"/>
</object>

View File

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-new</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-open</property>
</object>
<object class="GtkWindow" id="vmm-storage-browse">
<property name="can_focus">False</property>
<property name="border_width">12</property>
@ -143,6 +153,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_new_volume_clicked" swapped="no"/>
</object>
@ -187,6 +198,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image2</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_choose_volume_clicked" swapped="no"/>
</object>

View File

@ -108,15 +108,11 @@ class vmmAddHardware(vmmGObjectUI):
})
self.bind_escape_key_close()
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_APPLY,
Gtk.IconSize.BUTTON)
self.widget("create-finish").set_image(finish_img)
self.set_initial_state()
hwlist = self.widget("hardware-list")
hwlist.get_selection().connect("changed", self.hw_selected)
self.set_initial_state()
def show(self, parent):
logging.debug("Showing addhw")
self.reset_state()

View File

@ -165,10 +165,6 @@ class vmmCloneVM(vmmGObjectUI):
})
self.bind_escape_key_close()
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_NEW,
Gtk.IconSize.BUTTON)
self.widget("clone-ok").set_image(finish_img)
self.set_initial_state()
def show(self, parent):
@ -226,12 +222,6 @@ class vmmCloneVM(vmmGObjectUI):
self.widget("storage-viewport").override_background_color(Gtk.StateType.NORMAL,
defcolor)
box = self.widget("clone-vm-icon-box")
image = Gtk.Image.new_from_icon_name("vm_clone_wizard",
Gtk.IconSize.DIALOG)
image.show()
box.pack_end(image, False, False, False)
# Populate state
def reset_state(self):
self.widget("clone-cancel").grab_focus()

View File

@ -122,9 +122,6 @@ class vmmConnect(vmmGObjectUI):
pass
def set_initial_state(self):
stock_img = Gtk.Image.new_from_stock(Gtk.STOCK_CONNECT,
Gtk.IconSize.BUTTON)
self.widget("connect").set_image(stock_img)
self.widget("connect").grab_default()
# Hostname combo box entry

View File

@ -796,10 +796,6 @@ class vmmConsolePages(vmmGObjectUI):
self.keycombo_menu = uihelpers.build_keycombo_menu(self.send_key)
self.init_fs_toolbar()
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_YES,
Gtk.IconSize.BUTTON)
self.widget("console-auth-login").set_image(finish_img)
# Make viewer widget background always be black
black = Gdk.Color(0, 0, 0)
self.widget("console-gfx-viewport").modify_bg(Gtk.StateType.NORMAL,

View File

@ -220,19 +220,8 @@ class vmmCreate(vmmGObjectUI):
self.widget("create-pages").set_show_tabs(False)
self.widget("install-method-pages").set_show_tabs(False)
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_QUIT,
Gtk.IconSize.BUTTON)
self.widget("create-finish").set_image(finish_img)
blue = Gdk.Color.parse("#0072A8")[1]
self.widget("create-header").modify_bg(Gtk.StateType.NORMAL,
blue)
box = self.widget("create-vm-icon-box")
image = Gtk.Image.new_from_icon_name("vm_new_wizard",
Gtk.IconSize.DIALOG)
image.show()
box.pack_end(image, False, False, False)
self.widget("create-header").modify_bg(Gtk.StateType.NORMAL, blue)
# Connection list
self.widget("create-conn-label").set_text("")

View File

@ -168,19 +168,9 @@ class vmmCreateInterface(vmmGObjectUI):
self.widget("pages").set_show_tabs(False)
self.widget("bond-pages").set_show_tabs(False)
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_QUIT,
Gtk.IconSize.BUTTON)
self.widget("finish").set_image(finish_img)
blue = Gdk.Color.parse("#0072A8")[1]
self.widget("header").modify_bg(Gtk.StateType.NORMAL, blue)
box = self.widget("header-icon-box")
image = Gtk.Image.new_from_icon_name("network-idle",
Gtk.IconSize.DIALOG)
image.show()
box.pack_end(image, False, False, False)
# Interface type
type_list = self.widget("interface-type")
type_model = Gtk.ListStore(str, str)

View File

@ -78,10 +78,6 @@ class vmmCreateNetwork(vmmGObjectUI):
})
self.bind_escape_key_close()
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_QUIT,
Gtk.IconSize.BUTTON)
self.widget("create-finish").set_image(finish_img)
self.set_initial_state()
def show(self, parent):

View File

@ -81,10 +81,6 @@ class vmmCreatePool(vmmGObjectUI):
})
self.bind_escape_key_close()
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_QUIT,
Gtk.IconSize.BUTTON)
self.widget("pool-finish").set_image(finish_img)
self.set_initial_state()
def show(self, parent):

View File

@ -58,20 +58,7 @@ class vmmCreateVolume(vmmGObjectUI):
})
self.bind_escape_key_close()
format_list = self.widget("vol-format")
format_model = Gtk.ListStore(str, str)
format_list.set_model(format_model)
text2 = Gtk.CellRendererText()
format_list.pack_start(text2, False)
format_list.add_attribute(text2, 'text', 1)
self.widget("vol-info-view").modify_bg(Gtk.StateType.NORMAL,
Gdk.Color.parse("grey")[1])
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_QUIT,
Gtk.IconSize.BUTTON)
self.widget("vol-create").set_image(finish_img)
self._init_state()
self.reset_state()
@ -124,6 +111,18 @@ class vmmCreateVolume(vmmGObjectUI):
suffix = ".img"
return suffix
def _init_state(self):
format_list = self.widget("vol-format")
format_model = Gtk.ListStore(str, str)
format_list.set_model(format_model)
text2 = Gtk.CellRendererText()
format_list.pack_start(text2, False)
format_list.add_attribute(text2, 'text', 1)
self.widget("vol-info-view").modify_bg(Gtk.StateType.NORMAL,
Gdk.Color.parse("grey")[1])
def _make_stub_vol(self):
self.vol = StorageVolume(self.conn.get_backend())
self.vol.pool = self.parent_pool.get_backend()

View File

@ -59,11 +59,6 @@ class vmmDeleteDialog(vmmGObjectUI):
})
self.bind_escape_key_close()
image = Gtk.Image.new_from_icon_name("vm_delete_wizard",
Gtk.IconSize.DIALOG)
image.show()
self.widget("icon-box").pack_end(image, False, False, False)
prepare_storage_list(self.widget("delete-storage-list"))
def toggle_remove_storage(self, src):

View File

@ -549,10 +549,6 @@ class vmmDetails(vmmGObjectUI):
"changed",
self.config_bootdev_selected)
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_ADD,
Gtk.IconSize.BUTTON)
self.widget("add-hardware-button").set_image(finish_img)
self.populate_hw_list()
self.repopulate_boot_list()

View File

@ -141,13 +141,6 @@ class vmmHost(vmmGObjectUI):
"on_config_autoconnect_toggled": self.toggle_autoconnect,
})
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_DELETE,
Gtk.IconSize.BUTTON)
self.widget("vol-delete").set_image(finish_img)
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_NEW,
Gtk.IconSize.BUTTON)
self.widget("vol-add").set_image(finish_img)
self.conn.connect("resources-sampled", self.refresh_resources)
self.reset_state()

View File

@ -72,13 +72,7 @@ class vmmMigrateDialog(vmmGObjectUI):
self.bind_escape_key_close()
blue = Gdk.color_parse("#0072A8")
self.widget("migrate-header").modify_bg(Gtk.StateType.NORMAL,
blue)
image = Gtk.Image.new_from_icon_name("vm_clone_wizard",
Gtk.IconSize.DIALOG)
image.show()
self.widget("migrate-vm-icon-box").pack_end(image, False, False, False)
self.widget("migrate-header").modify_bg(Gtk.StateType.NORMAL, blue)
self.init_state()
def show(self, parent):

View File

@ -129,9 +129,6 @@ class vmmSnapshotPage(vmmGObjectUI):
slist.set_tooltip_column(2)
slist.append_column(col)
self.widget("snapshot-new-ok").set_image(
Gtk.Image.new_from_stock(Gtk.STOCK_NEW, Gtk.IconSize.BUTTON))
###################
# Functional bits #

View File

@ -69,13 +69,6 @@ class vmmStorageBrowser(vmmGObjectUI):
})
self.bind_escape_key_close()
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_NEW,
Gtk.IconSize.BUTTON)
self.widget("new-volume").set_image(finish_img)
finish_img = Gtk.Image.new_from_stock(Gtk.STOCK_OPEN,
Gtk.IconSize.BUTTON)
self.widget("choose-volume").set_image(finish_img)
self.set_initial_state()
def show(self, parent, conn=None):