Exemple #1
0
	def init_edit_widget(self):

		"""Builds the loop controls."""

		super(loop, self).init_edit_widget(stretch=False)
		self.loop_widget = loop_widget(self.experiment.main_window)
		self.loop_widget.ui.widget_advanced.hide()
		self.edit_vbox.addWidget(self.loop_widget)
		self.auto_add_widget(self.loop_widget.ui.spin_cycles)
		self.auto_add_widget(self.loop_widget.ui.spin_repeat, u"repeat")
		self.auto_add_widget(self.loop_widget.ui.spin_skip, u"skip")
		self.auto_add_widget(self.loop_widget.ui.combobox_order, u"order")
		self.auto_add_widget(self.loop_widget.ui.checkbox_offset, u"offset")
		self.auto_add_widget(self.loop_widget.ui.combobox_item, u"item")
		self.auto_add_widget(self.loop_widget.ui.edit_break_if, u"break_if")
		self.loop_widget.ui.edit_break_if.setValidator(cond_validator(self,
			default=u'never'))
		self.loop_widget.ui.button_add_cyclevar.clicked.connect(
			self.add_cyclevar)
		self.loop_widget.ui.button_rename_cyclevar.clicked.connect(
			self.rename_cyclevar)
		self.loop_widget.ui.button_remove_cyclevar.clicked.connect(
			self.remove_cyclevar)
		self.loop_widget.ui.button_wizard.clicked.connect(self.wizard)
		self.loop_widget.ui.button_apply_weights.clicked.connect(
			self.apply_weights)
		self.loop_widget.ui.combobox_order.setItemIcon(0,
			self.experiment.icon(u"random"))
		self.loop_widget.ui.combobox_order.setItemIcon(1,
			self.experiment.icon(u"sequential"))
		self.loop_table = loop_table.loop_table(self, self.cycles,
			self.cyclevar_count())
		self.edit_vbox.addWidget(self.loop_table)
Exemple #2
0
    def init_edit_widget(self):
        """Builds the loop controls."""

        super(loop, self).init_edit_widget(stretch=False)
        self.loop_widget = loop_widget(self.experiment.main_window)
        self.loop_widget.ui.widget_advanced.hide()
        self.edit_vbox.addWidget(self.loop_widget)
        self.auto_add_widget(self.loop_widget.ui.spin_cycles)
        self.auto_add_widget(self.loop_widget.ui.spin_repeat, u"repeat")
        self.auto_add_widget(self.loop_widget.ui.spin_skip, u"skip")
        self.auto_add_widget(self.loop_widget.ui.combobox_order, u"order")
        self.auto_add_widget(self.loop_widget.ui.checkbox_offset, u"offset")
        self.auto_add_widget(self.loop_widget.ui.combobox_item, u"item")
        self.auto_add_widget(self.loop_widget.ui.edit_break_if, u"break_if")
        self.loop_widget.ui.edit_break_if.setValidator(
            cond_validator(self, default=u'never'))
        self.loop_widget.ui.button_add_cyclevar.clicked.connect(
            self.add_cyclevar)
        self.loop_widget.ui.button_rename_cyclevar.clicked.connect(
            self.rename_cyclevar)
        self.loop_widget.ui.button_remove_cyclevar.clicked.connect(
            self.remove_cyclevar)
        self.loop_widget.ui.button_wizard.clicked.connect(self.wizard)
        self.loop_widget.ui.button_apply_weights.clicked.connect(
            self.apply_weights)
        self.loop_widget.ui.combobox_order.setItemIcon(
            0, self.theme.qicon(u"random"))
        self.loop_widget.ui.combobox_order.setItemIcon(
            1, self.theme.qicon(u"sequential"))
        self.loop_table = loop_table.loop_table(
            self, self.var.get(u'cycles', _eval=False), self.cyclevar_count())
        self.edit_vbox.addWidget(self.loop_table)
        self.set_focus_widget(None)
Exemple #3
0
    def init_edit_widget(self):

        """Build the loop controls"""

        self.lock = True

        qtitem.qtitem.init_edit_widget(self, False)
        self.loop_widget = QtGui.QWidget()
        self.loop_widget.ui = loop_widget_ui.Ui_loop_widget()
        self.loop_widget.ui.setupUi(self.loop_widget)
        self.experiment.main_window.theme.apply_theme(self.loop_widget)
        self.edit_vbox.addWidget(self.loop_widget)

        self.auto_add_widget(self.loop_widget.ui.spin_cycles)
        self.auto_add_widget(self.loop_widget.ui.spin_repeat, "repeat")
        self.auto_add_widget(self.loop_widget.ui.spin_skip, "skip")
        self.auto_add_widget(self.loop_widget.ui.combobox_item, "item")
        self.auto_add_widget(self.loop_widget.ui.combobox_order, "order")
        self.auto_add_widget(self.loop_widget.ui.checkbox_offset, "offset")

        self.loop_widget.ui.button_add_cyclevar.clicked.connect(self.add_cyclevar)
        self.loop_widget.ui.button_rename_cyclevar.clicked.connect(self.rename_cyclevar)
        self.loop_widget.ui.button_remove_cyclevar.clicked.connect(self.remove_cyclevar)
        self.loop_widget.ui.button_wizard.clicked.connect(self.wizard)

        self.loop_widget.ui.combobox_order.setItemIcon(0, self.experiment.icon("random"))
        self.loop_widget.ui.combobox_order.setItemIcon(1, self.experiment.icon("sequential"))

        self.loop_table = loop_table.loop_table(self, self.cycles, self.cyclevar_count())
        self.edit_vbox.addWidget(self.loop_table)

        self.lock = False
        return self._edit_widget
Exemple #4
0
	def init_edit_widget(self):

		"""Builds the loop controls."""

		self.lock = True

		qtitem.qtitem.init_edit_widget(self, False)
		self.loop_widget = QtGui.QWidget()
		self.loop_widget.ui = loop_widget_ui.Ui_loop_widget()
		self.loop_widget.ui.setupUi(self.loop_widget)
		self.experiment.main_window.theme.apply_theme(self.loop_widget)
		self.loop_widget.ui.widget_advanced.hide()

		self.edit_vbox.addWidget(self.loop_widget)

		self.auto_add_widget(self.loop_widget.ui.spin_cycles)
		self.auto_add_widget(self.loop_widget.ui.spin_repeat, u"repeat")
		self.auto_add_widget(self.loop_widget.ui.spin_skip, u"skip")
		self.auto_add_widget(self.loop_widget.ui.combobox_order, u"order")
		self.auto_add_widget(self.loop_widget.ui.checkbox_offset, u"offset")
		# The break-if box needs to be validated, so we don't add it to the
		# auto widgets.
		self.loop_widget.ui.edit_break_if.editingFinished.connect( \
			self.apply_edit_changes)
		# The item combobox needs special treatment, because it's changes
		# must be visible in the item tree as well
		self.loop_widget.ui.combobox_item.currentIndexChanged.connect( \
			self.apply_item_change)

		self.loop_widget.ui.button_add_cyclevar.clicked.connect( \
			self.add_cyclevar)
		self.loop_widget.ui.button_rename_cyclevar.clicked.connect( \
			self.rename_cyclevar)
		self.loop_widget.ui.button_remove_cyclevar.clicked.connect( \
			self.remove_cyclevar)
		self.loop_widget.ui.button_wizard.clicked.connect(self.wizard)
		self.loop_widget.ui.button_apply_weights.clicked.connect( \
			self.apply_weights)

		self.loop_widget.ui.combobox_order.setItemIcon(0, \
			self.experiment.icon(u"random"))
		self.loop_widget.ui.combobox_order.setItemIcon(1, \
			self.experiment.icon(u"sequential"))

		self.loop_table = loop_table.loop_table(self, self.cycles, \
			self.cyclevar_count())
		self.edit_vbox.addWidget(self.loop_table)

		self.lock = False
		return self._edit_widget
Exemple #5
0
    def init_edit_widget(self):
        """Builds the loop controls."""

        self.lock = True

        qtitem.qtitem.init_edit_widget(self, False)
        self.loop_widget = QtGui.QWidget()
        self.loop_widget.ui = loop_widget_ui.Ui_loop_widget()
        self.loop_widget.ui.setupUi(self.loop_widget)
        self.experiment.main_window.theme.apply_theme(self.loop_widget)
        self.loop_widget.ui.widget_advanced.hide()

        self.edit_vbox.addWidget(self.loop_widget)

        self.auto_add_widget(self.loop_widget.ui.spin_cycles)
        self.auto_add_widget(self.loop_widget.ui.spin_repeat, u"repeat")
        self.auto_add_widget(self.loop_widget.ui.spin_skip, u"skip")
        self.auto_add_widget(self.loop_widget.ui.combobox_order, u"order")
        self.auto_add_widget(self.loop_widget.ui.checkbox_offset, u"offset")
        # The break-if box needs to be validated, so we don't add it to the
        # auto widgets.
        self.loop_widget.ui.edit_break_if.editingFinished.connect( \
         self.apply_edit_changes)
        # The item combobox needs special treatment, because it's changes
        # must be visible in the item tree as well
        self.loop_widget.ui.combobox_item.currentIndexChanged.connect( \
         self.apply_item_change)

        self.loop_widget.ui.button_add_cyclevar.clicked.connect( \
         self.add_cyclevar)
        self.loop_widget.ui.button_rename_cyclevar.clicked.connect( \
         self.rename_cyclevar)
        self.loop_widget.ui.button_remove_cyclevar.clicked.connect( \
         self.remove_cyclevar)
        self.loop_widget.ui.button_wizard.clicked.connect(self.wizard)
        self.loop_widget.ui.button_apply_weights.clicked.connect( \
         self.apply_weights)

        self.loop_widget.ui.combobox_order.setItemIcon(0, \
         self.experiment.icon(u"random"))
        self.loop_widget.ui.combobox_order.setItemIcon(1, \
         self.experiment.icon(u"sequential"))

        self.loop_table = loop_table.loop_table(self, self.cycles, \
         self.cyclevar_count())
        self.edit_vbox.addWidget(self.loop_table)

        self.lock = False
        return self._edit_widget
Exemple #6
0
    def init_edit_widget(self):
        """Build the loop controls"""

        self.lock = True

        qtitem.qtitem.init_edit_widget(self, False)
        self.loop_widget = QtGui.QWidget()
        self.loop_widget.ui = loop_widget_ui.Ui_loop_widget()
        self.loop_widget.ui.setupUi(self.loop_widget)
        self.experiment.main_window.theme.apply_theme(self.loop_widget)
        self.edit_vbox.addWidget(self.loop_widget)

        self.auto_add_widget(self.loop_widget.ui.spin_cycles)
        self.auto_add_widget(self.loop_widget.ui.spin_repeat, "repeat")
        self.auto_add_widget(self.loop_widget.ui.spin_skip, "skip")
        self.auto_add_widget(self.loop_widget.ui.combobox_item, "item")
        self.auto_add_widget(self.loop_widget.ui.combobox_order, "order")
        self.auto_add_widget(self.loop_widget.ui.checkbox_offset, "offset")

        self.loop_widget.ui.button_add_cyclevar.clicked.connect( \
         self.add_cyclevar)
        self.loop_widget.ui.button_rename_cyclevar.clicked.connect( \
         self.rename_cyclevar)
        self.loop_widget.ui.button_remove_cyclevar.clicked.connect( \
         self.remove_cyclevar)
        self.loop_widget.ui.button_wizard.clicked.connect( \
         self.wizard)

        self.loop_widget.ui.combobox_order.setItemIcon(0, \
         self.experiment.icon("random"))
        self.loop_widget.ui.combobox_order.setItemIcon(1, \
         self.experiment.icon("sequential"))

        self.loop_table = loop_table.loop_table(self, self.cycles, \
         self.cyclevar_count())
        self.edit_vbox.addWidget(self.loop_table)

        self.lock = False
        return self._edit_widget