This commit is contained in:
Stanislav Nikitin 2018-11-10 20:58:15 +05:00
parent 39ac02dfc5
commit 2b3c9ef9ea
25 changed files with 1054 additions and 1022 deletions

View File

@ -39,17 +39,50 @@ INSERT INTO database (version) VALUES (1);
// Migrate database to latest version. // Migrate database to latest version.
// ToDo: make it more good :). // ToDo: make it more good :).
func migrate_full(db *Database, version int) { func migrate_full(db *Database, version int) {
if version < 1 {start_to_one(db); version = 1} if version < 1 {
if version == 1 {one_to_two(db); version = 2} start_to_one(db)
if version == 2 {two_to_three(db); version = 3} version = 1
if version == 3 {three_to_four(db); version = 4} }
if version == 4 {four_to_five(db); version = 5} if version == 1 {
if version == 5 {five_to_six(db); version = 6 } one_to_two(db)
if version == 6 {six_to_seven(db); version = 7} version = 2
if version == 7 {seven_to_eight(db); version = 8} }
if version == 8 {eight_to_nine(db); version = 9} if version == 2 {
if version == 9 {nine_to_ten(db); version = 10} two_to_three(db)
if version == 10 {ten_to_eleven(db); version = 11} version = 3
}
if version == 3 {
three_to_four(db)
version = 4
}
if version == 4 {
four_to_five(db)
version = 5
}
if version == 5 {
five_to_six(db)
version = 6
}
if version == 6 {
six_to_seven(db)
version = 7
}
if version == 7 {
seven_to_eight(db)
version = 8
}
if version == 8 {
eight_to_nine(db)
version = 9
}
if version == 9 {
nine_to_ten(db)
version = 10
}
if version == 10 {
ten_to_eleven(db)
version = 11
}
} }
// Initial database structure. // Initial database structure.

View File

@ -24,8 +24,8 @@ package translator
import ( import (
// stdlib // stdlib
"fmt" "fmt"
"path/filepath"
"os" "os"
"path/filepath"
) )
// Detect language on Windows. // Detect language on Windows.

View File

@ -107,7 +107,6 @@ func (m *MainWindow) showAboutQtDialog(a bool) {
widgets.QMessageBox_AboutQt(m.window, "About Qt") widgets.QMessageBox_AboutQt(m.window, "About Qt")
} }
func (m *MainWindow) showOptionsDialog(a bool) { func (m *MainWindow) showOptionsDialog(a bool) {
fmt.Println("Showing options dialog...") fmt.Println("Showing options dialog...")
} }