Beispiel #1
0
    def __createLayout( self, bpoint ):
        """ Creates the dialog layout """

        self.resize( 400, 150 )
        self.setSizeGripEnabled( True )

        # Top level layout
        layout = QVBoxLayout( self )

        gridLayout = QGridLayout()
        fileLabel = QLabel( "File name:" )
        gridLayout.addWidget( fileLabel, 0, 0 )
        fileValue = QLabel( bpoint.getAbsoluteFileName() )
        gridLayout.addWidget( fileValue, 0, 1 )
        lineLabel = QLabel( "Line:" )
        gridLayout.addWidget( lineLabel, 1, 0 )
        lineValue = QLabel( str( bpoint.getLineNumber() ) )
        gridLayout.addWidget( lineValue, 1, 1 )
        conditionLabel = QLabel( "Condition:" )
        gridLayout.addWidget( conditionLabel, 2, 0 )
        self.__conditionValue = CDMComboBox( True )
        self.__conditionValue.lineEdit().setText( bpoint.getCondition() )
        gridLayout.addWidget( self.__conditionValue, 2, 1 )
        ignoreLabel = QLabel( "Ignore count:" )
        gridLayout.addWidget( ignoreLabel, 3, 0 )
        self.__ignoreValue = QSpinBox()
        self.__ignoreValue.setMinimum( 0 )
        self.__ignoreValue.setValue( bpoint.getIgnoreCount() )
        gridLayout.addWidget( self.__ignoreValue, 3, 1 )
        layout.addLayout( gridLayout )

        # Checkboxes part
        self.__tempCheckbox = QCheckBox( "&Temporary" )
        self.__tempCheckbox.setChecked( bpoint.isTemporary() )
        layout.addWidget( self.__tempCheckbox )
        self.__enabled = QCheckBox( "&Enabled" )
        self.__enabled.setChecked( bpoint.isEnabled() )
        layout.addWidget( self.__enabled )

        # Buttons at the bottom
        buttonBox = QDialogButtonBox( self )
        buttonBox.setOrientation( Qt.Horizontal )
        buttonBox.setStandardButtons( QDialogButtonBox.Ok |
                                      QDialogButtonBox.Cancel )
        self.__OKButton = buttonBox.button( QDialogButtonBox.Ok )
        self.__OKButton.setDefault( True )
        buttonBox.accepted.connect( self.accept )
        buttonBox.rejected.connect( self.close )
        layout.addWidget( buttonBox )

        self.__conditionValue.setFocus()
        return
    def __createLayout(self):
        """Creates the widget layout"""
        verticalLayout = QVBoxLayout(self)
        verticalLayout.setContentsMargins(0, 0, 0, 0)
        verticalLayout.setSpacing(0)

        self.__headerLabel = HeaderFitLabel(self)
        self.__headerLabel.setText('Variables')
        self.__headerLabel.setSizePolicy(QSizePolicy.Expanding,
                                         QSizePolicy.Fixed)
        self.__headerLabel.setMinimumWidth(10)

        self.__filterMenu = QMenu(self)
        self.__showAllAct = self.__filterMenu.addAction('Show all variables')
        self.__showAllAct.setData('showall')
        self.__filterMenu.addSeparator()
        self.__filters = []
        for title, settingName, _ in VARIABLE_FILTERS:
            action = self.__filterMenu.addAction(title)
            action.setCheckable(True)
            action.setData(settingName)
            self.__filters.append(action)
        self.__filterMenu.aboutToShow.connect(self.__filterMenuAboutToShow)
        self.__filterMenu.triggered.connect(self.__filterMenuTriggered)

        self.__filterButton = QToolButton(self)
        self.__filterButton.setIcon(getIcon('dbgvarflt.png'))
        self.__filterButton.setToolTip('Variable filter')
        self.__filterButton.setPopupMode(QToolButton.InstantPopup)
        self.__filterButton.setMenu(self.__filterMenu)
        self.__filterButton.setFocusPolicy(Qt.NoFocus)
        self.__filterButton.setFixedSize(self.__headerLabel.height(),
                                         self.__headerLabel.height())

        self.__execStatement = CDMComboBox(True)
        self.__execStatement.setSizePolicy(QSizePolicy.Expanding,
                                           QSizePolicy.Expanding)
        self.__execStatement.lineEdit().setToolTip("Execute statement")
        self.__execStatement.setFixedHeight(26)
        self.__execStatement.editTextChanged.connect(
            self.__execStatementChanged)
        self.__execStatement.enterClicked.connect(self.__onEnterInExec)
        self.__execButton = QPushButton("Exec")
        self.__execButton.setEnabled(False)
        self.__execButton.setFixedHeight(26)
        self.__execButton.clicked.connect(self.__onExec)

        self.headerToolbar = QToolBar(self)
        self.headerToolbar.setIconSize(QSize(18, 18))
        self.headerToolbar.setContentsMargins(1, 1, 1, 1)
        self.headerToolbar.addWidget(self.__headerLabel)
        self.headerToolbar.addWidget(self.__filterButton)

        execLayout = QGridLayout()
        execLayout.setContentsMargins(1, 1, 1, 1)
        execLayout.setSpacing(1)
        execLayout.addWidget(self.__execStatement, 0, 0)
        execLayout.addWidget(self.__execButton, 0, 1)

        verticalLayout.addWidget(self.headerToolbar)
        verticalLayout.addWidget(self.__browser)
        verticalLayout.addLayout(execLayout)
Beispiel #3
0
    def __createLayout( self ):
        " Creates the widget layout "

        verticalLayout = QVBoxLayout( self )
        verticalLayout.setContentsMargins( 0, 0, 0, 0 )
        verticalLayout.setSpacing( 0 )

        headerFrame = QFrame()
        headerFrame.setFrameStyle( QFrame.StyledPanel )
        headerFrame.setAutoFillBackground( True )
        headerPalette = headerFrame.palette()
        headerBackground = headerPalette.color( QPalette.Background )
        headerBackground.setRgb( min( headerBackground.red() + 30, 255 ),
                                 min( headerBackground.green() + 30, 255 ),
                                 min( headerBackground.blue() + 30, 255 ) )
        headerPalette.setColor( QPalette.Background, headerBackground )
        headerFrame.setPalette( headerPalette )
        headerFrame.setFixedHeight( 24 )

        self.__headerLabel = QLabel( "Variables" )

        expandingSpacer = QSpacerItem( 10, 10, QSizePolicy.Expanding )
        fixedSpacer = QSpacerItem( 3, 3 )
        fixedSpacer1 = QSpacerItem( 5, 5 )

        self.__mcfButton = QToolButton()
        self.__mcfButton.setCheckable( True )
        self.__mcfButton.setChecked( self.__hideMCFFilter )
        self.__mcfButton.setIcon( PixmapCache().getIcon( 'dbgfltmcf.png' ) )
        self.__mcfButton.setFixedSize( 20, 20 )
        self.__mcfButton.setToolTip( "Show/hide modules, classes and functions" )
        self.__mcfButton.setFocusPolicy( Qt.NoFocus )
        self.__mcfButton.clicked.connect( self.__onMCFFilter )

        self.__globalAndLocalButton = QToolButton()
        self.__globalAndLocalButton.setCheckable( True )
        self.__globalAndLocalButton.setChecked( self.__filter == VariablesViewer.FilterGlobalAndLocal )
        self.__globalAndLocalButton.setIcon( PixmapCache().getIcon( 'dbgfltgl.png' ) )
        self.__globalAndLocalButton.setFixedSize( 20, 20 )
        self.__globalAndLocalButton.setToolTip( "Do not filter out global or local variables" )
        self.__globalAndLocalButton.setFocusPolicy( Qt.NoFocus )
        self.__globalAndLocalButton.clicked.connect( self.__onGlobalAndLocalFilter )

        self.__localOnlyButton = QToolButton()
        self.__localOnlyButton.setCheckable( True )
        self.__localOnlyButton.setChecked( self.__filter == VariablesViewer.FilterLocalOnly )
        self.__localOnlyButton.setIcon( PixmapCache().getIcon( 'dbgfltlo.png' ) )
        self.__localOnlyButton.setFixedSize( 20, 20 )
        self.__localOnlyButton.setToolTip( "Filter out global variables" )
        self.__localOnlyButton.setFocusPolicy( Qt.NoFocus )
        self.__localOnlyButton.clicked.connect( self.__onLocalFilter )

        self.__globalOnlyButton = QToolButton()
        self.__globalOnlyButton.setCheckable( True )
        self.__globalOnlyButton.setChecked( self.__filter == VariablesViewer.FilterGlobalOnly )
        self.__globalOnlyButton.setIcon( PixmapCache().getIcon( 'dbgfltgo.png' ) )
        self.__globalOnlyButton.setFixedSize( 20, 20 )
        self.__globalOnlyButton.setToolTip( "Filter out local variables" )
        self.__globalOnlyButton.setFocusPolicy( Qt.NoFocus )
        self.__globalOnlyButton.clicked.connect( self.__onGlobalFilter )

        self.__execStatement = CDMComboBox( True )
        self.__execStatement.setSizePolicy( QSizePolicy.Expanding,
                                            QSizePolicy.Expanding )
        self.__execStatement.lineEdit().setToolTip(
                                "Expression to be executed" )
        self.__execStatement.setFixedHeight( 26 )
        self.__execStatement.editTextChanged.connect( self.__execStatementChanged )
        self.__execStatement.enterClicked.connect( self.__onEnterInExec )
        self.__execButton = QPushButton( "Exec" )
        # self.__execButton.setFocusPolicy( Qt.NoFocus )
        self.__execButton.setEnabled( False )
        self.__execButton.clicked.connect( self.__onExec )

        self.__evalStatement = CDMComboBox( True )
        self.__evalStatement.setSizePolicy( QSizePolicy.Expanding,
                                            QSizePolicy.Expanding )
        self.__evalStatement.lineEdit().setToolTip(
                                "Expression to be evaluated" )
        self.__evalStatement.setFixedHeight( 26 )
        self.__evalStatement.editTextChanged.connect( self.__evalStatementChanged )
        self.__evalStatement.enterClicked.connect( self.__onEnterInEval )
        self.__evalButton = QPushButton( "Eval" )
        # self.__evalButton.setFocusPolicy( Qt.NoFocus )
        self.__evalButton.setEnabled( False )
        self.__evalButton.clicked.connect( self.__onEval )

        headerLayout = QHBoxLayout()
        headerLayout.setContentsMargins( 0, 0, 0, 0 )
        headerLayout.setSpacing( 0 )
        headerLayout.addSpacerItem( fixedSpacer )
        headerLayout.addWidget( self.__headerLabel )
        headerLayout.addSpacerItem( expandingSpacer )
        headerLayout.addWidget( self.__mcfButton )
        headerLayout.addSpacerItem( fixedSpacer1 )
        headerLayout.addWidget( self.__globalAndLocalButton )
        headerLayout.addWidget( self.__localOnlyButton )
        headerLayout.addWidget( self.__globalOnlyButton )
        headerFrame.setLayout( headerLayout )

        execEvalLayout = QGridLayout()
        execEvalLayout.setContentsMargins( 1, 1, 1, 1 )
        execEvalLayout.setSpacing( 1 )
        execEvalLayout.addWidget( self.__execStatement, 0, 0 )
        execEvalLayout.addWidget( self.__execButton, 0, 1 )
        execEvalLayout.addWidget( self.__evalStatement, 1, 0 )
        execEvalLayout.addWidget( self.__evalButton, 1, 1 )

        verticalLayout.addWidget( headerFrame )
        verticalLayout.addWidget( self.__browser )
        verticalLayout.addLayout( execEvalLayout )

        return
Beispiel #4
0
    def __createLayout(self):
        """Creates the widget layout"""
        verticalLayout = QVBoxLayout(self)
        verticalLayout.setContentsMargins(0, 0, 0, 0)
        verticalLayout.setSpacing(0)

        headerFrame = QFrame()
        headerFrame.setObjectName('varsheader')
        headerFrame.setStyleSheet('QFrame#varsheader {' + getLabelStyle(self) +
                                  '}')
        headerFrame.setFixedHeight(HEADER_HEIGHT)

        self.__headerLabel = QLabel("Variables")

        expandingSpacer = QSpacerItem(10, 10, QSizePolicy.Expanding)

        self.__filterMenu = QMenu(self)
        self.__showAllAct = self.__filterMenu.addAction('Show all variables')
        self.__showAllAct.setData('showall')
        self.__filterMenu.addSeparator()
        self.__filters = []
        for title, settingName, _ in VARIABLE_FILTERS:
            action = self.__filterMenu.addAction(title)
            action.setCheckable(True)
            action.setData(settingName)
            self.__filters.append(action)
        self.__filterMenu.aboutToShow.connect(self.__filterMenuAboutToShow)
        self.__filterMenu.triggered.connect(self.__filterMenuTriggered)

        self.__filterButton = QToolButton(self)
        self.__filterButton.setIcon(getIcon('dbgvarflt.png'))
        self.__filterButton.setToolTip('Variable filter')
        self.__filterButton.setPopupMode(QToolButton.InstantPopup)
        self.__filterButton.setMenu(self.__filterMenu)
        self.__filterButton.setFocusPolicy(Qt.NoFocus)
        self.__filterButton.setFixedSize(HEADER_BUTTON, HEADER_BUTTON)

        self.__execStatement = CDMComboBox(True)
        self.__execStatement.setSizePolicy(QSizePolicy.Expanding,
                                           QSizePolicy.Expanding)
        self.__execStatement.lineEdit().setToolTip("Execute statement")
        self.__execStatement.setFixedHeight(26)
        self.__execStatement.editTextChanged.connect(
            self.__execStatementChanged)
        self.__execStatement.enterClicked.connect(self.__onEnterInExec)
        self.__execButton = QPushButton("Exec")
        self.__execButton.setEnabled(False)
        self.__execButton.setFixedHeight(26)
        self.__execButton.clicked.connect(self.__onExec)

        headerLayout = QHBoxLayout()
        headerLayout.setContentsMargins(0, 0, 0, 0)
        headerLayout.setSpacing(0)
        headerLayout.addSpacing(3)
        headerLayout.addWidget(self.__headerLabel)
        headerLayout.addSpacerItem(expandingSpacer)
        headerLayout.addWidget(self.__filterButton)
        headerFrame.setLayout(headerLayout)

        execLayout = QGridLayout()
        execLayout.setContentsMargins(1, 1, 1, 1)
        execLayout.setSpacing(1)
        execLayout.addWidget(self.__execStatement, 0, 0)
        execLayout.addWidget(self.__execButton, 0, 1)

        verticalLayout.addWidget(headerFrame)
        verticalLayout.addWidget(self.__browser)
        verticalLayout.addLayout(execLayout)