~ubuntu-branches/debian/experimental/spyder/experimental

« back to all changes in this revision

Viewing changes to spyderlib/plugins/editor.py

  • Committer: Package Import Robot
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2013-03-27 16:25:27 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20130327162527-kk4v2dr2fshy9ljf
Tags: 2.2.0~rc+dfsg-1
* Imported Upstream version 2.2.0~rc+dfsg
* Suggests: tortoisehg and gitk (Closes: #704064)

Show diffs side-by-side

added added

removed removed

Lines of Context:
470
470
        self.outlineexplorer = outlineexplorer
471
471
        for editorstack in self.editorstacks:
472
472
            editorstack.set_outlineexplorer(self.outlineexplorer)
 
473
        self.editorstacks[0].initialize_outlineexplorer()
473
474
        self.connect(self.outlineexplorer,
474
475
                     SIGNAL("edit_goto(QString,int,QString)"),
475
476
                     lambda filenames, goto, word:
476
477
                     self.load(filenames=filenames, goto=goto, word=word,
477
478
                               editorwindow=self))
 
479
        self.connect(self.outlineexplorer, SIGNAL("edit(QString)"),
 
480
                     lambda filenames:
 
481
                     self.load(filenames=filenames, editorwindow=self))
478
482
            
479
483
    def show_hide_outline_explorer(self):
480
484
        if self.outlineexplorer is not None:
876
880
                            re_run_action, run_selected_action, None,
877
881
                            self.winpdb_action]
878
882
        self.main.run_menu_actions += run_menu_actions
879
 
        run_toolbar_actions = [run_action, debug_action, configure_action,
880
 
                               run_selected_action, re_run_action]
 
883
        run_toolbar_actions = [run_action, run_selected_action, re_run_action,
 
884
                               configure_action]
881
885
        self.main.run_toolbar_actions += run_toolbar_actions
882
886
        
883
 
        debug_toolbar_actions = [debug_action,
884
 
                                 debug_next_action,
885
 
                                 debug_step_action,
886
 
                                 debug_return_action,
887
 
                                 debug_continue_action,
888
 
                                 debug_exit_action]
 
887
        debug_toolbar_actions = [debug_action, debug_next_action,
 
888
                                 debug_step_action, debug_return_action,
 
889
                                 debug_continue_action, debug_exit_action]
889
890
        self.main.debug_toolbar_actions += debug_toolbar_actions
890
891
        
891
892
        source_menu_actions = [eol_menu, trailingspaces_action,
1153
1154
            (_("Search toolbar"), self.main.search_menu_actions),
1154
1155
            (_("Source toolbar"), self.main.source_toolbar_actions),
1155
1156
            (_("Run toolbar"), self.main.run_toolbar_actions),
 
1157
            (_("Debug toolbar"), self.main.debug_toolbar_actions),
1156
1158
            (_("Edit toolbar"), self.main.edit_toolbar_actions),
1157
1159
                             )
1158
1160
        self.menu_list = (
1684
1686
    
1685
1687
    
1686
1688
    #------ Explorer widget
1687
 
    def __close(self, filename):
 
1689
    def close_file_from_name(self, filename):
 
1690
        """Close file from its name"""
1688
1691
        filename = osp.abspath(unicode(filename))
1689
1692
        index = self.editorstacks[0].has_filename(filename)
1690
1693
        if index is not None:
1692
1695
                
1693
1696
    def removed(self, filename):
1694
1697
        """File was removed in file explorer widget or in project explorer"""
1695
 
        self.__close(filename)
 
1698
        self.close_file_from_name(filename)
1696
1699
    
1697
1700
    def removed_tree(self, dirname):
1698
1701
        """Directory was removed in project explorer widget"""