def __createLayout(self):
        """Creates the dialog layout"""
        self.resize(320, 120)
        self.setSizeGripEnabled(True)

        pluginVersion = getPluginVersionAndPath(self.__pluginHomeDir)
        pylintVersion, pylintPath = getPylintVersionAndPath()

        vboxLayout = QVBoxLayout(self)
        hboxLayout = QHBoxLayout()
        iconLabel = QLabel()
        iconLabel.setPixmap(QPixmap(self.__pluginHomeDir + 'pylint.png'))
        iconLabel.setScaledContents(True)
        iconLabel.setFixedSize(48, 48)
        hboxLayout.addWidget(iconLabel)
        titleLabel = QLabel('<b>Codimension pylint plugin</b>')
        titleLabel.setSizePolicy(QSizePolicy.Expanding,
                                 QSizePolicy.Expanding)
        titleLabel.setFixedHeight(48)
        titleLabel.setAlignment(Qt.AlignCenter)

        infoLabel = QLabel('<hr><br>More info:'
                           '<ul>'
                           '<li>Plugin<br>'
                           'Version: ' + pluginVersion + '<br>'
                           'Location: ' + self.__pluginHomeDir + '</li>'
                           '<li>Pylint<br>'
                           'Version: ' + pylintVersion + '<br>' +
                           'Location: ' + pylintPath + '</li>'
                           '</ul><br>')
        hboxLayout.addWidget(titleLabel)
        vboxLayout.addLayout(hboxLayout)
        vboxLayout.addWidget(infoLabel)

        self.__buttonBox = QDialogButtonBox(self)
        self.__buttonBox.setOrientation(Qt.Horizontal)
        self.__buttonBox.setStandardButtons(QDialogButtonBox.Ok)
        self.__buttonBox.accepted.connect(self.close)
        self.__buttonBox.rejected.connect(self.close)
        vboxLayout.addWidget(self.__buttonBox)
Exemple #2
0
    def __createLayout(self):
        """Creates the dialog layout"""
        self.resize(640, 420)
        self.setSizeGripEnabled(True)

        vboxLayout = QVBoxLayout(self)
        hboxLayout = QHBoxLayout()
        iconLabel = QLabel()
        logoPath = os.path.dirname(os.path.abspath(__file__)) + \
                   os.path.sep + "svn-logo.png"
        iconLabel.setPixmap(QPixmap(logoPath))
        iconLabel.setScaledContents(True)
        iconLabel.setFixedSize(48, 48)
        hboxLayout.addWidget(iconLabel)
        titleLabel = QLabel("Codimension SVN plugin settings")
        titleLabel.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        titleLabel.setFixedHeight(48)
        titleLabel.setAlignment(Qt.AlignCenter)
        hboxLayout.addWidget(titleLabel)
        vboxLayout.addLayout(hboxLayout)

        self.__tabWidget = QTabWidget(self)
        self.__tabWidget.setFocusPolicy(Qt.NoFocus)

        ideWide = self.__createIDEWide()
        self.__tabWidget.addTab(ideWide, "IDE Wide")
        projectSpecific = self.__createProjectSpecific()
        self.__tabWidget.addTab(projectSpecific, "Project Specific")
        version = self.__createVersionWidget()
        self.__tabWidget.addTab(version, "Versions")
        vboxLayout.addWidget(self.__tabWidget)

        # Buttons at the bottom
        self.__buttonBox = QDialogButtonBox(self)
        self.__buttonBox.setOrientation(Qt.Horizontal)
        self.__buttonBox.setStandardButtons(QDialogButtonBox.Ok
                                            | QDialogButtonBox.Cancel)
        self.__buttonBox.accepted.connect(self.userAccept)
        self.__buttonBox.rejected.connect(self.close)
        vboxLayout.addWidget(self.__buttonBox)