Beispiel #1
0
 def __init__(self):
     # Build GUI
     super(ActiveProjectView, self).__init__()
     self._layout = QtGui.QVBoxLayout(self)
     self._header_layout = QtGui.QHBoxLayout()
     self._header_layout.addWidget(QtGui.QLabel('Job Number:'))
     self.search_le = QtGui.QLineEdit()
     self.search_le.setFixedWidth(150)
     self._header_layout.addWidget(self.search_le)
     self._header_layout.addItem(Spacer(20, 0, ypolicy='fixed'))
     self.refresh_btn = ImageButton(Image.REFRESH,
                                    self._header_layout,
                                    tooltip='Refresh',
                                    flat=True)
     self.print_btn = ImageButton(Image.PRINT,
                                  self._header_layout,
                                  tooltip='Print',
                                  flat=True)
     self.table = ProjectTable()
     self.notes = NoteBox()
     self._layout.addLayout(self._header_layout)
     self._splitter = QtGui.QSplitter()
     self._splitter.setOrientation(QtCore.Qt.Vertical)
     self._splitter.addWidget(self.table)
     self._splitter.addWidget(self.notes)
     self._layout.addWidget(self._splitter)
Beispiel #2
0
 def __init__(self):
     # Build GUI
     super(WeekendSignUpView, self).__init__('Weekend Work')
     self.setFixedHeight(self._DOCK_FIXED_HEIGHT)
     # self.setMaximumWidth(self._DOCK_MAX_WIDTH)
     self._widget = QtGui.QWidget()
     self._layout = QtGui.QHBoxLayout(self._widget)
     self._layout.addWidget(QtGui.QLabel('Are you available?'))
     self.yes_btn = ImageButton(Image.AVAILABLE, self._layout)
     self.yes_btn.myheight = self._BTN_HEIGHT
     self.no_btn = ImageButton(Image.UNAVAILABLE, self._layout)
     self.no_btn.myheight = self._BTN_HEIGHT
     self.setWidget(self._widget)
Beispiel #3
0
 def __init__(self, parent, headers):
     self._parent = parent
     self._headers = headers
     super(DuelingListBoxView, self).__init__()
     self.source = ListBoxHeaderView(self, self._headers[0])
     self._btn_layout = QtGui.QVBoxLayout()
     self._btn_layout.addItem(Spacer())
     self.add_btn = ImageButton(Image.FORWARD, self._btn_layout)
     self.import_btn = ImageButton(Image.IMPORT_RIGHT,
                                   self._btn_layout,
                                   tooltip='Import')
     self.subtract_btn = ImageButton(Image.BACK, self._btn_layout)
     self.add_btn.mysquare = 30
     self.import_btn.mysquare = 30
     self.subtract_btn.mysquare = 30
     self._btn_layout.addItem(Spacer())
     self.addLayout(self._btn_layout)
     self.destination = ListBoxHeaderView(self, self._headers[1])
     self._parent.addLayout(self)
Beispiel #4
0
 def __init__(self, options):
     super(View, self).__init__()
     self._layout = set_layout(self, 'QHBoxLayout')
     self._options = ComboBox(options, self._layout)
     self.job_num_le = QtGui.QLineEdit()
     self._layout.addWidget(self.job_num_le)
     self.search_btn = ImageButton(os.path.join(APP_PATH, 'images',
                                                'search.png'),
                                   self._layout,
                                   tooltip='Search',
                                   flat=True)
Beispiel #5
0
    def __init__(self):
        super(JobFolderView, self).__init__()
        self._layout = QtGui.QVBoxLayout(self)

        # Shortcut-based widgets
        self._shortcuts = Workspace(self._layout, 'Shortcuts', 100,
                                    'QHBoxLayout')
        self.vault_btn = ImageButton(Image.VAULT, self._shortcuts.layout)
        self.p_folder_btn = ImageButton(Image.P_FOLDER, self._shortcuts.layout)
        self.rev_engr_btn = ImageButton(Image.REV_ENGR, self._shortcuts.layout)
        self.photo_btn = ImageButton(Image.CAMERA, self._shortcuts.layout)
        self.probes_btn = ImageButton(Image.EMAIL,
                                      self._shortcuts.layout,
                                      tooltip='Request Probe Locations')
        self.agree_btn = ImageButton(Image.AGREEMENT,
                                     self._shortcuts.layout,
                                     tooltip='User Agreement')

        # Set ImageButton sizes
        for i in range(self._shortcuts.layout.count()):
            item = self._shortcuts.layout.itemAt(i)
            item.widget().mysquare = self.BUTTON_SIZE

        # Project-based widgets
        self._projects = Workspace(self._layout, 'Projects', 1000)
        self._splitter = QtGui.QSplitter()
        self._splitter.setOrientation(QtCore.Qt.Vertical)
        self.table = ProjectTable()
        self.notes = NoteBox()
        self._splitter.addWidget(self.table)
        self._splitter.addWidget(self.notes)
        self._projects.layout.addWidget(self._splitter)
Beispiel #6
0
 def __init__(self, parent, label, btn_img):
     self._parent = parent
     self._label = label
     self._btn_img = btn_img
     super(InputListView, self).__init__()
     self.addWidget(QtGui.QLabel(self._label))
     self.input_le = QtGui.QLineEdit()
     self.addWidget(self.input_le)
     self.enter_btn = ImageButton(self._btn_img, self, flat=True)
     self.enter_btn.mysquare = 30
     self._parent.addLayout(self)
     self.listbox = ListBox()
     self._parent.addWidget(self.listbox)
Beispiel #7
0
 def __init__(self):
     # Build GUI
     super(PartLocatorView, self).__init__('Part Locator')
     self._widget = QtGui.QWidget()
     self._v_layout = QtGui.QVBoxLayout(self._widget)
     self._h_layout = QtGui.QHBoxLayout()
     self._search_lb = QtGui.QLabel('Job Number:')
     self._h_layout.addWidget(self._search_lb)
     self.search_le = QtGui.QLineEdit()
     self.search_le.setValidator(QtGui.QIntValidator())
     self.search_le.setMaxLength(6)
     self._h_layout.addWidget(self.search_le)
     self.search_btn = ImageButton(Image.SEARCH, self._h_layout, flat=True)
     self._v_layout.addLayout(self._h_layout)
     self.results = Table(['Bins', 'Pallets', 'Racks'])
     self.results.verticalHeader().setVisible(False)
     self._v_layout.addWidget(self.results)
     self.setWidget(self._widget)
Beispiel #8
0
	def __init__(self):
		# Build GUI
		super(AboutDialog, self).__init__('About', 'QFormLayout')
		self._intro = '' \
			'Nucleus is a Sulzer software application that aims to track, \n' \
			'schedule, and optimize the work performed by the CAD \n' \
			'Department at Sulzer RES La Porte. \n\n' \
			'Nucleus is developed and maintained by Brandon McCleary \n' \
			'with input from other Sulzer members. '
		self._icon_btn = ImageButton(
			Image.LOGO,
			response=self._on_click_contact,
			flat=True
		)
		self._icon_btn.myheight = 100
		self.layout.addRow(QtGui.QLabel(self._intro), self._icon_btn)
		self._outro = 'Questions or suggestions for future Nucleus versions?'
		self._contact_btn = GenericButton(
			'Contact',
			response=self._on_click_contact
		)
		self.layout.addRow(QtGui.QLabel(self._outro), self._contact_btn)
		self.setMaximumSize(self.width(), self.height())
Beispiel #9
0
    def _set_cell(self, col, row, date_var):
        """Set the ``Table`` cell value.

		Parameters
		----------
		col : int
			``Table`` column index.
			Every column index except 0 is related to the ``Job's`` project due 
			dates. See HEADERS for column index reference.

		row : int
			``Table`` row index.
			Each row index corresponds to a different job.

		date_var : int
			The number of project due dates that correspond to `col`. 

		"""
        # Use an ImageButton to distinguish 0 from other values.
        if date_var == 0:
            btn = ImageButton(Image.ZERO, flat=True)
            self.setCellWidget(row, col, btn)
        else:
            self.setItem(row, col, TableItem(str(date_var)))