コード例 #1
0
ファイル: findinfiles.py プロジェクト: koll00/Gui_SM
 def __init__(self, parent=None):
     supported_encodings = self.get_option('supported_encodings')
     
     search_path = self.get_option('search_path', None)        
     self.search_text_samples = self.get_option('search_text_samples')
     search_text = self.get_option('search_text')
     search_text = [txt for txt in search_text \
                    if txt not in self.search_text_samples]
     search_text += self.search_text_samples
     
     search_text_regexp = self.get_option('search_text_regexp')
     include = self.get_option('include')
     include_idx = self.get_option('include_idx', None)
     include_regexp = self.get_option('include_regexp')
     exclude = self.get_option('exclude')
     exclude_idx = self.get_option('exclude_idx', None)
     exclude_regexp = self.get_option('exclude_regexp')
     in_python_path = self.get_option('in_python_path')
     more_options = self.get_option('more_options')
     FindInFilesWidget.__init__(self, parent,
                                search_text, search_text_regexp, search_path,
                                include, include_idx, include_regexp,
                                exclude, exclude_idx, exclude_regexp,
                                supported_encodings,
                                in_python_path, more_options)
     SMPluginMixin.__init__(self, parent)
     
     # Initialize plugin
     self.initialize_plugin()
     
     self.connect(self, SIGNAL('toggle_visibility(bool)'), self.toggle)
コード例 #2
0
    def __init__(self, parent=None):
        supported_encodings = self.get_option('supported_encodings')

        search_path = self.get_option('search_path', None)
        self.search_text_samples = self.get_option('search_text_samples')
        search_text = self.get_option('search_text')
        search_text = [txt for txt in search_text \
                       if txt not in self.search_text_samples]
        search_text += self.search_text_samples

        search_text_regexp = self.get_option('search_text_regexp')
        include = self.get_option('include')
        include_idx = self.get_option('include_idx', None)
        include_regexp = self.get_option('include_regexp')
        exclude = self.get_option('exclude')
        exclude_idx = self.get_option('exclude_idx', None)
        exclude_regexp = self.get_option('exclude_regexp')
        in_python_path = self.get_option('in_python_path')
        more_options = self.get_option('more_options')
        FindInFilesWidget.__init__(self, parent, search_text,
                                   search_text_regexp, search_path, include,
                                   include_idx, include_regexp, exclude,
                                   exclude_idx, exclude_regexp,
                                   supported_encodings, in_python_path,
                                   more_options)
        SMPluginMixin.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()

        self.connect(self, SIGNAL('toggle_visibility(bool)'), self.toggle)
コード例 #3
0
ファイル: variableexplorer.py プロジェクト: koll00/Gui_SM
    def __init__(self, parent):
        QStackedWidget.__init__(self, parent)
        SMPluginMixin.__init__(self, parent)
        self.shellwidgets = {}

        # Initialize plugin
        self.initialize_plugin()
コード例 #4
0
    def __init__(self, parent):
        QStackedWidget.__init__(self, parent)
        SMPluginMixin.__init__(self, parent)
        self.shellwidgets = {}

        # Initialize plugin
        self.initialize_plugin()
コード例 #5
0
ファイル: explorer.py プロジェクト: koll00/Gui_SM
    def __init__(self, parent=None):
        ExplorerWidget.__init__(self, parent=parent,
                                name_filters=self.get_option('name_filters'),
                                valid_types=VALID_EXT,
                                show_all=self.get_option('show_all'),
                                show_toolbar=self.get_option('show_toolbar'),
                                show_icontext=self.get_option('show_icontext'))
        SMPluginMixin.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()
        
        self.set_font(self.get_plugin_font())
コード例 #6
0
ファイル: projectexplorer.py プロジェクト: koll00/Gui_SM
    def __init__(self, parent=None):
        ProjectExplorerWidget.__init__(self, parent=parent,
                    name_filters=self.get_option('name_filters'),
                    valid_types=VALID_EXT,
                    show_all=self.get_option('show_all', False),
                    show_hscrollbar=self.get_option('show_hscrollbar', True))
        SMPluginMixin.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()

        self.treewidget.header().hide()
        self.set_font(self.get_plugin_font())
        self.load_config()
コード例 #7
0
    def __init__(self, parent=None):
        ExplorerWidget.__init__(self,
                                parent=parent,
                                name_filters=self.get_option('name_filters'),
                                valid_types=VALID_EXT,
                                show_all=self.get_option('show_all'),
                                show_toolbar=self.get_option('show_toolbar'),
                                show_icontext=self.get_option('show_icontext'))
        SMPluginMixin.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()

        self.set_font(self.get_plugin_font())
コード例 #8
0
    def __init__(self, parent=None):
        ProjectExplorerWidget.__init__(
            self,
            parent=parent,
            name_filters=self.get_option('name_filters'),
            valid_types=VALID_EXT,
            show_all=self.get_option('show_all', False),
            show_hscrollbar=self.get_option('show_hscrollbar', True))
        SMPluginMixin.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()

        self.treewidget.header().hide()
        self.set_font(self.get_plugin_font())
        self.load_config()
コード例 #9
0
ファイル: variableexplorer.py プロジェクト: koll00/Gui_SM
 def visibility_changed(self, enable):
     """DockWidget visibility has changed"""
     SMPluginMixin.visibility_changed(self, enable)
     for nsb in self.shellwidgets.values():
         nsb.visibility_changed(enable and nsb is self.currentWidget())
コード例 #10
0
 def visibility_changed(self, enable):
     """DockWidget visibility has changed"""
     SMPluginMixin.visibility_changed(self, enable)
     for nsb in self.shellwidgets.values():
         nsb.visibility_changed(enable and nsb is self.currentWidget())
コード例 #11
0
ファイル: workingdirectory.py プロジェクト: koll00/Gui_SM
    def __init__(self, parent, workdir=None):
        QToolBar.__init__(self, parent)
        SMPluginMixin.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()
        
        # Setting default values for editor-related options
        self.get_option('editor/open/browse_scriptdir', True)
        self.get_option('editor/open/browse_workdir', False)
        self.get_option('editor/new/browse_scriptdir', False)
        self.get_option('editor/new/browse_workdir', True)
        self.get_option('editor/open/auto_set_to_basedir', False)
        self.get_option('editor/save/auto_set_to_basedir', False)
        
        self.setWindowTitle(self.get_plugin_title()) # Toolbar title
        self.setObjectName(self.get_plugin_title()) # Used to save Window state
        
        # Previous dir action
        self.history = []
        self.histindex = None
        self.previous_action = create_action(self, "previous", None,
                                     get_icon('previous.png'), _('Back'),
                                     triggered=self.previous_directory)
        self.addAction(self.previous_action)
        
        # Next dir action
        self.history = []
        self.histindex = None
        self.next_action = create_action(self, "next", None,
                                     get_icon('next.png'), _('Next'),
                                     triggered=self.next_directory)
        self.addAction(self.next_action)
        
        # Enable/disable previous/next actions
        self.connect(self, SIGNAL("set_previous_enabled(bool)"),
                     self.previous_action.setEnabled)
        self.connect(self, SIGNAL("set_next_enabled(bool)"),
                     self.next_action.setEnabled)
        
        # Path combo box
        adjust = self.get_option('working_dir_adjusttocontents', False)
        self.pathedit = PathComboBox(self, adjust_to_contents=adjust)
        self.pathedit.setToolTip(_("This is the working directory for newly\n"
                               "opened consoles (Python interpreters and\n"
                               "terminals), for the file explorer, for the\n"
                               "find in files plugin and for new files\n"
                               "created in the editor"))
        self.connect(self.pathedit, SIGNAL("open_dir(QString)"), self.chdir)
        self.pathedit.setMaxCount(self.get_option('working_dir_history', 20))
        wdhistory = self.load_wdhistory( workdir )
        if workdir is None:
            if self.get_option('startup/use_last_directory', True):
                if wdhistory:
                    workdir = wdhistory[0]
                else:
                    workdir = "."
            else:
                workdir = self.get_option('startup/fixed_directory', ".")
                if not osp.isdir(workdir):
                    workdir = "."
        self.chdir(workdir)
        self.pathedit.addItems( wdhistory )
        self.refresh_plugin()
        self.addWidget(self.pathedit)
        
        # Browse action
        browse_action = create_action(self, "browse", None,
                                      get_std_icon('DirOpenIcon'),
                                      _('Browse a working directory'),
                                      triggered=self.select_directory)
        self.addAction(browse_action)
        
        # Set current console working directory action
        setwd_action = create_action(self, icon=get_icon('set_workdir.png'),
                                     text=_("Set as current console's "
                                                  "working directory"),
                                     triggered=self.set_as_current_console_wd)
        self.addAction(setwd_action)
        
        # Parent dir action
        parent_action = create_action(self, "parent", None,
                                      get_icon('up.png'),
                                      _('Change to parent directory'),
                                      triggered=self.parent_directory)
        self.addAction(parent_action)
コード例 #12
0
    def __init__(self, parent, workdir=None):
        QToolBar.__init__(self, parent)
        SMPluginMixin.__init__(self, parent)

        # Initialize plugin
        self.initialize_plugin()

        # Setting default values for editor-related options
        self.get_option('editor/open/browse_scriptdir', True)
        self.get_option('editor/open/browse_workdir', False)
        self.get_option('editor/new/browse_scriptdir', False)
        self.get_option('editor/new/browse_workdir', True)
        self.get_option('editor/open/auto_set_to_basedir', False)
        self.get_option('editor/save/auto_set_to_basedir', False)

        self.setWindowTitle(self.get_plugin_title())  # Toolbar title
        self.setObjectName(
            self.get_plugin_title())  # Used to save Window state

        # Previous dir action
        self.history = []
        self.histindex = None
        self.previous_action = create_action(self,
                                             "previous",
                                             None,
                                             get_icon('previous.png'),
                                             _('Back'),
                                             triggered=self.previous_directory)
        self.addAction(self.previous_action)

        # Next dir action
        self.history = []
        self.histindex = None
        self.next_action = create_action(self,
                                         "next",
                                         None,
                                         get_icon('next.png'),
                                         _('Next'),
                                         triggered=self.next_directory)
        self.addAction(self.next_action)

        # Enable/disable previous/next actions
        self.connect(self, SIGNAL("set_previous_enabled(bool)"),
                     self.previous_action.setEnabled)
        self.connect(self, SIGNAL("set_next_enabled(bool)"),
                     self.next_action.setEnabled)

        # Path combo box
        adjust = self.get_option('working_dir_adjusttocontents', False)
        self.pathedit = PathComboBox(self, adjust_to_contents=adjust)
        self.pathedit.setToolTip(
            _("This is the working directory for newly\n"
              "opened consoles (Python interpreters and\n"
              "terminals), for the file explorer, for the\n"
              "find in files plugin and for new files\n"
              "created in the editor"))
        self.connect(self.pathedit, SIGNAL("open_dir(QString)"), self.chdir)
        self.pathedit.setMaxCount(self.get_option('working_dir_history', 20))
        wdhistory = self.load_wdhistory(workdir)
        if workdir is None:
            if self.get_option('startup/use_last_directory', True):
                if wdhistory:
                    workdir = wdhistory[0]
                else:
                    workdir = "."
            else:
                workdir = self.get_option('startup/fixed_directory', ".")
                if not osp.isdir(workdir):
                    workdir = "."
        self.chdir(workdir)
        self.pathedit.addItems(wdhistory)
        self.refresh_plugin()
        self.addWidget(self.pathedit)

        # Browse action
        browse_action = create_action(self,
                                      "browse",
                                      None,
                                      get_std_icon('DirOpenIcon'),
                                      _('Browse a working directory'),
                                      triggered=self.select_directory)
        self.addAction(browse_action)

        # Set current console working directory action
        setwd_action = create_action(self,
                                     icon=get_icon('set_workdir.png'),
                                     text=_("Set as current console's "
                                            "working directory"),
                                     triggered=self.set_as_current_console_wd)
        self.addAction(setwd_action)

        # Parent dir action
        parent_action = create_action(self,
                                      "parent",
                                      None,
                                      get_icon('up.png'),
                                      _('Change to parent directory'),
                                      triggered=self.parent_directory)
        self.addAction(parent_action)