Commit 13b0a959 authored by Federico Asara's avatar Federico Asara

QT GUI, selects modality.

parent a4615d13
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'source.ui'
#
# Created: Fri Aug 26 10:00:05 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(256, 232)
Dialog.setSizeGripEnabled(True)
Dialog.setModal(True)
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.label = QtGui.QLabel(Dialog)
self.label.setFrameShape(QtGui.QFrame.NoFrame)
self.label.setFrameShadow(QtGui.QFrame.Raised)
self.label.setScaledContents(True)
self.label.setWordWrap(True)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label)
self.synth = QtGui.QRadioButton(Dialog)
self.synth.setObjectName(_fromUtf8("synth"))
self.verticalLayout.addWidget(self.synth)
self.file = QtGui.QRadioButton(Dialog)
self.file.setObjectName(_fromUtf8("file"))
self.verticalLayout.addWidget(self.file)
self.fc = QtGui.QRadioButton(Dialog)
self.fc.setChecked(True)
self.fc.setObjectName(_fromUtf8("fc"))
self.verticalLayout.addWidget(self.fc)
self.adc = QtGui.QRadioButton(Dialog)
self.adc.setObjectName(_fromUtf8("adc"))
self.verticalLayout.addWidget(self.adc)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Data Source", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Dialog", "Select a data source; the program will adapt to your choiche.", None, QtGui.QApplication.UnicodeUTF8))
self.synth.setText(QtGui.QApplication.translate("Dialog", "Synthetic data", None, QtGui.QApplication.UnicodeUTF8))
self.file.setText(QtGui.QApplication.translate("Dialog", "Read from file", None, QtGui.QApplication.UnicodeUTF8))
self.fc.setText(QtGui.QApplication.translate("Dialog", "Full chain", None, QtGui.QApplication.UnicodeUTF8))
self.adc.setText(QtGui.QApplication.translate("Dialog", "ADC only", None, QtGui.QApplication.UnicodeUTF8))
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import PAGE
from PAGE.Utilities import *
import Source
from numpy import *
from PyQt4.Qwt5 import QwtPlotGrid
#FIXME: pressing tab while editing crashes everything
class SourceSelector(QDialog):
def __init__(self, parent = None):
QDialog.__init__(self, parent)
self.ui = Source.Ui_Dialog()
self.ui.setupUi(self)
def answer(self):
if self.ui.synth.isChecked():
return 'synth'
elif self.ui.file.isChecked():
return 'file'
elif self.ui.fc.isChecked():
return 'fc'
elif self.ui.adc.isChecked():
return 'adc'
def test():
import sys
import PyQt4.QtCore
import PyQt4.QtGui
# Create a Qt application
app = PyQt4.QtGui.QApplication(sys.argv)
mw = ModuleSelector()
mw.show()
# Enter Qt application main loop
app.exec_()
if __name__ == '__main__':
test()
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>256</width>
<height>232</height>
</rect>
</property>
<property name="windowTitle">
<string>Data Source</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="text">
<string>Select a data source; the program will adapt to your choiche.</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="synth">
<property name="text">
<string>Synthetic data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="file">
<property name="text">
<string>Read from file</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="fc">
<property name="text">
<string>Full chain</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="adc">
<property name="text">
<string>ADC only</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>227</x>
<y>210</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>231</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Dialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>246</x>
<y>216</y>
</hint>
<hint type="destinationlabel">
<x>255</x>
<y>231</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment