Skip to content

Commit d1a468f

Browse files
committed
make material info message box
1 parent 2f2e21b commit d1a468f

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

openmc_plotter/main_window.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from PySide2.QtWidgets import (QApplication, QLabel, QSizePolicy, QMainWindow,
1111
QScrollArea, QMessageBox, QAction, QFileDialog,
1212
QColorDialog, QInputDialog, QWidget,
13-
QGestureEvent)
13+
QGestureEvent, QDialog)
1414

1515
import openmc
1616
import openmc.lib
@@ -529,6 +529,11 @@ def openView(self):
529529
message = 'Error loading plot settings. Incompatible model.'
530530
self.statusBar().showMessage(message, 5000)
531531

532+
def viewMaterialProps(self, id):
533+
msg_box = QMessageBox()
534+
msg_box.setText("Testing mat prop box for mat {}".format(id))
535+
msg_box.exec_()
536+
532537
def openStatePoint(self):
533538
# check for an alread-open statepoint
534539
if self.model.statepoint:

openmc_plotter/plotgui.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from functools import partial
2+
from xml import dom
23

34
from PySide2 import QtCore, QtGui
45
from PySide2.QtWidgets import (QWidget, QPushButton, QHBoxLayout, QVBoxLayout,
@@ -354,9 +355,14 @@ def contextMenuEvent(self, event):
354355

355356
# Domain ID
356357
if domain[id].name:
357-
domainID = self.menu.addAction("{} {}: \"{}\"".format(domain_kind, id, domain[id].name))
358+
domainID = self.menu.addAction("{} {} Info: \"{}\"".format(domain_kind, id, domain[id].name))
358359
else:
359-
domainID = self.menu.addAction("{} {}".format(domain_kind, id))
360+
domainID = self.menu.addAction("{} {} Info".format(domain_kind, id))
361+
362+
# add connector to a new window of info here for material props
363+
if domain_kind == 'Material':
364+
mat_prop_connector = partial(self.main_window.viewMaterialProps, id)
365+
domainID.triggered.connect(mat_prop_connector)
360366

361367
self.menu.addSeparator()
362368

0 commit comments

Comments
 (0)