本文整理汇总了Python中miro.frontends.widgets.application.Application类的典型用法代码示例。如果您正苦于以下问题:Python Application类的具体用法?Python Application怎么用?Python Application使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Application类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_window
def build_window(self):
self._set_default_icon()
Application.build_window(self)
self.window.connect('save-dimensions', self.set_main_window_dimensions)
self.window.connect('save-maximized', self.set_main_window_maximized)
# handle maximized
maximized = self.get_main_window_maximized()
if maximized != None:
if maximized:
self.window._window.maximize()
else:
self.window._window.unmaximize()
# handle the trayicon
self.trayicon = trayicon.Trayicon('miro')
if app.config.get(options.SHOW_TRAYICON):
self.trayicon.set_visible(True)
else:
self.trayicon.set_visible(False)
# check x, y to make sure the window is visible and fix it
# if not
self.window.check_position_and_fix()
# handle media keys
self.mediakeyhandler = mediakeys.get_media_key_handler(self.window)
示例2: startup_ui
def startup_ui(self):
sys.excepthook = self.exception_handler
Application.startup_ui(self)
call_on_ui_thread(migrateappname.migrateVideos, 'Democracy', 'Miro')
call_on_ui_thread(flash.check_flash_install)
call_on_ui_thread(bonjour.check_bonjour_install)
timer.add(15, self._init_autoupdate)
示例3: build_window
def build_window(self):
icopath = self._get_icon_location()
Application.build_window(self)
self.window.connect('save-dimensions', self.set_main_window_dimensions)
self.window.connect('save-maximized', self.set_main_window_maximized)
maximized = self.get_main_window_maximized()
if maximized != None:
if maximized:
self.window._window.maximize()
else:
self.window._window.unmaximize()
self.trayicon = trayicon.Trayicon(icopath)
if app.config.get(options.SHOW_TRAYICON):
self.trayicon.set_visible(True)
else:
self.trayicon.set_visible(False)
if app.config.get(options.WINDOW_DIMENSIONS) == "":
# Miro is being started for the first time on this computer
# so we do some figuring to make sure the default width/height
# fit on this monitor.
geom = self.window.get_monitor_geometry()
width = min(1024, geom.width)
height = min(600, geom.height)
self.window.set_frame(width=width, height=height)
else:
# check x, y to make sure the window is visible and fix it
# if not
self.window.check_position_and_fix()
示例4: do_quit
def do_quit(self):
if self.window is not None:
windowFrame = self.window.nswindow.frame()
windowFrame.size.height -= 22
app.config.set(prefs.LEFT_VIEW_SIZE, self.window.splitter.get_left_width())
app.config.set(prefs.MAIN_WINDOW_FRAME, NSStringFromRect(windowFrame))
app.config.save()
Application.do_quit(self)
示例5: startup_ui
def startup_ui(self):
migrateappname.migrateVideos('Democracy', 'Miro')
osxmenus.populate_menu()
Application.startup_ui(self)
app.menu_manager.connect('enabled-changed', osxmenus.on_menu_change)
app.playback_manager.connect('did-start-playing', osxmenus.on_playback_change)
app.playback_manager.connect('did-stop', osxmenus.on_playback_change)
quicktime.register_components()
quicktime.warm_up()
示例6: connect_to_signals
def connect_to_signals(self):
Application.connect_to_signals(self)
eventloop.connect('thread-will-start', self.beginLoop)
eventloop.connect('thread-did-start', self.endLoop)
eventloop.connect('begin-loop', self.beginLoop)
eventloop.connect('end-loop', self.endLoop)
httpclient.register_on_start(
lambda cm: cm.connect('begin-loop', self.beginLoop))
httpclient.register_on_start(
lambda cm: cm.connect('end-loop', self.endLoop))
示例7: build_window
def build_window(self):
self._set_default_icon()
Application.build_window(self)
self.window.connect('save-dimensions', self.set_main_window_dimensions)
self.window.connect('save-maximized', self.set_main_window_maximized)
# handle maximized
maximized = self.get_main_window_maximized()
if maximized != None:
if maximized:
self.window._window.maximize()
else:
self.window._window.unmaximize()
# handle the trayicon
if APP_INDICATOR_SUPPORT:
self.trayicon = miroappindicator.MiroAppIndicator('miro')
else:
self.trayicon = trayicon.Trayicon('miro')
if app.config.get(options.SHOW_TRAYICON):
self.trayicon.set_visible(True)
else:
self.trayicon.set_visible(False)
if options.override_dimensions:
# if the user specified override dimensions on the command
# line, set them here.
self.window.set_frame(
width=options.override_dimensions[0],
height=options.override_dimensions[1])
elif not get_int("width") and not get_int("height"):
# if this is the first time Miro has been started, we want
# to set a default size that makes sense in the context of
# their monitor resolution. the check here is against
# whether there are width/height values in gconf already
# which isn't true in a first-run situation.
geom = self.window.get_monitor_geometry()
width = min(1024, geom.width)
height = min(600, geom.height)
self.window.set_frame(width=width, height=height)
else:
# the user isn't overriding dimensions and this is not the
# first time Miro has been launched on this computer, so
# we double-check that the position works on this monitor
# and if it puts Miro in a bad place, then fix it.
self.window.check_position_and_fix()
# handle media keys
self.mediakeyhandler = mediakeys.get_media_key_handler(self.window)
示例8: startup_ui
def startup_ui(self):
migrateappname.migrateVideos('Democracy', 'Miro')
self.menubar = osxmenus.MenuBar()
Application.startup_ui(self)
# add the Amazon cookie to Safari
storage = NSHTTPCookieStorage.sharedHTTPCookieStorage()
if 'dmusic_download_manager_enabled' not in [
cookie.name() for cookie in storage.cookiesForURL_(
NSURL.URLWithString_('http://www.amazon.com'))]:
storage.setCookie_(NSHTTPCookie.cookieWithProperties_(
{NSHTTPCookieName: 'dmusic_download_manager_enabled',
NSHTTPCookieValue: '1.0.3',
NSHTTPCookieDomain: '.amazon.com',
NSHTTPCookiePath: '/',
NSHTTPCookieMaximumAge: 3600 * 365 * 10}))
quicktime.register_components()
quicktime.warm_up()
self.emit("event-processed")
示例9: build_window
def build_window(self):
icopath = self._set_default_icon()
Application.build_window(self)
self.window.connect('save-dimensions', self.set_main_window_dimensions)
self.window.connect('save-maximized', self.set_main_window_maximized)
maximized = self.get_main_window_maximized()
if maximized != None:
if maximized:
self.window._window.maximize()
else:
self.window._window.unmaximize()
self.trayicon = trayicon.Trayicon(icopath)
if app.config.get(options.SHOW_TRAYICON):
self.trayicon.set_visible(True)
else:
self.trayicon.set_visible(False)
# check x, y to make sure the window is visible and fix it if
# not
self.window.check_position_and_fix()
示例10: startup_ui
def startup_ui(self):
sys.excepthook = self.exception_handler
Application.startup_ui(self)
call_on_ui_thread(migrateappname.migrateVideos, 'Democracy', 'Miro')
call_on_ui_thread(flash.check_flash_install)
call_on_ui_thread(bonjour.check_bonjour_install)
if app.config.get(prefs.APP_FINAL_RELEASE) == u"0":
# if this is not a final release, look at the beta
# channel
url = app.config.get(prefs.AUTOUPDATE_BETA_URL)
logging.info("Using beta channel")
else:
# if this is a final release, look at the final
# channel
url = app.config.get(prefs.AUTOUPDATE_URL)
logging.info("Using the final channel")
ctypes.cdll.winsparkle.win_sparkle_set_appcast_url(
url.encode('ascii', 'ignore'))
ctypes.cdll.winsparkle.win_sparkle_set_app_details(
unicode(app.config.get(prefs.PUBLISHER)),
unicode(app.config.get(prefs.SHORT_APP_NAME)),
unicode(app.config.get(prefs.APP_VERSION)))
ctypes.cdll.winsparkle.win_sparkle_init()
示例11: handle_first_time
def handle_first_time(self, callback):
self._set_default_icon()
Application.handle_first_time(self, callback)
示例12: startup_ui
def startup_ui(self):
sys.excepthook = self.exception_handler
Application.startup_ui(self)
示例13: startup_ui
def startup_ui(self):
sys.excepthook = self.exception_handler
Application.startup_ui(self)
call_on_ui_thread(bonjour.check_bonjour_install)
示例14: __init__
def __init__(self):
Application.__init__(self)
self.gotQuit = False
示例15: __init__
def __init__(self):
Application.__init__(self)
signals.SignalEmitter.__init__(self, "event-processed")
self.gotQuit = False