本文整理汇总了Python中src.ui.main.Edis类的典型用法代码示例。如果您正苦于以下问题:Python Edis类的具体用法?Python Edis怎么用?Python Edis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Edis类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
QStatusBar.__init__(self)
self.hide()
Edis.load_component("status_bar", self)
# Conexiones
self.messageChanged.connect(self._clean_status)
示例2: __init__
def __init__(self, edis=None):
QWidget.__init__(self, edis)
self.setAcceptDrops(True)
self.box = QVBoxLayout(self)
self.box.setContentsMargins(0, 0, 0, 0)
self.box.setSpacing(0)
# Stacked
self.stack = QStackedWidget()
self.box.addWidget(self.stack)
# Replace widget
#FIXME: mover esto
self._replace_widget = replace_widget.ReplaceWidget()
self._replace_widget.hide()
self.box.addWidget(self._replace_widget)
# Editor widget
self.editor_widget = editor_widget.EditorWidget()
# Conexiones
self.connect(self.editor_widget, SIGNAL("saveCurrentFile()"),
self.save_file)
self.connect(self.editor_widget, SIGNAL("fileClosed(int)"),
self._file_closed)
self.connect(self.editor_widget, SIGNAL("recentFile(QStringList)"),
self.update_recents_files)
self.connect(self.editor_widget, SIGNAL("allFilesClosed()"),
self.add_start_page)
self.connect(self.editor_widget, SIGNAL("currentWidgetChanged(int)"),
self.change_widget)
Edis.load_component("principal", self)
示例3: load_project_widget
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)
示例4: build_source_code
def build_source_code(self):
output = Edis.get_component("output")
project = Edis.get_lateral("tree_projects")
weditor = self.get_active_editor()
if weditor is not None:
filename = self.save_file()
if project.sources:
output.build((filename, project.sources))
else:
if filename:
output.build((weditor.filename, []))
示例5: show_snake
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)
示例6: load_symbols_widget
def load_symbols_widget(self, widget):
if self._symbols_widget is None:
self._symbols_widget = Edis.get_lateral("symbols")
self.tabs.addTab(self._symbols_widget, self.tr("Símbolos"))
# Conexiones
editor_container = Edis.get_component("principal")
self.connect(self._symbols_widget, SIGNAL("goToLine(int)"),
editor_container.go_to_line)
self.connect(editor_container, SIGNAL("updateSymbols(QString)"),
self._update_symbols_widget)
#lambda filename: self.thread.parse(filename))
self.connect(editor_container.editor_widget,
SIGNAL("allFilesClosed()"),
self._symbols_widget.clear)
示例7: create_editor
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
示例8: __init__
def __init__(self):
QTreeWidget.__init__(self)
self.setObjectName("simbolos")
self.header().setHidden(True)
self.setSelectionMode(self.SingleSelection)
self.setAnimated(True)
self.header().setStretchLastSection(False)
self.header().setHorizontalScrollMode(
QAbstractItemView.ScrollPerPixel)
self.header().setResizeMode(0, QHeaderView.ResizeToContents)
# Conexión
self.itemClicked[QTreeWidgetItem, int].connect(self.go_to_line)
self.itemActivated[QTreeWidgetItem, int].connect(self.go_to_line)
Edis.load_lateral("symbols", self)
示例9: __init__
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)
示例10: _create_file
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)
示例11: _open_file
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()
示例12: _change_scheme
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
示例13: _load_menu_combo_file
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))
示例14: _delete_file
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)
示例15: _change_dock_position
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)