Example #1
0
    def __init__(self, parent, **kwargs):
        """Creates a new instance of NwmRecentWidget."""
        super(NwmRecentWidget, self).__init__(parent, widgetFile=False, id='recent', **kwargs)

        self._pathWidgets = []

        mainLayout = self._getLayout(self, QtGui.QVBoxLayout)
        mainLayout.setContentsMargins(6, 6, 6, 6)
        mainLayout.setSpacing(6)

        topWidget, topLayout = self._createWidget(self, QtGui.QHBoxLayout, True)

        label = QtGui.QLabel(topWidget)
        label.setText(u'Recent Container Paths:')
        label.setStyleSheet("QLabel { color:#333; font-weight:500; font-size:16px; }")
        topLayout.addWidget(label)
        topLayout.addStretch()

        btn = PyGlassPushButton(
            topWidget,
            text='Cancel',
            icon=IconSheetMap.CANCEL,
            size=SizeEnum.MEDIUM,
            colorScheme=ColorSchemes.BLUE
        )
        btn.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred)
        btn.clicked.connect(self._handleCancel)
        topLayout.addWidget(btn)

        self._pathBox, layout = self._createWidget(self, QtGui.QVBoxLayout, True)

        mainLayout.addStretch()
    def __init__(self, parent, **kwargs):
        """Creates a new instance of StaticFlowDeployWidget."""
        super(StaticFlowDeployWidget, self).__init__(parent, widgetFile=False, id='deploy', **kwargs)

        self._pathWidgets = []

        mainLayout = self._getLayout(self, QtGui.QVBoxLayout)
        mainLayout.setContentsMargins(6, 6, 6, 6)
        mainLayout.setSpacing(6)

        topWidget, topLayout = self._createWidget(self, QtGui.QHBoxLayout, True)

        label = QtGui.QLabel(topWidget)
        label.setText(u'Deploying Site:')
        label.setStyleSheet("QLabel { color:#333; font-weight:500; font-size:16px; }")
        topLayout.addWidget(label)
        topLayout.addStretch()

        btn = PyGlassPushButton(
            topWidget,
            text='Close',
            icon=IconSheetMap.CHECK,
            size=SizeEnum.MEDIUM,
            colorScheme=ColorSchemes.COPPER)
        btn.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred)
        btn.clicked.connect(self._handleClose)
        topLayout.addWidget(btn)
        self._closeBtn = btn

        self._statusText = QtGui.QTextEdit(self)
        self._statusText.setReadOnly(True)
        self._statusText.setWordWrapMode(QtGui.QTextOption.NoWrap)
        mainLayout.addWidget(self._statusText)
Example #3
0
    def __init__(self, parent, **kwargs):
        """Creates a new instance of NwmHomeWidget."""
        super(NwmHomeWidget, self).__init__(parent,
                                            widgetFile=False,
                                            id='home',
                                            **kwargs)

        mainLayout = self._getLayout(self, QtGui.QVBoxLayout)
        mainLayout.setContentsMargins(6, 6, 6, 6)

        rootPath = self.mainWindow.appConfig.get(AppConfigEnum.ROOT_PATH,
                                                 NGinxSetupOps.getExePath())

        label = QtGui.QLabel(self)
        label.setText(u'Server Container Path:')
        label.setStyleSheet(self._HEADER_STYLE)
        mainLayout.addWidget(label)

        label = QtGui.QLabel(self)
        label.setText(
            u'The absolute path the location NGinx will use as its root source'
        )
        label.setStyleSheet(self._INFO_STYLE)
        mainLayout.addWidget(label)
        mainLayout.addSpacing(3)

        textWidget, textLayout = self._createWidget(self, QtGui.QHBoxLayout,
                                                    True)

        text = QtGui.QLineEdit(textWidget)
        text.setText(rootPath)
        textLayout.addWidget(text)
        self._pathLineEdit = text

        recent = PyGlassPushButton(textWidget,
                                   icon=IconSheetMap.DOWN,
                                   size=SizeEnum.SMALL)
        recent.setSizePolicy(QtGui.QSizePolicy.Maximum,
                             QtGui.QSizePolicy.Preferred)
        recent.clicked.connect(self._handleRecentLocations)
        textLayout.addWidget(recent)
        self._recentBtn = recent

        browse = PyGlassPushButton(textWidget,
                                   icon=IconSheetMap.FOLDER,
                                   size=SizeEnum.SMALL)
        browse.setSizePolicy(QtGui.QSizePolicy.Maximum,
                             QtGui.QSizePolicy.Preferred)
        browse.clicked.connect(self._handleLocatePath)
        textLayout.addWidget(browse)
        self._browseBtn = browse

        mainLayout.addSpacing(20)

        label = QtGui.QLabel(self)
        label.setText(u'Server Management:')
        label.setStyleSheet(self._HEADER_STYLE)
        mainLayout.addWidget(label)

        label = QtGui.QLabel(self)
        label.setText(u'Modify the state of your NGinx server')
        label.setStyleSheet(self._INFO_STYLE)
        mainLayout.addWidget(label)
        mainLayout.addSpacing(3)

        buttonBox, boxLayout = self._createWidget(self, QtGui.QHBoxLayout,
                                                  True)

        btn = PyGlassPushButton(buttonBox,
                                text='Start',
                                icon=IconSheetMap.FORWARD)
        btn.clicked.connect(self._handleStartServer)
        boxLayout.addWidget(btn)
        self._startBtn = btn

        btn = PyGlassPushButton(buttonBox, text='Stop', icon=IconSheetMap.X)
        btn.clicked.connect(self._handleStopServer)
        boxLayout.addWidget(btn)
        self._stopBtn = btn

        btn = PyGlassPushButton(buttonBox,
                                text='Reload',
                                icon=IconSheetMap.ROTATE)
        btn.clicked.connect(self._handleReloadServer)
        boxLayout.addWidget(btn)
        self._reloadBtn = btn

        boxLayout.addStretch()

        mainLayout.addStretch()

        self._updateDisplay()
Example #4
0
    def __init__(self, parent, **kwargs):
        """Creates a new instance of NwmHomeWidget."""
        super(NwmHomeWidget, self).__init__(parent, widgetFile=False, id='home', **kwargs)

        mainLayout = self._getLayout(self, QtGui.QVBoxLayout)
        mainLayout.setContentsMargins(6, 6, 6, 6)

        rootPath = self.mainWindow.appConfig.get(
            AppConfigEnum.ROOT_PATH, NGinxSetupOps.getExePath()
        )

        label = QtGui.QLabel(self)
        label.setText(u'Server Container Path:')
        label.setStyleSheet(self._HEADER_STYLE)
        mainLayout.addWidget(label)

        label = QtGui.QLabel(self)
        label.setText(u'The absolute path the location NGinx will use as its root source')
        label.setStyleSheet(self._INFO_STYLE)
        mainLayout.addWidget(label)
        mainLayout.addSpacing(3)

        textWidget, textLayout = self._createWidget(self, QtGui.QHBoxLayout, True)

        text = QtGui.QLineEdit(textWidget)
        text.setText(rootPath)
        textLayout.addWidget(text)
        self._pathLineEdit = text

        recent = PyGlassPushButton(textWidget, icon=IconSheetMap.DOWN, size=SizeEnum.SMALL)
        recent.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred)
        recent.clicked.connect(self._handleRecentLocations)
        textLayout.addWidget(recent)
        self._recentBtn = recent

        browse = PyGlassPushButton(textWidget, icon=IconSheetMap.FOLDER, size=SizeEnum.SMALL)
        browse.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred)
        browse.clicked.connect(self._handleLocatePath)
        textLayout.addWidget(browse)
        self._browseBtn = browse

        mainLayout.addSpacing(20)

        label = QtGui.QLabel(self)
        label.setText(u'Server Management:')
        label.setStyleSheet(self._HEADER_STYLE)
        mainLayout.addWidget(label)

        label = QtGui.QLabel(self)
        label.setText(u'Modify the state of your NGinx server')
        label.setStyleSheet(self._INFO_STYLE)
        mainLayout.addWidget(label)
        mainLayout.addSpacing(3)

        buttonBox, boxLayout = self._createWidget(self, QtGui.QHBoxLayout, True)

        btn = PyGlassPushButton(buttonBox, text='Start', icon=IconSheetMap.FORWARD)
        btn.clicked.connect(self._handleStartServer)
        boxLayout.addWidget(btn)
        self._startBtn = btn

        btn = PyGlassPushButton(buttonBox, text='Stop', icon=IconSheetMap.X)
        btn.clicked.connect(self._handleStopServer)
        boxLayout.addWidget(btn)
        self._stopBtn = btn

        btn = PyGlassPushButton(buttonBox, text='Reload', icon=IconSheetMap.ROTATE)
        btn.clicked.connect(self._handleReloadServer)
        boxLayout.addWidget(btn)
        self._reloadBtn = btn

        boxLayout.addStretch()

        mainLayout.addStretch()

        self._updateDisplay()
    def __init__(self, parent, **kwargs):
        """Creates a new instance of StaticFlowHomeWidget."""
        super(StaticFlowHomeWidget, self).__init__(parent, widgetFile=False, id='home', **kwargs)

        mainLayout = self._getLayout(self, QtGui.QVBoxLayout)
        mainLayout.setContentsMargins(6, 6, 6, 6)

        rootPath = self.mainWindow.appConfig.get(AppConfigEnum.ROOT_PATH, u'')

        label = QtGui.QLabel(self)
        label.setText(u'Project Root Path:')
        label.setStyleSheet(self._HEADER_STYLE)
        mainLayout.addWidget(label)

        label = QtGui.QLabel(self)
        label.setText(u'The absolute path where your Static Flow project resides')
        label.setStyleSheet(self._INFO_STYLE)
        mainLayout.addWidget(label)
        mainLayout.addSpacing(3)

        textWidget, textLayout = self._createWidget(self, QtGui.QHBoxLayout, True)

        text = QtGui.QLineEdit(textWidget)
        text.setText(rootPath)
        textLayout.addWidget(text)
        self._pathLineEdit = text
        self._pathLineEdit.textChanged.connect(self._handlePathUpdated)

        recent = PyGlassPushButton(textWidget, icon=IconSheetMap.DOWN, size=SizeEnum.SMALL)
        recent.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred)
        recent.clicked.connect(self._handleRecentLocations)
        textLayout.addWidget(recent)
        self._recentBtn = recent

        browse = PyGlassPushButton(textWidget, icon=IconSheetMap.FOLDER, size=SizeEnum.SMALL)
        browse.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred)
        browse.clicked.connect(self._handleLocatePath)
        textLayout.addWidget(browse)
        self._browseBtn = browse

        mainLayout.addSpacing(20)

        label = QtGui.QLabel(self)
        label.setText(u'Deployment:')
        label.setStyleSheet(self._HEADER_STYLE)
        mainLayout.addWidget(label)

        label = QtGui.QLabel(self)
        label.setText(u'Site deployment operations')
        label.setStyleSheet(self._INFO_STYLE)
        mainLayout.addWidget(label)
        mainLayout.addSpacing(3)

        buttonBox, boxLayout = self._createWidget(self, QtGui.QHBoxLayout, True)

        btn = PyGlassPushButton(buttonBox, text='Remote')
        btn.clicked.connect(self._handleRemoteDeploy)
        boxLayout.addWidget(btn)
        self._remoteBtn = btn

        btn = PyGlassPushButton(buttonBox, text='Local')
        btn.clicked.connect(self._handleLocalDeploy)
        boxLayout.addWidget(btn)
        self._localBtn = btn

        btn = PyGlassPushButton(buttonBox, text='Test')
        btn.clicked.connect(self._handleTestDeploy)
        boxLayout.addWidget(btn)
        self._testBtn = btn

        boxLayout.addStretch()

        mainLayout.addStretch()

        self._updateDisplay()