本文整理汇总了Python中variety.Util.Util.is_unity方法的典型用法代码示例。如果您正苦于以下问题:Python Util.is_unity方法的具体用法?Python Util.is_unity怎么用?Python Util.is_unity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类variety.Util.Util
的用法示例。
在下文中一共展示了Util.is_unity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_menu
# 需要导入模块: from variety.Util import Util [as 别名]
# 或者: from variety.Util.Util import is_unity [as 别名]
def create_menu(self, window):
self.menu = Gtk.Menu()
if not Util.is_unity():
self.next_main = Gtk.MenuItem(_("_Next"))
self.next_main.set_use_underline(True)
self.next_main.connect("activate", window.next_wallpaper)
self.menu.append(self.next_main)
self.prev_main = Gtk.MenuItem(_("_Previous"))
self.prev_main.set_use_underline(True)
self.prev_main.connect("activate", window.prev_wallpaper)
self.menu.append(self.prev_main)
self.menu.append(Gtk.SeparatorMenuItem.new())
self.file_label = Gtk.MenuItem(_("Current desktop wallpaper"))
self.file_label.connect("activate", window.open_file)
self.menu.append(self.file_label)
self.show_origin = Gtk.MenuItem(_("Show origin"))
self.show_origin.connect("activate", window.on_show_origin)
self.show_origin.set_sensitive(False)
self.menu.append(self.show_origin)
self.show_author = Gtk.MenuItem("Show author")
self.show_author.connect("activate", window.on_show_author)
self.show_author.set_sensitive(False)
self.show_author.set_visible(False)
self.menu.append(self.show_author)
self.copy_to_favorites = Gtk.MenuItem(_("Copy to _Favorites"))
self.copy_to_favorites.set_use_underline(True)
self.copy_to_favorites.connect("activate", window.copy_to_favorites)
self.menu.append(self.copy_to_favorites)
self.move_to_favorites = Gtk.MenuItem(_("Move to Favorites"))
self.move_to_favorites.set_use_underline(True)
self.move_to_favorites.connect("activate", window.move_to_favorites)
self.move_to_favorites.set_visible(False)
self.menu.append(self.move_to_favorites)
self.trash = Gtk.MenuItem(_("Delete to _Trash"))
self.trash.set_use_underline(True)
self.trash.connect("activate", window.move_to_trash)
self.menu.append(self.trash)
self.menu.append(Gtk.SeparatorMenuItem.new())
self.image_menu = Gtk.Menu()
self.next = Gtk.MenuItem(_("_Next"))
self.next.set_use_underline(True)
self.next.connect("activate", window.next_wallpaper)
self.image_menu.append(self.next)
self.prev = Gtk.MenuItem(_("_Previous"))
self.prev.set_use_underline(True)
self.prev.connect("activate", window.prev_wallpaper)
self.image_menu.append(self.prev)
self.fast_forward = Gtk.MenuItem(_("_Next, skipping forward history"))
self.fast_forward.set_use_underline(True)
def _fast_forward(widget):
window.next_wallpaper(widget, bypass_history=True)
self.fast_forward.connect("activate", _fast_forward)
self.image_menu.append(self.fast_forward)
self.image_menu.append(Gtk.SeparatorMenuItem.new())
self.scroll_tip = Gtk.MenuItem(_("Tip: Scroll wheel over icon\nfor Next and Previous"))
self.scroll_tip.set_sensitive(False)
self.image_menu.append(self.scroll_tip)
self.image_menu.append(Gtk.SeparatorMenuItem.new())
self.pause_resume = Gtk.MenuItem(_("Pause on current"))
self.pause_resume.connect("activate", window.on_pause_resume)
self.image_menu.append(self.pause_resume)
self.image_item = Gtk.MenuItem(_("_Image"))
self.image_item.set_use_underline(True)
self.image_item.set_submenu(self.image_menu)
self.menu.append(self.image_item)
self.image_menu.append(Gtk.SeparatorMenuItem.new())
self.focus = Gtk.MenuItem(_("Where is it from?"))
self.focus.connect("activate", window.focus_in_preferences)
self.image_menu.append(self.focus)
self.no_effects = Gtk.CheckMenuItem(_("Show without effects"))
self.no_effects.set_active(False)
self.no_effects.set_use_underline(True)
def _toggle_no_effects(widget=None):
window.toggle_no_effects(self.no_effects.get_active())
self.no_effects_handler_id = self.no_effects.connect("toggled", _toggle_no_effects)
self.image_menu.append(self.no_effects)
self.google_image = Gtk.MenuItem(_("Google Image Search"))
self.google_image.connect("activate", window.google_image_search)
#.........这里部分代码省略.........