当前位置: 首页>>代码示例>>Python>>正文


Python Edis.get_component方法代码示例

本文整理汇总了Python中src.ui.main.Edis.get_component方法的典型用法代码示例。如果您正苦于以下问题:Python Edis.get_component方法的具体用法?Python Edis.get_component怎么用?Python Edis.get_component使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在src.ui.main.Edis的用法示例。


在下文中一共展示了Edis.get_component方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: show_snake

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def show_snake(self):
     from src.ui.widgets.pyborita import pyborita_widget
     w = pyborita_widget.PyboritaWidget(self)
     toolbar = Edis.get_component("toolbar")
     lateral = Edis.get_component("tab_container")
     status = Edis.get_component("status_bar")
     output = Edis.get_component("output")
     widgets = [toolbar, status, lateral, output]
     for widget in widgets:
         widget.hide()
     self.stack.insertWidget(0, w)
     self.stack.setCurrentIndex(0)
开发者ID:Garjy,项目名称:edis,代码行数:14,代码来源:editor_container.py

示例2: _delete_file

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
    def _delete_file(self):
        """ Borra fisicamente el archivo y lo quita del árbol """

        DEBUG("Deleting file...")
        current_item = self.currentItem()
        # Flags
        yes = QMessageBox.Yes
        no = QMessageBox.No
        result = QMessageBox.warning(
            self,
            self.tr("Advertencia"),
            self.tr("Está seguro que quiere borrar " "el archivo?<br><br><b>{0}</b>").format(current_item.path),
            no | yes,
        )
        if result == no:
            return
        # Elimino el item de la lista de fuentes
        self._sources.remove(current_item.path)
        # Cierro el archivo del editor
        editor_container = Edis.get_component("principal")
        editor_container.close_file_from_project(current_item.path)
        # Elimino el item del árbol
        index = current_item.parent().indexOfChild(current_item)
        current_item.parent().takeChild(index)
        # Borro el archivo fisicamente
        os.remove(current_item.path)
开发者ID:Garjy,项目名称:edis,代码行数:28,代码来源:tree_projects.py

示例3: _change_dock_position

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def _change_dock_position(self):
     edis = Edis.get_component("edis")
     current_area = edis.dockWidgetArea(self)
     if current_area == Qt.LeftDockWidgetArea:
         edis.addDockWidget(Qt.RightDockWidgetArea, self)
     else:
         edis.addDockWidget(Qt.LeftDockWidgetArea, self)
开发者ID:Garjy,项目名称:edis,代码行数:9,代码来源:tab_container.py

示例4: __init__

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
    def __init__(self, parent=None):
        super(EnvironmentConfiguration, self).__init__()
        self.general_section = GeneralSection()
        #self.shortcut_section = ShortcutSection()

        preferences = Edis.get_component("preferences")
        preferences.install_section(self)
开发者ID:Garjy,项目名称:edis,代码行数:9,代码来源:environment_configuration.py

示例5: _create_file

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def _create_file(self):
     DEBUG("Creating a file...")
     dialog = NewFileDialog(self)
     data = dialog.data
     if data:
         current_item = self.currentItem()
         filename, ftype = data["filename"], data["type"]
         filename = os.path.join(current_item.path, filename)
         if os.path.exists(filename):
             # El archivo ya existe
             QMessageBox.information(
                 self, self.tr("Información"), self.tr("Ya existe un archivo con ese" " nombre"), QMessageBox.Ok
             )
             DEBUG("A file already exists...")
             return
         if ftype == 1:
             # Header file
             preprocessor = os.path.splitext(os.path.basename(filename))[0]
             content = "#ifndef %s_H_\n#define %s_H\n\n#endif" % (preprocessor.upper(), preprocessor.upper())
         else:
             content = ""
             # Agrego a la lista de archivos fuente
             self._sources.append(filename)
         # Creo el archivo
         file_manager.write_file(filename, content)
         if isinstance(current_item, EdisItem):
             parent = current_item.child(ftype)
         else:
             parent = current_item
         # Agrego el ítem al árbol
         new_item = TreeItem(parent, [data["filename"]])
         new_item.path = filename
         editor_container = Edis.get_component("principal")
         editor_container.open_file(filename)
开发者ID:Garjy,项目名称:edis,代码行数:36,代码来源:tree_projects.py

示例6: _open_file

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
    def _open_file(self, item):
        """ Cambia de archivo en el stacked """

        editor_container = Edis.get_component("principal")
        index = self.list_of_files.row(item)
        editor_container.editor_widget.change_item(index)
        self.close()
开发者ID:Garjy,项目名称:edis,代码行数:9,代码来源:file_selector.py

示例7: save

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def save(self):
     settings.set_setting('editor/wrap-mode',
         self.check_wrap.isChecked())
     settings.set_setting('editor/show-margin',
         self.check_margin.isChecked())
     settings.set_setting('editor/width-margin',
         self.slider_margin.value())
     settings.set_setting('editor/show-line-number',
         self.check_line_numbers.isChecked())
     settings.set_setting('editor/mark-change',
         self.check_mark_change.isChecked())
     settings.set_setting('editor/match-brace',
         self.check_match_brace.isChecked())
     settings.set_setting('editor/show-caret-line',
         self.check_current_line.isChecked())
     settings.set_setting('editor/show-tabs-spaces',
         self.check_whitespace.isChecked())
     settings.set_setting('editor/show-guides',
         self.check_guides.isChecked())
     settings.set_setting('editor/eof',
         self.check_eof.isChecked())
     editor_container = Edis.get_component("principal")
     editor = editor_container.get_active_editor()
     if editor is not None:
         editor.set_brace_matching()
         editor.show_line_numbers()
         editor.update_options()
         editor.update_margin()
开发者ID:Garjy,项目名称:edis,代码行数:30,代码来源:editor_configuration.py

示例8: _load_menu_combo_file

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
    def _load_menu_combo_file(self, point):
        """ Muestra el menú """

        menu = QMenu()
        editor_container = Edis.get_component("principal")
        save_as_action = menu.addAction(QIcon(":image/save-as"),
                                        self.tr("Guardar como..."))
        reload_action = menu.addAction(QIcon(":image/reload"),
                                       self.tr("Recargar"))
        menu.addSeparator()
        compile_action = menu.addAction(QIcon(":image/build"),
                                        self.tr("Compilar"))
        execute_action = menu.addAction(QIcon(":image/run"),
                                        self.tr("Ejecutar"))
        menu.addSeparator()
        close_action = menu.addAction(QIcon(":image/close"),
                                      self.tr("Cerrar archivo"))

        # Conexiones
        self.connect(save_as_action, SIGNAL("triggered()"),
                     editor_container.save_file_as)
        self.connect(reload_action, SIGNAL("triggered()"),
                     editor_container.reload_file)
        self.connect(compile_action, SIGNAL("triggered()"),
                     editor_container.build_source_code)
        self.connect(execute_action, SIGNAL("triggered()"),
                     editor_container.run_binary)
        self.connect(close_action, SIGNAL("triggered()"),
                     editor_container.close_file)

        menu.exec_(self.mapToGlobal(point))
开发者ID:Garjy,项目名称:edis,代码行数:33,代码来源:editor_widget.py

示例9: _change_scheme

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def _change_scheme(self, theme):
     theme = theme.split()[0].lower()
     editor_container = Edis.get_component("principal")
     editor = editor_container.get_active_editor()
     if editor is not None:
         # Restyle
         pass
开发者ID:Garjy,项目名称:edis,代码行数:9,代码来源:editor_configuration.py

示例10: create_editor

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
    def create_editor(self, obj_file=None, filename=""):
        if obj_file is None:
            obj_file = object_file.EdisFile(filename)
        self.stack.addWidget(self.editor_widget)
        # Quito la página de inicio, si está
        _start_page = self.stack.widget(0)
        if isinstance(_start_page, start_page.StartPage):
            self.remove_widget(_start_page)
            # Detengo el tiimer
            _start_page.timer.stop()
        weditor = editor.Editor(obj_file)
        self.editor_widget.add_widget(weditor)
        self.editor_widget.add_item_combo(obj_file.filename)
        lateral = Edis.get_component("tab_container")
        if not lateral.isVisible():
            lateral.show()

        # Conexiones
        self.connect(obj_file, SIGNAL("fileChanged(PyQt_PyObject)"),
                     self._file_changed)
        self.connect(weditor, SIGNAL("cursorPositionChanged(int, int)"),
                     self.update_cursor)
        self.connect(weditor, SIGNAL("modificationChanged(bool)"),
                     self._file_modified)
        self.connect(weditor, SIGNAL("fileSaved(QString)"),
                     self._file_saved)
        self.connect(weditor, SIGNAL("linesChanged(int)"),
                     self.editor_widget.combo.move_to_symbol)
        self.connect(weditor, SIGNAL("dropEvent(PyQt_PyObject)"),
                     self._drop_editor)
        self.emit(SIGNAL("fileChanged(QString)"), obj_file.filename)

        weditor.setFocus()

        return weditor
开发者ID:Garjy,项目名称:edis,代码行数:37,代码来源:editor_container.py

示例11: __init__

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
    def __init__(self):
        super(EditorConfiguration, self).__init__()
        self.general = GeneralSection()
        self.display = DisplaySection()
        self.completion = CompletionSection()

        preferences = Edis.get_component("preferences")
        preferences.install_section(self)
开发者ID:Garjy,项目名称:edis,代码行数:10,代码来源:editor_configuration.py

示例12: _replace

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def _replace(self):
     if not self.word_replace:
         return
     editor_container = Edis.get_component("principal")
     weditor = editor_container.get_active_editor()
     if weditor.hasSelectedText():
         weditor.replace(self.word_replace)
         self._find_next()
开发者ID:Garjy,项目名称:edis,代码行数:10,代码来源:replace_widget.py

示例13: _replace_all

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def _replace_all(self):
     editor_container = Edis.get_component("principal")
     weditor = editor_container.get_active_editor()
     found = weditor.findFirst(self.word, False, False, False, False,
                               True, 0, 0, True)
     while found:
         weditor.replace(self.word_replace)
         found = weditor.findNext()
开发者ID:Garjy,项目名称:edis,代码行数:10,代码来源:replace_widget.py

示例14: eventFilter

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
 def eventFilter(self, obj, event):
     if obj == self.label_logo and event.type() == QEvent.MouseButtonPress:
         self.clicks += 1
         if self.clicks == 6:
             self.close()
             editor_container = Edis.get_component("principal")
             editor_container.show_snake()
     return False
开发者ID:Garjy,项目名称:edis,代码行数:10,代码来源:about.py

示例15: load_project_widget

# 需要导入模块: from src.ui.main import Edis [as 别名]
# 或者: from src.ui.main.Edis import get_component [as 别名]
    def load_project_widget(self, widget):
        self._tree_project = Edis.get_lateral("tree_projects")
        self.tabs.addTab(self._tree_project, self.tr("Proyectos"))

        editor_container = Edis.get_component("principal")
        self.connect(editor_container, SIGNAL("projectOpened(PyQt_PyObject)"),
                     self._open_project)
        self.connect(editor_container, SIGNAL("folderOpened(PyQt_PyObject)"),
                     self._open_directory)
开发者ID:Garjy,项目名称:edis,代码行数:11,代码来源:tab_container.py


注:本文中的src.ui.main.Edis.get_component方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。