From 5a1e4c78ed623ae1833fa5764077092988e9a614 Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Wed, 12 Apr 2023 14:28:13 +0200 Subject: [PATCH] Correct some writing and add check for unknown/unsupported bootloader --- internal/ui_main_events.go | 2 +- internal/ui_main_view.go | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/ui_main_events.go b/internal/ui_main_events.go index b85e1ee..335a86b 100644 --- a/internal/ui_main_events.go +++ b/internal/ui_main_events.go @@ -72,7 +72,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Blank the password field m.authDialog.SetValue("") - fmt.Println("Working... Application frozen until done, check debug.log for progress") + fmt.Println(titleStyle.Render("Working... Application frozen until done, check debug.log for progress")) // Start installation and send the password to the command m.install() diff --git a/internal/ui_main_view.go b/internal/ui_main_view.go index a02e6f7..2b437a2 100644 --- a/internal/ui_main_view.go +++ b/internal/ui_main_view.go @@ -6,6 +6,8 @@ import ( "path/filepath" "strings" + "github.com/HikariKnight/quickpassthrough/internal/configs" + "github.com/HikariKnight/quickpassthrough/pkg/fileio" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" ) @@ -147,8 +149,16 @@ func (m model) View() string { tea.Batch() case DONE: - title = titleStyle.Render("Applying configurations!") + title = titleStyle.Render("Applied configurations!") + view = dialogStyle.Render(fmt.Sprintf("%s\n\nPress Enter to Exit.", strings.Join(m.installOutput, "\n"))) + + // If the bootloader is unknown/unsupported + config := configs.GetConfig() + if config.Bootloader == "unknown" { + // Change the view to reflect that + view = dialogStyle.Render(fmt.Sprintf("%s\n\nI do not have a good way to reliably edit your bootloader!\nPlease add: %s\nTo your bootloaders kernel arguments.\nPress Enter to Exit.", strings.Join(m.installOutput, "\n"), fileio.ReadFile(config.Path.CMDLINE))) + } } //return listStyle.SetString(fmt.Sprintf("%s\n\n", title)).Render(m.lists[m.focused].View()) return lipgloss.JoinVertical(lipgloss.Left, fmt.Sprintf("%s\n%s\n", title, view))