本文整理汇总了Python中preferences.Preferences.start方法的典型用法代码示例。如果您正苦于以下问题:Python Preferences.start方法的具体用法?Python Preferences.start怎么用?Python Preferences.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类preferences.Preferences
的用法示例。
在下文中一共展示了Preferences.start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PopUpMenu
# 需要导入模块: from preferences import Preferences [as 别名]
# 或者: from preferences.Preferences import start [as 别名]
class PopUpMenu(object):
def __init__(self, photolist, photoframe):
self.gui = Gtk.Builder()
self.gui.add_from_file(os.path.join(constants.SHARED_DATA_DIR, 'menu.ui'))
self.photoimage = photoframe.photoimage
self.photolist = photolist
self.preferences = Preferences(photolist)
self.about = AboutDialog()
self.is_show = False
def start(self, widget, event):
self.set_recent_menu()
if SETTINGS.get_boolean('window-fix'):
self.gui.get_object('menuitem6').set_active(True)
photo = self.photoimage.photo
accessible = photo.can_open() if photo else False
self.set_open_menu_sensitive(accessible)
is_fullscreen = SETTINGS.get_boolean('fullscreen')
self.gui.get_object('menuitem8').set_active(is_fullscreen)
self.gui.connect_signals(self)
menu = self.gui.get_object('menu')
menu.popup(None, None, None, None, event.button, event.time)
self.is_show = True
def set_recent_menu(self):
RecentMenu(self.gui, self.photolist)
def set_open_menu_sensitive(self, state):
self.gui.get_object('menuitem5').set_sensitive(state)
def on_menuitem5_activate(self, *args):
"open_photo"
self.photoimage.photo.open()
def on_next_photo(self, *args):
self.photolist.next_photo(*args)
def on_menuitem8_toggled(self, widget, *args):
"_full_screen_cb"
SETTINGS.set_boolean('fullscreen', widget.get_active())
def on_menuitem6_toggled(self, widget):
"_fix_window_cb"
SETTINGS.set_boolean('window-fix', widget.get_active())
def on_prefs(self, *args):
self.preferences.start(*args)
def on_help(self, widget):
Gtk.show_uri(None, 'ghelp:gphotoframe', Gdk.CURRENT_TIME)
def on_about(self, *args):
self.about.start()
def on_quit(self, *args):
self.photolist.queue.clear_cache()
reactor.stop()
def on_menu_hide(self, *args):
self.is_show = False