def __init__(self):
        """
		Args:
			flow: What part of setup is the user entering into?
		"""
        super(StartupMainWindow, self).__init__()

        self.logger = logging.getLogger('menu.' + self.__class__.__name__)
        self.logger.info('Setup starting...')
        self.setObjectName('launcher_{0}'.format(self.__class__.__name__))

        self.armada_root_path = definitions.ROOT_PATH

        self.setWindowIcon(resource.icon('armada_logo', 'png'))
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.installEventFilter(self)
        self.setStyleSheet(resource.style_sheet('setup'))
        # self.resize(500, 750)
        # self.sizeHint()
        self.setWindowTitle('Armada Startup')

        # GUI -----------------------------------------------
        self.login_flow_widget = login_flow.LoginFlow(self)
        self.creation_flow_widget = creation_flow_widget.CreationFlowWidget(
            self)

        # Main stacked widget that switches between first login and creation flows
        self.sw_main = QtWidgets.QStackedWidget()

        self.sw_main.addWidget(self.login_flow_widget)
        self.sw_main.addWidget(self.creation_flow_widget)

        # Layout -----------------------------------------------
        self.main_layout = QtWidgets.QHBoxLayout()
        self.main_layout.addWidget(self.sw_main)
        self.main_layout.setContentsMargins(0, 0, 0, 0)
        self.main_layout.setSpacing(0)

        self.setLayout(self.main_layout)

        # # Wait for user input
        # self.exec_()

        # Connections -----------------------------------
        self.login_flow_widget.loginPressed.connect(self._on_login_pressed)
        self.creation_flow_widget.setup_completed.connect(
            self._on_setup_completed)
Beispiel #2
0
	def __init__(self, parent=None):
		"""
		Args:
			flow: What part of setup is the user entering into?
		"""
		super(CreateSoftware, self).__init__(parent)

		self.logger = logging.getLogger('menu.' + self.__class__.__name__)
		self.logger.info('Workplace creation starting...')
		self.setObjectName('launcher_{0}'.format(self.__class__.__name__))

		self.parent = parent
		self.armada_root_path = definitions.ROOT_PATH

		# self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
		self.installEventFilter(self)
		self.setStyleSheet(resource.style_sheet('setup'))
		self.sizeHint()

		# GUI ----------------------------------
		self.btn_back = QtWidgets.QPushButton()
		self.btn_back.setIcon(resource.color_svg('arrow_left', 128, '#9E9E9E'))
		self.btn_back.setIconSize(QtCore.QSize(30, 30))
		self.btn_back.setFixedHeight(30)
		self.btn_back.setStyleSheet(resource.style_sheet('push_button_w_icon'))

		self.tb_welcome = QtWidgets.QLabel()
		self.tb_welcome.setText("""
				<p style="font-size:30px;font-weight: normal;">Almost there!</p>"""
								)
		self.tb_welcome.setWordWrap(True)

		self.tb_description = QtWidgets.QLabel()
		self.tb_description.setStyleSheet("""
			background-color: transparent;
			font: 12px;
			font-weight: normal"""
		)
		self.tb_description.setText("""
			<p>Let's make sure we have the right path for each software.</p>"""
		)
		self.tb_description.setWordWrap(True)

		# Input
		# scroll area
		self.scrollArea = QtWidgets.QScrollArea()
		self.scrollArea.setWidgetResizable(True)
		self.scrollArea.setStyleSheet('background-color: #00000000;')
		self.content = QtWidgets.QWidget()
		self.content.setStyleSheet('background-color: #00000000;')

		self.scrollArea.setWidget(self.content)

		layout = QtWidgets.QVBoxLayout(self.content)
		layout.setContentsMargins(0, 0, 0, 0)
		layout.setSpacing(20)

		supported_software = ['maya', 'houdini', 'blender']

		for item in supported_software:
			software_card = SoftwareCard(self, item)
			layout.addWidget(software_card)

		self.btn_next = QtWidgets.QPushButton('Next')
		self.btn_next.setFixedWidth(100)
		self.btn_next.setStyleSheet('''
			QPushButton{
				Background:#2e7a78;
				height: 30px;
				font: 12px "Roboto-Thin"
			}
			QPushButton:hover{
				Background: #369593;
			}
			QPushButton:hover:pressed{
				Background: #2e7a78;
			}
			QPushButton:pressed{
				Background:  #2a615f;
			}
			QPushButton:disabled{
				Background: #3b3b3b;
			}'''
		)
		self.btn_next.setFixedSize(100, 40)

		# Layout --------------------------------------------
		btn_back_layout = QtWidgets.QVBoxLayout()
		btn_back_layout.addWidget(self.btn_back)
		btn_back_layout.setAlignment(QtCore.Qt.AlignTop)
		btn_back_layout.setContentsMargins(0, 0, 0, 0)
		btn_back_layout.setSpacing(0)

		description_layout = QtWidgets.QVBoxLayout()
		description_layout.addWidget(self.tb_welcome)
		description_layout.addWidget(self.tb_description)
		description_layout.setAlignment(QtCore.Qt.AlignTop)
		description_layout.setContentsMargins(0, 0, 0, 0)
		description_layout.setSpacing(30)

		input_layout = QtWidgets.QVBoxLayout()
		input_layout.addWidget(self.scrollArea)

		btn_layout = QtWidgets.QVBoxLayout()
		btn_layout.addWidget(self.btn_next)
		btn_layout.setAlignment(QtCore.Qt.AlignTop)
		btn_layout.setContentsMargins(0, 0, 0, 0)
		btn_layout.setSpacing(0)

		contents_layout = QtWidgets.QVBoxLayout()
		contents_layout.addLayout(description_layout)
		contents_layout.addLayout(input_layout)
		contents_layout.addLayout(btn_layout)
		contents_layout.addStretch()
		contents_layout.setAlignment(QtCore.Qt.AlignTop)
		contents_layout.setContentsMargins(0, 0, 0, 0)
		contents_layout.setSpacing(50)

		# disclaimer_layout = QtWidgets.QVBoxLayout()
		# disclaimer_layout.addWidget(self.lbl_disclaimer)
		# disclaimer_layout.setAlignment(QtCore.Qt.AlignBottom | QtCore.Qt.AlignCenter)
		# disclaimer_layout.setContentsMargins(0, 20, 0, 20)
		# disclaimer_layout.setSpacing(0)

		self.main_layout = QtWidgets.QHBoxLayout()
		self.main_layout.addLayout(btn_back_layout)
		self.main_layout.addLayout(contents_layout)
		# self.main_layout.addLayout(disclaimer_layout)
		# self.main_layout.setAlignment(QtCore.Qt.AlignBottom)
		self.main_layout.setContentsMargins(20, 20, 60, 20)
		self.main_layout.setSpacing(10)

		self.setLayout(self.main_layout)
	def __init__(self, parent=None):
		"""
		Args:
			flow: What part of setup is the user entering into?
		"""
		super(CreationFlowWidget, self).__init__(parent)

		self.logger = logging.getLogger('menu.' + self.__class__.__name__)
		self.logger.info('Setup starting...')
		self.setObjectName('launcher_{0}'.format(self.__class__.__name__))

		self.armada_root_path = definitions.ROOT_PATH

		self.setWindowIcon(resource.icon('armada_logo', 'png'))
		self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
		self.installEventFilter(self)
		self.setStyleSheet(resource.style_sheet('setup'))
		# self.resize(1300, 750)
		self.sizeHint()

		# GUI -----------------------------------------------
		self.frame_left = QtWidgets.QFrame()
		self.frame_left.setStyleSheet("QFrame{background: #202020;}")
		self.frame_left.setMaximumWidth(600)

		# Logo
		self.logo_image = QtWidgets.QLabel(self)
		self.logo_image.setObjectName('MainLogo')
		self.logo_image.resize(self.logo_image.sizeHint())
		self.logo_image_pixmap = resource.pixmap('banner').scaled(
			200, 25, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
		self.logo_image.setPixmap(self.logo_image_pixmap)
		self.logo_image.setAlignment(QtCore.Qt.AlignVCenter)

		# Breadcrumb stuff
		self.breadcrumb_steps = breadcrumb_startup_steps.BreadcrumbStartupSteps(self)
		self.breadcrumb_steps.setCurrentIndex(breadcrumb_startup_steps.ABOUT_YOU)
		# self.breadcrumb_steps.setTabEnabled(breadcrumb_startup_steps.WORKSPACE, False)
		# self.breadcrumb_steps.setTabEnabled(breadcrumb_startup_steps.PROJECT, False)

		self.disclaimer_widget = disclaimer.Disclaimer(self)
		self.username_widget = create_username.CreateUsername(self)
		self.workspace_widget = create_workspace.CreateWorkspace(self)
		self.project_widget = create_project.CreateProject(self)
		self.structure_workflow_widget = create_structure_workflow.CreateStructureWorkflow(self)
		self.structure_selection_widget = create_structure_selection.CreateStructureSelection(self)
		self.software_widget = create_software.CreateSoftware(self)

		# Creation stacked widget. Guides first setup flow
		self.sw_creation_flows = QtWidgets.QStackedWidget(self)

		self.sw_creation_flows.addWidget(self.disclaimer_widget)
		self.sw_creation_flows.addWidget(self.username_widget)
		self.sw_creation_flows.addWidget(self.workspace_widget)
		self.sw_creation_flows.addWidget(self.project_widget)
		self.sw_creation_flows.addWidget(self.structure_workflow_widget)
		self.sw_creation_flows.addWidget(self.structure_selection_widget)
		self.sw_creation_flows.addWidget(self.software_widget)

		self.example_widget = QtWidgets.QWidget()
		self.example_widget.setMaximumWidth(400)
		self.example_widget.setObjectName("armada_ExampleWidget")

		# State machine ------------------
		self.state_machine = QtCore.QStateMachine()
		self.s00_disclaimer = QtCore.QState()
		self.s0_username = QtCore.QState()
		self.s1_workspace = QtCore.QState()
		self.s2_project = QtCore.QState()
		self.s3_structure_workflow = QtCore.QState()
		self.s4_structure_sel = QtCore.QState()
		self.s5_software = QtCore.QState()
		self.s6_complete = QtCore.QState()

		# Transitions
		# Disclaimer next
		self.trans_s00_s0 = self.s00_disclaimer.addTransition(self.disclaimer_widget.btn_next.clicked, self.s0_username)
		# User next
		self.trans_s0_s1 = self.s0_username.addTransition(self.username_widget.btn_next.clicked, self.s1_workspace)
		# Workspace next
		self.trans_s1_s2 = self.s1_workspace.addTransition(self.workspace_widget.btn_next.clicked, self.s2_project)
		# Project next
		self.trans_s2_s3 = self.s2_project.addTransition(self.project_widget.btn_next.clicked, self.s3_structure_workflow)
		# Structure workflow next
		self.trans_s3_s4 = self.s3_structure_workflow.addTransition(self.structure_workflow_widget.btn_next.clicked, self.s4_structure_sel)
		# Structure sel next
		self.trans_s4_s5 = self.s4_structure_sel.addTransition(self.structure_selection_widget.btn_next.clicked, self.s5_software)
		# Complete
		self.trans_s5_s6 = self.s5_software.addTransition(self.software_widget.btn_next.clicked, self.s6_complete)
		# Software back
		self.trans_s5_s4 = self.s5_software.addTransition(self.software_widget.btn_back.clicked, self.s4_structure_sel)
		# Structure sel back
		self.trans_s4_s3 = self.s4_structure_sel.addTransition(self.structure_selection_widget.btn_back.clicked, self.s3_structure_workflow)
		# Structure workflow back
		self.trans_s3_s2 = self.s3_structure_workflow.addTransition(self.structure_workflow_widget.btn_back.clicked, self.s2_project)
		# Project back
		self.trans_s3_s2 = self.s2_project.addTransition(self.project_widget.btn_back.clicked, self.s1_workspace)
		# Workspace back
		self.trans_s2_s1 = self.s1_workspace.addTransition(self.workspace_widget.btn_back.clicked, self.s0_username)

		# Add states
		self.state_machine.addState(self.s00_disclaimer)
		self.state_machine.addState(self.s0_username)
		self.state_machine.addState(self.s1_workspace)
		self.state_machine.addState(self.s2_project)
		self.state_machine.addState(self.s3_structure_workflow)
		self.state_machine.addState(self.s4_structure_sel)
		self.state_machine.addState(self.s5_software)
		self.state_machine.addState(self.s6_complete)
		self.state_machine.setInitialState(self.s00_disclaimer)

		# Connections
		self.s00_disclaimer.entered.connect(self.on_s00_disclaimer_entered)
		self.s0_username.entered.connect(self.on_s0_username_entered)
		self.s1_workspace.entered.connect(self.on_s1_workspace_entered)
		self.s2_project.entered.connect(self.on_s2_project_entered)
		self.s3_structure_workflow.entered.connect(self.on_s3_structure_workflow_entered)
		self.s4_structure_sel.entered.connect(self.on_s4_structure_sel_entered)
		self.s5_software.entered.connect(self.on_s5_software_entered)
		self.s6_complete.entered.connect(self.on_s6_complete)

		self.state_machine.start()

		# Layout --------------------------------------------
		frame_layout = QtWidgets.QHBoxLayout()
		frame_layout.addWidget(self.frame_left)
		frame_layout.setAlignment(QtCore.Qt.AlignLeft)
		frame_layout.setContentsMargins(0, 0, 0, 0)
		frame_layout.setSpacing(0)

		header_layout = QtWidgets.QHBoxLayout()
		header_layout.addWidget(self.logo_image, 0, QtCore.Qt.AlignTop)
		header_layout.addWidget(self.breadcrumb_steps, 1, QtCore.Qt.AlignLeft)
		header_layout.setContentsMargins(10, 10, 10, 10)
		header_layout.setSpacing(5)

		input_layout = QtWidgets.QVBoxLayout(self.frame_left)
		input_layout.addLayout(header_layout)
		input_layout.addWidget(self.sw_creation_flows)
		# input_layout.addStretch()
		input_layout.setAlignment(QtCore.Qt.AlignTop)
		input_layout.setContentsMargins(0, 0, 0, 0)
		input_layout.setSpacing(0)

		example_layout = QtWidgets.QVBoxLayout(self.example_widget)
		self.lbl_tbd = QtWidgets.QLabel('Example image TBD')
		example_layout.addWidget(self.lbl_tbd, 0, QtCore.Qt.AlignCenter)


		self.main_layout = QtWidgets.QHBoxLayout()
		self.main_layout.addLayout(frame_layout)
		self.main_layout.addWidget(self.lbl_tbd)
		self.main_layout.setAlignment(QtCore.Qt.AlignLeft)
		self.main_layout.setContentsMargins(0, 0, 0, 0)
		self.main_layout.setSpacing(0)

		self.setLayout(self.main_layout)
Beispiel #4
0
    def __init__(self, parent=None):
        """
		Args:
			flow: What part of setup is the user entering into?
		"""
        super(CreateWorkspace, self).__init__(parent)

        self.logger = logging.getLogger('menu.' + self.__class__.__name__)
        self.logger.info('Workplace creation starting...')
        self.setObjectName('launcher_{0}'.format(self.__class__.__name__))

        self.parent = parent
        self.armada_root_path = definitions.ROOT_PATH

        # self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.installEventFilter(self)
        self.setStyleSheet(resource.style_sheet('setup'))
        self.sizeHint()

        # GUI -----------------------------------------------
        self.btn_back = QtWidgets.QPushButton()
        self.btn_back.setIcon(resource.color_svg('arrow_left', 128, '#9E9E9E'))
        self.btn_back.setIconSize(QtCore.QSize(30, 30))
        self.btn_back.setFixedHeight(30)
        self.btn_back.setStyleSheet(resource.style_sheet('push_button_w_icon'))

        self.tb_welcome = QtWidgets.QLabel()

        self.tb_description = QtWidgets.QLabel()
        self.tb_description.setStyleSheet("""
			background-color: transparent;
			font: 12px;
			font-weight: normal
		""")
        self.tb_description.setText("""
			<p>A <b>workspace</b> is where all of your projects will be stored.
			<p>Name it after the company you work for, a series of projects you're starting, or the type of work you'll be doing.</p>
			<p>You can change the name later, but it's strongly advised that you don't!</p>"""
                                    )
        self.tb_description.setWordWrap(True)

        # Mount point
        self.lbl_mount_point = QtWidgets.QLabel(
            'Choose an empty directory to mount your workspace to')

        self.le_mount_point = QtWidgets.QLineEdit()
        self.le_mount_point.setPlaceholderText('e.g D:/OneDrive/Work')
        self.le_mount_point.setMinimumHeight(40)
        regexp = QtCore.QRegExp("^[a-zA-Z0-9_/:]+$", QtCore.Qt.CaseInsensitive)
        validator = QtGui.QRegExpValidator(regexp)
        self.le_mount_point.setValidator(validator)

        self.btn_mount_browse = QtWidgets.QPushButton("Browse")
        self.btn_mount_browse.setMinimumWidth(100)

        self.hline_mount_point = QtWidgets.QFrame()
        self.hline_mount_point.setFixedHeight(1)
        self.hline_mount_point.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                             QtWidgets.QSizePolicy.Fixed)
        self.hline_mount_point.setStyleSheet("background-color: #636363;")

        # Workspace name
        self.lbl_workspace = QtWidgets.QLabel(
            'What should we call this workspace?')

        self.le_workspace = QtWidgets.QLineEdit()
        self.le_workspace.setPlaceholderText(
            'e.g. Knufflebeast, Junior Year Projects, Solo Show, Research and Development, etc.'
        )
        self.le_workspace.setMinimumHeight(40)
        regexp = QtCore.QRegExp("^[a-zA-Z0-9-_ ]+$", QtCore.Qt.CaseInsensitive)
        validator = QtGui.QRegExpValidator(regexp)
        self.le_workspace.setValidator(validator)

        self.hline_workspace = QtWidgets.QFrame()
        self.hline_workspace.setFixedHeight(1)
        self.hline_workspace.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Fixed)
        self.hline_workspace.setStyleSheet("background-color: #636363;")

        # # Full path name
        # self.lbl_full_path = QtWidgets.QLabel('Full mount point path')
        #
        # self.lbl_path_example = QtWidgets.QLabel()
        # self.lbl_path_example.setWordWrap(True)
        # self.lbl_path_example.setStyleSheet("""
        # 			background-color: transparent;
        # 			font: 12px;
        # 			font-weight: normal"""
        # 											 )
        # self.hline_full_path = QtWidgets.QFrame()
        # self.hline_full_path.setFixedHeight(1)
        # self.hline_full_path.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        # self.hline_full_path.setStyleSheet("background-color: #636363;")

        self.btn_next = QtWidgets.QPushButton('Next')
        self.btn_next.setStyleSheet('''
			QPushButton{
				Background:#2e7a78;
				height: 30px;
				font: 12px "Roboto-Thin"
			}
			QPushButton:hover{
				Background: #369593;
			}
			QPushButton:hover:pressed{
				Background: #2e7a78;
			}
			QPushButton:pressed{
				Background:  #2a615f;
			}
			QPushButton:disabled{
				Background: #3b3b3b;
			}''')
        self.btn_next.setFixedSize(100, 40)
        self.btn_next.setEnabled(False)

        # self.lbl_disclaimer = QtWidgets.QTextBrowser()
        # self.lbl_disclaimer.setReadOnly(True)
        # self.lbl_disclaimer.setText('Armada Pipeline does not store passwords or account data at this time. Your acocunt is stored locally and only used to add another degree of flexibility project')
        # self.lbl_disclaimer.setMinimumSize(100, 50)

        # Layout --------------------------------------------
        btn_back_layout = QtWidgets.QVBoxLayout()
        btn_back_layout.addWidget(self.btn_back)
        btn_back_layout.setAlignment(QtCore.Qt.AlignTop)
        btn_back_layout.setContentsMargins(0, 0, 0, 0)
        btn_back_layout.setSpacing(0)

        description_layout = QtWidgets.QVBoxLayout()
        description_layout.addWidget(self.tb_welcome)
        description_layout.addWidget(self.tb_description)
        description_layout.setAlignment(QtCore.Qt.AlignTop)
        description_layout.setContentsMargins(0, 0, 0, 0)
        description_layout.setSpacing(30)

        mount_layout = QtWidgets.QHBoxLayout()
        mount_layout.addWidget(self.le_mount_point)
        mount_layout.addWidget(self.btn_mount_browse)
        mount_layout.setContentsMargins(0, 0, 0, 0)
        mount_layout.setSpacing(0)

        input_layout = QtWidgets.QVBoxLayout()
        input_layout.addWidget(self.lbl_mount_point)
        input_layout.addSpacing(10)
        input_layout.addLayout(mount_layout)
        input_layout.addWidget(self.hline_mount_point)
        input_layout.addSpacing(20)
        input_layout.addWidget(self.lbl_workspace)
        input_layout.addSpacing(10)
        input_layout.addWidget(self.le_workspace)
        input_layout.addWidget(self.hline_workspace)
        # input_layout.addSpacing(20)
        # input_layout.addWidget(self.lbl_full_path)
        # input_layout.addSpacing(10)
        # input_layout.addWidget(self.lbl_path_example)
        input_layout.setAlignment(QtCore.Qt.AlignTop)
        input_layout.setContentsMargins(0, 0, 0, 0)
        input_layout.setSpacing(0)

        btn_layout = QtWidgets.QVBoxLayout()
        btn_layout.addWidget(self.btn_next)
        btn_layout.setAlignment(QtCore.Qt.AlignTop)
        btn_layout.setContentsMargins(0, 0, 0, 0)
        btn_layout.setSpacing(0)

        contents_layout = QtWidgets.QVBoxLayout()
        contents_layout.addLayout(description_layout)
        contents_layout.addLayout(input_layout)
        contents_layout.addLayout(btn_layout)
        contents_layout.addStretch()
        contents_layout.setAlignment(QtCore.Qt.AlignTop)
        contents_layout.setContentsMargins(0, 0, 0, 0)
        contents_layout.setSpacing(50)

        # disclaimer_layout = QtWidgets.QVBoxLayout()
        # disclaimer_layout.addWidget(self.lbl_disclaimer)
        # disclaimer_layout.setAlignment(QtCore.Qt.AlignBottom | QtCore.Qt.AlignCenter)
        # disclaimer_layout.setContentsMargins(0, 20, 0, 20)
        # disclaimer_layout.setSpacing(0)

        self.main_layout = QtWidgets.QHBoxLayout()
        self.main_layout.addLayout(btn_back_layout)
        self.main_layout.addLayout(contents_layout)
        # self.main_layout.addLayout(disclaimer_layout)
        # self.main_layout.setAlignment(QtCore.Qt.AlignBottom)
        self.main_layout.setContentsMargins(20, 20, 60, 20)
        self.main_layout.setSpacing(10)

        self.setLayout(self.main_layout)

        # Connections -----------------------------------
        self.le_workspace.textChanged.connect(self.check_le_state)
        self.le_mount_point.textChanged.connect(self.check_le_state)
        self.btn_mount_browse.clicked.connect(self.on_browse_pressed)
Beispiel #5
0
	def __init__(self, parent=None, software=None):
		"""Cards for software
		"""
		super(SoftwareCard, self).__init__(parent)

		self.setStyleSheet(resource.style_sheet('setup'))

		self.frame_bg = QtWidgets.QFrame()
		self.frame_bg.setStyleSheet('background-color: #303030;')

		self.software = software

		# Path defaults
		if platform.system().lower() in ['windows']:
			if self.software == 'maya':
				self.env_var = 'ARMADA_MAYA_LOCATION'
				self.software_dir = 'Autodesk'
				software_path = 'C:/Program Files/Autodesk'
			elif self.software == 'blender':
				self.env_var = 'ARMADA_BLENDER_LOCATION'
				self.software_dir = 'Blender Foundation'
				software_path = 'C:/Program Files/Blender Foundation'
			elif self.software == 'houdini':
				self.env_var = 'ARMADA_HOUDINI_LOCATION'
				self.software_dir = 'Side Effects Software'
				software_path = 'C:/Program Files/Side Effects Software'
			elif self.software == 'mari':
				self.env_var = 'ARMADA_MARI_LOCATION'
				self.software_dir = 'Mari{version}'
				software_path = 'C:/Program Files'

		elif platform.system().lower() in ['darwin']:
			self.maya_ver = 'maya2020'
			self.blender_ver = 'Blender.app'
			maya_path = '/Applications/Autodesk'
			blender_path = '/Applications'
			houdini_path = '/Applications'
		else:
			raise

		# Blender
		self.icon_software = QtWidgets.QPushButton(resource.icon(self.software, 'png'), '')
		self.icon_software.setStyleSheet(resource.style_sheet('icon_label'))
		self.icon_software.setIconSize(QtCore.QSize(30, 30))

		self.lbl_software_install = QtWidgets.QLabel('{0} install location'.format(self.software.capitalize()))

		self.le_software_path = QtWidgets.QLineEdit()
		self.le_software_path.setMinimumHeight(40)
		regexp = QtCore.QRegExp("^[a-zA-Z0-9_/:]+$", QtCore.Qt.CaseInsensitive)
		validator = QtGui.QRegExpValidator(regexp)
		self.le_software_path.setValidator(validator)
		self.le_software_path.setText(software_path)
		self.le_software_path.setStyleSheet(resource.style_sheet('setup'))

		self.hline_software_path = QtWidgets.QFrame()
		self.hline_software_path.setFixedHeight(1)
		self.hline_software_path.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
		self.hline_software_path.setStyleSheet("background-color: #636363;")

		self.btn_software_browse = QtWidgets.QPushButton("Browse")
		self.btn_software_browse.setMinimumWidth(100)
		self.btn_software_browse.setStyleSheet('background-color: red;')
		self.btn_software_browse.setStyleSheet(resource.style_sheet('setup'))

		self.lbl_software_version = QtWidgets.QLabel("Versions found:")
		self.lbl_software_version.setStyleSheet("""
								background-color: transparent;
								font: 12px;
								font-weight: normal"""
											   )

		self.lw_software_verisons = QtWidgets.QListWidget()
		# self.lw_houdini_verisons.setViewMode(QtWidgets.QListView.IconMode)
		self.lw_software_verisons.setMaximumHeight(50)
		# self.lw_houdini_verisons.setResizeMode(QtWidgets.QListView.Fixed)
		# self.lw_houdini_verisons.setUniformItemSizes(True)
		# self.lw_houdini_verisons.setSizeAdjustPolicy(QtWidgets.QListWidget.AdjustIgnored)
		self.lw_software_verisons.setMovement(self.lw_software_verisons.Static)
		self.lw_software_verisons.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
		self.lw_software_verisons.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
		self.lw_software_verisons.setFlow(QtWidgets.QListView.LeftToRight)
		# self.lw_software_verisons.setSpacing(5)
		self.lw_software_verisons.setMinimumHeight(30)
		self.lw_software_verisons.setStyleSheet("""
						QListView{
							show-decoration-selected: 0;
							background: #00000000;
							color:rgb(218,218,218) ;
							font:12px "Roboto-Thin";
							border: none;
							outline: none;
							padding-left: 10px;
							padding-right: 10px;
						}
						QListView::item{
							background: #606060;
							color:rgb(218,218,218) ;
							font:12px "Roboto-Thin";
							border-radius: 5px;
							outline: none;
							margin-right: 10px;
							padding-left: 10px;
							padding-right: 10px;
						}"""
											   )

		# Add versions
		self._on_update_versions()

		# Layout --------------------------------------------
		frame_layout = QtWidgets.QHBoxLayout()
		frame_layout.addWidget(self.frame_bg)
		frame_layout.setAlignment(QtCore.Qt.AlignLeft)
		frame_layout.setContentsMargins(0, 0, 0, 0)
		frame_layout.setSpacing(0)

		label_layout = QtWidgets.QHBoxLayout()
		label_layout.addWidget(self.icon_software, 0, QtCore.Qt.AlignLeft)
		label_layout.addWidget(self.lbl_software_install, 0, QtCore.Qt.AlignLeft)
		label_layout.setAlignment(QtCore.Qt.AlignLeft)
		label_layout.setContentsMargins(0, 0, 0, 0)
		label_layout.setSpacing(0)

		input_layout = QtWidgets.QHBoxLayout()
		input_layout.addWidget(self.le_software_path)
		input_layout.addWidget(self.btn_software_browse)
		input_layout.setContentsMargins(0, 0, 0, 0)
		input_layout.setSpacing(0)

		contents = QtWidgets.QVBoxLayout(self.frame_bg)
		contents.addLayout(label_layout)
		contents.addLayout(input_layout)
		contents.addWidget(self.hline_software_path)
		contents.addSpacing(10)
		contents.addWidget(self.lbl_software_version)
		contents.addSpacing(10)
		contents.addWidget(self.lw_software_verisons)
		contents.setContentsMargins(10, 10, 10, 10)
		contents.setSpacing(0)

		self.main_layout = QtWidgets.QVBoxLayout()
		self.main_layout.addLayout(frame_layout)
		self.main_layout.setContentsMargins(0, 0, 0, 0)
		self.main_layout.setSpacing(0)

		self.setLayout(self.main_layout)

		# Set initial software env variables
		self.set_env_vars()

		# Connections ---------------------------------------------------------------
		self.le_software_path.textChanged.connect(self.check_le_state)
		self.btn_software_browse.clicked.connect(self.on_software_browse_pressed)
    def __init__(self, parent=None):
        """
		Args:
			flow: What part of setup is the user entering into?
		"""
        super(CreateUsername, self).__init__(parent)

        self.logger = logging.getLogger('menu.' + self.__class__.__name__)
        self.logger.info('Workplace creation starting...')
        self.setObjectName('launcher_{0}'.format(self.__class__.__name__))

        self.parent = parent
        self.armada_root_path = definitions.ROOT_PATH

        # self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.installEventFilter(self)
        self.setStyleSheet(resource.style_sheet('setup'))
        self.sizeHint()

        # GUI ----------------------------------
        self.btn_back = QtWidgets.QPushButton()
        self.btn_back.setIcon(resource.color_svg('arrow_left', 128, '#9E9E9E'))
        self.btn_back.setIconSize(QtCore.QSize(30, 30))
        self.btn_back.setFixedHeight(30)
        self.btn_back.setStyleSheet(resource.style_sheet('push_button_w_icon'))
        self.btn_back.hide()

        self.tb_welcome = QtWidgets.QLabel()
        self.tb_welcome.setText("""
			<p style="font-size:30px;font-weight: normal;">Welcome aboard!</p>""")

        self.tb_description = QtWidgets.QLabel()
        self.tb_description.setStyleSheet("""
		"font: 12px;font-weight: normal; color: #CFCFCF;
		""")

        # Input
        self.lbl_username = QtWidgets.QLabel("What's your full name?")

        self.le_username = QtWidgets.QLineEdit()
        self.le_username.setMinimumHeight(40)
        regexp = QtCore.QRegExp("^[a-zA-Z0-9- ]+$", QtCore.Qt.CaseInsensitive)
        validator = QtGui.QRegExpValidator(regexp)
        self.le_username.setValidator(validator)

        self.hline_username = QtWidgets.QFrame()
        self.hline_username.setFixedHeight(1)
        self.hline_username.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                          QtWidgets.QSizePolicy.Fixed)
        self.hline_username.setStyleSheet("background-color: #636363;")

        self.btn_next = QtWidgets.QPushButton('Next')
        self.btn_next.setFixedWidth(100)
        self.btn_next.setStyleSheet('''
			QPushButton{
				Background:#2e7a78;
				height: 30px;
				font: 12px "Roboto-Thin"
			}
			QPushButton:hover{
				Background: #369593;
			}
			QPushButton:hover:pressed{
				Background: #2e7a78;
			}
			QPushButton:pressed{
				Background:  #2a615f;
			}
			QPushButton:disabled{
				Background: #3b3b3b;
			}''')
        self.btn_next.setFixedSize(100, 40)
        self.btn_next.setEnabled(False)

        # self.lbl_disclaimer = QtWidgets.QTextBrowser()
        # self.lbl_disclaimer.setReadOnly(True)
        # self.lbl_disclaimer.setText('Armada Pipeline does not store passwords or account data at this time. Your acocunt is stored locally and only used to add another degree of flexibility project')
        # self.lbl_disclaimer.setMinimumSize(100, 50)

        # Layout --------------------------------------------
        btn_back_layout = QtWidgets.QVBoxLayout()
        btn_back_layout.addWidget(self.btn_back)
        btn_back_layout.setAlignment(QtCore.Qt.AlignTop)
        btn_back_layout.setContentsMargins(0, 0, 0, 0)
        btn_back_layout.setSpacing(0)

        description_layout = QtWidgets.QVBoxLayout()
        description_layout.addWidget(self.tb_welcome)
        description_layout.addWidget(self.tb_description)
        description_layout.setAlignment(QtCore.Qt.AlignTop)
        description_layout.setContentsMargins(0, 0, 0, 0)
        description_layout.setSpacing(30)

        input_layout = QtWidgets.QVBoxLayout()
        input_layout.addWidget(self.lbl_username)
        input_layout.addSpacing(10)
        input_layout.addWidget(self.le_username)
        input_layout.addWidget(self.hline_username)
        input_layout.setAlignment(QtCore.Qt.AlignTop)
        input_layout.setContentsMargins(0, 0, 0, 0)
        input_layout.setSpacing(0)

        btn_layout = QtWidgets.QVBoxLayout()
        btn_layout.addWidget(self.btn_next)
        btn_layout.setAlignment(QtCore.Qt.AlignTop)
        btn_layout.setContentsMargins(0, 0, 0, 0)
        btn_layout.setSpacing(0)

        contents_layout = QtWidgets.QVBoxLayout()
        contents_layout.addLayout(description_layout)
        contents_layout.addLayout(input_layout)
        contents_layout.addLayout(btn_layout)
        contents_layout.addStretch()
        contents_layout.setAlignment(QtCore.Qt.AlignTop)
        contents_layout.setContentsMargins(0, 0, 0, 0)
        contents_layout.setSpacing(50)

        self.main_layout = QtWidgets.QHBoxLayout()
        self.main_layout.addLayout(btn_back_layout)
        self.main_layout.addLayout(contents_layout)
        self.main_layout.setContentsMargins(60, 20, 60, 20)
        self.main_layout.setSpacing(10)

        self.setLayout(self.main_layout)

        # Connections -----------------------------------
        self.le_username.textChanged.connect(self.check_le_state)
Beispiel #7
0
	def __init__(self, parent=None):
		"""
		Args:
			flow: What part of setup is the user entering into?
		"""
		super(ExampleWidget, self).__init__(parent)

		self.logger = logging.getLogger('menu.' + self.__class__.__name__)
		self.logger.info('Workplace creation starting...')
		self.setObjectName('launcher_{0}'.format(self.__class__.__name__))

		self.parent = parent
		self.armada_root_path = definitions.ROOT_PATH

		# self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
		self.installEventFilter(self)
		self.setStyleSheet(resource.style_sheet('setup'))
		self.sizeHint()

		# GUI ----------------------------------
		self.user_avatar = label_image.LabelImage('mike.bourbeau', size=30)  # name='mike_photo')
		self.user_avatar.setObjectName('CurrentUser')

		self.lbl_workspace = QtWidgets.QLabel('Knufflebeast')
		self.lbl_workspace.setStyleSheet("font:12pt;font-weight:bold;")

		self.lbl_user_name = QtWidgets.QLabel('Mike Bourbeau')
		self.lbl_user_name.setStyleSheet("font:10pt 'Roboto-Thin'; color: #949494;")

		# Layout --------------------------------------------
		btn_back_layout = QtWidgets.QVBoxLayout()
		btn_back_layout.addWidget(self.btn_back)
		btn_back_layout.setAlignment(QtCore.Qt.AlignTop)
		btn_back_layout.setContentsMargins(0, 0, 0, 0)
		btn_back_layout.setSpacing(0)

		description_layout = QtWidgets.QVBoxLayout()
		description_layout.addWidget(self.tb_welcome)
		description_layout.addWidget(self.tb_description)
		description_layout.setAlignment(QtCore.Qt.AlignTop)
		description_layout.setContentsMargins(0, 0, 0, 0)
		description_layout.setSpacing(30)

		input_layout = QtWidgets.QVBoxLayout()
		input_layout.addWidget(self.lbl_username)
		input_layout.addSpacing(10)
		input_layout.addWidget(self.le_username)
		input_layout.addWidget(self.hline_username)
		input_layout.setAlignment(QtCore.Qt.AlignTop)
		input_layout.setContentsMargins(0, 0, 0, 0)
		input_layout.setSpacing(0)

		btn_layout = QtWidgets.QVBoxLayout()
		btn_layout.addWidget(self.btn_next)
		btn_layout.setAlignment(QtCore.Qt.AlignTop)
		btn_layout.setContentsMargins(0, 0, 0, 0)
		btn_layout.setSpacing(0)

		contents_layout = QtWidgets.QVBoxLayout()
		contents_layout.addLayout(description_layout)
		contents_layout.addLayout(input_layout)
		contents_layout.addLayout(btn_layout)
		contents_layout.addStretch()
		contents_layout.setAlignment(QtCore.Qt.AlignTop)
		contents_layout.setContentsMargins(0, 0, 0, 0)
		contents_layout.setSpacing(50)

		self.main_layout = QtWidgets.QHBoxLayout()
		self.main_layout.addLayout(btn_back_layout)
		self.main_layout.addLayout(contents_layout)
		self.main_layout.setContentsMargins(60, 20, 60, 20)
		self.main_layout.setSpacing(10)

		self.setLayout(self.main_layout)

		# Connections -----------------------------------
		self.btn_next.clicked.connect(self._on_next)
		self.le_username.textChanged.connect(self.check_le_state)
	def __init__(self, setup=FULL):
		"""
		Args:
			setup: What part of setup is the user entering into?
		"""
		super(ArmadaInstaller, self).__init__()

		self.logger = logging.getLogger('menu.' + self.__class__.__name__)
		self.logger.info('Setup starting...')

		self.setup = setup
		self.setObjectName('armada_Installer')
		self.armada_root_path = definitions.ROOT_PATH

		# self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
		self.setWindowTitle('Armada Pipeline Installer')
		self.setWindowIcon(resource.icon('armada_logo', 'png'))
		self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
		self.installEventFilter(self)
		self.setStyleSheet(resource.style_sheet('setup'))
		self.setFixedSize(1000, 500)
		self.sizeHint()

		# GUI ------------------------------
		pixmap_banner = resource.pixmap(name='banner_setup', scope='help')
		self.lbl_banner = QtWidgets.QLabel()
		self.lbl_banner.setPixmap(pixmap_banner)

		self.cb_style_sheet = """
		QCheckBox::indicator:checked:disabled {{
			image: url({0}/resources/icon/checkbox_unchecked.svg);
			background: #29dff7;
		}}
		QCheckBox::indicator:unchecked:disabled{{
			image: url({0}/resources/icon/checkbox_unchecked.svg);
		}}
		""".format(self.armada_root_path)

		self.cb_s0_install = QtWidgets.QCheckBox('Install Armada Pipeline')
		self.cb_s0_install.setStyleSheet(self.cb_style_sheet)
		self.cb_s0_install.setEnabled(False)

		self.cb_s1_download = QtWidgets.QCheckBox('Installing')
		self.cb_s1_download.setStyleSheet(self.cb_style_sheet)
		self.cb_s1_download.setEnabled(False)

		self.cb_s2_complete = QtWidgets.QCheckBox('Installation Complete')
		self.cb_s2_complete.setStyleSheet(self.cb_style_sheet)
		self.cb_s2_complete.setEnabled(False)

		self.lbl_title = QtWidgets.QLabel("Mount Point Setup")
		# self.lbl_title.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
		# self.lbl_title.setMinimumHeight(400)
		self.lbl_title.setStyleSheet("""
		QLabel {
			font-size: 30px;
			font-family: Roboto;
			color: #FFFFFF;
		}""")

		# Mount point setup
		self.lbl_install_dir = QtWidgets.QLabel()
		self.lbl_install_dir.setText("Install to:")
		self.lbl_install_dir.setStyleSheet(resource.style_sheet('setup'))

		self.le_install_dir = QtWidgets.QLineEdit()
		# Path defaults

		if platform.system().lower() in ['windows']:
			# install_dir = os.getenv('programdata').replace('\\', '/')
			# install_dir = str(Path.home()).replace('\\', '/')
			install_dir = "C:/Program Files"
		elif platform.system().lower() in ['darwin']:
			install_dir = "/Applications"
		else:
			raise
		self.le_install_dir.setText(install_dir)
		self.le_install_dir.setTextMargins(10, 5, 10, 5)

		self.lbl_armada_ver = QtWidgets.QLabel()
		self.lbl_armada_ver.setText("Armada Pipeline version:")
		self.lbl_armada_ver.setStyleSheet(resource.style_sheet('setup'))

		releases_url = 'https://api.github.com/repos/Armada-Pipeline/armada-pipeline/releases'
		# header = {'Authorization': 'token ' + cred.token}
		response = requests.get(releases_url)

		json_data = json.loads(response.content)

		self.armada_versions = []
		for release in json_data:
			if isinstance(release, str):
				# self.armada_versions.append('v2020.09.02-beta')
				self.armada_versions.append('v2020.09.15-beta')
				break
			elif release['target_commitish'] == 'master' and release['prerelease'] is False:
				release_name = release['tag_name']
				if release_name.startswith("v"):
					self.armada_versions.append(release_name[1:])
				else:
					self.armada_versions.append(release_name)

		self.cb_version_numbers = VersionsComboBox(self)
		self.cb_version_numbers.addItems(self.armada_versions)
		self.cb_version_numbers.setMinimumHeight(30)
		self.cb_version_numbers.setStyleSheet(resource.style_sheet('setup'))
		self.cb_version_numbers.setView(QtWidgets.QListView())
		self.cb_version_numbers.view().window().setWindowFlags(QtCore.Qt.Popup | QtCore.Qt.FramelessWindowHint | QtCore.Qt.NoDropShadowWindowHint );

		self.lbl_full_path = QtWidgets.QLabel()
		self.lbl_full_path.setText("Full path:")
		self.lbl_full_path.setStyleSheet(resource.style_sheet('setup'))
		self.le_full_path = QtWidgets.QLabel()
		serifFont = QtGui.QFont("Roboto", 10, QtGui.QFont.StyleItalic)
		self.le_full_path.setFont(serifFont)
		# self.le_full_path.setText('{0}/Armada Pipeline/armada_pipeline_{1}_win10'.format(self.le_install_dir.text(), self.armada_version))
		self.le_full_path.setText('{0}/Armada Pipeline/'.format(self.le_install_dir.text()))
		self.le_full_path.setWordWrap(True)

		self.btn_install_browse = QtWidgets.QPushButton("Browse")
		self.btn_install_browse.setMinimumWidth(100)

		self.task_description = QtWidgets.QLabel()

		self.progress_bar = QtWidgets.QProgressBar()
		self.progress_bar.setMinimum(0)
		self.progress_bar.setMaximum(100)
		self.progress_bar.setAlignment(QtCore.Qt.AlignCenter)

		self.btn_left = QtWidgets.QPushButton("Cancel")
		btn_left_retain = self.btn_left.sizePolicy()
		btn_left_retain.setRetainSizeWhenHidden(True)
		self.btn_left.setSizePolicy(btn_left_retain)
		self.btn_left.setStyleSheet("""
			QPushButton{			
				background-color:#636363;
				height: 30px;			
				}
				QPushButton:hover{
					background: #369593;
				}
				QPushButton:hover:pressed{
					background: #2e7a78;
				}
				QPushButton:pressed{
					background:  #2a615f;
				}
				QPushButton:disabled{
					background: #3b3b3b;
				}
			""")
		self.btn_right = QtWidgets.QPushButton("Install")
		self.btn_right.setStyleSheet("""
			QPushButton{			
				background-color:#636363;
				height: 30px;
				border-style: solid;
				border-width: 3px;
				border-color: #369593;

				}
				QPushButton:hover{
					background: #369593;
				}
				QPushButton:hover:pressed{
					background: #2e7a78;
					border-style: solid;
					border-width: 3px;
					border-color: #2e7a78;
				}
				QPushButton:pressed{
					background:  #2a615f;
				}
				QPushButton:disabled{
					background: #3b3b3b;
					border-style: solid;
					border-width: 0px;
					border-color: #4abdbb;
					border-radius: 0px;
				}
		""")
		self.btn_right.setDisabled(True)

		self.lbl_description = QtWidgets.QTextBrowser()
		self.lbl_description.setReadOnly(True)
		self.lbl_description.setOpenExternalLinks(True)
		self.lbl_description.setStyleSheet("""
		QTextEdit {
			background-color: #262626;
			color: #FFFFFF;
			font: 14px "Roboto-thin";
			border: 0px;
		}""")

		# State machine ------------------
		self.state_machine = QtCore.QStateMachine()
		self.s0_install = QtCore.QState()
		self.s1_download = QtCore.QState()
		self.s2_complete = QtCore.QState()

		# Entry point for setup
		# Transitions
		self.trans_s0_s1 = self.s0_install.addTransition(self.btn_right.clicked, self.s1_download)
		self.trans_s1_s2 = self.s1_download.addTransition(self.btn_right.clicked, self.s2_complete)

		# Add states
		self.state_machine.addState(self.s0_install)
		self.state_machine.addState(self.s1_download)
		self.state_machine.addState(self.s2_complete)
		self.state_machine.setInitialState(self.s0_install)

		# Connections
		self.s0_install.entered.connect(self.on_s0_install_entered)
		self.s1_download.entered.connect(self.on_install_pressed)
		self.s1_download.entered.connect(self.on_s1_download_entered)
		self.s2_complete.entered.connect(self.on_s2_complete_entered)

		# Properties
		self.s0_install.assignProperty(self.btn_left, "text", "Cancel")
		self.s0_install.assignProperty(self.btn_right, "text", "Install")
		self.s1_download.assignProperty(self.btn_right, "text", "Next")
		self.s2_complete.assignProperty(self.btn_right, "text", "Set Sail!")

		self.state_machine.start()

		# Layout ---------------------------
		self.steps_layout = QtWidgets.QVBoxLayout()
		self.steps_layout.addWidget(self.lbl_banner, 0, QtCore.Qt.AlignCenter | QtCore.Qt.AlignTop)
		self.steps_layout.addWidget(self.cb_s0_install, 0, QtCore.Qt.AlignCenter)
		self.steps_layout.addWidget(self.cb_s1_download, 0, QtCore.Qt.AlignCenter)
		self.steps_layout.addWidget(self.cb_s2_complete, 0, QtCore.Qt.AlignCenter)
		self.steps_layout.setContentsMargins(30, 30, 30, 100)

		self.title_layout = QtWidgets.QHBoxLayout()
		self.title_layout.addWidget(self.lbl_title)
		# self.title_layout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
		self.title_layout.setAlignment(QtCore.Qt.AlignCenter)
		self.title_layout.setContentsMargins(20, 20, 20, 20)

		self.armada_version_layout = QtWidgets.QHBoxLayout()
		self.armada_version_layout.addWidget(self.lbl_armada_ver, 0, QtCore.Qt.AlignLeft)
		self.armada_version_layout.addWidget(self.cb_version_numbers, 1, QtCore.Qt.AlignLeft)
		self.armada_version_layout.setContentsMargins(0, 0, 0, 20)

		# Mount point layout
		self.install_dir_layout = QtWidgets.QHBoxLayout()
		self.install_dir_layout.addWidget(self.lbl_install_dir, 0, QtCore.Qt.AlignLeft)
		self.install_dir_layout.addWidget(self.le_install_dir, 1)
		self.install_dir_layout.addWidget(self.btn_install_browse, 0, QtCore.Qt.AlignRight)
		self.install_dir_layout.setAlignment(QtCore.Qt.AlignLeft)

		self.full_path_layout = QtWidgets.QHBoxLayout()
		self.full_path_layout.addWidget(self.lbl_full_path, 0, QtCore.Qt.AlignLeft)
		self.full_path_layout.addWidget(self.le_full_path, 1)
		self.full_path_layout.setContentsMargins(0, 20, 0, 20)

		# Structure layout
		self.description_layout = QtWidgets.QHBoxLayout()
		self.description_layout.addWidget(self.lbl_description, 1, QtCore.Qt.AlignTop)
		self.description_layout.setContentsMargins(0, 0, 0, 0)

		self.button_layout = QtWidgets.QHBoxLayout()
		self.button_layout.addWidget(self.btn_left)
		self.button_layout.addWidget(self.btn_right)
		self.button_layout.setAlignment(QtCore.Qt.AlignBottom)
		self.button_layout.setContentsMargins(20, 20, 20, 20)

		self.info_layout = QtWidgets.QVBoxLayout()
		self.info_layout.addLayout(self.armada_version_layout)
		self.info_layout.addLayout(self.description_layout)
		self.info_layout.addLayout(self.install_dir_layout)
		self.info_layout.addLayout(self.full_path_layout)
		self.info_layout.setContentsMargins(30, 30, 30, 30)

		self.user_layout = QtWidgets.QVBoxLayout()
		self.user_layout.addLayout(self.title_layout)
		self.user_layout.addLayout(self.info_layout)
		self.user_layout.addWidget(self.task_description)
		self.user_layout.addWidget(self.progress_bar)
		self.user_layout.addLayout(self.button_layout, QtCore.Qt.AlignBottom)

		self.main_layout = QtWidgets.QHBoxLayout()
		self.main_layout.addLayout(self.steps_layout)
		self.main_layout.addLayout(self.user_layout)

		self.setLayout(self.main_layout)

		# Connections
		self.btn_install_browse.clicked.connect(self.on_browse_pressed)
		self.le_install_dir.textChanged.connect(self.on_le_mount_text_changed)

		self.esc_pressed.connect(self.on_cancel_pressed)

		# Wait for user input
		self.exec_()
Beispiel #9
0
    def __init__(self, parent=None):
        """
		Args:
			flow: What part of setup is the user entering into?
		"""
        super(CreateStructureWorkflow, self).__init__(parent)

        self.logger = logging.getLogger('menu.' + self.__class__.__name__)
        self.logger.info('Workplace creation starting...')
        self.setObjectName('launcher_{0}'.format(self.__class__.__name__))

        self.parent = parent
        self.armada_root_path = definitions.ROOT_PATH

        # self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.installEventFilter(self)
        self.setStyleSheet(resource.style_sheet('setup'))
        self.sizeHint()

        # GUI ----------------------------------
        self.btn_back = QtWidgets.QPushButton()
        self.btn_back.setIcon(resource.color_svg('arrow_left', 128, '#9E9E9E'))
        self.btn_back.setIconSize(QtCore.QSize(30, 30))
        self.btn_back.setFixedHeight(30)
        self.btn_back.setStyleSheet(resource.style_sheet('push_button_w_icon'))

        self.tb_welcome = QtWidgets.QLabel()
        self.tb_welcome.setText("""
			<p style="font-size:30px;font-weight: normal;">How should we organize this project?</p>"""
                                )
        self.tb_welcome.setWordWrap(True)

        self.tb_description = QtWidgets.QLabel()
        self.tb_description.setStyleSheet("""
			background-color: transparent;
			font: 12px;
			font-weight: normal""")
        self.tb_description.setText("""
			<p>Each project utilizes a set of rules called a <b>structure</b> to enforce folder/file locations and naming conventions.
			<p>Once configured a structure automatically makes sure everyone adheres to the ruleset so you can focus on what you do best: Makin art!</p>"""
                                    )
        self.tb_description.setWordWrap(True)

        # Input
        self.lbl_structure_workflow = QtWidgets.QLabel(
            "Choose a structure workflow")

        self.lw_items = QtWidgets.QListWidget()
        self.lw_items.setViewMode(QtWidgets.QListView.IconMode)
        # self.lw_items.setMaximumHeight(50)
        # self.lw_items.setResizeMode(QtWidgets.QListView.Fixed)
        self.lw_items.setUniformItemSizes(True)
        self.lw_items.setSizeAdjustPolicy(QtWidgets.QListWidget.AdjustIgnored)
        self.lw_items.setMovement(self.lw_items.Static)
        self.lw_items.setSizeAdjustPolicy(
            QtWidgets.QAbstractScrollArea.AdjustToContents)
        self.lw_items.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                    QtWidgets.QSizePolicy.Expanding)
        self.lw_items.setFlow(QtWidgets.QListView.LeftToRight)
        # self.lw_items.setSpacing(5)
        self.lw_items.setMinimumHeight(100)
        self.lw_items.setStyleSheet("""
				QListView{
					show-decoration-selected: 0;
					background: #262626;
					color:rgb(218,218,218) ;
					font:12px "Roboto-Thin";
					border: none;
					height: 200px;
					outline: 0;
					padding-left: 10;
					padding-right: 10;
				}
				""")

        # Structure workflow options
        builtin_icon = resource.color_svg('folder_folder', 1024, '#F9D085')
        lw_item = QtWidgets.QListWidgetItem(builtin_icon, 'Built In Structure')
        lw_item.setSizeHint(self.lw_items.sizeHint())
        self.lw_items.addItem(lw_item)

        custom_icon = resource.color_svg('structure_create', 1024, '#7D7D7D')
        lw_item = QtWidgets.QListWidgetItem(custom_icon, 'Custom Structure')
        lw_item.setSizeHint(self.lw_items.sizeHint())
        # lw_item.setFlags(QtCore.Qt.ItemIsSelectable)  # TODO: enable when custom structures workflow is figured out
        self.lw_items.addItem(lw_item)

        self.lbl_structure_description = QtWidgets.QLabel()
        self.lbl_structure_description.setWordWrap(True)
        self.lbl_structure_description.setStyleSheet("""
			background-color: transparent;
			font: 12px;
			font-weight: normal""")

        self.hline_username = QtWidgets.QFrame()
        self.hline_username.setFixedHeight(1)
        self.hline_username.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                          QtWidgets.QSizePolicy.Fixed)
        self.hline_username.setStyleSheet("background-color: #636363;")

        self.btn_next = QtWidgets.QPushButton('Next')
        self.btn_next.setFixedWidth(100)
        self.btn_next.setStyleSheet('''
			QPushButton{
				Background:#2e7a78;
				height: 30px;
				font: 12px "Roboto-Thin"
			}
			QPushButton:hover{
				Background: #369593;
			}
			QPushButton:hover:pressed{
				Background: #2e7a78;
			}
			QPushButton:pressed{
				Background:  #2a615f;
			}
			QPushButton:disabled{
				Background: #3b3b3b;
			}''')
        self.btn_next.setFixedSize(100, 40)
        self.btn_next.setEnabled(False)

        # self.lbl_disclaimer = QtWidgets.QTextBrowser()
        # self.lbl_disclaimer.setReadOnly(True)
        # self.lbl_disclaimer.setText('Armada Pipeline does not store passwords or account data at this time. Your acocunt is stored locally and only used to add another degree of flexibility project')
        # self.lbl_disclaimer.setMinimumSize(100, 50)

        # Layout --------------------------------------------
        btn_back_layout = QtWidgets.QVBoxLayout()
        btn_back_layout.addWidget(self.btn_back)
        btn_back_layout.setAlignment(QtCore.Qt.AlignTop)
        btn_back_layout.setContentsMargins(0, 0, 0, 0)
        btn_back_layout.setSpacing(0)

        description_layout = QtWidgets.QVBoxLayout()
        description_layout.addWidget(self.tb_welcome)
        description_layout.addWidget(self.tb_description)
        description_layout.setAlignment(QtCore.Qt.AlignTop)
        description_layout.setContentsMargins(0, 0, 0, 0)
        description_layout.setSpacing(30)

        input_layout = QtWidgets.QVBoxLayout()
        input_layout.addWidget(self.lbl_structure_workflow)
        input_layout.addWidget(self.lw_items)
        input_layout.addWidget(self.lbl_structure_description)
        input_layout.setAlignment(QtCore.Qt.AlignTop)
        input_layout.setContentsMargins(0, 0, 0, 0)
        input_layout.setSpacing(10)

        btn_layout = QtWidgets.QVBoxLayout()
        btn_layout.addWidget(self.btn_next)
        btn_layout.setAlignment(QtCore.Qt.AlignTop)
        btn_layout.setContentsMargins(0, 0, 0, 0)
        btn_layout.setSpacing(0)

        contents_layout = QtWidgets.QVBoxLayout()
        contents_layout.addLayout(description_layout)
        contents_layout.addLayout(input_layout)
        contents_layout.addLayout(btn_layout)
        contents_layout.addStretch()
        contents_layout.setAlignment(QtCore.Qt.AlignTop)
        contents_layout.setContentsMargins(0, 0, 0, 0)
        contents_layout.setSpacing(50)

        self.main_layout = QtWidgets.QHBoxLayout()
        self.main_layout.addLayout(btn_back_layout)
        self.main_layout.addLayout(contents_layout)
        self.main_layout.setContentsMargins(20, 20, 60, 20)
        self.main_layout.setSpacing(10)

        self.setLayout(self.main_layout)

        # Connections -----------------------------------
        # self.btn_next.clicked.connect(self._on_next)
        self.lw_items.itemClicked.connect(self._lw_sel_changed)
Beispiel #10
0
	def __init__(self, setup=FULL):
		"""
		Args:
			setup: What part of setup is the user entering into?
		"""
		super(ArmadaUninstaller, self).__init__()

		self.logger = logging.getLogger('menu.' + self.__class__.__name__)
		self.logger.info('Setup starting...')

		self.setup = setup
		self.setObjectName('armada_Installer')
		self.armada_root_path = definitions.ROOT_PATH

		# self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
		self.setWindowTitle('Armada Pipeline Uninstaller')
		self.setWindowIcon(resource.icon('armada_logo', 'png'))
		self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
		self.installEventFilter(self)
		self.setStyleSheet(resource.style_sheet('setup'))
		self.setFixedSize(1000, 500)
		self.sizeHint()

		# GUI ------------------------------
		pixmap_banner = resource.pixmap(name='banner_setup', scope='help')
		self.lbl_banner = QtWidgets.QLabel()
		self.lbl_banner.setPixmap(pixmap_banner)

		self.cb_style_sheet = """
		QCheckBox::indicator:checked:disabled {{
			image: url({0}/resources/icon/checkbox_unchecked.svg);
			background: #29dff7;
		}}
		QCheckBox::indicator:unchecked:disabled{{
			image: url({0}/resources/icon/checkbox_unchecked.svg);
		}}
		""".format(self.armada_root_path)

		self.cb_s0_install = QtWidgets.QCheckBox('Uninstall Armada Pipeline')
		self.cb_s0_install.setStyleSheet(self.cb_style_sheet)
		self.cb_s0_install.setEnabled(False)

		self.cb_s1_download = QtWidgets.QCheckBox('Uninstalling')
		self.cb_s1_download.setStyleSheet(self.cb_style_sheet)
		self.cb_s1_download.setEnabled(False)

		self.cb_s2_complete = QtWidgets.QCheckBox('Uninstallation Complete')
		self.cb_s2_complete.setStyleSheet(self.cb_style_sheet)
		self.cb_s2_complete.setEnabled(False)

		self.cb_delete_local_settings = QtWidgets.QCheckBox("Remove Armada's local settings?")

		self.lbl_title = QtWidgets.QLabel()
		# self.lbl_title.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
		# self.lbl_title.setMinimumHeight(400)
		self.lbl_title.setStyleSheet("""
		QLabel {
			font-size: 30px;
			font-family: Roboto;
			color: #FFFFFF;
		}""")

		self.lbl_full_path = QtWidgets.QLabel()
		self.lbl_full_path.setText("Full path:")
		self.lbl_full_path.setStyleSheet(resource.style_sheet('setup'))
		self.le_full_path = QtWidgets.QLabel()
		serifFont = QtGui.QFont("Roboto", 10, QtGui.QFont.StyleItalic)
		self.le_full_path.setFont(serifFont)
		# self.le_full_path.setText('{0}/Armada Pipeline/armada_pipeline_{1}_win10'.format(self.le_install_dir.text(), self.armada_version))

		self.le_full_path.setWordWrap(True)

		self.btn_install_browse = QtWidgets.QPushButton("Browse")
		self.btn_install_browse.setMinimumWidth(100)

		self.task_description = QtWidgets.QLabel()

		self.progress_bar = QtWidgets.QProgressBar()
		self.progress_bar.setMinimum(0)
		self.progress_bar.setMaximum(100)
		self.progress_bar.setAlignment(QtCore.Qt.AlignCenter)

		self.btn_left = QtWidgets.QPushButton("Cancel")
		btn_left_retain = self.btn_left.sizePolicy()
		btn_left_retain.setRetainSizeWhenHidden(True)
		self.btn_left.setSizePolicy(btn_left_retain)
		self.btn_left.setStyleSheet("""
			QPushButton{			
				background-color:#636363;
				height: 30px;			
				}
				QPushButton:hover{
					background: #369593;
				}
				QPushButton:hover:pressed{
					background: #2e7a78;
				}
				QPushButton:pressed{
					background:  #2a615f;
				}
				QPushButton:disabled{
					background: #3b3b3b;
				}
			""")
		self.btn_right = QtWidgets.QPushButton("Install")
		self.btn_right.setStyleSheet("""
			QPushButton{			
				background-color:#636363;
				height: 30px;
				border-style: solid;
				border-width: 3px;
				border-color: #369593;

				}
				QPushButton:hover{
					background: #369593;
				}
				QPushButton:hover:pressed{
					background: #2e7a78;
					border-style: solid;
					border-width: 3px;
					border-color: #2e7a78;
				}
				QPushButton:pressed{
					background:  #2a615f;
				}
				QPushButton:disabled{
					background: #3b3b3b;
					border-style: solid;
					border-width: 0px;
					border-color: #4abdbb;
					border-radius: 0px;
				}
		""")
		self.btn_right.setDisabled(True)

		self.lbl_description = QtWidgets.QTextBrowser()
		self.lbl_description.setReadOnly(True)
		self.lbl_description.setOpenExternalLinks(True)
		self.lbl_description.setStyleSheet("""
		QTextEdit {
			background-color: #262626;
			color: #FFFFFF;
			font: 14px "Roboto-thin";
			border: 0px;
			
		}""")

		# State machine ------------------
		self.state_machine = QtCore.QStateMachine()
		self.s0_install = QtCore.QState()
		self.s1_download = QtCore.QState()
		self.s2_complete = QtCore.QState()

		# Entry point for setup
		# Transitions
		self.trans_s0_s1 = self.s0_install.addTransition(self.btn_right.clicked, self.s1_download)
		self.trans_s1_s2 = self.s1_download.addTransition(self.btn_right.clicked, self.s2_complete)

		# Add states
		self.state_machine.addState(self.s0_install)
		self.state_machine.addState(self.s1_download)
		self.state_machine.addState(self.s2_complete)
		self.state_machine.setInitialState(self.s0_install)

		# Connections
		self.s0_install.entered.connect(self.on_s0_install_entered)
		self.s1_download.entered.connect(self.on_uninstall_pressed)
		self.s1_download.entered.connect(self.on_s1_download_entered)
		self.s2_complete.entered.connect(self.on_s2_complete_entered)

		# Properties
		self.s0_install.assignProperty(self.btn_left, "text", "Cancel")
		self.s0_install.assignProperty(self.btn_right, "text", "Install")
		self.s1_download.assignProperty(self.btn_right, "text", "Next")
		self.s2_complete.assignProperty(self.btn_right, "text", "Set Sail!")

		self.state_machine.start()

		# Layout ---------------------------
		self.steps_layout = QtWidgets.QVBoxLayout()
		self.steps_layout.addWidget(self.lbl_banner, 0, QtCore.Qt.AlignCenter | QtCore.Qt.AlignTop)
		self.steps_layout.addWidget(self.cb_s0_install, 0, QtCore.Qt.AlignCenter)
		self.steps_layout.addWidget(self.cb_s1_download, 0, QtCore.Qt.AlignCenter)
		self.steps_layout.addWidget(self.cb_s2_complete, 0, QtCore.Qt.AlignCenter)
		self.steps_layout.setContentsMargins(30, 30, 30, 100)

		self.title_layout = QtWidgets.QHBoxLayout()
		self.title_layout.addWidget(self.lbl_title)
		# self.title_layout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
		self.title_layout.setAlignment(QtCore.Qt.AlignCenter)
		self.title_layout.setContentsMargins(20, 20, 20, 20)

		self.full_path_layout = QtWidgets.QHBoxLayout()
		self.full_path_layout.addWidget(self.cb_delete_local_settings, 0, QtCore.Qt.AlignLeft)
		self.full_path_layout.addWidget(self.le_full_path, 1)
		self.full_path_layout.setContentsMargins(0, 20, 0, 20)

		# Structure layout
		self.description_layout = QtWidgets.QHBoxLayout()
		self.description_layout.addWidget(self.lbl_description, 1, QtCore.Qt.AlignTop)
		self.description_layout.setContentsMargins(0, 0, 0, 0)

		self.button_layout = QtWidgets.QHBoxLayout()
		self.button_layout.addWidget(self.btn_left)
		self.button_layout.addWidget(self.btn_right)
		self.button_layout.setAlignment(QtCore.Qt.AlignBottom)
		self.button_layout.setContentsMargins(20, 20, 20, 20)

		self.info_layout = QtWidgets.QVBoxLayout()
		self.info_layout.addLayout(self.description_layout)
		self.info_layout.addLayout(self.full_path_layout)
		self.info_layout.setContentsMargins(30, 30, 30, 30)

		self.user_layout = QtWidgets.QVBoxLayout()
		self.user_layout.addLayout(self.title_layout)
		self.user_layout.addLayout(self.info_layout)
		self.user_layout.addWidget(self.task_description)
		self.user_layout.addWidget(self.progress_bar)
		self.user_layout.addLayout(self.button_layout, QtCore.Qt.AlignBottom)

		self.main_layout = QtWidgets.QHBoxLayout()
		self.main_layout.addLayout(self.steps_layout)
		self.main_layout.addLayout(self.user_layout)

		self.setLayout(self.main_layout)

		# Connections
		self.btn_install_browse.clicked.connect(self.on_browse_pressed)

		self.esc_pressed.connect(self.on_cancel_pressed)

		# Wait for user input
		self.exec_()