view

package
v0.0.0-...-f064738 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 14 Imported by: 1

Documentation

Overview

Package view of the application, all the windows are built in this package.

Index

Constants

View Source
const (
	COLUMN_TITLE = iota
	COLUMN_ARTIST
	COLUMN_ALBUM
	COLUMN_GENRE
	COLUMN_PATH
	COLUMN_VISIBLE
	COLUMN_ID
)

IDs to access the tree view columns by

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func GetBufferEntry

func GetBufferEntry(entry *gtk.SearchEntry) *gtk.EntryBuffer

GetBufferEntry takes a gtk.SearchEntry as a parameter and returns its gtk.EntryBuffer. It includes error handling.

func GetLabelText

func GetLabelText(label *gtk.Label) string

GetLabelText takes a gtk.Label as a parameter and returns the text it contains. It includes error handling.

func GetTextEntry

func GetTextEntry(entry *gtk.Entry) string

GetTextEntry receives a gtk.Entry as a parameter and returns the text it contains. It includes error handling.

func GetTextEntryClean

func GetTextEntryClean(entry *gtk.SearchEntry) string

GetTextEntryClean receives a gtk.SearchEntry as a parameter, returns the text it contains and cleans its buffer. It includes error handling.

func GetTextSearchEntry

func GetTextSearchEntry(entry *gtk.SearchEntry) string

GetTextSearchEntry receives a gtk.SearchEntry as a parameter and returns the text it contains. It includes error handling.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func SetupBox

func SetupBox() *gtk.Box

SetupBox creates a new gtk.Box object, sets its 'Homogeneous' property to false, and returns it. It includes error handling.

func SetupComboBoxText

func SetupComboBoxText() *gtk.ComboBoxText

SetupComboBoxText creates a new gtk.ComboBoxTex object and returns it. It includes error handling.

func SetupEntry

func SetupEntry() *gtk.Entry

SetupEntry creates a new gtk.Entry object and returns it. It includes error handling.

func SetupGrid

func SetupGrid(orient gtk.Orientation) *gtk.Grid

SetupGrid creates a new gtk.Grid object with orientation specified by a parameter of type gtk.Orientation, and returns it. It includes error handling.

func SetupLabel

func SetupLabel(text string) *gtk.Label

SetupLabel creates a new gtk.Label object with text content given by the argument of the function, sets its XAlign property to 0, and returns it. It includes error handling.

func SetupListBox

func SetupListBox() *gtk.ListBox

SetupListBox creates a new gtk.ListBox object and returns it. It includes error handling.

func SetupListBoxRowLabel

func SetupListBoxRowLabel(text string) *gtk.ListBoxRow

SetupListBoxRowLabel creates a new gtk.ListBoxRow object, creates a new label containing the text given as an argument of the function, adds the label to the listbox row, and returns it. It includes error handling.

func SetupNotebook

func SetupNotebook() *gtk.Notebook

SetupNotebook creates a new gtk.Notebook object and returns it. It includes error handling.

func SetupPopupWindow

func SetupPopupWindow(title string, width, height int) *gtk.Window

SetupPopupWindow creates a new gtk.Window object with title, width and height given by its parameters; context its "destroy" signal to the window Close() function, and returns it. It includes error handling.

func SetupScrolledWindow

func SetupScrolledWindow() *gtk.ScrolledWindow

SetupScrolledWindow creates a new gtk.ScrolledWindow object, sets its Policy to (1,1), HExpand to true, and returns it. It includes error handling.

func SetupSearchBar

func SetupSearchBar() *gtk.SearchBar

SetupSearchBar creates a new gtk.SearchBar object and returns it. It includes error handling.

func SetupSearchEntry

func SetupSearchEntry() *gtk.SearchEntry

SetupSearchEntry creates a new gtk.SearchEntry object and returns it. It includes error handling.

func SetupToolButtonIcon

func SetupToolButtonIcon(iconName string) *gtk.ToolButton

SetupToolButtonIcon creates a new gtk.ToolButton object with image determined by de icon name taken as argument, and returns it. It includes error handling.

func SetupToolButtonLabel

func SetupToolButtonLabel(text string) *gtk.ToolButton

SetupToolButtonLabel creates a new gtk.ToolButton object with text label given by the entry of the function, and returns it. It includes error handling.

func SetupToolbar

func SetupToolbar() *gtk.Toolbar

SetupToolbar creates a new gtk.Toolbar object and returns it. It includes error handling.

func SetupWindow

func SetupWindow(title string) *gtk.Window

SetupWindow creates a new gtk.Window object with fixed size (1000 by 700), connects its "destroy" signal to gtk.MainQuit() funcion, and returns it. It includes error handling.

Types

type About

type About struct {
	Win *gtk.Window
}

About represents the about dialog window in the main application. It contains its window for the controller to close it.

func NewAbout

func NewAbout() *About

NewAbout creates, returns, and draws a new About object.

type AddMember

type AddMember struct {
	CurrentMemberLB *gtk.ListBox

	NewMemberCBT *gtk.ComboBoxText
	// contains filtered or unexported fields
}

AddMember contains a gtk.ListBox, a gtk.ComboBoxText and the grid holding them. These are used to create the dialog where a member is added to a group in the application. It is intended to be used inside a gtk.Container.

func NewAddMember

func NewAddMember() *AddMember

NewAddMember creates a new AddMember object and returs it.

type AddToGroup

type AddToGroup struct {
	CurrentGroupLB *gtk.ListBox

	NewGroupCBT *gtk.ComboBoxText
	// contains filtered or unexported fields
}

AddToGroup represent the contents of the tab in the 'edit person' window where a person can be added to a group (without the window). It contains the combo box that shows the list of existing persons, the list box to show the current members of the group and the grid that holds them.

func NewAddToGroup

func NewAddToGroup() *AddToGroup

NewAddToGroup creates an AddToGroup object, which is intended to be added to a gtk.Container in order to be used.

type EditForeignPerformer

type EditForeignPerformer struct {
	GroupCBT      *gtk.ComboBoxText
	GroupContent  *GroupContent
	Notebook      *gtk.Notebook
	PersonCBT     *gtk.ComboBoxText
	PersonContent *PersonContent
	SaveB         *gtk.ToolButton
	Win           *gtk.Window
}

EditForeignPerformer holds the gtk.Window object corresponding to the 'edit performer' window, and its necessary elements to connect it to the model.

func EditForeignPerformerWindow

func EditForeignPerformerWindow() *EditForeignPerformer

EditForeignPerformerWindow draws the window coresponding to the 'Edit Performer' menu accessed through the 'performers' button in the main window. It is intended to edit any existing person or group, not necessarily appearing as a performer in the database.

type EditGroup

type EditGroup struct {
	CurrentMemberLB *gtk.ListBox
	GroupContent    *GroupContent
	NewMemberCBT    *gtk.ComboBoxText
	Notebook        *gtk.Notebook
	SaveB           *gtk.ToolButton
	Win             *gtk.Window
}

EditGroup represents the window from the 'Edit Group' dialog in the main application. It contains the information of both a GroupContent and an AddMember objects.

func EditGroupWindow

func EditGroupWindow() *EditGroup

EditGroupWindow creates and draws the 'Edit Group' window for the main application. It returns a new EditGroup object.

type EditPerformer

type EditPerformer struct {
	GroupContent  *GroupContent
	Notebook      *gtk.Notebook
	PersonContent *PersonContent
	SaveB         *gtk.ToolButton
	Win           *gtk.Window
}

EditPerformer represents a window for the 'edit performer' action associated to a row in the tree view of the main window. It contains the necessary fields that the controller will use to connect it with the model.

func EditPerformerWindow

func EditPerformerWindow() *EditPerformer

EditPerformerWindow draws the window.

type EditPerson

type EditPerson struct {
	CurrentGroupLB *gtk.ListBox
	NewGroupCBT    *gtk.ComboBoxText
	Notebook       *gtk.Notebook
	PersonContent  *PersonContent
	SaveB          *gtk.ToolButton
	Win            *gtk.Window
}

EditPerson represents the window for the 'edit person' dialog in the main window. It contains a PersonContent and the relevant fields from an AddToGroup.

func EditPersonWindow

func EditPersonWindow() *EditPerson

EditPersonWindow creates and draws a window containing an EditPerson.

type EditRola

type EditRola struct {
	RolaContent *RolaContent
	SaveB       *gtk.ToolButton
	Win         *gtk.Window
}

An EditRola represents the window used by the 'Edit Rola' menu in the main application window.

func EditRolaWindow

func EditRolaWindow() *EditRola

EditRolaWindow creates an EditRola and draws the corresponding window.

type GroupContent

type GroupContent struct {
	GroupNameE *gtk.Entry
	StartE     *gtk.Entry
	EndE       *gtk.Entry
	// contains filtered or unexported fields
}

GroupContent contains the entries needed by the controller to retrieve information from an 'Edit Group' menu. It contains the corresopnding gtk.Entry objects, and the grid that holds them together. It is meant to be used inside a gtk.Container.

func NewGroupContent

func NewGroupContent() *GroupContent

NewGroupContent creates and returns a new GroupContent object.

type MainWindow

type MainWindow struct {
	Buttons        map[string]*gtk.ToolButton
	Grid           *gtk.Grid
	ScrolledWindow *gtk.ScrolledWindow
	SearchEntry    *gtk.SearchEntry
	SongInfo       []*gtk.Label
	TreeView       *TreeView
	Win            *gtk.Window
}

MainWindow represents the view of the main window. As an object it holds the gtk objects used by the controller.

func SetupMainWindow

func SetupMainWindow() *MainWindow

SetupMainWindow draws the main window and initializes the gtk objects needed by the controller.

type PersonContent

type PersonContent struct {
	StageNameE *gtk.Entry
	RealNameE  *gtk.Entry
	BirthE     *gtk.Entry
	DeathE     *gtk.Entry
	// contains filtered or unexported fields
}

PersonContent represent the contents of the main tab in the 'edit person' window (without the window). It contains the entries for the user to edit the information and the grid that holds them.

func NewPersonContent

func NewPersonContent() *PersonContent

NewPersonContent creates a PersonContent object, which should be added to a gtk.Container in order to be used.

type RolaContent

type RolaContent struct {
	TitleE  *gtk.Entry
	ArtistE *gtk.Entry
	AlbumE  *gtk.Entry
	GenreE  *gtk.Entry
	TrackE  *gtk.Entry
	YearE   *gtk.Entry
	// contains filtered or unexported fields
}

RolaContent contains all the entries (gtk.Entry) used in the 'Edit Rola' menu in the main application window, as well as the grid holding them together. It is meant to be used inside a gtk.Container.

func NewRolaContent

func NewRolaContent() *RolaContent

NewRolaContent creates and returns a new RolaContent.

type TreeView

type TreeView struct {
	TreeView  *gtk.TreeView
	ListStore *gtk.ListStore
	Filter    *gtk.TreeModelFilter
}

TreeView represents the tree view with the list of Rolas in the main window of the package.

func NewTreeView

func NewTreeView() *TreeView

NewTreeView creates and returns a new TreeView object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL