def __init__(self): QtGui.QWidget.__init__(self) l = QtGui.QVBoxLayout() self.setLayout(l) title = QtGui.QLabel('<b>Undo / Redo</b>') self.activate = QtGui.QCheckBox('Activate') self.activate.setChecked(True) self.activate.stateChanged.connect(self._enableLenHistory) self._label_lenHist = QtGui.QLabel('History Length') self.lenHistory = QtGui.QSpinBox() self.lenHistory.setRange(1, 100) self.lenHistory.setValue(5) l_history = QtGui.QHBoxLayout() l_history.addWidget(self._label_lenHist) l_history.addWidget(self.lenHistory) l.addWidget(title) l.addWidget(self.activate) l.addLayout(l_history)
def __init__(self, session): FirstStart.__init__(self, session) self.layout().insertWidget(3, ChooseProfile(session)) #TEMPORARY CONTENT TO BE REMOVED AFTER CODE RELEASE self.resize(300, 310) lab = QtGui.QLabel('<b>Software License Agreement</b>') ed = QtGui.QTextBrowser() ed.setReadOnly(True) ed.setOpenExternalLinks(True) ed.setCurrentFont(QtGui.QFont("Courier New", 8)) ed.setHtml('''<font size="3" face="Courier New"> This free software 'dataArtist' is licensed under GPLv3. By using this software the user agrees to the thereby associated terms. More information can be found <a href = "http://www.gnu.org/licenses/quick-guide-gplv3.en.html">here </a> </font>''') btn = QtGui.QCheckBox('I accept the terms') self.btn_done.setEnabled(False) btn.clicked.connect(lambda checked: self.btn_done.setEnabled(checked)) self.layout().insertWidget(4, lab) self.layout().insertWidget(5, ed) self.layout().insertWidget(6, btn)
def __init__(self, gui): #TODO: make pyqtgraph optics(colortheme...) directly changeable - not just # at reload QtGui.QWidget.__init__(self) self.gui = gui session = gui.app.session #CONNECT SAVE/RESTORE: session.sigSave.connect(self._save) session.sigRestore.connect(self._restore) #LAYOUT: layout = QtGui.QVBoxLayout() layout.setAlignment(QtCore.Qt.AlignTop) self.setLayout(layout) hlayout = QtGui.QHBoxLayout() layout.addLayout(hlayout) self.label_colorTheme = QtGui.QLabel('Color theme') hlayout.addWidget(self.label_colorTheme) self.combo_colorTheme = QtGui.QComboBox() hlayout.addWidget(self.combo_colorTheme) self.combo_colorTheme.addItems(('dark', 'bright')) self.combo_colorTheme.currentIndexChanged.connect( lambda i, self=self: self.setColorTheme(self.combo_colorTheme. currentText())) self.check_antialiasting = QtGui.QCheckBox('Antialiasting') layout.addWidget(self.check_antialiasting) self.check_antialiasting.stateChanged.connect(self._setAntialiasting) combo_profile = ChooseProfile(session) layout.addWidget(combo_profile)
def __init__(self, gui): QtGui.QWidget.__init__(self) self.gui = gui #CONNECT SAVE/RESTORE: gui.app.session.sigSave.connect(self._save) gui.app.session.sigRestore.connect(self._restore) #LAYOUT: layout = QtGui.QVBoxLayout() layout.setAlignment(QtCore.Qt.AlignTop) self.setLayout(layout) hlayout = QtGui.QHBoxLayout() layout.addLayout(hlayout) self.label_multifiles = QtGui.QLabel('Import files') hlayout.addWidget(self.label_multifiles) self.combo_import = QtGui.QComboBox() hlayout.addWidget(self.combo_import) # self.combo_import.addItems(( 'separated', # 'together', # 'in current display', # 'in import display')) self.combo_import.addItems( ('SPLIT into MULTIPLE displays', 'ALL in NEW display', 'ALL in CURRENT display', 'ALL in IMPORT display')) self.combo_import.setCurrentIndex(self.importFilesPolicy) self.combo_import.currentIndexChanged.connect(self._importChanged) self.btn_loadFiles = QtGui.QCheckBox('load files') self.btn_loadFiles.setChecked(True) self.btn_loadFiles.toggled.connect( lambda checked, self=self: self.__setattr__( 'loadImportedFiles', checked)) layout.addWidget(self.btn_loadFiles) self.btn_ask = QtGui.QCheckBox('Show import dialog') self.btn_ask.setChecked(self.showImportDialog) self.btn_ask.toggled.connect(lambda checked, self=self: self. __setattr__('showImportDialog', checked)) layout.addWidget(self.btn_ask)
def __init__(self, gui): QtGui.QWidget.__init__(self) self.gui = gui rab = self.rabbitMQServer = RabbitMQServer(gui) self._wf = wf = WatchFolder(gui) s = gui.app.session #CONNECT SAVE/RESTORE: s.sigSave.connect(self._save) s.sigRestore.connect(self._restore) #CONNECT CLOSE gui.app.lastWindowClosed.connect(rab.stop) #LAYOUT: layout = QtGui.QVBoxLayout() layout.setAlignment(QtCore.Qt.AlignTop) self.setLayout(layout) #WATCH FOLDER ############# self.cb_watchFolder = QtGui.QCheckBox('Watch folder') self.cb_watchFolder.toggled.connect(self._watchFolderChanged) layout.addWidget(self.cb_watchFolder) self._folder_opts = QtGui.QWidget() layout.addWidget(self._folder_opts) gl = QtGui.QGridLayout() self._folder_opts.setLayout(gl) self._folder_opts.hide() self._wf_folderEdit = QtGui.QLineEdit('-') self._wf_folderEdit.setReadOnly(True) gl.addWidget(self._wf_folderEdit, 0, 0) btn = QtGui.QPushButton('Change') btn.clicked.connect(self._wf_folderChanged) gl.addWidget(btn, 0, 1) self._cb_filesOnly = QtGui.QCheckBox('Files only') self._cb_filesOnly.setChecked(wf.opts['files only']) self.cb_watchFolder.toggled.connect( lambda val: wf.opts.__setitem__('files only', val)) gl.addWidget(self._cb_filesOnly, 1, 0) gl.addWidget(QtGui.QLabel('refreshrate [msec]'), 2, 0) self._wf_refRate = QtGui.QSpinBox() self._wf_refRate.setRange(1, 100000) self._wf_refRate.setValue(wf.opts['refreshrate']) self._wf_refRate.valueChanged.connect(self._wf_refRateChanged) gl.addWidget(self._wf_refRate, 2, 1) #RABBIT MQ ########## hlayout = QtGui.QHBoxLayout() layout.addLayout(hlayout) self.cb_allowRabbit = QtGui.QCheckBox( 'Allow inter-process communication\nusing the RabbitMQ server') self.cb_allowRabbit.toggled.connect(self._allowRabbitMQchanged) hlayout.addWidget(self.cb_allowRabbit) self.cb_confirm = QtGui.QCheckBox('Confirm received messages') self.cb_confirm.hide() self.cb_confirm.setChecked(rab.opts['corfirmPosts']) self.cb_confirm.toggled.connect( lambda val: rab.opts.__setitem__('corfirmPosts', val)) hlayout.addWidget(self.cb_confirm) self._rab_opts = QtGui.QWidget() layout.addWidget(self._rab_opts) gl = QtGui.QGridLayout() self._rab_opts.setLayout(gl) self._rab_opts.hide() gl.addWidget(QtGui.QLabel('refreshrate [msec]'), 0, 0) self._rab_refRate = QtGui.QSpinBox() self._rab_refRate.setRange(1, 1000) self._rab_refRate.setValue(rab.opts['refreshrate']) self._rab_refRate.valueChanged.connect( lambda val: rab.opts.__setitem__('refreshrate', val)) gl.addWidget(self._rab_refRate, 0, 1) gl.addWidget(QtGui.QLabel('host'), 1, 0) self.le_host = QtGui.QLineEdit() self.le_host.setText(rab.opts['host']) self.le_host.textChanged.connect( lambda val: rab.opts.__setitem__('host', val)) gl.addWidget(self.le_host, 1, 1) gl.addWidget(QtGui.QLabel('timeout [msec]'), 2, 0) self.sb_timeout = QtGui.QSpinBox() self.sb_timeout.setRange(0, 1000) self.sb_timeout.setValue(rab.opts['timeout']) self.sb_timeout.valueChanged.connect( lambda val: rab.opts.__setitem__('timeout', val)) gl.addWidget(self.sb_timeout, 2, 1) gl.addWidget(QtGui.QLabel('<b>....listen to queues named:</b>'), 3, 0) for n, (queue, action) in enumerate(rab.listenTo.iteritems()): gl.addWidget(QtGui.QLabel(queue), 4 + n, 0) gl.addWidget(QtGui.QLabel(action.__doc__), 4 + n, 1)