Exemple #1
0
 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)
Exemple #2
0
    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()
Exemple #3
0
 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")
Exemple #4
0
    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)
Exemple #5
0
 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)
Exemple #6
0
 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)
Exemple #7
0
 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()
Exemple #8
0
 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))
Exemple #9
0
 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))
Exemple #10
0
    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)
Exemple #11
0
    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)
Exemple #12
0
 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")
Exemple #13
0
    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()
Exemple #14
0
 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()
Exemple #15
0
 def __init__(self):
     Application.__init__(self)
     self.gotQuit = False
Exemple #16
0
 def startup_ui(self):
     sys.excepthook = self.exception_handler
     Application.startup_ui(self)
     call_on_ui_thread(bonjour.check_bonjour_install)
Exemple #17
0
 def on_window_show(self, window):
     Application.on_window_show(self, window)
     self.app_controller.finish_startup()
Exemple #18
0
 def startup_ui(self):
     sys.excepthook = self.exception_handler
     Application.startup_ui(self)
Exemple #19
0
 def __init__(self):
     Application.__init__(self)
     self.showing_update_dialog = False
Exemple #20
0
 def __init__(self):
     Application.__init__(self)
     signals.SignalEmitter.__init__(self, "event-processed")
     self.gotQuit = False
Exemple #21
0
 def handle_first_time(self, callback):
     Application.handle_first_time(self, callback)
Exemple #22
0
 def startup_ui(self):
     sys.excepthook = self.exception_handler
     Application.startup_ui(self)
     call_on_ui_thread(bonjour.check_bonjour_install)
Exemple #23
0
 def handle_first_time(self, callback):
     self._set_default_icon()
     Application.handle_first_time(self, callback)
Exemple #24
0
 def __init__(self):
     Application.__init__(self)
     signals.SignalEmitter.__init__(self, "event-processed")
     self.gotQuit = False
Exemple #25
0
 def startup_ui(self):
     Application.startup_ui(self)
     call_on_ui_thread(migrateappname.migrateVideos, 'Democracy', 'Miro')
     call_on_ui_thread(flash.check_flash_install)
Exemple #26
0
 def handle_first_time(self, callback):
     self._set_default_icon()
     Application.handle_first_time(self, callback)
Exemple #27
0
 def on_window_show(self, window):
     Application.on_window_show(self, window)
     self.app_controller.finish_startup()