Exemplo n.º 1
0
    def command_enter_misc_actions(self):
        """
        Overrides superclass method. 
        
        @see: baseCommand.command_enter_misc_actions()  for documentation
        """
        #@WARNING: The following code in  was originally in
        #def init_gui method. Its copied 'as is' from there.-- Ninad 2008-08-21

        self.w.simMoviePlayerAction.setChecked(
            1)  # toggle on the Movie Player icon+

        # Disable some action items in the main window.
        # [bruce 050426 comment: I'm skeptical of disabling the ones marked #k
        #  and suggest for some others (especially "simulator") that they
        #  auto-exit the mode rather than be disabled,
        #  but I won't revise these for now.]
        self.w.disable_QActions_for_movieMode(True)
        #  Actions marked #k are now in disable_QActions_for_movieMode(). mark 060314)

        # Disable Undo/Redo actions, and undo checkpoints, during this mode (they *must* be reenabled in restore_gui).
        # We do this last, so as not to do it if there are exceptions in the rest of the method,
        # since if it's done and never undone, Undo/Redo won't work for the rest of the session.
        # [bruce 060414; same thing done in some other modes]

        undo_manager.disable_undo_checkpoints('Movie Player')
        undo_manager.disable_UndoRedo(
            'Movie Player',
            "in Movie Player")  # optimizing this for shortness in menu text
Exemplo n.º 2
0
    def command_enter_misc_actions(self):
        """
        Overrides superclass method. 
        
        @see: baseCommand.command_enter_misc_actions()  for documentation
        """
        #@WARNING: The following code in  was originally in 
        #def init_gui method. Its copied 'as is' from there.-- Ninad 2008-08-21
        
        self.w.simMoviePlayerAction.setChecked(1) # toggle on the Movie Player icon+

        # Disable some action items in the main window.
        # [bruce 050426 comment: I'm skeptical of disabling the ones marked #k
        #  and suggest for some others (especially "simulator") that they
        #  auto-exit the mode rather than be disabled,
        #  but I won't revise these for now.]
        self.w.disable_QActions_for_movieMode(True)
            #  Actions marked #k are now in disable_QActions_for_movieMode(). mark 060314)

        # Disable Undo/Redo actions, and undo checkpoints, during this mode (they *must* be reenabled in restore_gui).
        # We do this last, so as not to do it if there are exceptions in the rest of the method,
        # since if it's done and never undone, Undo/Redo won't work for the rest of the session.
        # [bruce 060414; same thing done in some other modes]
        
        undo_manager.disable_undo_checkpoints('Movie Player')
        undo_manager.disable_UndoRedo('Movie Player', "in Movie Player") # optimizing this for shortness in menu text
Exemplo n.º 3
0
    def init_gui(self):

        if not self.propMgr:
            self.propMgr = MoviePropertyManager(self)
            #@bug BUG: following is a workaround for bug 2494
            changes.keep_forever(self.propMgr)

        #@NOTE: self.propMgr.show() is called later in this (init_gui) method.

        self.updateCommandToolbar(bool_entering = True)

        self.w.simMoviePlayerAction.setChecked(1) # toggle on the Movie Player icon+

        # Disable some action items in the main window.
        # [bruce 050426 comment: I'm skeptical of disabling the ones marked #k
        #  and suggest for some others (especially "simulator") that they
        #  auto-exit the mode rather than be disabled,
        #  but I won't revise these for now.]
        self.w.disable_QActions_for_movieMode(True)
            #  Actions marked #k are now in disable_QActions_for_movieMode(). mark 060314)

        # MP dashboard initialization.
        self.enableMovieControls(False)
            #bruce 050428 precaution (has no noticable effect but seems safer in theory)
        #bruce 050428, working on bug 395: I think some undesirable state is left in the dashboard, so let's reinit it
        # (and down below we might like to init it from the movie if possible, but it's not always possible).
        self.propMgr._moviePropMgr_reinit() ###e could pass frameno? is max frames avail yet in all playable movies? not sure.
        # [bruce 050426 comment: probably this should just be a call of an update method, also used during the mode ###e]
        movie = self.o.assy.current_movie # might be None, but might_be_playable() true implies it's not
        if self.might_be_playable(): #bruce 050426 added condition
            frameno = movie.currentFrame
        else:
            frameno = 0 #bruce 050426 guessed value

        self.propMgr.frameNumberSpinBox.setValue(frameno) # bruce 050428 question: does this call our slot method?? ###k
        self.propMgr.moviePlayActiveAction.setVisible(0)
        self.propMgr.moviePlayRevActiveAction.setVisible(0)

        if self.might_be_playable(): # We have a movie file ready.  It's showtime! [bruce 050426 changed .filename -> .might_be_playable()]
            movie.cueMovie(propMgr = self.propMgr) # Cue movie.
            self.enableMovieControls(True)
            self.propMgr.updateFrameInformation()
            if movie.filename: #k not sure this cond is needed or what to do if not true [bruce 050510]
                env.history.message( "Movie file ready to play: %s" % movie.filename) #bruce 050510 added this message
        else:
            self.enableMovieControls(False)

        #Need to do this after calling movie._setUp (propMgr displays movie
        #information in its msg groupbox.  All this will be cleaned up when we
        #do moviemode code cleanup.

        self.propMgr.show()

        # Disable Undo/Redo actions, and undo checkpoints, during this mode (they *must* be reenabled in restore_gui).
        # We do this last, so as not to do it if there are exceptions in the rest of the method,
        # since if it's done and never undone, Undo/Redo won't work for the rest of the session.
        # [bruce 060414; same thing done in some other modes]
        import foundation.undo_manager as undo_manager
        undo_manager.disable_undo_checkpoints('Movie Player')
        undo_manager.disable_UndoRedo('Movie Player', "in Movie Player") # optimizing this for shortness in menu text
            # this makes Undo menu commands and tooltips look like "Undo (not permitted in Movie Player)" (and similarly for Redo)
        self.connect_or_disconnect_signals(True)
Exemplo n.º 4
0
    def init_gui(self):

        if not self.propMgr:
            self.propMgr = MoviePropertyManager(self)
            #@bug BUG: following is a workaround for bug 2494
            changes.keep_forever(self.propMgr)

        #@NOTE: self.propMgr.show() is called later in this (init_gui) method.

        self.updateCommandToolbar(bool_entering=True)

        self.w.simMoviePlayerAction.setChecked(
            1)  # toggle on the Movie Player icon+

        # Disable some action items in the main window.
        # [bruce 050426 comment: I'm skeptical of disabling the ones marked #k
        #  and suggest for some others (especially "simulator") that they
        #  auto-exit the mode rather than be disabled,
        #  but I won't revise these for now.]
        self.w.disable_QActions_for_movieMode(True)
        #  Actions marked #k are now in disable_QActions_for_movieMode(). mark 060314)

        # MP dashboard initialization.
        self.enableMovieControls(False)
        #bruce 050428 precaution (has no noticable effect but seems safer in theory)
        #bruce 050428, working on bug 395: I think some undesirable state is left in the dashboard, so let's reinit it
        # (and down below we might like to init it from the movie if possible, but it's not always possible).
        self.propMgr._moviePropMgr_reinit(
        )  ###e could pass frameno? is max frames avail yet in all playable movies? not sure.
        # [bruce 050426 comment: probably this should just be a call of an update method, also used during the mode ###e]
        movie = self.o.assy.current_movie  # might be None, but might_be_playable() true implies it's not
        if self.might_be_playable():  #bruce 050426 added condition
            frameno = movie.currentFrame
        else:
            frameno = 0  #bruce 050426 guessed value

        self.propMgr.frameNumberSpinBox.setValue(
            frameno
        )  # bruce 050428 question: does this call our slot method?? ###k
        self.propMgr.moviePlayActiveAction.setVisible(0)
        self.propMgr.moviePlayRevActiveAction.setVisible(0)

        if self.might_be_playable(
        ):  # We have a movie file ready.  It's showtime! [bruce 050426 changed .filename -> .might_be_playable()]
            movie.cueMovie(propMgr=self.propMgr)  # Cue movie.
            self.enableMovieControls(True)
            self.propMgr.updateFrameInformation()
            if movie.filename:  #k not sure this cond is needed or what to do if not true [bruce 050510]
                env.history.message(
                    "Movie file ready to play: %s" %
                    movie.filename)  #bruce 050510 added this message
        else:
            self.enableMovieControls(False)

        #Need to do this after calling movie._setUp (propMgr displays movie
        #information in its msg groupbox.  All this will be cleaned up when we
        #do moviemode code cleanup.

        self.propMgr.show()

        # Disable Undo/Redo actions, and undo checkpoints, during this mode (they *must* be reenabled in restore_gui).
        # We do this last, so as not to do it if there are exceptions in the rest of the method,
        # since if it's done and never undone, Undo/Redo won't work for the rest of the session.
        # [bruce 060414; same thing done in some other modes]
        import foundation.undo_manager as undo_manager
        undo_manager.disable_undo_checkpoints('Movie Player')
        undo_manager.disable_UndoRedo(
            'Movie Player',
            "in Movie Player")  # optimizing this for shortness in menu text
        # this makes Undo menu commands and tooltips look like "Undo (not permitted in Movie Player)" (and similarly for Redo)
        self.connect_or_disconnect_signals(True)