Compare commits

...

2 Commits

Author SHA1 Message Date
d0539f5e90
Fixed an error when building an assembly in fyne-cross. 2024-02-17 20:06:09 +06:00
240ae7aa96
Windows OS fix. 2024-02-17 20:04:11 +06:00
3 changed files with 25 additions and 25 deletions

View File

@ -29,7 +29,7 @@ func (v View) blockDownloadFFmpeg(
var buttonDownloadFFmpeg *widget.Button
buttonDownloadFFmpeg = widget.NewButton(v.localizerService.GetMessage(&i18n.LocalizeConfig{
buttonDownloadFFmpeg = widget.NewButton(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "download",
}), func() {
buttonDownloadFFmpeg.Disable()
@ -42,13 +42,13 @@ func (v View) blockDownloadFFmpeg(
buttonDownloadFFmpeg.Enable()
})
downloadFFmpegFromSiteMessage := v.localizerService.GetMessage(&i18n.LocalizeConfig{
downloadFFmpegFromSiteMessage := v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "downloadFFmpegFromSite",
})
return container.NewVBox(
canvas.NewLine(colornames.Darkgreen),
widget.NewCard(v.localizerService.GetMessage(&i18n.LocalizeConfig{
widget.NewCard(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "buttonDownloadFFmpeg",
}), "", container.NewVBox(
widget.NewRichTextFromMarkdown(

View File

@ -29,7 +29,7 @@ func (h ConvertorHandler) downloadFFmpeg(progressBar *widget.ProgressBar, progre
return err
}
}
progressMessage.Text = h.localizerService.GetMessage(&i18n.LocalizeConfig{
progressMessage.Text = h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "downloadRun",
})
progressMessage.Refresh()
@ -38,7 +38,7 @@ func (h ConvertorHandler) downloadFFmpeg(progressBar *widget.ProgressBar, progre
return err
}
progressMessage.Text = h.localizerService.GetMessage(&i18n.LocalizeConfig{
progressMessage.Text = h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "unzipRun",
})
progressMessage.Refresh()
@ -48,7 +48,7 @@ func (h ConvertorHandler) downloadFFmpeg(progressBar *widget.ProgressBar, progre
}
_ = os.Remove("ffmpeg/ffmpeg.zip")
progressMessage.Text = h.localizerService.GetMessage(&i18n.LocalizeConfig{
progressMessage.Text = h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "testFF",
})
progressMessage.Refresh()

38
main.go
View File

@ -18,7 +18,7 @@ import (
"os"
)
var app kernel.AppContract
var application kernel.AppContract
var ffPathUtilities *kernel.FFPathUtilities
func init() {
@ -41,7 +41,7 @@ func init() {
localizerService.AddListener(layoutLocalizerListener)
queue := kernel.NewQueueList()
app = kernel.NewApp(
application = kernel.NewApp(
appMetadata,
localizerService,
queue,
@ -51,17 +51,17 @@ func init() {
}
func main() {
errorView := error2.NewView(app)
errorView := error2.NewView(application)
if canCreateFile("data/database") != true {
errorView.PanicErrorWriteDirectoryData()
app.GetWindow().ShowAndRun()
application.GetWindow().ShowAndRun()
return
}
db, err := gorm.Open(sqlite.Open("data/database"), &gorm.Config{})
if err != nil {
errorView.PanicError(err)
app.GetWindow().ShowAndRun()
application.GetWindow().ShowAndRun()
return
}
@ -70,7 +70,7 @@ func main() {
err = migration.Run(db)
if err != nil {
errorView.PanicError(err)
app.GetWindow().ShowAndRun()
application.GetWindow().ShowAndRun()
return
}
@ -79,7 +79,7 @@ func main() {
pathFFmpeg, err := convertorRepository.GetPathFfmpeg()
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) == false {
errorView.PanicError(err)
app.GetWindow().ShowAndRun()
application.GetWindow().ShowAndRun()
return
}
ffPathUtilities.FFmpeg = pathFFmpeg
@ -87,29 +87,29 @@ func main() {
pathFFprobe, err := convertorRepository.GetPathFfprobe()
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) == false {
errorView.PanicError(err)
app.GetWindow().ShowAndRun()
application.GetWindow().ShowAndRun()
return
}
ffPathUtilities.FFprobe = pathFFprobe
app.RunConvertor()
defer app.AfterClosing()
application.RunConvertor()
defer application.AfterClosing()
localizerView := localizer.NewView(app)
convertorView := convertor.NewView(app)
convertorHandler := handler.NewConvertorHandler(app, convertorView, convertorRepository)
localizerView := localizer.NewView(application)
convertorView := convertor.NewView(application)
convertorHandler := handler.NewConvertorHandler(application, convertorView, convertorRepository)
localizerRepository := localizer.NewRepository(settingRepository)
menuView := menu.NewView(app)
menuView := menu.NewView(application)
localizerListener := handler.NewLocalizerListener()
app.GetLocalizerService().AddListener(localizerListener)
mainMenu := handler.NewMenuHandler(app, convertorHandler, menuView, localizerView, localizerRepository, localizerListener)
application.GetLocalizerService().AddListener(localizerListener)
mainMenu := handler.NewMenuHandler(application, convertorHandler, menuView, localizerView, localizerRepository, localizerListener)
mainHandler := handler.NewMainHandler(app, convertorHandler, mainMenu, localizerRepository)
mainHandler := handler.NewMainHandler(application, convertorHandler, mainMenu, localizerRepository)
mainHandler.Start()
app.GetWindow().SetMainMenu(mainMenu.GetMainMenu())
app.GetWindow().ShowAndRun()
application.GetWindow().SetMainMenu(mainMenu.GetMainMenu())
application.GetWindow().ShowAndRun()
}
func appCloseWithDb(db *gorm.DB) {