summaryrefslogtreecommitdiff
path: root/virtManager
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2014-02-25 15:57:38 -0500
committerCole Robinson <crobinso@redhat.com>2014-02-25 15:57:38 -0500
commit99eaf059aeafe5705d2d91155cc082149f9d3ebe (patch)
tree8a8d55100592ed9d5753e81f9a20b03791ff993c /virtManager
parentce64d037bff56db994fedd065a9a34b8e827dda2 (diff)
downloadvirt-manager-99eaf059aeafe5705d2d91155cc082149f9d3ebe.tar.gz
Fix deprecation warnings on F21/rawhide
Diffstat (limited to 'virtManager')
-rw-r--r--virtManager/console.py5
-rw-r--r--virtManager/details.py4
-rw-r--r--virtManager/host.py2
-rw-r--r--virtManager/snapshots.py4
-rw-r--r--virtManager/systray.py21
5 files changed, 14 insertions, 22 deletions
diff --git a/virtManager/console.py b/virtManager/console.py
index 6ac8abce..ccbd6bff 100644
--- a/virtManager/console.py
+++ b/virtManager/console.py
@@ -1662,7 +1662,7 @@ class vmmConsolePages(vmmGObjectUI):
if group is None:
group = item
else:
- item = Gtk.MenuItem(msg)
+ item = Gtk.MenuItem.new_with_label(msg)
item.set_sensitive(sensitive)
@@ -1685,7 +1685,8 @@ class vmmConsolePages(vmmGObjectUI):
# Populate graphical devices
devs = self.vm.get_graphics_devices()
if len(devs) == 0:
- item = Gtk.MenuItem(_("No graphical console available"))
+ item = Gtk.MenuItem.new_with_label(
+ _("No graphical console available"))
item.set_sensitive(False)
src.add(item)
else:
diff --git a/virtManager/details.py b/virtManager/details.py
index e9132b8f..f5330eff 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -783,7 +783,7 @@ class vmmDetails(vmmGObjectUI):
# Add HW popup menu
self.addhwmenu = Gtk.Menu()
- addHW = Gtk.ImageMenuItem(_("_Add Hardware"))
+ addHW = Gtk.ImageMenuItem.new_with_label(_("_Add Hardware"))
addHW.set_use_underline(True)
addHWImg = Gtk.Image()
addHWImg.set_from_stock(Gtk.STOCK_ADD, Gtk.IconSize.MENU)
@@ -791,7 +791,7 @@ class vmmDetails(vmmGObjectUI):
addHW.show()
addHW.connect("activate", self.add_hardware)
- rmHW = Gtk.ImageMenuItem(_("_Remove Hardware"))
+ rmHW = Gtk.ImageMenuItem.new_with_label(_("_Remove Hardware"))
rmHW.set_use_underline(True)
rmHWImg = Gtk.Image()
rmHWImg.set_from_stock(Gtk.STOCK_REMOVE, Gtk.IconSize.MENU)
diff --git a/virtManager/host.py b/virtManager/host.py
index 4e2ff016..c8d7ee07 100644
--- a/virtManager/host.py
+++ b/virtManager/host.py
@@ -179,7 +179,7 @@ class vmmHost(vmmGObjectUI):
self.widget("storage-pages").set_show_tabs(False)
self.volmenu = Gtk.Menu()
- volCopyPath = Gtk.ImageMenuItem(_("Copy Volume Path"))
+ volCopyPath = Gtk.ImageMenuItem.new_with_label(_("Copy Volume Path"))
volCopyImage = Gtk.Image()
volCopyImage.set_from_stock(Gtk.STOCK_COPY, Gtk.IconSize.MENU)
volCopyPath.set_image(volCopyImage)
diff --git a/virtManager/snapshots.py b/virtManager/snapshots.py
index 08e3f2eb..6d4d9ace 100644
--- a/virtManager/snapshots.py
+++ b/virtManager/snapshots.py
@@ -154,7 +154,7 @@ class vmmSnapshotPage(vmmGObjectUI):
# Snapshot popup menu
menu = Gtk.Menu()
- item = Gtk.ImageMenuItem(_("_Start snapshot"))
+ item = Gtk.ImageMenuItem.new_with_label(_("_Start snapshot"))
item.set_use_underline(True)
img = Gtk.Image()
img.set_from_stock(Gtk.STOCK_MEDIA_PLAY, Gtk.IconSize.MENU)
@@ -163,7 +163,7 @@ class vmmSnapshotPage(vmmGObjectUI):
item.connect("activate", self._on_start_clicked)
menu.add(item)
- item = Gtk.ImageMenuItem(_("_Delete snapshot"))
+ item = Gtk.ImageMenuItem.new_with_label(_("_Delete snapshot"))
item.set_use_underline(True)
img = Gtk.Image()
img.set_from_stock(Gtk.STOCK_DELETE, Gtk.IconSize.MENU)
diff --git a/virtManager/systray.py b/virtManager/systray.py
index 787a31f6..b02142f1 100644
--- a/virtManager/systray.py
+++ b/virtManager/systray.py
@@ -35,18 +35,6 @@ except:
AppIndicator3 = None
-def build_image_menu_item(label):
- hasfunc = hasattr(Gtk.ImageMenuItem, "set_use_underline")
- if hasfunc:
- label.replace("_", "__")
-
- menu_item = Gtk.ImageMenuItem(label)
- if hasfunc:
- menu_item.set_use_underline(False)
-
- return menu_item
-
-
class vmmSystray(vmmGObject):
__gsignals__ = {
"action-toggle-manager": (GObject.SignalFlags.RUN_FIRST, None, []),
@@ -277,7 +265,7 @@ class vmmSystray(vmmGObject):
vm_names.sort()
if len(vm_names) == 0:
- menu_item = Gtk.MenuItem(_("No virtual machines"))
+ menu_item = Gtk.MenuItem.new_with_label(_("No virtual machines"))
menu_item.set_sensitive(False)
vm_submenu.insert(menu_item, 0)
return
@@ -301,7 +289,9 @@ class vmmSystray(vmmGObject):
return
# Build VM list entry
- menu_item = build_image_menu_item(vm.get_name())
+ menu_item = Gtk.ImageMenuItem.new_with_label(vm.get_name())
+ menu_item.set_use_underline(False)
+
vm_mappings[uuid] = menu_item
vm_action_menu = vmmenu.VMActionMenu(self, lambda: vm)
menu_item.set_submenu(vm_action_menu)
@@ -329,7 +319,8 @@ class vmmSystray(vmmGObject):
del(vm_mappings[uuid])
if len(vm_menu.get_children()) == 0:
- placeholder = Gtk.MenuItem(_("No virtual machines"))
+ placeholder = Gtk.MenuItem.new_with_label(
+ _("No virtual machines"))
placeholder.show()
placeholder.set_sensitive(False)
vm_menu.add(placeholder)