forms

package
v0.0.0-...-a1add1d Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package forms generated by go-bindata.// sources: glade/gnote-editpref.glade glade/gnote.glade glade/input-dialog.glade glade/note-search.glade glade/note.glade icons/aptdaemon-resolve.png icons/clear_left.png icons/configure.png icons/cookie.png icons/decrypted.png icons/document-new.png icons/email.png icons/kate.png icons/kcoloredit.png icons/kgpg.png icons/redo.png icons/undo.png

Index

Constants

This section is empty.

Variables

View Source
var CookieJar *cookiejar.Jar
View Source
var DateLayout string

DateLayout - global

View Source
var DbConn *gorm.DB

DbConn - Global DB connection

View Source
var WebNotePassword string

WebNotePassword

View Source
var WebNoteUser string

WebNoteUser

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 ChangePassphrase

func ChangePassphrase(old, new, keyFile string) error

func ChromaHighlight

func ChromaHighlight(inputString, lexer string) (out string, err error)

ChromaHighlight - Syntax highlighter using Chroma syntax highlighter: "github.com/alecthomas/chroma" informations above

func CreateDataNoteLangFileExt

func CreateDataNoteLangFileExt()

Populate some notes needed for data lookup - used by other part of the app Currently we store the language / file extention data but in the future we might store more This note is used to lookup Language => File Extention so we can save the note to file with correct extension in note-pad.go and note-search.go

func CreateDataNoteListOfLanguageSupport

func CreateDataNoteListOfLanguageSupport()

Parse the language string that current gtksourceview support and save it to a note so we can check against it The list is created from this command on linux ls /usr/share/gtksourceview-3.0/language-specs/ | sed 's/.lang//'

func CreateWinBundle

func CreateWinBundle(mingw64Prefix string)

Python and msys shell is like s***t. File not found while file exists and etc etc.. FFS lets write it in golang

func DeleteConfig

func DeleteConfig(key string) error

DeleteConfig - delete the config key

func DoMigration

func DoMigration(oldDB, newDB string)

DoMigration - once off - this is old

func DoMigrationV1

func DoMigrationV1(oldDB, newDB string)

func GetButton

func GetButton(b *gtk.Builder, id string) (btn *gtk.Button)

func GetCheckMenuItem

func GetCheckMenuItem(b *gtk.Builder, id string) (el *gtk.CheckMenuItem)

func GetConfig

func GetConfig(key ...string) (string, error)

GetConfig - by key and return value. Give second arg as default value.

func GetDialog

func GetDialog(b *gtk.Builder, id string) (Window *gtk.Dialog)

func GetEntry

func GetEntry(b *gtk.Builder, id string) (treeView *gtk.Entry)

func GetFirstnChar

func GetFirstnChar(text string, n int) (o string)

func GetLabel

func GetLabel(b *gtk.Builder, id string) (treeView *gtk.Label)

func GetListStore

func GetListStore(b *gtk.Builder, id string) (listStore *gtk.ListStore)

func GetMenuItem

func GetMenuItem(b *gtk.Builder, id string) (el *gtk.MenuItem)

func GetNoteFromLua

func GetNoteFromLua(L *lua.LState) int

func GetSearchEntry

func GetSearchEntry(b *gtk.Builder, id string) (treeView *gtk.SearchEntry)

func GetSourceView

func GetSourceView(b *gtk.Builder, id string) *sourceview.SourceView

func GetStatusBar

func GetStatusBar(b *gtk.Builder, id string) (treeView *gtk.Statusbar)

func GetTextView

func GetTextView(b *gtk.Builder, id string) (treeView *gtk.TextView)

func GetTreeView

func GetTreeView(b *gtk.Builder, id string) (treeView *gtk.TreeView)

func GetWebnoteCredential

func GetWebnoteCredential() string

func GetWindow

func GetWindow(b *gtk.Builder, id string) (Window *gtk.Window)

func InputDialog

func InputDialog(opt ...interface{}) string

InputDialog - Args: title, label prompt, password-mask,

func IsLanguageSupported

func IsLanguageSupported(lang string) string

Take a string, lookup the supported language and if found return the string or match part of string. If completely not found, return empty string

func LoginToWebnote

func LoginToWebnote() (*http.Client, string, string)

func LookupFileExtByLanguage

func LookupFileExtByLanguage(lang string) string

func MessageBox

func MessageBox(msg string)

MessageBox - display a message

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 RestoreAssetsAll

func RestoreAssetsAll(extractDir string)

RestoreAssetsAll -

func RunLuaFile

func RunLuaFile(luaFileName string) string

func SearchNotesFromLua

func SearchNotesFromLua(L *lua.LState) int

func SetConfig

func SetConfig(key, val string) error

SetConfig - Set a config key with value

func SetupConfigDB

func SetupConfigDB()

SetupConfigDB - SetupDB. This is the initial point of config setup. Note init() does not work if it relies on DbConn as at the time the DBPATH is not yet available

func SetupDefaultConfig

func SetupDefaultConfig()

SetupDefaultConfig - Setup/reset default configuration set

func UpdateNotesFromLua

func UpdateNotesFromLua(L *lua.LState) int

Types

type AppConfig

type AppConfig struct {
	gorm.Model
	// Section string `gorm:"type:varchar(128);unique_index:section_key"`
	Key string `gorm:"type:varchar(128);unique_index:section_key"`
	Val string `gorm:"type:text"`
}

AppConfig - Application config struct

type GnoteApp

type GnoteApp struct {
	Builder    *gtk.Builder
	MainWindow *gtk.Window
	// contains filtered or unexported fields
}

GnoteApp - struct

func (*GnoteApp) DoChangePassphrase

func (app *GnoteApp) DoChangePassphrase()

Change Passphrase

func (*GnoteApp) DoCreateNoteFromClipboard

func (app *GnoteApp) DoCreateNoteFromClipboard()

Create a note from current clipboard

func (*GnoteApp) DoExportNotes

func (app *GnoteApp) DoExportNotes()

Export a selections of notes into json file

func (*GnoteApp) DoImportNotes

func (app *GnoteApp) DoImportNotes()

Import notes from previously exported json file

func (*GnoteApp) DoResetDB

func (app *GnoteApp) DoResetDB()

func (*GnoteApp) DoSetConfig

func (app *GnoteApp) DoSetConfig()

Set config Key -> Value. We no longer be able to open the db directly using sqlite3 command if teh file is encrypted thus we need this

func (*GnoteApp) DoSyncNotesFromWebnote

func (app *GnoteApp) DoSyncNotesFromWebnote()

func (*GnoteApp) DoUpdateResource

func (app *GnoteApp) DoUpdateResource()

DoUpdateResource -

func (*GnoteApp) DoVacuum

func (app *GnoteApp) DoVacuum()

func (*GnoteApp) InitApp

func (app *GnoteApp) InitApp()

InitApp -

func (*GnoteApp) NewNoteFromFile

func (app *GnoteApp) NewNoteFromFile(o *gtk.FileChooserButton)

NewNoteFromFile -

func (*GnoteApp) ResultListKeyPress

func (app *GnoteApp) ResultListKeyPress(w *gtk.TreeView, ev *gdk.Event)

ResultListKeyPress - evt

func (*GnoteApp) RowActivated

func (app *GnoteApp) RowActivated(treeView *gtk.TreeView, path *gtk.TreePath, column *gtk.TreeViewColumn)

RowActivated - Process when a treeview list row activated. Pop up a note window with the id

func (*GnoteApp) ShowMain

func (app *GnoteApp) ShowMain()

ShowMain - show main window to do something. Meant to be called from NotePad

func (*GnoteApp) TreeSelectionChanged

func (app *GnoteApp) TreeSelectionChanged(s *gtk.TreeSelection)

TreeSelectionChanged - evt

type Note

type Note struct {
	// Do not embed gorm Model as we use our own ID as primary key
	// gorm.Model
	ID            int    `gorm:"primary_key,AUTO_INCREMENT"`
	Title         string `gorm:"type:varchar(512);not null;unique_index"`
	Datelog       int64  `gorm:"type:int"`
	Content       string `gorm:"type:text"`
	URL           string `gorm:"type:text"`
	Flags         string `gorm:"type:text"`
	ReminderTicks int64  `gorm:"type:int;default 0"`
	Timestamp     int64  `gorm:"type:int;default 0"`
	Readonly      int8   `gorm:"default 0"`
	FormatTag     []byte
	AlertCount    int8 `gorm:"type:int;default 0"`
	PixbufDict    []byte
	TimeSpent     int `gorm:"type:int;default 0"`
	LastTextMark  []byte
	Language      string `gorm:"type:text"`
	FileExt       string `gorm:"type:text"`
}

Note - data structure

func (*Note) Delete

func (n *Note) Delete()

Delete - Delete note

func (*Note) NewNote

func (n *Note) NewNote(in map[string]interface{})

NewNote - Create a new note object

func (*Note) String

func (n *Note) String() string

func (*Note) Update

func (n *Note) Update(in map[string]interface{})

Update - Update existing note. Currently not need as the above already populate most data

type NotePad

type NotePad struct {
	StartUpdateTime time.Time

	Note
	// contains filtered or unexported fields
}

NotePad - GUI related

func NewNoteFromFile

func NewNoteFromFile(filename string) *NotePad

NewNoteFromFile -

func NewNotePad

func NewNotePad(id int) *NotePad

NewNotePad - Create new NotePad

func (*NotePad) AppendUpdateMarkBtnClick

func (np *NotePad) AppendUpdateMarkBtnClick()

func (*NotePad) ClearFlagsBtnClick

func (np *NotePad) ClearFlagsBtnClick()

func (*NotePad) ClearURL

func (np *NotePad) ClearURL()

func (*NotePad) DecryptContent

func (np *NotePad) DecryptContent()

func (*NotePad) DoHighlight

func (np *NotePad) DoHighlight()

func (*NotePad) EncryptContent

func (np *NotePad) EncryptContent()

func (*NotePad) EndUpdateMarkBtnClick

func (np *NotePad) EndUpdateMarkBtnClick()

func (*NotePad) FetchDataFromGUI

func (np *NotePad) FetchDataFromGUI()

FetchDataFromGUI - populate the Note data from GUI widget. Prepare to save to db or anything else

func (*NotePad) GetSelection

func (np *NotePad) GetSelection() (string, *gtk.TextIter, *gtk.TextIter)

GetSelection - Get the current selection and return start_iter, end_iter, text To be used in various places

func (*NotePad) HighlightBtnClick

func (np *NotePad) HighlightBtnClick()

HighlightBtnClick -

func (*NotePad) InsertFileToNote

func (np *NotePad) InsertFileToNote(o *gtk.FileChooserButton)

func (*NotePad) KeyPressed

func (np *NotePad) KeyPressed(o interface{}, ev *gdk.Event) bool

KeyPressed - handle key board

func (*NotePad) Load

func (np *NotePad) Load(id int)

Load - Load note data and set the widget with data

func (*NotePad) NewLinkNote

func (np *NotePad) NewLinkNote()

func (*NotePad) NoteSearch

func (np *NotePad) NoteSearch()

NoteSearch - Search text in the note

func (*NotePad) NoteSearchText

func (np *NotePad) NoteSearchText()

func (*NotePad) SaveNote

func (np *NotePad) SaveNote()

SaveNote - save current note

func (*NotePad) SaveNoteToFile

func (np *NotePad) SaveNoteToFile()

func (*NotePad) SaveToWebnote

func (np *NotePad) SaveToWebnote()

SaveToWebnote - save to webnote store

func (*NotePad) SaveWindowSize

func (np *NotePad) SaveWindowSize()

SaveWindowSize -

func (*NotePad) SearchNoteFromPad

func (np *NotePad) SearchNoteFromPad()

func (*NotePad) ShowMainWindowBtnClick

func (np *NotePad) ShowMainWindowBtnClick(o *gtk.Button)

ShowMainWindowBtnClick -

func (*NotePad) TextChanged

func (np *NotePad) TextChanged()

TextChanged - Marked as changed

func (*NotePad) ToggleReadOnly

func (np *NotePad) ToggleReadOnly(bt *gtk.ToggleButton)

ToggleReadOnly - set content readonly mode

type NoteSearch

type NoteSearch struct {
	// contains filtered or unexported fields
}

NoteSearch - GUI related

func NewNoteSearch

func NewNoteSearch(np *NotePad) *NoteSearch

NewNoteSearch - Create new NotePad

func (*NoteSearch) CommandFilter

func (ns *NoteSearch) CommandFilter(o *gtk.CheckButton)

func (*NoteSearch) FindText

func (ns *NoteSearch) FindText() bool

func (*NoteSearch) KeyPressed

func (ns *NoteSearch) KeyPressed(o interface{}, ev *gdk.Event)

func (*NoteSearch) NoteFindIcase

func (ns *NoteSearch) NoteFindIcase(o *gtk.CheckButton)

func (*NoteSearch) NoteFindText

func (ns *NoteSearch) NoteFindText()

NoteFindText -

func (*NoteSearch) NoteReplaceAll

func (ns *NoteSearch) NoteReplaceAll(o *gtk.Button)

NoteReplaceAll -

func (*NoteSearch) NoteReplaceText

func (ns *NoteSearch) NoteReplaceText(o *gtk.Button)

NoteReplaceText -

func (*NoteSearch) OutputToNewNote

func (ns *NoteSearch) OutputToNewNote(o *gtk.CheckButton)

func (*NoteSearch) ResetIter

func (ns *NoteSearch) ResetIter()

Jump to

Keyboard shortcuts

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