view

package
v0.0.0-...-d3aecbb Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const BATCH_TIMER = time.Millisecond * 555

Variables

This section is empty.

Functions

func FormatReports

func FormatReports(reports []string, indent string) (lines []string)

func GetStyleAltStr

func GetStyleAltStr(option StyleOption, trueStr, falseStr string) string

func GetStyleAttrMask

func GetStyleAttrMask(element StyleElement) tcell.AttrMask

func GetStyleAttrName

func GetStyleAttrName(element StyleElement) string

func GetStyleColor

func GetStyleColor(element StyleElement) tcell.Color

func GetStyleColorName

func GetStyleColorName(element StyleElement) string

func GetStyleMarker

func GetStyleMarker(text, fill, attr StyleElement) string

func GetStyleOption

func GetStyleOption(option StyleOption) bool

func HighlightTrailingSpace

func HighlightTrailingSpace(text, style string, offset uint) string

func LoadStyleConfig

func LoadStyleConfig() error
func Modal(p tview.Primitive, width, height int) tview.Primitive

func SaveStyleConfig

func SaveStyleConfig() error

func TrimEllipsisFront

func TrimEllipsisFront(data string, maxlen int) string

Types

type ActionEntry

type ActionEntry struct {
	Title     string
	Impl      ActionImpl
	Shortcuts []ActionKey
}

type ActionHandler

type ActionHandler struct {
	Context string
	Actions map[string]ActionEntry
	Filter  func(event *tcell.EventKey) bool
}

func (*ActionHandler) FormatSummary

func (actmap *ActionHandler) FormatSummary(names ...string) string

func (*ActionHandler) GetContext

func (actmap *ActionHandler) GetContext() string

func (*ActionHandler) GetShortcuts

func (actmap *ActionHandler) GetShortcuts(name string) []ActionKey

func (*ActionHandler) HandleInput

func (actmap *ActionHandler) HandleInput(event *tcell.EventKey) *tcell.EventKey

func (*ActionHandler) InvokeAction

func (actmap *ActionHandler) InvokeAction(name string) bool

func (*ActionHandler) ListActions

func (actmap *ActionHandler) ListActions() []string

func (*ActionHandler) RegisterAction

func (actmap *ActionHandler) RegisterAction(name, title string, impl ActionImpl, shortcuts ...ActionKey)

func (*ActionHandler) SetShortcuts

func (actmap *ActionHandler) SetShortcuts(name string, shortcuts ...ActionKey) error

type ActionImpl

type ActionImpl func() bool

type ActionKey

type ActionKey struct {
	Key       tcell.Key
	Modifiers tcell.ModMask
	Rune      rune
}

func NewActionKey

func NewActionKey(key tcell.Key, mods tcell.ModMask) ActionKey

func NewActionRune

func NewActionRune(r rune, mods tcell.ModMask) ActionKey

func (*ActionKey) Matches

func (key *ActionKey) Matches(event *tcell.EventKey) bool

func (*ActionKey) String

func (key *ActionKey) String() string

type ActionMap

type ActionMap interface {
	RegisterAction(name, title string, impl ActionImpl, shortcuts ...ActionKey)
	SetShortcuts(name string, shortcut ...ActionKey) error
	InvokeAction(name string) bool
	HandleInput(event *tcell.EventKey) *tcell.EventKey
	FormatSummary(name ...string) string
	GetContext() string
	ListActions() []string
	GetShortcuts(name string) []ActionKey
}

func NewActionHandler

func NewActionHandler(context string, filter func(event *tcell.EventKey) bool) ActionMap

type AddProjectForm

type AddProjectForm struct {
	tview.Primitive

	Form        *tview.Form
	Application *tview.Application
	Listener    AddProjectFormListener
	Directory   *tview.InputField
	Remote      *tview.InputField
	NickName    *tview.InputField
	Server      *tview.InputField
	Project     *tview.InputField
	Token       *tview.InputField
	Global      *tview.Checkbox
}

func NewAddProjectForm

func NewAddProjectForm(app *tview.Application, listener AddProjectFormListener) *AddProjectForm

func (*AddProjectForm) GetName

func (form *AddProjectForm) GetName() string

func (*AddProjectForm) LoadLocalProject

func (form *AddProjectForm) LoadLocalProject()

type AddProjectFormListener

type AddProjectFormListener interface {
	AddProjectFormCancel()
	AddProjectFormConfirm(repo model.Repo)
	AddProjectFormAutoFillToken(server, project string) string
}

type ChoosePasswordForm

type ChoosePasswordForm struct {
	tview.Primitive

	Layout   *tview.Flex
	Info     *tview.TextView
	Form     *tview.Form
	Warning  *tview.TextView
	Listener ChoosePasswordFormListener

	Password      string
	PasswordAgain string
}

func NewChoosePasswordForm

func NewChoosePasswordForm(listener ChoosePasswordFormListener) *ChoosePasswordForm

func (*ChoosePasswordForm) GetName

func (form *ChoosePasswordForm) GetName() string

type ChoosePasswordFormListener

type ChoosePasswordFormListener interface {
	ChoosePasswordFormConfirm(password string)
}

type CommentForm

type CommentForm struct {
	*tview.Form

	Message     *tview.TextView
	Text        *tview.TextArea
	Listener    CommentFormListener
	StartThread *tview.Checkbox

	Context *model.CommentContext
}

func NewCommentForm

func NewCommentForm(listener CommentFormListener) *CommentForm

func (*CommentForm) Activate

func (form *CommentForm) Activate(app *tview.Application, context *model.CommentContext, reply int, allowStandalone bool)

func (*CommentForm) IsEditFocused

func (form *CommentForm) IsEditFocused() bool

type CommentFormListener

type CommentFormListener interface {
	CommentFormSave(text string, standAlone bool)
	CommentFormCancel()
}

type ConfirmForm

type ConfirmForm struct {
	tview.Primitive

	Name     string
	Layout   *tview.Flex
	Info     *tview.TextView
	Form     *tview.Form
	Listener ConfirmFormListener

	DontAskAgain bool
}

func NewConfirmForm

func NewConfirmForm(name, msg string, listener ConfirmFormListener) *ConfirmForm

func (*ConfirmForm) GetName

func (form *ConfirmForm) GetName() string

type ConfirmFormListener

type ConfirmFormListener interface {
	ConfirmFormResult(confirmed, dontaskagain bool)
}

type DetailPage

type DetailPage struct {
	*tview.Flex
	ActionMap

	Application    *tview.Application
	Listener       DetailPageListener
	Patches        *tview.Table
	Header         *tview.Frame
	Patch          *model.Commit
	Content        *tview.TextView
	ContentLine    int
	ContentScroll  int
	ContentLen     int
	ContentRegions []PatchRegion
	CommentText    *tview.TextArea
	CommentForm    *CommentForm
	CommentFrame   *tview.Frame
	CommentEdit    bool
	CommentRegion  *PatchRegion
	CommentOffset  uint
	CommentShow    bool

	MergeReq *model.MergeReq

	Version int
}

func NewDetailPage

func NewDetailPage(app *tview.Application, listener DetailPageListener) *DetailPage

func (*DetailPage) Activate

func (page *DetailPage) Activate()

func (*DetailPage) CommentFormCancel

func (page *DetailPage) CommentFormCancel()

func (*DetailPage) CommentFormSave

func (page *DetailPage) CommentFormSave(text string, standAlone bool)

func (*DetailPage) GetKeyShortcuts

func (page *DetailPage) GetKeyShortcuts() string

func (*DetailPage) GetName

func (page *DetailPage) GetName() string

func (*DetailPage) Refresh

func (page *DetailPage) Refresh(mreq *model.MergeReq)

func (*DetailPage) SelectPatch

func (page *DetailPage) SelectPatch(num int)

func (*DetailPage) SwitchVersion

func (page *DetailPage) SwitchVersion(version int)

type DetailPageListener

type DetailPageListener interface {
	DetailPageQuit()
	DetailPageRefreshMergeRequest(mreq *model.MergeReq)
	DetailPageAddMergeReqComment(mreq *model.MergeReq, text string, standAlone bool, context *model.CommentContext)
	DetailPageAddMergeReqReply(mreq *model.MergeReq, thread, text string)
	DetailPageResolveMergeReqThread(mreq *model.MergeReq, thread string, resolved bool)
	DetailPageLoadMergeReqSeriesPatches(mreq *model.MergeReq, series *model.Series)
	DetailPageLoadMergeReqCommitDiffs(mreq *model.MergeReq, commit *model.Commit)
	DetailPageAcceptMergeReq(mreq *model.MergeReq)
	DetailPageApproveMergeReq(mreq *model.MergeReq)
	DetailPageUnapproveMergeReq(mreq *model.MergeReq)
	DetailPagePickVersion()
	DetailPageChangePatch(num int)
	DetailPageRunCommand(mreq *model.MergeReq, series *model.Series, commit *model.Commit)
}

type Display

type Display struct {
	*tview.Application

	TokenKey [32]byte
	Config   *config.AppConfig
	Keymap   *Keymap

	Engine    controller.Engine
	MergeReqs MergeReqListBatch
	Repos     []model.Repo
	Users     []string

	Layout       *tview.Flex
	KeyShortcuts *tview.TextView
	StatusBar    *tview.TextView
	MessageBar   *MessageBar
	Pages        *tview.Pages

	IndexPage    *IndexPage
	OverviewPage *OverviewPage
	DetailPage   *DetailPage
	ProjectsPage *ProjectsPage
	ReportsPage  *ReportsPage
	MessagesPage *MessagesPage
	ThisPage     Page

	Snake  *snake.Game
	Pacman *pacman.Game

	FormActive         bool
	AddProjectForm     *AddProjectForm
	EditProjectForm    *EditProjectForm
	ChoosePasswordForm *ChoosePasswordForm
	PasswordForm       *PasswordForm
	SortForm           *SortForm
	FilterForm         *FilterForm
	QuickFilterForm    *QuickFilterForm
	VersionForm        *VersionForm
	ExitConfirmForm    *ConfirmForm
	ReportForm         *ReportForm
	RunCommandForm     *RunCommandForm

	CtrlC bool

	Filter      filter.FilterInfo
	Sorter      sorter.SorterInfo
	ReportsList model.Reports
}

func NewDisplay

func NewDisplay(tlscfg *tls.Config, httpproxy *url.URL) (*Display, error)

func (*Display) AddProjectFormAutoFillToken

func (display *Display) AddProjectFormAutoFillToken(server, project string) string

func (*Display) AddProjectFormCancel

func (display *Display) AddProjectFormCancel()

func (*Display) AddProjectFormConfirm

func (display *Display) AddProjectFormConfirm(repo model.Repo)

func (*Display) ChoosePasswordFormConfirm

func (display *Display) ChoosePasswordFormConfirm(password string)

func (*Display) ConfirmFormResult

func (display *Display) ConfirmFormResult(confirmed, dontaskagain bool)

func (*Display) DetailPageAcceptMergeReq

func (display *Display) DetailPageAcceptMergeReq(mreq *model.MergeReq)

func (*Display) DetailPageAddMergeReqComment

func (display *Display) DetailPageAddMergeReqComment(mreq *model.MergeReq, text string, standAlone bool, context *model.CommentContext)

func (*Display) DetailPageAddMergeReqReply

func (display *Display) DetailPageAddMergeReqReply(mreq *model.MergeReq, thread, text string)

func (*Display) DetailPageApproveMergeReq

func (display *Display) DetailPageApproveMergeReq(mreq *model.MergeReq)

func (*Display) DetailPageChangePatch

func (display *Display) DetailPageChangePatch(num int)

func (*Display) DetailPageLoadMergeReqCommitDiffs

func (display *Display) DetailPageLoadMergeReqCommitDiffs(mreq *model.MergeReq, commit *model.Commit)

func (*Display) DetailPageLoadMergeReqSeriesPatches

func (display *Display) DetailPageLoadMergeReqSeriesPatches(mreq *model.MergeReq, series *model.Series)

func (*Display) DetailPagePickVersion

func (display *Display) DetailPagePickVersion()

func (*Display) DetailPageQuit

func (display *Display) DetailPageQuit()

func (*Display) DetailPageRefreshMergeRequest

func (display *Display) DetailPageRefreshMergeRequest(mreq *model.MergeReq)

func (*Display) DetailPageResolveMergeReqThread

func (display *Display) DetailPageResolveMergeReqThread(mreq *model.MergeReq, thread string, resolved bool)

func (*Display) DetailPageRunCommand

func (display *Display) DetailPageRunCommand(mreq *model.MergeReq, ver *model.Series, patch *model.Commit)

func (*Display) DetailPageUnapproveMergeReq

func (display *Display) DetailPageUnapproveMergeReq(mreq *model.MergeReq)

func (*Display) EditProjectFormCancel

func (display *Display) EditProjectFormCancel()

func (*Display) EditProjectFormConfirm

func (display *Display) EditProjectFormConfirm(repo model.Repo)

func (*Display) FilterFormCancel

func (display *Display) FilterFormCancel()

func (*Display) FilterFormConfirm

func (display *Display) FilterFormConfirm(info filter.FilterInfo)

func (*Display) IndexPagePickFilter

func (display *Display) IndexPagePickFilter()

func (*Display) IndexPagePickQuickFilter

func (display *Display) IndexPagePickQuickFilter()

func (*Display) IndexPagePickSort

func (display *Display) IndexPagePickSort()

func (*Display) IndexPageQuit

func (display *Display) IndexPageQuit()

func (*Display) IndexPageRefreshMergeRequests

func (display *Display) IndexPageRefreshMergeRequests()

func (*Display) IndexPageRunCommand

func (display *Display) IndexPageRunCommand(mreq *model.MergeReq, ver *model.Series)

func (*Display) IndexPageViewMergeRequest

func (display *Display) IndexPageViewMergeRequest(mreq model.MergeReq)

func (*Display) IndexPageViewMessages

func (display *Display) IndexPageViewMessages()

func (*Display) IndexPageViewProjects

func (display *Display) IndexPageViewProjects()

func (*Display) IndexPageViewReports

func (display *Display) IndexPageViewReports()

func (*Display) MergeRequestNotify

func (display *Display) MergeRequestNotify(mreq *model.MergeReq)

func (*Display) MessagesPageQuit

func (display *Display) MessagesPageQuit()

func (*Display) OverviewPageAcceptMergeReq

func (display *Display) OverviewPageAcceptMergeReq(mreq *model.MergeReq)

func (*Display) OverviewPageApproveMergeReq

func (display *Display) OverviewPageApproveMergeReq(mreq *model.MergeReq)

func (*Display) OverviewPageChangePatch

func (display *Display) OverviewPageChangePatch(num int)

func (*Display) OverviewPagePickVersion

func (display *Display) OverviewPagePickVersion()

func (*Display) OverviewPageQuit

func (display *Display) OverviewPageQuit()

func (*Display) OverviewPageRefreshMergeRequest

func (display *Display) OverviewPageRefreshMergeRequest(mreq *model.MergeReq)

func (*Display) OverviewPageRunCommand

func (display *Display) OverviewPageRunCommand(mreq *model.MergeReq, ver *model.Series, patch *model.Commit)

func (*Display) OverviewPageUnapproveMergeReq

func (display *Display) OverviewPageUnapproveMergeReq(mreq *model.MergeReq)

func (*Display) PacmanGameFinished

func (display *Display) PacmanGameFinished()

func (*Display) PasswordFormConfirm

func (display *Display) PasswordFormConfirm(password string) error

func (*Display) ProjectsPageAddRepo

func (display *Display) ProjectsPageAddRepo()

func (*Display) ProjectsPageEditRepo

func (display *Display) ProjectsPageEditRepo(repo model.Repo)

func (*Display) ProjectsPageQuit

func (display *Display) ProjectsPageQuit()

func (*Display) RepoAdded

func (display *Display) RepoAdded(repo model.Repo)

func (*Display) RepoRemoved

func (display *Display) RepoRemoved(repo model.Repo)

func (*Display) ReportFormCancel

func (display *Display) ReportFormCancel()

func (*Display) ReportFormConfirm

func (display *Display) ReportFormConfirm(report model.Report)

func (*Display) ReportsPageAddReport

func (display *Display) ReportsPageAddReport()

func (*Display) ReportsPageApplyReport

func (display *Display) ReportsPageApplyReport(report model.Report)

func (*Display) ReportsPageDeleteReport

func (display *Display) ReportsPageDeleteReport(report model.Report)

func (*Display) ReportsPageEditReport

func (display *Display) ReportsPageEditReport(report model.Report)

func (*Display) ReportsPageQuit

func (display *Display) ReportsPageQuit()

func (*Display) ReportsPageSetDefault

func (display *Display) ReportsPageSetDefault(report model.Report)

func (*Display) Run

func (display *Display) Run() error

func (*Display) RunCommandFormCancel

func (display *Display) RunCommandFormCancel()

func (*Display) RunCommandFormConfirm

func (display *Display) RunCommandFormConfirm(cmdargs, cmdenv []string)

func (*Display) SnakeGameFinished

func (display *Display) SnakeGameFinished()

func (*Display) SortFormCancel

func (display *Display) SortFormCancel()

func (*Display) SortFormConfirm

func (display *Display) SortFormConfirm(info sorter.SorterInfo)

func (*Display) Status

func (display *Display) Status(msg string)

func (*Display) VersionFormCancel

func (display *Display) VersionFormCancel()

func (*Display) VersionFormConfirm

func (display *Display) VersionFormConfirm(version int)

type EditProjectForm

type EditProjectForm struct {
	tview.Primitive

	Form        *tview.Form
	Application *tview.Application
	Listener    EditProjectFormListener
	Directory   *tview.InputField
	Remote      *tview.InputField
	NickName    *tview.InputField
	Server      *tview.InputField
	Project     *tview.InputField
	Token       *tview.InputField
	Global      *tview.Checkbox
	State       *tview.DropDown

	Repo model.Repo
}

func NewEditProjectForm

func NewEditProjectForm(app *tview.Application, listener EditProjectFormListener) *EditProjectForm

func (*EditProjectForm) GetName

func (form *EditProjectForm) GetName() string

func (*EditProjectForm) SetRepo

func (form *EditProjectForm) SetRepo(repo model.Repo)

type EditProjectFormListener

type EditProjectFormListener interface {
	EditProjectFormCancel()
	EditProjectFormConfirm(repo model.Repo)
}

type FilterForm

type FilterForm struct {
	tview.Primitive

	Form     *tview.Form
	Listener FilterFormListener
	Projects *tview.DropDown
	Authors  *tview.DropDown

	StateOpen   bool
	StateClosed bool
	StateLocked bool
	StateMerged bool

	StatusNew     bool
	StatusUpdated bool
	StatusOld     bool
	StatusRead    bool

	Project string
	AgeUnit string
	AgeVal  time.Duration
	Author  string
	Label   string
	WIP     *bool
}

func NewFilterForm

func NewFilterForm(listener FilterFormListener) *FilterForm

func (*FilterForm) GetName

func (form *FilterForm) GetName() string

func (*FilterForm) Refresh

func (form *FilterForm) Refresh(repos model.Repos, names []string)

type FilterFormListener

type FilterFormListener interface {
	FilterFormConfirm(info filter.FilterInfo)
	FilterFormCancel()
}

type Form

type Form interface {
	tview.Primitive
	GetName() string
}

type IndexPage

type IndexPage struct {
	*tview.Frame
	ActionMap

	Application *tview.Application
	Listener    IndexPageListener
	MergeReqs   *tview.Table
}

func NewIndexPage

func NewIndexPage(app *tview.Application, listener IndexPageListener) *IndexPage

func (*IndexPage) Activate

func (page *IndexPage) Activate()

func (*IndexPage) GetKeyShortcuts

func (page *IndexPage) GetKeyShortcuts() string

func (*IndexPage) GetName

func (page *IndexPage) GetName() string

func (*IndexPage) GetSelectedMergeRequest

func (page *IndexPage) GetSelectedMergeRequest() *model.MergeReq

func (*IndexPage) Refresh

func (page *IndexPage) Refresh(mreqs []*model.MergeReq)

func (*IndexPage) SelectNextNewishMergeRequest

func (page *IndexPage) SelectNextNewishMergeRequest()

type IndexPageListener

type IndexPageListener interface {
	IndexPageQuit()
	IndexPageViewMergeRequest(mreq model.MergeReq)
	IndexPageViewProjects()
	IndexPageViewReports()
	IndexPageViewMessages()
	IndexPageRefreshMergeRequests()
	IndexPagePickSort()
	IndexPagePickFilter()
	IndexPagePickQuickFilter()
	IndexPageRunCommand(mreq *model.MergeReq, series *model.Series)
}

type Keymap

type Keymap struct {
	Groups map[string]KeymapGroup
}

func NewKeymap

func NewKeymap() *Keymap

func (*Keymap) LoadConfig

func (kmap *Keymap) LoadConfig() error

func (*Keymap) SaveConfig

func (kmap *Keymap) SaveConfig() error

func (*Keymap) UpdateActionMap

func (kmap *Keymap) UpdateActionMap(amap ActionMap) (bool, error)

type KeymapEntry

type KeymapEntry struct {
	Action  string
	Primary bool
	Default string
}

type KeymapGroup

type KeymapGroup struct {
	Entries map[string]KeymapEntry
}

type MergeReqListBatch

type MergeReqListBatch struct {
	model.MergeReqList

	// Invoked from controller background goroutine
	Notify  func([]*model.MergeReq)
	Pending chan *model.MergeReq
}

func NewMergeReqListBatch

func NewMergeReqListBatch(notify func([]*model.MergeReq)) MergeReqListBatch

func (*MergeReqListBatch) InsertBatch

func (mbatch *MergeReqListBatch) InsertBatch(mreqs []*model.MergeReq)

Invoked from tview main goroutine

func (*MergeReqListBatch) InsertDelayed

func (mbatch *MergeReqListBatch) InsertDelayed(mreq *model.MergeReq)

Invoked from controller background goroutine

type MessageBar

type MessageBar struct {
	App    *tview.Application
	Text   *tview.TextView
	Expiry *time.Time
	Clear  chan time.Duration
}

func NewMessageBar

func NewMessageBar(app *tview.Application) *MessageBar

func (*MessageBar) Info

func (msgbar *MessageBar) Info(msg string)

type Messages

type Messages interface {
	Info(message string)
}

type MessagesPage

type MessagesPage struct {
	*tview.Frame
	ActionMap

	Application *tview.Application
	Listener    MessagesPageListener

	Content *tview.TextView
}

func NewMessagesPage

func NewMessagesPage(app *tview.Application, listener MessagesPageListener) *MessagesPage

func (*MessagesPage) Activate

func (page *MessagesPage) Activate()

func (*MessagesPage) GetKeyShortcuts

func (page *MessagesPage) GetKeyShortcuts() string

func (*MessagesPage) GetName

func (page *MessagesPage) GetName() string

func (*MessagesPage) Info

func (page *MessagesPage) Info(msg string)

type MessagesPageListener

type MessagesPageListener interface {
	MessagesPageQuit()
}

type OverviewPage

type OverviewPage struct {
	*tview.Frame
	ActionMap

	Application *tview.Application
	Listener    OverviewPageListener
	Patches     *tview.Table

	MergeReq *model.MergeReq

	Version int
}

func NewOverviewPage

func NewOverviewPage(app *tview.Application, listener OverviewPageListener) *OverviewPage

func (*OverviewPage) Activate

func (page *OverviewPage) Activate()

func (*OverviewPage) GetKeyShortcuts

func (page *OverviewPage) GetKeyShortcuts() string

func (*OverviewPage) GetName

func (page *OverviewPage) GetName() string

func (*OverviewPage) Refresh

func (page *OverviewPage) Refresh(mreq *model.MergeReq)

func (*OverviewPage) SelectPatch

func (page *OverviewPage) SelectPatch(num int)

func (*OverviewPage) SwitchVersion

func (page *OverviewPage) SwitchVersion(version int)

type OverviewPageListener

type OverviewPageListener interface {
	OverviewPageQuit()
	OverviewPageRefreshMergeRequest(mreq *model.MergeReq)
	OverviewPageAcceptMergeReq(mreq *model.MergeReq)
	OverviewPageApproveMergeReq(mreq *model.MergeReq)
	OverviewPageUnapproveMergeReq(mreq *model.MergeReq)
	OverviewPagePickVersion()
	OverviewPageChangePatch(num int)
	OverviewPageRunCommand(mreq *model.MergeReq, series *model.Series, commit *model.Commit)
}

type Page

type Page interface {
	Form
	ActionMap
	GetKeyShortcuts() string
	Activate()
}

type PasswordForm

type PasswordForm struct {
	tview.Primitive

	Layout   *tview.Flex
	Info     *tview.TextView
	Form     *tview.Form
	Warning  *tview.TextView
	Listener PasswordFormListener

	Password string
}

func NewPasswordForm

func NewPasswordForm(listener PasswordFormListener) *PasswordForm

func (*PasswordForm) GetName

func (form *PasswordForm) GetName() string

type PasswordFormListener

type PasswordFormListener interface {
	PasswordFormConfirm(password string) error
}

type PatchRegion

type PatchRegion struct {
	IDStart   int
	IDEnd     int
	Type      diff.DiffLineType
	OldFile   string
	OldLine   uint
	NewFile   string
	NewLine   uint
	Thread    string
	ThreadIdx int
}

func FormatCommit

func FormatCommit(commit *model.Commit, series *model.Series, commentShow bool, threads []model.CommentThread) ([]string, []PatchRegion, error)

func FormatThreads

func FormatThreads(threads []model.CommentThread, threadidxs []int, filemarkers bool, endsep bool, region *int, indent string) (lines []string, regions []PatchRegion)

type ProjectsPage

type ProjectsPage struct {
	*tview.Frame
	ActionMap

	Application *tview.Application
	Listener    ProjectsPageListener
	Projects    *tview.Table
}

func NewProjectsPage

func NewProjectsPage(app *tview.Application, listener ProjectsPageListener) *ProjectsPage

func (*ProjectsPage) Activate

func (page *ProjectsPage) Activate()

func (*ProjectsPage) GetKeyShortcuts

func (page *ProjectsPage) GetKeyShortcuts() string

func (*ProjectsPage) GetName

func (page *ProjectsPage) GetName() string

func (*ProjectsPage) Refresh

func (page *ProjectsPage) Refresh(repos model.Repos)

type ProjectsPageListener

type ProjectsPageListener interface {
	ProjectsPageQuit()
	ProjectsPageAddRepo()
	ProjectsPageEditRepo(repo model.Repo)
}

type QuickFilterForm

type QuickFilterForm struct {
	tview.Primitive

	Form     *tview.Form
	Listener FilterFormListener
	Error    *tview.TextView

	Filter       *tview.InputField
	FilterString string
}

func NewQuickFilterForm

func NewQuickFilterForm(listener FilterFormListener) *QuickFilterForm

func (*QuickFilterForm) GetName

func (form *QuickFilterForm) GetName() string

func (*QuickFilterForm) SetMergeReqFilter

func (form *QuickFilterForm) SetMergeReqFilter(filterexpr string)

type ReportForm

type ReportForm struct {
	tview.Primitive

	Form     *tview.Form
	Listener ReportFormListener
	Error    *tview.TextView

	Name   *tview.InputField
	Filter *tview.InputField
	Sorter *tview.InputField

	Report model.Report
}

func NewReportForm

func NewReportForm(listener ReportFormListener) *ReportForm

func (*ReportForm) GetName

func (form *ReportForm) GetName() string

func (*ReportForm) SetReport

func (form *ReportForm) SetReport(report model.Report)

type ReportFormListener

type ReportFormListener interface {
	ReportFormConfirm(report model.Report)
	ReportFormCancel()
}

type ReportsPage

type ReportsPage struct {
	*tview.Frame
	ActionMap

	Application *tview.Application
	Listener    ReportsPageListener
	Reports     *tview.Table
}

func NewReportsPage

func NewReportsPage(app *tview.Application, listener ReportsPageListener) *ReportsPage

func (*ReportsPage) Activate

func (page *ReportsPage) Activate()

func (*ReportsPage) GetKeyShortcuts

func (page *ReportsPage) GetKeyShortcuts() string

func (*ReportsPage) GetName

func (page *ReportsPage) GetName() string

func (*ReportsPage) Refresh

func (page *ReportsPage) Refresh(reports model.Reports)

type ReportsPageListener

type ReportsPageListener interface {
	ReportsPageQuit()
	ReportsPageSetDefault(report model.Report)
	ReportsPageApplyReport(report model.Report)
	ReportsPageDeleteReport(report model.Report)
	ReportsPageEditReport(report model.Report)
	ReportsPageAddReport()
}

type RunCommandForm

type RunCommandForm struct {
	tview.Primitive

	Form     *tview.Form
	Listener RunCommandFormListener
	Error    *tview.TextView

	Command  *tview.InputField
	UseShell *tview.Checkbox

	MergeReq *model.MergeReq
	Version  *model.Series
	Patch    *model.Commit
}

func NewRunCommandForm

func NewRunCommandForm(listener RunCommandFormListener) *RunCommandForm

func (*RunCommandForm) GetName

func (form *RunCommandForm) GetName() string

func (*RunCommandForm) SetContext

func (form *RunCommandForm) SetContext(mreq *model.MergeReq, ver *model.Series, patch *model.Commit)

type RunCommandFormListener

type RunCommandFormListener interface {
	RunCommandFormConfirm(cmdargs, cmdenv []string)
	RunCommandFormCancel()
}

type SortForm

type SortForm struct {
	tview.Primitive

	Form     *tview.Form
	Listener SortFormListener

	Order   int
	Reverse bool
}

func NewSortForm

func NewSortForm(listener SortFormListener) *SortForm

func (*SortForm) GetName

func (form *SortForm) GetName() string

type SortFormListener

type SortFormListener interface {
	SortFormConfirm(info sorter.SorterInfo)
	SortFormCancel()
}

type StyleElement

type StyleElement int
const (
	ELEMENT_PRIMITIVE_FILL StyleElement = iota
	ELEMENT_CONTRAST_FILL
	ELEMENT_MORE_CONTRAST_FILL

	ELEMENT_PRIMARY_TEXT
	ELEMENT_SECONDARY_TEXT
	ELEMENT_TERTIARY_TEXT
	ELEMENT_INVERSE_TEXT
	ELEMENT_CONTRAST_SECONDARY_TEXT

	ELEMENT_BORDER
	ELEMENT_TITLE
	ELEMENT_GRAPHICS

	ELEMENT_STATUS_TEXT
	ELEMENT_STATUS_FILL
	ELEMENT_STATUS_ATTR

	ELEMENT_SHORTCUTS_TEXT
	ELEMENT_SHORTCUTS_FILL
	ELEMENT_SHORTCUTS_ATTR

	ELEMENT_MREQS_ACTIVE_TEXT
	ELEMENT_MREQS_ACTIVE_FILL
	ELEMENT_MREQS_ACTIVE_ATTR

	ELEMENT_MREQS_INACTIVE_TEXT
	ELEMENT_MREQS_INACTIVE_FILL
	ELEMENT_MREQS_INACTIVE_ATTR

	ELEMENT_HEADER_TEXT
	ELEMENT_HEADER_FILL
	ELEMENT_HEADER_ATTR

	ELEMENT_SUMMARY_SEPARATOR_TEXT
	ELEMENT_SUMMARY_SEPARATOR_FILL
	ELEMENT_SUMMARY_SEPARATOR_ATTR

	ELEMENT_SUMMARY_HEADER_TEXT
	ELEMENT_SUMMARY_HEADER_FILL
	ELEMENT_SUMMARY_HEADER_ATTR

	ELEMENT_SUMMARY_TITLE_TEXT
	ELEMENT_SUMMARY_TITLE_FILL
	ELEMENT_SUMMARY_TITLE_ATTR

	ELEMENT_SUMMARY_DATE_TEXT
	ELEMENT_SUMMARY_DATE_FILL
	ELEMENT_SUMMARY_DATE_ATTR

	ELEMENT_SUMMARY_AUTHOR_TEXT
	ELEMENT_SUMMARY_AUTHOR_FILL
	ELEMENT_SUMMARY_AUTHOR_ATTR

	ELEMENT_COMMENT_QUOTED_TEXT
	ELEMENT_COMMENT_QUOTED_FILL
	ELEMENT_COMMENT_QUOTED_ATTR

	ELEMENT_PROJECTS_ACTIVE_TEXT
	ELEMENT_PROJECTS_ACTIVE_FILL
	ELEMENT_PROJECTS_ACTIVE_ATTR

	ELEMENT_PROJECTS_INACTIVE_TEXT
	ELEMENT_PROJECTS_INACTIVE_FILL
	ELEMENT_PROJECTS_INACTIVE_ATTR

	ELEMENT_REPORTS_ACTIVE_TEXT
	ELEMENT_REPORTS_ACTIVE_FILL
	ELEMENT_REPORTS_ACTIVE_ATTR

	ELEMENT_REPORTS_INACTIVE_TEXT
	ELEMENT_REPORTS_INACTIVE_FILL
	ELEMENT_REPORTS_INACTIVE_ATTR

	ELEMENT_DIFF_PREAMBLE_TEXT
	ELEMENT_DIFF_PREAMBLE_FILL
	ELEMENT_DIFF_PREAMBLE_ATTR

	ELEMENT_DIFF_HUNK_TEXT
	ELEMENT_DIFF_HUNK_FILL
	ELEMENT_DIFF_HUNK_ATTR

	ELEMENT_DIFF_LINE_TEXT
	ELEMENT_DIFF_LINE_FILL
	ELEMENT_DIFF_LINE_ATTR

	ELEMENT_DIFF_CONTEXT_TEXT
	ELEMENT_DIFF_CONTEXT_FILL
	ELEMENT_DIFF_CONTEXT_ATTR

	ELEMENT_DIFF_ADDED_TEXT
	ELEMENT_DIFF_ADDED_FILL
	ELEMENT_DIFF_ADDED_ATTR

	ELEMENT_DIFF_REMOVED_TEXT
	ELEMENT_DIFF_REMOVED_FILL
	ELEMENT_DIFF_REMOVED_ATTR

	ELEMENT_DIFF_ALERT_TEXT
	ELEMENT_DIFF_ALERT_FILL
	ELEMENT_DIFF_ALERT_ATTR

	ELEMENT_DIFF_WHITESPACE_FILL

	ELEMENT_MESSAGES_TEXT
	ELEMENT_MESSAGES_FILL
	ELEMENT_MESSAGES_ATTR
)

type StyleOption

type StyleOption int
const (
	OPTION_ALLOW_EMOJI StyleOption = iota
)

type VersionForm

type VersionForm struct {
	tview.Primitive

	Form     *tview.Form
	Listener VersionFormListener

	MergeReq *model.MergeReq

	Version           *tview.DropDown
	VersionSearchNum  int
	VersionSearchLast time.Time
	// contains filtered or unexported fields
}

func NewVersionForm

func NewVersionForm(listener VersionFormListener) *VersionForm

func (*VersionForm) Focus

func (form *VersionForm) Focus(delegate func(p tview.Primitive))

func (*VersionForm) GetName

func (form *VersionForm) GetName() string

func (*VersionForm) Refresh

func (form *VersionForm) Refresh(mreq *model.MergeReq)

type VersionFormListener

type VersionFormListener interface {
	VersionFormConfirm(version int)
	VersionFormCancel()
}

Directories

Path Synopsis
distractions

Jump to

Keyboard shortcuts

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