Example #1
0
 def ok(self):
     global config
     self._tmp.save()
     config.read()
     cutoff_history.remove_list(self.cutoff_history_entries_for_deletion())
     cutoff_history.save()
     cutoff_presets.remove_list(self.cutoff_preset_entries_for_deletion())
     cutoff_presets.save()
     self.accept()
     for widget in QtWidgets.QApplication.topLevelWidgets():
         for gl_widget in widget.findChildren(GLWidget):
             gl_widget.update_needed = True
             QtWidgets.QApplication.postEvent(gl_widget, UpdateGLEvent())
Example #2
0
 def ok(self):
     global config
     self._tmp.save()
     config.read()
     cutoff_history.remove_list(self.cutoff_history_entries_for_deletion())
     cutoff_history.save()
     cutoff_presets.remove_list(self.cutoff_preset_entries_for_deletion())
     cutoff_presets.save()
     self.accept()
     for widget in QtWidgets.QApplication.topLevelWidgets():
         for gl_widget in widget.findChildren(GLWidget):
             gl_widget.update_needed = True
             QtWidgets.QApplication.postEvent(gl_widget, UpdateGLEvent())
Example #3
0
 def __update_cutoff_history(self):
     timestamp = datetime.datetime.now()
     user_cutoff_radii = self.radii_widget.cutoff_radii
     elements = self.__get_all_covalence_radii_by_element().keys()
     if not isinstance(user_cutoff_radii, collections.Iterable):
         user_cutoff_radii = dict((elem, user_cutoff_radii) for elem in elements)
     elements_by_frame = self.__get_elements_by_frame()
     new_history = []
     for filepath, frames in self.file_frame_dict.iteritems():
         filename = os.path.basename(filepath)
         file_elements = elements_by_frame[filepath]
         for frame in frames:
             elements = file_elements[frame]
             frame_cutoff_radii = dict((elem, user_cutoff_radii[elem]) for elem in elements)
             history_entry = HistoryEntry(filename, frame, timestamp, frame_cutoff_radii)
             new_history.append(history_entry)
     cutoff_history.extend(new_history)
     cutoff_history.save()
Example #4
0
 def __update_cutoff_history(self):
     timestamp = datetime.datetime.now()
     user_cutoff_radii = self.radii_widget.cutoff_radii
     elements = self.__get_all_covalence_radii_by_element().keys()
     if not isinstance(user_cutoff_radii, collections.Iterable):
         user_cutoff_radii = dict(
             (elem, user_cutoff_radii) for elem in elements)
     elements_by_frame = self.__get_elements_by_frame()
     new_history = []
     for filepath, frames in self.file_frame_dict.iteritems():
         filename = os.path.basename(filepath)
         file_elements = elements_by_frame[filepath]
         for frame in frames:
             elements = file_elements[frame]
             frame_cutoff_radii = dict(
                 (elem, user_cutoff_radii[elem]) for elem in elements)
             history_entry = HistoryEntry(filename, frame, timestamp,
                                          frame_cutoff_radii)
             new_history.append(history_entry)
     cutoff_history.extend(new_history)
     cutoff_history.save()
Example #5
0
 def accept(self):
     cutoff_history.remove_list(self.tw_cutoff.history_entries_for_deletion)
     cutoff_history.save()
     return super(CutoffHistoryDialog, self).accept()