Esempio n. 1
0
func runEngineWithGtk(launcher launchers.Launcher, bootDescriptorPath string) guiOutcomeStruct {
	log.Debug("Creating the GTK+ user interface...")

	userInterface, err := gtkui.NewGtkUserInterface(launcher)
	if err != nil {
		return guiOutcomeStruct{
			userInterface: nil,
			err:           err,
		}
	}

	log.Debug("User interface created")

	//----------------------------------------------------------------------------
	log.Info("Opening boot descriptor: '%v'...", bootDescriptorPath)

	bootDescriptor, err := descriptors.NewAppDescriptorFromPath(bootDescriptorPath)
	if err != nil {
		return guiOutcomeStruct{
			userInterface: userInterface,
			err:           err,
		}
	}

	log.Notice("Boot descriptor ready")
	//----------------------------------------------------------------------------

	log.Debug("Starting the launch process...")

	err = engine.Run(launcher, userInterface, bootDescriptor)
	return guiOutcomeStruct{
		userInterface: userInterface,
		err:           err,
	}
}
Esempio n. 2
0
func StartGUI(launcher launchers.Launcher, bootDescriptorPath string) (err error) {
	bootDescriptor, err := descriptors.NewAppDescriptorFromPath(bootDescriptorPath)
	if err != nil {
		return err
	}

	bashTerminal := terminals.NewBashTerminal()

	userInterface := termui.NewTerminalUserInterface(launcher, bashTerminal)

	result := engine.Run(launcher, userInterface, bootDescriptor)

	log.Notice("OK")

	return result
}