2024-06-23 02:55:21 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ying32/govcl/vcl"
|
|
|
|
)
|
|
|
|
|
|
|
|
type noLoadedDatabase struct{}
|
|
|
|
|
|
|
|
func (n *noLoadedDatabase) DisplayName() string {
|
2024-06-27 23:53:01 +00:00
|
|
|
return APPNAME
|
2024-06-23 02:55:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noLoadedDatabase) DriverName() string {
|
|
|
|
return "No database selected"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noLoadedDatabase) RootElement() *vcl.TTreeNode {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noLoadedDatabase) RenderForNav(f *TMainForm, ndata *navData) {
|
|
|
|
f.propertiesBox.SetText("Open a database to get started...")
|
|
|
|
}
|
|
|
|
|
2024-07-05 23:45:41 +00:00
|
|
|
func (n *noLoadedDatabase) ApplyChanges(f *TMainForm, ndata *navData) error {
|
2024-07-06 00:02:58 +00:00
|
|
|
return ErrNotSupported
|
2024-07-05 23:45:41 +00:00
|
|
|
}
|
|
|
|
|
2024-07-05 23:59:55 +00:00
|
|
|
func (n *noLoadedDatabase) ExecQuery(query string, resultArea *vcl.TStringGrid) error {
|
2024-07-06 00:02:58 +00:00
|
|
|
return ErrNotSupported
|
2024-06-23 02:55:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noLoadedDatabase) NavChildren(ndata *navData) ([]string, error) {
|
|
|
|
return []string{}, nil
|
|
|
|
}
|
|
|
|
|
2024-06-27 23:34:00 +00:00
|
|
|
func (ld *noLoadedDatabase) NavContext(ndata *navData) ([]contextAction, error) {
|
|
|
|
return nil, nil // No special actions are supported
|
|
|
|
}
|
|
|
|
|
2024-06-23 02:55:21 +00:00
|
|
|
func (n *noLoadedDatabase) Keepalive(ndata *navData) {
|
|
|
|
}
|
2024-06-23 03:28:15 +00:00
|
|
|
|
|
|
|
func (n *noLoadedDatabase) Close() {}
|