Пример #1
0
    def __init__(self, file_paths, platform):
        """
		ActionHandler constructor.
		Create the main window, setup the message handler, import the preferences,
		and connect all of the action handlers. Finally, enter the gtk main loop and block.
		@param file_paths a list of flow graph file passed from command line
		@param platform platform module
		"""
        self.clipboard = None
        for action in Actions.get_all_actions():
            action.connect('activate', self._handle_action)
        #setup the main window
        self.main_window = MainWindow(platform)
        self.main_window.connect('delete-event', self._quit)
        self.main_window.connect('key-press-event', self._handle_key_press)
        self.get_page = self.main_window.get_page
        self.get_flow_graph = self.main_window.get_flow_graph
        self.get_focus_flag = self.main_window.get_focus_flag
        #setup the messages
        Messages.register_messenger(self.main_window.add_report_line)
        Messages.send_init(platform)
        #initialize
        self.init_file_paths = file_paths
        Actions.APPLICATION_INITIALIZE()
        #enter the mainloop
        gtk.main()