def __init__(self, parent, project=None): QPlainTextEdit.__init__(self) EditorGeneric.__init__(self) BaseCentralWidget.__init__(self) self.parent = parent self.completer = Completer(self, project) self.setWordWrapMode(QTextOption.NoWrap) doc = self.document() option = QTextOption() option.setFlags(QTextOption.ShowTabsAndSpaces) doc.setDefaultTextOption(option) self.setDocument(doc) self.set_default_font() #file modification time POSIX self._mtime = None #Flag to dont bug the user when answer 'dont show the modification dialog' self.ask_if_externally_modified = True self.lineNumberArea = self.LineNumberArea(self) self.viewport().installEventFilter(self) self.highlighter = None styles.set_style(self, 'editor') self.connect(self, SIGNAL("cursorPositionChanged()"), self.highlight_current_line) self.connect(self, SIGNAL("modificationChanged(bool)"), self.modif_changed) self.highlight_current_line()
def __init__(self): QWidget.__init__(self) IDEGeneric.__init__(self) self.setWindowTitle('NINJA-IDE {Ninja Is Not Just Another IDE}') self.setWindowIcon(QIcon(resources.images['icon'])) self.setWindowState(Qt.WindowMaximized) self.setMinimumSize(700, 500) #Opactity self.opacity = 1 #ToolBar self._toolbar = QToolBar() self._toolbar.setToolTip('Press and Drag to Move') styles.set_style(self._toolbar, 'toolbar-default') self.addToolBar(Qt.LeftToolBarArea, self._toolbar) self._toolbar.setToolButtonStyle(Qt.ToolButtonIconOnly) #StatusBar self._status = StatusBar() self._status.hide() self.setStatusBar(self._status) #Main Widgets self.main = MainWindow(self) self.setCentralWidget(self.main) #Menu menubar = self.menuBar() styles.apply(menubar, 'menu') file_ = menubar.addMenu('&File') edit = menubar.addMenu('&Edit') view = menubar.addMenu('&View') project = menubar.addMenu('&Project') self.pluginsMenu = menubar.addMenu('P&lugins') about = menubar.addMenu('&About') #The order of the icons in the toolbar is defined by this calls self._menuFile = MenuFile(file_, self._toolbar, self.main) self._menuView = MenuView(view, self, self.main) self._menuEdit = MenuEdit(edit, self._toolbar, self.main, self._status) self._menuProject = MenuProject(project, self._toolbar, self.main) self._menuPlugins = MenuPlugins(self.pluginsMenu, self) self._menuAbout = MenuAbout(about, self.main) self.main.container.load_toolbar(self._toolbar) self.main._central.actual_tab().obtain_editor().setFocus() filenames, projects_path = core.cliparser.parse() for filename in filenames: self.main.open_document(filename) for project_path in projects_path: self.main.open_project_folder(project_path) self.connect(self.main, SIGNAL("fileSaved(QString)"), self.show_status_message)
def __init__(self): QPlainTextEdit.__init__(self, '>>> ') ConsoleGeneric.__init__(self) self.setUndoRedoEnabled(False) styles.set_style(self, 'editor') self.setToolTip('Show/Hide (F4)') self.highlighter = Highlighter(self.document(), 'python') self.connect(self, SIGNAL("cursorPositionChanged()"), self.highlight_current_line) self.highlight_current_line()
def __init__(self): QWidget.__init__(self) self.setReadOnly(True) styles.set_style(self, 'editor') self.setPlainText('For the moment NINJA only show output when the Program ends.') self.overlay = Overlay(self) self.overlay.hide() self.proc = QProcess(self) #self.proc.setProcessChannelMode(QProcess.ForwardedChannels) self.connect(self.proc, SIGNAL("readyReadStandardOutput()"), self.refresh_output) self.connect(self.proc, SIGNAL("readyReadStandardError()"), self.refresh_error) self.connect(self.proc, SIGNAL("finished(int, QProcess::ExitStatus)"), self._finish_process)
def __init__(self): QWidget.__init__(self) self.setReadOnly(True) styles.set_style(self, 'editor') self.setPlainText( 'For the moment NINJA only show output when the Program ends.') self.overlay = Overlay(self) self.overlay.hide() self.proc = QProcess(self) #self.proc.setProcessChannelMode(QProcess.ForwardedChannels) self.connect(self.proc, SIGNAL("readyReadStandardOutput()"), self.refresh_output) self.connect(self.proc, SIGNAL("readyReadStandardError()"), self.refresh_error) self.connect(self.proc, SIGNAL("finished(int, QProcess::ExitStatus)"), self._finish_process)