Exemple #1
0
	def show_script_edit_dialog(self):

		"""
		desc:
			Shows the script-edit dialog.
		"""

		old_string = self.to_string()
		string = text_input(self.sketchpad._edit_widget,
			msg=_(u'Element script'), content=self.to_string(),
			validator=self.script_validator).get_input()
		if string is None:
			return
		try:
			self.from_string(string)
		except osexception as e:
			self.experiment.notify(e)
			self.console.write(e)
			self.from_string(old_string)
			return
		self.sketchpad.draw()
Exemple #2
0
    def text_input(self, title, message=None, content=u'', parent=None):
        """
		dexc:
			Pops up a text input dialog.

		arguments:
			title:		The title for the dialog.

		keywords:
			message:	A text message.
			contents:	The initial contents.
			parent:		A parent QWidget or None to use the main window as
						parent.

		returns:
			A string of text or None if cancel was pressed.
		"""

        from libqtopensesame.dialogs.text_input import text_input
        if parent == None:
            parent = self.main_window
        tid = text_input(parent, msg=message, content=content)
        return tid.get_input()
Exemple #3
0
	def text_input(self, title, message=None, content=u'', parent=None):

		"""
		dexc:
			Pops up a text input dialog.

		arguments:
			title:		The title for the dialog.

		keywords:
			message:	A text message.
			contents:	The initial contents.
			parent:		A parent QWidget or None to use the main window as
						parent.

		returns:
			A string of text or None if cancel was pressed.
		"""

		from libqtopensesame.dialogs.text_input import text_input
		if parent is None:
			parent = self.main_window
		tid = text_input(parent, msg=message, content=content)
		return tid.get_input()
	def activate(self):

		"""
		desc:
			Is called when the extension is activated through the menu/ toolbar
			action.
		"""
		
		from libqtopensesame.dialogs.notification import notification
		welcome = notification(self.main_window,'On the next page, please input the URL of your couch db server followed by a database name.'
		'For example, if you have couch db installed on the machine you are currently using, you might enter: '
		'http://localhost:5984/psynteract')
		welcome.exec_()
		
		from libqtopensesame.dialogs.text_input import text_input
		psynteract_url = text_input(self.main_window)
		current_url = psynteract_url.get_input()
		
		from psynteract import install
		server_url = install(current_url)

		feedback = notification(self.main_window,'Your server is available at '+server_url)
		feedback.exec_()