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 ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func ChangePassphrase(old, new, keyFile string) error
- func ChromaHighlight(inputString, lexer string) (out string, err error)
- func CreateDataNoteLangFileExt()
- func CreateDataNoteListOfLanguageSupport()
- func CreateWinBundle(mingw64Prefix string)
- func DeleteConfig(key string) error
- func DoMigration(oldDB, newDB string)
- func DoMigrationV1(oldDB, newDB string)
- func GetButton(b *gtk.Builder, id string) (btn *gtk.Button)
- func GetCheckMenuItem(b *gtk.Builder, id string) (el *gtk.CheckMenuItem)
- func GetConfig(key ...string) (string, error)
- func GetDialog(b *gtk.Builder, id string) (Window *gtk.Dialog)
- func GetEntry(b *gtk.Builder, id string) (treeView *gtk.Entry)
- func GetFirstnChar(text string, n int) (o string)
- func GetLabel(b *gtk.Builder, id string) (treeView *gtk.Label)
- func GetListStore(b *gtk.Builder, id string) (listStore *gtk.ListStore)
- func GetMenuItem(b *gtk.Builder, id string) (el *gtk.MenuItem)
- func GetNoteFromLua(L *lua.LState) int
- func GetSearchEntry(b *gtk.Builder, id string) (treeView *gtk.SearchEntry)
- func GetSourceView(b *gtk.Builder, id string) *sourceview.SourceView
- func GetStatusBar(b *gtk.Builder, id string) (treeView *gtk.Statusbar)
- func GetTextView(b *gtk.Builder, id string) (treeView *gtk.TextView)
- func GetTreeView(b *gtk.Builder, id string) (treeView *gtk.TreeView)
- func GetWebnoteCredential() string
- func GetWindow(b *gtk.Builder, id string) (Window *gtk.Window)
- func InputDialog(opt ...interface{}) string
- func IsLanguageSupported(lang string) string
- func LoginToWebnote() (*http.Client, string, string)
- func LookupFileExtByLanguage(lang string) string
- func MessageBox(msg string)
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RestoreAssetsAll(extractDir string)
- func RunLuaFile(luaFileName string) string
- func SearchNotesFromLua(L *lua.LState) int
- func SetConfig(key, val string) error
- func SetupConfigDB()
- func SetupDefaultConfig()
- func UpdateNotesFromLua(L *lua.LState) int
- type AppConfig
- type GnoteApp
- func (app *GnoteApp) DoChangePassphrase()
- func (app *GnoteApp) DoCreateNoteFromClipboard()
- func (app *GnoteApp) DoExportNotes()
- func (app *GnoteApp) DoImportNotes()
- func (app *GnoteApp) DoResetDB()
- func (app *GnoteApp) DoSetConfig()
- func (app *GnoteApp) DoSyncNotesFromWebnote()
- func (app *GnoteApp) DoUpdateResource()
- func (app *GnoteApp) DoVacuum()
- func (app *GnoteApp) InitApp()
- func (app *GnoteApp) NewNoteFromFile(o *gtk.FileChooserButton)
- func (app *GnoteApp) ResultListKeyPress(w *gtk.TreeView, ev *gdk.Event)
- func (app *GnoteApp) RowActivated(treeView *gtk.TreeView, path *gtk.TreePath, column *gtk.TreeViewColumn)
- func (app *GnoteApp) ShowMain()
- func (app *GnoteApp) TreeSelectionChanged(s *gtk.TreeSelection)
- type Note
- type NotePad
- func (np *NotePad) AppendUpdateMarkBtnClick()
- func (np *NotePad) ClearFlagsBtnClick()
- func (np *NotePad) ClearURL()
- func (np *NotePad) DecryptContent()
- func (np *NotePad) DoHighlight()
- func (np *NotePad) EncryptContent()
- func (np *NotePad) EndUpdateMarkBtnClick()
- func (np *NotePad) FetchDataFromGUI()
- func (np *NotePad) GetSelection() (string, *gtk.TextIter, *gtk.TextIter)
- func (np *NotePad) HighlightBtnClick()
- func (np *NotePad) InsertFileToNote(o *gtk.FileChooserButton)
- func (np *NotePad) KeyPressed(o interface{}, ev *gdk.Event) bool
- func (np *NotePad) Load(id int)
- func (np *NotePad) NewLinkNote()
- func (np *NotePad) NoteSearch()
- func (np *NotePad) NoteSearchText()
- func (np *NotePad) SaveNote()
- func (np *NotePad) SaveNoteToFile()
- func (np *NotePad) SaveToWebnote()
- func (np *NotePad) SaveWindowSize()
- func (np *NotePad) SearchNoteFromPad()
- func (np *NotePad) ShowMainWindowBtnClick(o *gtk.Button)
- func (np *NotePad) TextChanged()
- func (np *NotePad) ToggleReadOnly(bt *gtk.ToggleButton)
- type NoteSearch
- func (ns *NoteSearch) CommandFilter(o *gtk.CheckButton)
- func (ns *NoteSearch) FindText() bool
- func (ns *NoteSearch) KeyPressed(o interface{}, ev *gdk.Event)
- func (ns *NoteSearch) NoteFindIcase(o *gtk.CheckButton)
- func (ns *NoteSearch) NoteFindText()
- func (ns *NoteSearch) NoteReplaceAll(o *gtk.Button)
- func (ns *NoteSearch) NoteReplaceText(o *gtk.Button)
- func (ns *NoteSearch) OutputToNewNote(o *gtk.CheckButton)
- func (ns *NoteSearch) ResetIter()
Constants ¶
This section is empty.
Variables ¶
var CookieJar *cookiejar.Jar
var DateLayout string
DateLayout - global
var DbConn *gorm.DB
DbConn - Global DB connection
var WebNotePassword string
WebNotePassword
var WebNoteUser string
WebNoteUser
Functions ¶
func Asset ¶
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 ¶
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 ¶
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 ChangePassphrase ¶
func ChromaHighlight ¶
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 DoMigrationV1 ¶
func DoMigrationV1(oldDB, newDB string)
func GetCheckMenuItem ¶
func GetCheckMenuItem(b *gtk.Builder, id string) (el *gtk.CheckMenuItem)
func GetFirstnChar ¶
func GetNoteFromLua ¶
func GetSearchEntry ¶
func GetSearchEntry(b *gtk.Builder, id string) (treeView *gtk.SearchEntry)
func GetSourceView ¶
func GetSourceView(b *gtk.Builder, id string) *sourceview.SourceView
func GetWebnoteCredential ¶
func GetWebnoteCredential() string
func InputDialog ¶
func InputDialog(opt ...interface{}) string
InputDialog - Args: title, label prompt, password-mask,
func IsLanguageSupported ¶
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 LookupFileExtByLanguage ¶
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func RunLuaFile ¶
func SearchNotesFromLua ¶
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 ¶
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) 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) 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) NewNoteFromFile ¶
func (app *GnoteApp) NewNoteFromFile(o *gtk.FileChooserButton)
NewNoteFromFile -
func (*GnoteApp) ResultListKeyPress ¶
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
type NotePad ¶
NotePad - GUI related
func (*NotePad) AppendUpdateMarkBtnClick ¶
func (np *NotePad) AppendUpdateMarkBtnClick()
func (*NotePad) ClearFlagsBtnClick ¶
func (np *NotePad) ClearFlagsBtnClick()
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 ¶
GetSelection - Get the current selection and return start_iter, end_iter, text To be used in various places
func (*NotePad) InsertFileToNote ¶
func (np *NotePad) InsertFileToNote(o *gtk.FileChooserButton)
func (*NotePad) KeyPressed ¶
KeyPressed - handle key board
func (*NotePad) NewLinkNote ¶
func (np *NotePad) NewLinkNote()
func (*NotePad) NoteSearchText ¶
func (np *NotePad) NoteSearchText()
func (*NotePad) SaveNoteToFile ¶
func (np *NotePad) SaveNoteToFile()
func (*NotePad) SaveToWebnote ¶
func (np *NotePad) SaveToWebnote()
SaveToWebnote - save to webnote store
func (*NotePad) SearchNoteFromPad ¶
func (np *NotePad) SearchNoteFromPad()
func (*NotePad) ShowMainWindowBtnClick ¶
ShowMainWindowBtnClick -
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 (*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) 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()