예제 #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,
	}
}
예제 #2
0
func (app *App) GetLocalDescriptor() (localDescriptor descriptors.AppDescriptor) {
	if app.localDescriptorCached {
		return app.localDescriptor
	}

	app.localDescriptorCached = true

	if !caravel.FileExists(app.localDescriptorPath) {
		log.Notice("The local descriptor is missing")
		return nil
	}

	log.Notice("The local descriptor has been found! Opening it...")
	localDescriptor, err := descriptors.NewAppDescriptorFromPath(app.localDescriptorPath)
	if err != nil {
		log.Warning(err.Error())
		return nil
	}
	log.Notice("Local descriptor ready")

	log.Debug("The local descriptor is: %#v", localDescriptor)

	app.localDescriptor = localDescriptor

	return localDescriptor
}
예제 #3
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
}