def __handle_edit_issue_finish(self, ret):
        if ret:
            dlgcfg = self.edit_issue_dialog[1]
            
            mod_issue = self.editing_issue
            
            mod_issue.date_of_incident = dlgcfg.doiEdit.text()
            mod_issue.incident_desc = dlgcfg.incidentDescEdit.toPlainText()
            mod_issue.problems_desc = dlgcfg.problemsEdit.toPlainText()
            
            mod_issue.parts_ordered = dlgcfg.partsOrderedCheck.checkState() != 0
            mod_issue.parts_ordered_date = dlgcfg.partsOrderedDateEdit.text()
            mod_issue.parts_expected_date = dlgcfg.partsExpectedDateEdit.text()
            if dlgcfg.insuranceRadio.isChecked():
                mod_issue.insurance_or_warranty = 0
            elif dlgcfg.warrantyRadio.isChecked():
                mod_issue.insurance_or_warranty = 1
            else:
                mod_issue.insurance_or_warranty = 2
                
            mod_issue.resolved = dlgcfg.resolvedCheck.checkState() != 0
            mod_issue.fixed_desc = dlgcfg.fixedEdit.toPlainText()
            
            mod_issue.temp_tablet_assigned = dlgcfg.tempTabletCheck.checkState() != 0
            mod_issue.temp_tablet_pcsb = dlgcfg.tempTabletEdit.text()
            
            mod_issue.tablet_returned = dlgcfg.returnedToStudentCheck.checkState() != 0
            
            utils.list_add_replace(self.mod_issues, mod_issue)

            self.generate_issue_table_ui(self.get_issue_list())
            
        self.editing_issue = None
        self.edit_issue_dialog = None
Exemplo n.º 2
0
 def handle_update_tablet(self, dgi):
     tablet = BaseTablet.from_datagram(dgi)
     utils.list_add_replace(self.tablets, tablet)
         
     if self.tablet_table_generated:
         row = self.find_table_guid_row(self.ui.tabletView, tablet.guid)
         if row is not None:
             self.update_tablet_row_ui(row, tablet)
Exemplo n.º 3
0
 def handle_new_issue(self, dgi):
     num_issues = dgi.get_uint16()
     for i in range(num_issues):
         issue = Issue.from_datagram(dgi)
         utils.list_add_replace(self.issues, issue)
         
         tablets = [tablet for tablet in self.tablets if tablet.guid == issue.tablet_guid]
         tablet = tablets[0] if len(tablets) > 0 else None
         if tablet and self.tablet_table_generated:
             self.update_tablet_row_ui(self.find_table_guid_row(self.ui.tabletView, tablet.guid), tablet)
Exemplo n.º 4
0
 def handle_update_link(self, dgi):
     num_links = dgi.get_uint16()
     for i in range(num_links):
         link = StudentTabletLink.from_datagram(dgi)
         utils.list_add_replace(self.student_tablet_links, link)
         
         tablets = [tablet for tablet in self.tablets if tablet.guid == link.tablet_guid]
         tablet = tablets[0] if len(tablets) > 0 else None
         users = [user for user in self.students if user.guid == link.student_guid]
         user = users[0] if len(users) > 0 else None
         if tablet and self.tablet_table_generated:
             self.update_tablet_row_ui(self.find_table_guid_row(self.ui.tabletView, tablet.guid), tablet)
         if user and self.user_table_generated:
             self.update_student_row_ui(self.find_table_guid_row(self.ui.tabletView_2, user.guid), user)
Exemplo n.º 5
0
 def handle_new_issue_step(self, dgi):
     num_steps = dgi.get_uint16()
     for i in range(num_steps):
         step = IssueStep.from_datagram(dgi)
         utils.list_add_replace(self.issue_steps, step)
Exemplo n.º 6
0
    def update_student_row(self, i, dgi, student = None):
        if not student:
            student = Student.from_datagram(dgi)

        utils.list_add_replace(self.students, student)