Example #1
0
 def deleteAllRecordsTable(self):
     """ Reset All records from widget
     
     """
     try:
         records = self.fieldUserMapTable.rowCount()
         if records > 0:
             message = "{} rows reset, are you sure?".format(records)
             if showQuestiondialog(self, "Reset All Records",
                                   message) == QtWidgets.QMessageBox.Yes:
                 for rowPosition in range(
                         self.fieldUserMapTable.rowCount()):
                     combo = self.fieldUserMapTable.cellWidget(
                         rowPosition, 1)
                     combo.setCurrentText("None")
                 #while (self.fieldUserMapTable.rowCount() > 0):
                 #self.fieldUserMapTable.removeRow(0)
     except:
         self.planHeatDMM.resources.log.write_log(
             "ERROR",
             "FieldUserMapDialog - deleteAllRecordsTable Unexpected error:"
             + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
         showErrordialog(
             self.planHeatDMM.dlg,
             "FieldUserMapDialog - deleteAllRecordsTable Unexpected error:",
             str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
Example #2
0
 def refreshRecordsTable(self):
     """ Refresh all records from the last saving operation , or initial state """
     
     try:
             message = "Discard, not saved changes, are you sure?"
             if showQuestiondialog(self,"Discard Changes",message) == QtWidgets.QMessageBox.Yes:
                 #self.deleteAllRecordsTable(showMessageDialog=False)
                 while (self.buildUseMapTable.rowCount() > 0):
                     self.buildUseMapTable.removeRow(0)
                 self.addRecordsTable()
     except:
         self.planHeatDMM.resources.log.write_log("ERROR","BuildingUseMapDialog - refreshRecordsTable Unexpected error:" + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
         showErrordialog(self.planHeatDMM.dlg,"BuildingUseMapDialog - refreshRecordsTable Unexpected error:",str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
    def refreshRecordsTable(self):
        """ Refresh all records from the last saving operation , or initial state """

        try:
            message = "Discard, not saved changes, are you sure?"
            if showQuestiondialog(self, "Discard Changes",
                                  message) == QtWidgets.QMessageBox.Yes:
                while (self.retrofitScenarioTable.rowCount() > 0):
                    self.retrofitScenarioTable.removeRow(0)
                self.addRecordsTable()

        except:
            self.__log.write_log(
                "ERROR",
                "RetrofitScenarioWidget - refreshRecordsTable Unexpected error:"
                + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
            showErrordialog(
                self.planHeatDMM.dlg,
                "RetrofitScenarioWidget - refreshRecordsTable Unexpected error:",
                str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
    def deleteAllRecordsTable(self):
        """ Reset All records from widget
    
        """
        try:
            records = self.retrofitScenarioTable.rowCount()
            if records > 0:
                message = "{} rows reset, are you sure?".format(records)
                if showQuestiondialog(self, "Reset All Records",
                                      message) == QtWidgets.QMessageBox.Yes:
                    for rowPosition in range(
                            self.retrofitScenarioTable.rowCount()):
                        self.resetRow(rowPosition)

        except:
            self.__log.write_log(
                "ERROR",
                "RetrofitScenarioWidget - deleteAllRecordsTable Unexpected error:"
                + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
            showErrordialog(
                self.planHeatDMM.dlg,
                "RetrofitScenarioWidget - deleteAllRecordsTable Unexpected error:",
                str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))