mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-24 20:16:28 +00:00
ChooseAnalysis: Fix Ok button.
Also move double-click signal connection to .ui.
This commit is contained in:
parent
f6cecd407f
commit
a22fc0f669
@ -75,5 +75,37 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ChooseAnalysis</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>199</x>
|
||||
<y>400</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>199</x>
|
||||
<y>210</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>analysisTypes</sender>
|
||||
<signal>itemDoubleClicked(QTreeWidgetItem*,int)</signal>
|
||||
<receiver>ChooseAnalysis</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>199</x>
|
||||
<y>206</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>199</x>
|
||||
<y>210</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
@ -66,7 +66,6 @@ class ChooseAnalysis(SEToolsWidget, QDialog):
|
||||
|
||||
def setupUi(self):
|
||||
self.load_ui("choose_analysis.ui")
|
||||
self.analysisTypes.doubleClicked.connect(self.accept)
|
||||
|
||||
def show(self, mls):
|
||||
analysis_map = {"Domain Transition Analysis": DomainTransitionAnalysisTab,
|
||||
@ -118,10 +117,12 @@ class ChooseAnalysis(SEToolsWidget, QDialog):
|
||||
self.analysisTypes.sortByColumn(0, Qt.AscendingOrder)
|
||||
super(ChooseAnalysis, self).show()
|
||||
|
||||
def accept(self):
|
||||
def accept(self, item=None):
|
||||
try:
|
||||
# .ui is set for single item selection.
|
||||
item = self.analysisTypes.selectedItems()[0]
|
||||
if not item:
|
||||
# .ui is set for single item selection.
|
||||
item = self.analysisTypes.selectedItems()[0]
|
||||
|
||||
title = item.text(0)
|
||||
self.parent.create_new_analysis(title, item._tab_class)
|
||||
except (IndexError, TypeError):
|
||||
|
Loading…
Reference in New Issue
Block a user