mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 22:42:31 +08:00
🧹 drivers: refactor a bit
This commit is contained in:
parent
2eab6198d7
commit
b5253b2f4e
@ -21,9 +21,9 @@ using namespace std::string_view_literals;
|
|||||||
#include "follow_process_log.hpp"
|
#include "follow_process_log.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace tui {
|
namespace {
|
||||||
|
|
||||||
static void setup_graphics_card() noexcept {
|
void setup_graphics_card() noexcept {
|
||||||
std::string driver{};
|
std::string driver{};
|
||||||
|
|
||||||
/// TODO(vnepogodin): parse toml DBs
|
/// TODO(vnepogodin): parse toml DBs
|
||||||
@ -42,7 +42,7 @@ static void setup_graphics_card() noexcept {
|
|||||||
driver = radiobox_list[static_cast<size_t>(selected)];
|
driver = radiobox_list[static_cast<size_t>(selected)];
|
||||||
screen.ExitLoopClosure()();
|
screen.ExitLoopClosure()();
|
||||||
};
|
};
|
||||||
detail::radiolist_widget(radiobox_list, ok_callback, &selected, &screen, {.text = use_spacebar}, {.text_size = nothing});
|
tui::detail::radiolist_widget(radiobox_list, ok_callback, &selected, &screen, {.text = use_spacebar}, {.text_size = nothing});
|
||||||
}
|
}
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
if (driver.empty()) { return; }
|
if (driver.empty()) { return; }
|
||||||
@ -62,7 +62,7 @@ static void setup_graphics_card() noexcept {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void install_graphics_menu() noexcept {
|
void install_graphics_menu() noexcept {
|
||||||
[[maybe_unused]] auto* config_instance = Config::instance();
|
[[maybe_unused]] auto* config_instance = Config::instance();
|
||||||
[[maybe_unused]] auto& config_data = config_instance->data();
|
[[maybe_unused]] auto& config_data = config_instance->data();
|
||||||
[[maybe_unused]] const auto& mountpoint = std::get<std::string>(config_data["MOUNTPOINT"]);
|
[[maybe_unused]] const auto& mountpoint = std::get<std::string>(config_data["MOUNTPOINT"]);
|
||||||
@ -96,9 +96,13 @@ static void install_graphics_menu() noexcept {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
detail::menu_widget(menu_entries, ok_callback, &selected, &screen);
|
tui::detail::menu_widget(menu_entries, ok_callback, &selected, &screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
namespace tui {
|
||||||
|
|
||||||
void install_drivers_menu() noexcept {
|
void install_drivers_menu() noexcept {
|
||||||
const std::vector<std::string> menu_entries = {
|
const std::vector<std::string> menu_entries = {
|
||||||
"Install Display Driver",
|
"Install Display Driver",
|
||||||
|
Loading…
Reference in New Issue
Block a user