24 from datetime
import datetime
25 from PyQt5
import QtCore, QtWidgets, QtGui
26 from .scene_selection_helper
import SelHelper
27 from .preset_list_model
import PresetListModel
28 from .preset_editor_widget
import PresetEditor
29 from .preset
import Preset
35 QtWidgets.QWidget.__init__(self, parent)
45 self.
list_view_list_view_.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
48 self.
add_actionadd_action.setIcon(QtGui.QIcon(PresetWidget.ICONS_DIR+
"add_icon.png"))
53 self.
add_button_add_button_.setIconSize(QtCore.QSize(20,20))
58 grid = QtWidgets.QGridLayout()
59 grid.setContentsMargins(0,5,0,0)
60 grid.addWidget(self.
list_view_list_view_,0,0,3,3)
64 self.
list_view_list_view_.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
71 self.setMinimumSize(250,200)
92 self.
edit_edit_.triggered.connect(self.
EditEdit)
98 if self.
list_model_list_model_.IsEditable(index.row()):
99 self.
context_menu_context_menu_.popup(QtWidgets.QCursor.pos())
105 preset =
Preset(datetime.now().isoformat(
' '))
108 if self.
list_model_list_model_.AddItem(preset, row,
True,
True):
110 self.
list_view_list_view_.setCurrentIndex(index)
114 if(self.
list_view_list_view_.currentIndex().isValid()):
115 ret = QtWidgets.QMessageBox.warning(self,
"Delete Preset",
117 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
118 if ret == QtWidgets.QMessageBox.Yes:
122 if(self.
list_view_list_view_.currentIndex().isValid()):
126 row = self.
list_view_list_view_.currentIndex().row()
128 self.
list_model_list_model_.AddItem(preset, row,
True,
True)
131 if(self.
list_view_list_view_.currentIndex().isValid()):
136 scene_selection = gui.SceneSelection.Instance()
137 preset=self.
list_model_list_model_.GetPreset(index)
138 for i
in range(0,scene_selection.GetActiveNodeCount()):
139 node = scene_selection.GetActiveNode(i)
148 self.setEnabled(
True)
149 if SelHelper().CheckAllFlags(SelHelper.NO_SELECTION):
150 self.setEnabled(
False)
153 if SelHelper().CheckNotFlags(SelHelper.HAS_ENTITY | SelHelper.IS_ONE_TYPE):
154 self.setEnabled(
False)
158 if(self.
list_view_list_view_.currentIndex().isValid()):
162 return self.
text_text_
graphical rendering of mol::EntityHandle entites
String DLLEXPORT_OST_BASE GetSharedDataPath()