/* * Copyright (c) 2022, Ashley N. * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include class EscalatorWindow final : public GUI::Window { C_OBJECT(EscalatorWindow) public: struct Options { StringView description; Core::Account current_user; bool preserve_env { false }; }; virtual ~EscalatorWindow() override = default; ErrorOr execute_command(); private: EscalatorWindow(StringView executable, Vector arguments, Options const& options); ErrorOr check_password(); Vector m_arguments; StringView m_executable; Core::Account m_current_user; bool m_preserve_env { false }; RefPtr m_icon_image_widget; RefPtr m_ok_button; RefPtr m_cancel_button; RefPtr m_password_input; };