Application roles are now strings
This commit is contained in:
parent
58913a6a92
commit
e71636ee1b
@ -32,80 +32,48 @@ type ApplicationDescription struct {
|
||||
// String satisfies the fmt.Stringer interface.
|
||||
func (application ApplicationDescription) String () string {
|
||||
if application.Name == "" {
|
||||
return application.Role.String()
|
||||
return string(application.Role)
|
||||
} else {
|
||||
return application.Name
|
||||
}
|
||||
}
|
||||
|
||||
// ApplicationRole describes what an application does.
|
||||
type ApplicationRole int; const (
|
||||
RoleUnknown ApplicationRole = iota
|
||||
type ApplicationRole string; const (
|
||||
RoleUnknown ApplicationRole = ""
|
||||
|
||||
RoleWebBrowser
|
||||
RoleMesssanger
|
||||
RolePhone
|
||||
RoleMail
|
||||
RoleWebBrowser ApplicationRole = "Web Browser"
|
||||
RoleMesssanger ApplicationRole = "Messsanger"
|
||||
RolePhone ApplicationRole = "Phone"
|
||||
RoleMail ApplicationRole = "Mail"
|
||||
|
||||
RoleTerminalEmulator
|
||||
RoleFileBrowser
|
||||
RoleTextEditor
|
||||
RoleTerminalEmulator ApplicationRole = "Terminal Emulator"
|
||||
RoleFileBrowser ApplicationRole = "File Browser"
|
||||
RoleTextEditor ApplicationRole = "Text Editor"
|
||||
|
||||
RoleDocumentViewer
|
||||
RoleWordProcessor
|
||||
RoleSpreadsheet
|
||||
RoleSlideshow
|
||||
RoleCalculator
|
||||
RoleDocumentViewer ApplicationRole = "Document Viewer"
|
||||
RoleWordProcessor ApplicationRole = "Word Processor"
|
||||
RoleSpreadsheet ApplicationRole = "Spreadsheet"
|
||||
RoleSlideshow ApplicationRole = "Slideshow"
|
||||
RoleCalculator ApplicationRole = "Calculator"
|
||||
|
||||
RolePreferences
|
||||
RoleProcessManager
|
||||
RoleSystemInformation
|
||||
RoleManual
|
||||
RolePreferences ApplicationRole = "Preferences"
|
||||
RoleProcessManager ApplicationRole = "Process Manager"
|
||||
RoleSystemInformation ApplicationRole = "System Information"
|
||||
RoleManual ApplicationRole = "Manual"
|
||||
|
||||
RoleCamera
|
||||
RoleImageViewer
|
||||
RoleMediaPlayer
|
||||
RoleImageEditor
|
||||
RoleAudioEditor
|
||||
RoleVideoEditor
|
||||
RoleCamera ApplicationRole = "Camera"
|
||||
RoleImageViewer ApplicationRole = "Image Viewer"
|
||||
RoleMediaPlayer ApplicationRole = "Media Player"
|
||||
RoleImageEditor ApplicationRole = "Image Editor"
|
||||
RoleAudioEditor ApplicationRole = "Audio Editor"
|
||||
RoleVideoEditor ApplicationRole = "Video Editor"
|
||||
|
||||
RoleClock
|
||||
RoleCalendar
|
||||
RoleChecklist
|
||||
RoleClock ApplicationRole = "Clock"
|
||||
RoleCalendar ApplicationRole = "Calendar"
|
||||
RoleChecklist ApplicationRole = "Checklist"
|
||||
)
|
||||
|
||||
// String satisfies the fmt.Stringer interface.
|
||||
func (role ApplicationRole) String () string {
|
||||
switch role {
|
||||
case RoleWebBrowser: return "Web Browser"
|
||||
case RoleMesssanger: return "Messsanger"
|
||||
case RolePhone: return "Phone"
|
||||
case RoleMail: return "Mail"
|
||||
case RoleTerminalEmulator: return "Terminal Emulator"
|
||||
case RoleFileBrowser: return "File Browser"
|
||||
case RoleTextEditor: return "Text Editor"
|
||||
case RoleDocumentViewer: return "Document Viewer"
|
||||
case RoleWordProcessor: return "Word Processor"
|
||||
case RoleSpreadsheet: return "Spreadsheet"
|
||||
case RoleSlideshow: return "Slideshow"
|
||||
case RoleCalculator: return "Calculator"
|
||||
case RolePreferences: return "Preferences"
|
||||
case RoleProcessManager: return "Process Manager"
|
||||
case RoleSystemInformation: return "System Information"
|
||||
case RoleManual: return "Manual"
|
||||
case RoleCamera: return "Camera"
|
||||
case RoleImageViewer: return "Image Viewer"
|
||||
case RoleMediaPlayer: return "Media Player"
|
||||
case RoleImageEditor: return "Image Editor"
|
||||
case RoleAudioEditor: return "Audio Editor"
|
||||
case RoleVideoEditor: return "Video Editor"
|
||||
case RoleClock: return "Clock"
|
||||
case RoleCalendar: return "Calendar"
|
||||
case RoleChecklist: return "Checklist"
|
||||
default: return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
// RunApplication is like Run, but runs an application.
|
||||
func RunApplication (application Application) error {
|
||||
return tomo.Run(application.Init)
|
||||
|
Loading…
Reference in New Issue
Block a user