Compare commits
No commits in common. "d0539f5e90733a39f435883b487ef80cbe838af8" and "0d05fdb30703bf82b20d752128f496ab13e339ed" have entirely different histories.
d0539f5e90
...
0d05fdb307
@ -29,7 +29,7 @@ func (v View) blockDownloadFFmpeg(
|
|||||||
|
|
||||||
var buttonDownloadFFmpeg *widget.Button
|
var buttonDownloadFFmpeg *widget.Button
|
||||||
|
|
||||||
buttonDownloadFFmpeg = widget.NewButton(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
buttonDownloadFFmpeg = widget.NewButton(v.localizerService.GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "download",
|
MessageID: "download",
|
||||||
}), func() {
|
}), func() {
|
||||||
buttonDownloadFFmpeg.Disable()
|
buttonDownloadFFmpeg.Disable()
|
||||||
@ -42,13 +42,13 @@ func (v View) blockDownloadFFmpeg(
|
|||||||
buttonDownloadFFmpeg.Enable()
|
buttonDownloadFFmpeg.Enable()
|
||||||
})
|
})
|
||||||
|
|
||||||
downloadFFmpegFromSiteMessage := v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
downloadFFmpegFromSiteMessage := v.localizerService.GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "downloadFFmpegFromSite",
|
MessageID: "downloadFFmpegFromSite",
|
||||||
})
|
})
|
||||||
|
|
||||||
return container.NewVBox(
|
return container.NewVBox(
|
||||||
canvas.NewLine(colornames.Darkgreen),
|
canvas.NewLine(colornames.Darkgreen),
|
||||||
widget.NewCard(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
widget.NewCard(v.localizerService.GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "buttonDownloadFFmpeg",
|
MessageID: "buttonDownloadFFmpeg",
|
||||||
}), "", container.NewVBox(
|
}), "", container.NewVBox(
|
||||||
widget.NewRichTextFromMarkdown(
|
widget.NewRichTextFromMarkdown(
|
||||||
|
@ -29,7 +29,7 @@ func (h ConvertorHandler) downloadFFmpeg(progressBar *widget.ProgressBar, progre
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progressMessage.Text = h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
progressMessage.Text = h.localizerService.GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "downloadRun",
|
MessageID: "downloadRun",
|
||||||
})
|
})
|
||||||
progressMessage.Refresh()
|
progressMessage.Refresh()
|
||||||
@ -38,7 +38,7 @@ func (h ConvertorHandler) downloadFFmpeg(progressBar *widget.ProgressBar, progre
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
progressMessage.Text = h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
progressMessage.Text = h.localizerService.GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "unzipRun",
|
MessageID: "unzipRun",
|
||||||
})
|
})
|
||||||
progressMessage.Refresh()
|
progressMessage.Refresh()
|
||||||
@ -48,7 +48,7 @@ func (h ConvertorHandler) downloadFFmpeg(progressBar *widget.ProgressBar, progre
|
|||||||
}
|
}
|
||||||
_ = os.Remove("ffmpeg/ffmpeg.zip")
|
_ = os.Remove("ffmpeg/ffmpeg.zip")
|
||||||
|
|
||||||
progressMessage.Text = h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
progressMessage.Text = h.localizerService.GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "testFF",
|
MessageID: "testFF",
|
||||||
})
|
})
|
||||||
progressMessage.Refresh()
|
progressMessage.Refresh()
|
||||||
|
38
main.go
38
main.go
@ -18,7 +18,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
var application kernel.AppContract
|
var app kernel.AppContract
|
||||||
var ffPathUtilities *kernel.FFPathUtilities
|
var ffPathUtilities *kernel.FFPathUtilities
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -41,7 +41,7 @@ func init() {
|
|||||||
localizerService.AddListener(layoutLocalizerListener)
|
localizerService.AddListener(layoutLocalizerListener)
|
||||||
|
|
||||||
queue := kernel.NewQueueList()
|
queue := kernel.NewQueueList()
|
||||||
application = kernel.NewApp(
|
app = kernel.NewApp(
|
||||||
appMetadata,
|
appMetadata,
|
||||||
localizerService,
|
localizerService,
|
||||||
queue,
|
queue,
|
||||||
@ -51,17 +51,17 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
errorView := error2.NewView(application)
|
errorView := error2.NewView(app)
|
||||||
if canCreateFile("data/database") != true {
|
if canCreateFile("data/database") != true {
|
||||||
errorView.PanicErrorWriteDirectoryData()
|
errorView.PanicErrorWriteDirectoryData()
|
||||||
application.GetWindow().ShowAndRun()
|
app.GetWindow().ShowAndRun()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := gorm.Open(sqlite.Open("data/database"), &gorm.Config{})
|
db, err := gorm.Open(sqlite.Open("data/database"), &gorm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorView.PanicError(err)
|
errorView.PanicError(err)
|
||||||
application.GetWindow().ShowAndRun()
|
app.GetWindow().ShowAndRun()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ func main() {
|
|||||||
err = migration.Run(db)
|
err = migration.Run(db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorView.PanicError(err)
|
errorView.PanicError(err)
|
||||||
application.GetWindow().ShowAndRun()
|
app.GetWindow().ShowAndRun()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ func main() {
|
|||||||
pathFFmpeg, err := convertorRepository.GetPathFfmpeg()
|
pathFFmpeg, err := convertorRepository.GetPathFfmpeg()
|
||||||
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) == false {
|
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) == false {
|
||||||
errorView.PanicError(err)
|
errorView.PanicError(err)
|
||||||
application.GetWindow().ShowAndRun()
|
app.GetWindow().ShowAndRun()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ffPathUtilities.FFmpeg = pathFFmpeg
|
ffPathUtilities.FFmpeg = pathFFmpeg
|
||||||
@ -87,29 +87,29 @@ func main() {
|
|||||||
pathFFprobe, err := convertorRepository.GetPathFfprobe()
|
pathFFprobe, err := convertorRepository.GetPathFfprobe()
|
||||||
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) == false {
|
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) == false {
|
||||||
errorView.PanicError(err)
|
errorView.PanicError(err)
|
||||||
application.GetWindow().ShowAndRun()
|
app.GetWindow().ShowAndRun()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ffPathUtilities.FFprobe = pathFFprobe
|
ffPathUtilities.FFprobe = pathFFprobe
|
||||||
|
|
||||||
application.RunConvertor()
|
app.RunConvertor()
|
||||||
defer application.AfterClosing()
|
defer app.AfterClosing()
|
||||||
|
|
||||||
localizerView := localizer.NewView(application)
|
localizerView := localizer.NewView(app)
|
||||||
convertorView := convertor.NewView(application)
|
convertorView := convertor.NewView(app)
|
||||||
convertorHandler := handler.NewConvertorHandler(application, convertorView, convertorRepository)
|
convertorHandler := handler.NewConvertorHandler(app, convertorView, convertorRepository)
|
||||||
|
|
||||||
localizerRepository := localizer.NewRepository(settingRepository)
|
localizerRepository := localizer.NewRepository(settingRepository)
|
||||||
menuView := menu.NewView(application)
|
menuView := menu.NewView(app)
|
||||||
localizerListener := handler.NewLocalizerListener()
|
localizerListener := handler.NewLocalizerListener()
|
||||||
application.GetLocalizerService().AddListener(localizerListener)
|
app.GetLocalizerService().AddListener(localizerListener)
|
||||||
mainMenu := handler.NewMenuHandler(application, convertorHandler, menuView, localizerView, localizerRepository, localizerListener)
|
mainMenu := handler.NewMenuHandler(app, convertorHandler, menuView, localizerView, localizerRepository, localizerListener)
|
||||||
|
|
||||||
mainHandler := handler.NewMainHandler(application, convertorHandler, mainMenu, localizerRepository)
|
mainHandler := handler.NewMainHandler(app, convertorHandler, mainMenu, localizerRepository)
|
||||||
mainHandler.Start()
|
mainHandler.Start()
|
||||||
|
|
||||||
application.GetWindow().SetMainMenu(mainMenu.GetMainMenu())
|
app.GetWindow().SetMainMenu(mainMenu.GetMainMenu())
|
||||||
application.GetWindow().ShowAndRun()
|
app.GetWindow().ShowAndRun()
|
||||||
}
|
}
|
||||||
|
|
||||||
func appCloseWithDb(db *gorm.DB) {
|
func appCloseWithDb(db *gorm.DB) {
|
||||||
|
Loading…
Reference in New Issue
Block a user