def __init__(self): super(MigrationWidget, self).__init__() self._migration = {} vbox = QVBoxLayout(self) lbl_title = QLabel(self.tr("Current code:")) self.current_list = QListWidget() lbl_suggestion = QLabel(self.tr("Suggested changes:")) self.suggestion = QPlainTextEdit() self.suggestion.setReadOnly(True) self.btn_apply = QPushButton(self.tr("Apply change!")) hbox = QHBoxLayout() hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox.addWidget(self.btn_apply) vbox.addWidget(lbl_title) vbox.addWidget(self.current_list) vbox.addWidget(lbl_suggestion) vbox.addWidget(self.suggestion) vbox.addLayout(hbox) self.connect(self.current_list, SIGNAL("itemClicked(QListWidgetItem*)"), self.load_suggestion) self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes) ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
def __init__(self, parent=None): super(MigrationWidget, self).__init__(parent, Qt.WindowStaysOnTopHint) self._migration, vbox, hbox = {}, QVBoxLayout(self), QHBoxLayout() lbl_title = QLabel(translations.TR_CURRENT_CODE) lbl_suggestion = QLabel(translations.TR_SUGGESTED_CHANGES) self.current_list, self.suggestion = QListWidget(), QPlainTextEdit() self.suggestion.setReadOnly(True) self.btn_apply = QPushButton(translations.TR_APPLY_CHANGES + " !") self.suggestion.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !") self.btn_apply.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !") # pack up all widgets hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox.addWidget(self.btn_apply) vbox.addWidget(lbl_title) vbox.addWidget(self.current_list) vbox.addWidget(lbl_suggestion) vbox.addWidget(self.suggestion) vbox.addLayout(hbox) # connections self.connect( self.current_list, SIGNAL("itemClicked(QListWidgetItem*)"), self.load_suggestion) self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes) # registers IDE.register_service('tab_migration', self) ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent, Qt.WindowStaysOnTopHint) vbox = QVBoxLayout(self) vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) vbox.setContentsMargins(0, 0, 0, 0) self._buttons = [] self._combo_project = QComboBox() self._combo_project.setMinimumHeight(30) self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu) vbox.addWidget(self._combo_project) self._projects_area = QStackedLayout() logger.debug("This is the projects area") logger.debug(self._projects_area) vbox.addLayout(self._projects_area) self.projects = [] self._combo_project.currentIndexChanged[int].connect(self._change_current_project) self._combo_project.customContextMenuRequested['const QPoint &'].connect(self.context_menu_for_root) connections = ( {'target': 'main_container', 'signal_name': 'addToProject',#(QString) 'slot': self._add_file_to_project}, {'target': 'main_container', 'signal_name': 'showFileInExplorer',#(QString) 'slot': self._show_file_in_explorer}, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self): QTreeWidget.__init__(self) self.header().setHidden(True) self.setSelectionMode(self.SingleSelection) self.setAnimated(True) self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel) self.header().setResizeMode(0, QHeaderView.ResizeToContents) self.header().setStretchLastSection(False) self.actualSymbols = ('', {}) self.docstrings = {} self.collapsedItems = {} self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self._go_to_definition) self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem *, int)"), self._go_to_definition) self.setContextMenuPolicy(Qt.CustomContextMenu) self.connect(self, SIGNAL("customContextMenuRequested(const QPoint &)"), self._menu_context_tree) self.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem *)"), self._item_collapsed) self.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem *)"), self._item_expanded) IDE.register_service('symbols_explorer', self) ExplorerContainer.register_tab(translations.TR_TAB_SYMBOLS, self)
def __init__(self, parent=None): super(TreeSymbolsWidget, self).__init__(parent, Qt.WindowStaysOnTopHint) vbox = QVBoxLayout(self) vbox.setContentsMargins(0, 0, 0, 0) vbox.setSpacing(0) self.tree = QTreeWidget() vbox.addWidget(self.tree) self.tree.header().setHidden(True) self.tree.setSelectionMode(self.tree.SingleSelection) self.tree.setAnimated(True) self.tree.header().setHorizontalScrollMode( QAbstractItemView.ScrollPerPixel) self.tree.header().setResizeMode(0, QHeaderView.ResizeToContents) self.tree.header().setStretchLastSection(False) self.actualSymbols = ('', {}) self.docstrings = {} self.collapsedItems = {} self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self._go_to_definition) self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem *, int)"), self._go_to_definition) self.tree.setContextMenuPolicy(Qt.CustomContextMenu) self.connect(self, SIGNAL("customContextMenuRequested(const QPoint &)"), self._menu_context_tree) self.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem *)"), self._item_collapsed) self.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem *)"), self._item_expanded) IDE.register_service('symbols_explorer', self) ExplorerContainer.register_tab(translations.TR_TAB_SYMBOLS, self)
def __init__(self, parent=None): super(MigrationWidget, self).__init__(parent, Qt.WindowStaysOnTopHint) self._migration = {} vbox = QVBoxLayout(self) lbl_title = QLabel(self.tr("Current code:")) self.current_list = QListWidget() lbl_suggestion = QLabel(self.tr("Suggested changes:")) self.suggestion = QPlainTextEdit() self.suggestion.setReadOnly(True) self.btn_apply = QPushButton(self.tr("Apply change!")) hbox = QHBoxLayout() hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox.addWidget(self.btn_apply) vbox.addWidget(lbl_title) vbox.addWidget(self.current_list) vbox.addWidget(lbl_suggestion) vbox.addWidget(self.suggestion) vbox.addLayout(hbox) self.connect(self.current_list, SIGNAL("itemClicked(QListWidgetItem*)"), self.load_suggestion) self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes) IDE.register_service('tab_migration', self) ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
def __init__(self, parent=None): super(MigrationWidget, self).__init__(parent, Qt.WindowStaysOnTopHint) self._migration, vbox, hbox = {}, QVBoxLayout(self), QHBoxLayout() lbl_title = QLabel(translations.TR_CURRENT_CODE) lbl_suggestion = QLabel(translations.TR_SUGGESTED_CHANGES) self.current_list, self.suggestion = QListWidget(), QPlainTextEdit() self.suggestion.setReadOnly(True) self.btn_apply = QPushButton(translations.TR_APPLY_CHANGES + " !") self.suggestion.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !") self.btn_apply.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !") # pack up all widgets hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox.addWidget(self.btn_apply) vbox.addWidget(lbl_title) vbox.addWidget(self.current_list) vbox.addWidget(lbl_suggestion) vbox.addWidget(self.suggestion) vbox.addLayout(hbox) # connections self.connect(self.current_list, SIGNAL("itemClicked(QListWidgetItem*)"), self.load_suggestion) self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes) # registers IDE.register_service('tab_migration', self) ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent, Qt.WindowStaysOnTopHint) vbox = QVBoxLayout(self) vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) vbox.setContentsMargins(0, 0, 0, 0) self._buttons = [] self._combo_project = QComboBox() self._combo_project.setMinimumHeight(30) self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu) vbox.addWidget(self._combo_project) self._projects_area = QStackedLayout() logger.debug("This is the projects area") logger.debug(self._projects_area) vbox.addLayout(self._projects_area) self.projects = [] self._combo_project.currentIndexChanged[int].connect(self._change_current_project) self._combo_project.customContextMenuRequested['const QPoint &'].connect(self.context_menu_for_root) connections = ( {'target': 'main_container', 'signal_name': 'addToProject',#(QString) 'slot': self._add_file_to_project}, {'target': 'main_container', 'signal_name': 'showFileInExplorer',#(QString) 'slot': self._show_file_in_explorer}, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self, parent=None): super(TreeSymbolsWidget, self).__init__(parent, Qt.WindowStaysOnTopHint) vbox = QVBoxLayout(self) vbox.setContentsMargins(0, 0, 0, 0) vbox.setSpacing(0) self.tree = QTreeWidget() vbox.addWidget(self.tree) self.tree.header().setHidden(True) self.tree.setSelectionMode(self.tree.SingleSelection) self.tree.setAnimated(True) self.tree.header().setHorizontalScrollMode( QAbstractItemView.ScrollPerPixel) self.tree.header().setResizeMode(0, QHeaderView.ResizeToContents) self.tree.header().setStretchLastSection(False) self.actualSymbols = ('', {}) self.docstrings = {} self.collapsedItems = {} self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self._go_to_definition) self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem *, int)"), self._go_to_definition) self.tree.setContextMenuPolicy(Qt.CustomContextMenu) self.connect(self, SIGNAL("customContextMenuRequested(const QPoint &)"), self._menu_context_tree) self.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem *)"), self._item_collapsed) self.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem *)"), self._item_expanded) IDE.register_service('symbols_explorer', self) ExplorerContainer.register_tab(translations.TR_TAB_SYMBOLS, self)
def __init__(self, parent): QWidget.__init__(self, parent) vbox = QVBoxLayout(self) self._webInspector = QWebInspector(self) vbox.addWidget(self._webInspector) self.btnDock = QPushButton(translations.TR_UNDOCK) vbox.addWidget(self.btnDock) ExplorerContainer.register_tab(translations.TR_TAB_WEB_INSPECTOR, self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent) vbox = QVBoxLayout(self) vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) vbox.setContentsMargins(0, 0, 0, 0) vbox.setSpacing(0) self._buttons = [] frame = QFrame() frame.setObjectName("actionbar") box = QVBoxLayout(frame) box.setContentsMargins(1, 1, 1, 1) box.setSpacing(0) self._combo_project = QComboBox() self._combo_project.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) self._combo_project.setSizeAdjustPolicy( QComboBox.AdjustToMinimumContentsLengthWithIcon) self._combo_project.setObjectName("combo_projects") box.addWidget(self._combo_project) vbox.addWidget(frame) self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu) self._projects_area = QStackedLayout() logger.debug("This is the projects area") vbox.addLayout(self._projects_area) # Empty widget self._empty_proj = QLabel(translations.TR_NO_PROJECTS) self._empty_proj.setAlignment(Qt.AlignCenter) self._empty_proj.setAutoFillBackground(True) self._empty_proj.setBackgroundRole(QPalette.Base) self._projects_area.addWidget(self._empty_proj) self._projects_area.setCurrentWidget(self._empty_proj) self.projects = [] self._combo_project.currentIndexChanged.connect( self._change_current_project) self._combo_project.customContextMenuRequested[ 'const QPoint&'].connect(self.context_menu_for_root) connections = ( { "target": "main_container", "signal_name": "addToProject", "slot": self._add_file_to_project }, { "target": "main_container", "signal_name": "showFileInExplorer", "slot": self._show_file_in_explorer }, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent) vbox = QVBoxLayout(self) vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) vbox.setContentsMargins(0, 0, 0, 0) vbox.setSpacing(0) self._buttons = [] frame = QFrame() frame.setObjectName("actionbar") box = QVBoxLayout(frame) box.setContentsMargins(1, 1, 1, 1) box.setSpacing(0) self._combo_project = QComboBox() self._combo_project.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed) self._combo_project.setSizeAdjustPolicy( QComboBox.AdjustToMinimumContentsLengthWithIcon) self._combo_project.setObjectName("combo_projects") box.addWidget(self._combo_project) vbox.addWidget(frame) self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu) self._projects_area = QStackedLayout() logger.debug("This is the projects area") vbox.addLayout(self._projects_area) # Empty widget self._empty_proj = QLabel(translations.TR_NO_PROJECTS) self._empty_proj.setAlignment(Qt.AlignCenter) self._empty_proj.setAutoFillBackground(True) self._empty_proj.setBackgroundRole(QPalette.Base) self._projects_area.addWidget(self._empty_proj) self._projects_area.setCurrentWidget(self._empty_proj) self.projects = [] self._combo_project.activated.connect( self._change_current_project) self._combo_project.customContextMenuRequested[ 'const QPoint&'].connect(self.context_menu_for_root) connections = ( { "target": "main_container", "signal_name": "addToProject", "slot": self._add_file_to_project }, { "target": "main_container", "signal_name": "showFileInExplorer", "slot": self._show_file_in_explorer }, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self, parent): QWidget.__init__(self, parent) vbox = QVBoxLayout(self) self._webInspector = QWebInspector(self) vbox.addWidget(self._webInspector) self.btnDock = QPushButton(translations.TR_UNDOCK) vbox.addWidget(self.btnDock) ExplorerContainer.register_tab(translations.TR_TAB_WEB_INSPECTOR, self) IDE.register_service('web_inspector', self)
def __init__(self, parent=None): super().__init__(parent, Qt.WindowStaysOnTopHint) box = QVBoxLayout(self) box.setContentsMargins(0, 0, 0, 0) box.setSpacing(0) hbox = QHBoxLayout() hbox.setContentsMargins(0, 0, 0, 0) self._list = ErrorsList() hbox.addWidget(self._list) box.addLayout(hbox) IDE.register_service("tab_errors", self) ExplorerContainer.register_tab(translations.TR_TAB_ERRORS, self)
def __init__(self, parent=None): super().__init__(parent, Qt.WindowStaysOnTopHint) box = QVBoxLayout(self) box.setContentsMargins(0, 0, 0, 0) box.setSpacing(0) hbox = QHBoxLayout() hbox.setContentsMargins(0, 0, 0, 0) self._list = ErrorsList() hbox.addWidget(self._list) box.addLayout(hbox) IDE.register_service("tab_errors", self) ExplorerContainer.register_tab(translations.TR_TAB_ERRORS, self)
def __init__(self, parent=None): super(ErrorsWidget, self).__init__(parent, Qt.WindowStaysOnTopHint) self.pep8 = None self._outRefresh = True vbox = QVBoxLayout(self) self.listErrors = QListWidget() self.listErrors.setSortingEnabled(True) self.listPep8 = QListWidget() self.listPep8.setSortingEnabled(True) hbox_lint = QHBoxLayout() if settings.FIND_ERRORS: self.btn_lint_activate = QPushButton(self.tr("Lint: ON")) else: self.btn_lint_activate = QPushButton(self.tr("Lint: OFF")) self.errorsLabel = QLabel(self.tr("Static Errors: %s") % 0) hbox_lint.addWidget(self.errorsLabel) hbox_lint.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox_lint.addWidget(self.btn_lint_activate) vbox.addLayout(hbox_lint) vbox.addWidget(self.listErrors) hbox_pep8 = QHBoxLayout() if settings.CHECK_STYLE: self.btn_pep8_activate = QPushButton(self.tr("PEP8: ON")) else: self.btn_pep8_activate = QPushButton(self.tr("PEP8: OFF")) self.pep8Label = QLabel(self.tr("PEP8 Errors: %s") % 0) hbox_pep8.addWidget(self.pep8Label) hbox_pep8.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox_pep8.addWidget(self.btn_pep8_activate) vbox.addLayout(hbox_pep8) vbox.addWidget(self.listPep8) self.connect(self.listErrors, SIGNAL("itemSelectionChanged()"), self.errors_selected) self.connect(self.listPep8, SIGNAL("itemSelectionChanged()"), self.pep8_selected) self.connect(self.btn_lint_activate, SIGNAL("clicked()"), self._turn_on_off_lint) self.connect(self.btn_pep8_activate, SIGNAL("clicked()"), self._turn_on_off_pep8) IDE.register_service('tab_errors', self) ExplorerContainer.register_tab(translations.TR_TAB_ERRORS, self)
def __init__(self): super(ErrorsWidget, self).__init__() self.pep8 = None self._outRefresh = True vbox = QVBoxLayout(self) self.listErrors = QListWidget() self.listErrors.setSortingEnabled(True) self.listPep8 = QListWidget() self.listPep8.setSortingEnabled(True) hbox_lint = QHBoxLayout() if settings.FIND_ERRORS: self.btn_lint_activate = QPushButton(self.tr("Lint: ON")) else: self.btn_lint_activate = QPushButton(self.tr("Lint: OFF")) self.errorsLabel = QLabel(self.tr("Static Errors: %s") % 0) hbox_lint.addWidget(self.errorsLabel) hbox_lint.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox_lint.addWidget(self.btn_lint_activate) vbox.addLayout(hbox_lint) vbox.addWidget(self.listErrors) hbox_pep8 = QHBoxLayout() if settings.CHECK_STYLE: self.btn_pep8_activate = QPushButton(self.tr("PEP8: ON")) else: self.btn_pep8_activate = QPushButton(self.tr("PEP8: OFF")) self.pep8Label = QLabel(self.tr("PEP8 Errors: %s") % 0) hbox_pep8.addWidget(self.pep8Label) hbox_pep8.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding)) hbox_pep8.addWidget(self.btn_pep8_activate) vbox.addLayout(hbox_pep8) vbox.addWidget(self.listPep8) self.connect(self.listErrors, SIGNAL("itemSelectionChanged()"), self.errors_selected) self.connect(self.listPep8, SIGNAL("itemSelectionChanged()"), self.pep8_selected) self.connect(self.btn_lint_activate, SIGNAL("clicked()"), self._turn_on_off_lint) self.connect(self.btn_pep8_activate, SIGNAL("clicked()"), self._turn_on_off_pep8) IDE.register_service('tab_errors', self) ExplorerContainer.register_tab(translations.TR_TAB_ERRORS, self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent) vbox = QVBoxLayout(self) # vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) vbox.setContentsMargins(0, 0, 0, 0) vbox.setSpacing(0) self._buttons = [] frame = QFrame() frame.setObjectName("actionbar") box = QVBoxLayout(frame) box.setContentsMargins(0, 0, 0, 0) box.setSpacing(0) self._combo_project = QComboBox() self._combo_project.setItemDelegate(QStyledItemDelegate()) self._combo_project.setObjectName("combo_projects") box.addWidget(self._combo_project) vbox.addWidget(frame) self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu) self._projects_area = QStackedLayout() logger.debug("This is the projects area") vbox.addLayout(self._projects_area) self.projects = [] self._combo_project.customContextMenuRequested[ 'const QPoint&'].connect(self.context_menu_for_root) connections = ( { 'target': 'main_container', 'signal_name': 'addToProject', 'slot': self._add_file_to_project }, { 'target': 'main_container', 'signal_name': 'showFileInExplorer', 'slot': self._show_file_in_explorer }, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self, *args, **kwargs): super(ProjectTreeColumn, self).__init__(*args, **kwargs) #self._widget = QWidget() self._layout = QVBoxLayout() self._layout.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) self._layout.setContentsMargins(0, 0, 0, 0) self._layout.setSpacing(0) self.setLayout(self._layout) self._vbox = QVBoxLayout() self._vbox.setContentsMargins(0, 0, 0, 0) self._vbox.setSpacing(0) self._vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) self._buttons = [] self._projects_area = QWidget() logger.debug("This is the projects area") logger.debug(self._projects_area) self._projects_area.setLayout(self._vbox) self._scroll_area = QScrollArea() self.layout().addWidget(self._scroll_area) self._scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) self._scroll_area.setWidgetResizable(True) self._scroll_area.setEnabled(True) self._scroll_area.setWidget(self._projects_area) self._scroll_area.setGeometry(self.geometry()) #self._projects_area.setGeometry(self.geometry()) self._vbox.setGeometry(self.geometry()) self.projects = [] self._active_project = None #for each_test in range(50): # button = QPushButton('Test%d' % each_test) # self._buttons.append(button) # self._projects_area.layout().addWidget(button) connections = ( {'target': 'main_container', 'signal_name': 'addToProject(QString)', 'slot': self._add_file_to_project}, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent) vbox = QVBoxLayout(self) # vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) vbox.setContentsMargins(0, 0, 0, 0) vbox.setSpacing(0) self._buttons = [] combo_container = ui_tools.StyledBar() combo_container.setProperty('gradient', True) combo_layout = QVBoxLayout(combo_container) combo_layout.setContentsMargins(0, 0, 0, 0) self._combo_project = QComboBox() combo_layout.addWidget(self._combo_project) self._combo_project.setProperty("border_bottom", True) self._combo_project.setProperty("gradient", True) self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu) vbox.addWidget(combo_container) self._projects_area = QStackedLayout() logger.debug("This is the projects area") vbox.addLayout(self._projects_area) self.projects = [] self._combo_project.currentIndexChanged[int].connect( self._change_current_project) self._combo_project.customContextMenuRequested[ 'const QPoint&'].connect(self.context_menu_for_root) connections = ( { 'target': 'main_container', 'signal_name': 'addToProject(QString)', 'slot': self._add_file_to_project }, { 'target': 'main_container', 'signal_name': 'showFileInExplorer(QString)', 'slot': self._show_file_in_explorer }, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent, Qt.WindowStaysOnTopHint) self._layout = QVBoxLayout() self._layout.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) self._layout.setContentsMargins(0, 0, 0, 0) self._layout.setSpacing(0) self.setLayout(self._layout) self._vbox = QVBoxLayout() self._vbox.setContentsMargins(0, 0, 0, 0) self._vbox.setSpacing(0) self._vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) self._buttons = [] self._projects_area = QWidget() logger.debug("This is the projects area") logger.debug(self._projects_area) self._projects_area.setLayout(self._vbox) self._scroll_area = QScrollArea() self.layout().addWidget(self._scroll_area) self._scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) self._scroll_area.setWidgetResizable(True) self._scroll_area.setEnabled(True) self._scroll_area.setWidget(self._projects_area) self._scroll_area.setGeometry(self.geometry()) self._vbox.setGeometry(self.geometry()) self.projects = [] self._active_project = None connections = ( {'target': 'main_container', 'signal_name': 'addToProject(QString)', 'slot': self._add_file_to_project}, {'target': 'main_container', 'signal_name': 'showFileInExplorer(QString)', 'slot': self._show_file_in_explorer}, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
def __init__(self, parent=None): super().__init__(parent, Qt.WindowStaysOnTopHint) box = QVBoxLayout(self) box.setContentsMargins(0, 0, 0, 0) box.setSpacing(0) # Model self._manager = BookmarkManager() # QML UI view = QQuickWidget() view.setResizeMode(QQuickWidget.SizeRootObjectToView) view.rootContext().setContextProperty("bookmarkModel", self._manager) view.rootContext().setContextProperty("theme", resources.QML_COLORS) view.setSource(ui_tools.get_qml_resource("BookmarkList.qml")) box.addWidget(view) self._root = view.rootObject() self._root.openBookmark.connect(self._open_bookmark) self._root.menuRequested.connect(self._show_menu) IDE.register_service("bookmarks", self) ExplorerContainer.register_tab("Bookmarks", self)
def __init__(self, parent=None): super().__init__(parent, Qt.WindowStaysOnTopHint) box = QVBoxLayout(self) box.setContentsMargins(3, 3, 3, 3) box.setSpacing(0) # Model self._manager = BookmarkManager() # QML UI view = QQuickWidget() view.setResizeMode(QQuickWidget.SizeRootObjectToView) view.rootContext().setContextProperty("bookmarkModel", self._manager) view.rootContext().setContextProperty("theme", resources.QML_COLORS) view.setSource(ui_tools.get_qml_resource("BookmarkList.qml")) box.addWidget(view) self._root = view.rootObject() self._root.openBookmark.connect(self._open_bookmark) self._root.menuRequested.connect(self._show_menu) IDE.register_service("bookmarks", self) ExplorerContainer.register_tab("Bookmarks", self)
def __init__(self, parent=None): super(ProjectTreeColumn, self).__init__(parent, Qt.WindowStaysOnTopHint) self._layout = QVBoxLayout() self._layout.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) self._layout.setContentsMargins(0, 0, 0, 0) self._layout.setSpacing(0) self.setLayout(self._layout) self._vbox = QVBoxLayout() self._vbox.setContentsMargins(0, 0, 0, 0) self._vbox.setSpacing(0) self._vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint) self._buttons = [] self._projects_area = QWidget() logger.debug("This is the projects area") logger.debug(self._projects_area) self._projects_area.setLayout(self._vbox) self._scroll_area = QScrollArea() self.layout().addWidget(self._scroll_area) self._scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) self._scroll_area.setWidgetResizable(True) self._scroll_area.setEnabled(True) self._scroll_area.setWidget(self._projects_area) self._scroll_area.setGeometry(self.geometry()) self._vbox.setGeometry(self.geometry()) self.projects = [] self._active_project = None connections = ({ 'target': 'main_container', 'signal_name': 'addToProject(QString)', 'slot': self._add_file_to_project }, ) IDE.register_service('projects_explorer', self) IDE.register_signals('projects_explorer', connections) ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)