symmetry
This commit is contained in:
@ -85,22 +85,26 @@ class MainWindow(QMainWindow):
|
||||
self.on_make_new_plot(name, desc)
|
||||
|
||||
|
||||
def on_make_new_plot(self, *args, **kwargs):
|
||||
sub = MDISubPlot(*args, **kwargs)
|
||||
self.mdi.add(sub)
|
||||
|
||||
|
||||
def on_plot_selected(self):
|
||||
selected = self.lst.selectedItems()
|
||||
if not selected:
|
||||
return
|
||||
if len(selected) == 1:
|
||||
item = selected[0]
|
||||
self.on_make_new_plot(item.key, item.value)
|
||||
return
|
||||
pairs = ((i.key, i.value) for i in selected)
|
||||
names, descs = zip(*pairs)
|
||||
sub = MDISubMultiPlot(names, descs)
|
||||
name, desc = item.key, item.value
|
||||
self.on_make_new_plot(name, desc)
|
||||
else:
|
||||
pairs = ((i.key, i.value) for i in selected)
|
||||
names, descs = zip(*pairs)
|
||||
self.on_make_new_multi_plot(names, descs)
|
||||
|
||||
|
||||
def on_make_new_plot(self, *args, **kwargs):
|
||||
sub = MDISubPlot(*args, **kwargs)
|
||||
self.mdi.add(sub)
|
||||
|
||||
def on_make_new_multi_plot(self, *args, **kwargs):
|
||||
sub = MDISubMultiPlot(*args, **kwargs)
|
||||
self.mdi.add(sub)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user