move filter consts to each db file
This commit is contained in:
parent
53e9b6555e
commit
1ac96eb133
@ -14,6 +14,10 @@ import (
|
||||
"go.etcd.io/bbolt/version"
|
||||
)
|
||||
|
||||
const (
|
||||
boltFilter = "Bolt database|*.db|All files|*.*"
|
||||
)
|
||||
|
||||
type boltLoadedDatabase struct {
|
||||
displayName string
|
||||
path string
|
||||
|
@ -14,6 +14,7 @@ import (
|
||||
|
||||
const (
|
||||
sqliteTablesCaption = "Tables"
|
||||
sqliteFilter = "SQLite database|*.db;*.db3;*.sqlite;*.sqlite3|All files|*.*"
|
||||
)
|
||||
|
||||
type sqliteLoadedDatabase struct {
|
||||
|
8
main.go
8
main.go
@ -332,7 +332,7 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
|
||||
func (f *TMainForm) OnMnuFileBoltNewClick(sender vcl.IObject) {
|
||||
dlg := vcl.NewSaveDialog(f)
|
||||
dlg.SetTitle("Save database as...")
|
||||
dlg.SetFilter("Bolt database|*.db|All files|*.*")
|
||||
dlg.SetFilter(boltFilter)
|
||||
ret := dlg.Execute() // Fake blocking
|
||||
if ret {
|
||||
f.boltAddDatabaseFromFile(dlg.FileName(), false)
|
||||
@ -342,7 +342,7 @@ func (f *TMainForm) OnMnuFileBoltNewClick(sender vcl.IObject) {
|
||||
func (f *TMainForm) OnMnuFileBoltOpenClick(sender vcl.IObject) {
|
||||
dlg := vcl.NewOpenDialog(f)
|
||||
dlg.SetTitle("Select a database file...")
|
||||
dlg.SetFilter("Bolt database|*.db|All files|*.*")
|
||||
dlg.SetFilter(boltFilter)
|
||||
ret := dlg.Execute() // Fake blocking
|
||||
if ret {
|
||||
f.boltAddDatabaseFromFile(dlg.FileName(), false)
|
||||
@ -352,7 +352,7 @@ func (f *TMainForm) OnMnuFileBoltOpenClick(sender vcl.IObject) {
|
||||
func (f *TMainForm) OnMnuFileBoltOpenReadonlyClick(sender vcl.IObject) {
|
||||
dlg := vcl.NewOpenDialog(f)
|
||||
dlg.SetTitle("Select a database file...")
|
||||
dlg.SetFilter("Bolt database|*.db|All files|*.*")
|
||||
dlg.SetFilter(boltFilter)
|
||||
ret := dlg.Execute() // Fake blocking
|
||||
if ret {
|
||||
f.boltAddDatabaseFromFile(dlg.FileName(), true)
|
||||
@ -364,7 +364,7 @@ func (f *TMainForm) OnMnuFileSqliteOpenClick(sender vcl.IObject) {
|
||||
|
||||
dlg := vcl.NewOpenDialog(f)
|
||||
dlg.SetTitle("Select a database file...")
|
||||
dlg.SetFilter("SQLite database|*.db;*.db3;*.sqlite;*.sqlite3|All files|*.*")
|
||||
dlg.SetFilter(sqliteFilter)
|
||||
ret := dlg.Execute() // Fake blocking
|
||||
if ret {
|
||||
f.sqliteAddDatabaseFromFile(dlg.FileName(), cliDriver)
|
||||
|
Loading…
Reference in New Issue
Block a user