mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
6e19ab2bbc
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibCore/Timer.h>
|
|
#include <LibGUI/Dialog.h>
|
|
#include <LibGUI/RunningProcessesModel.h>
|
|
|
|
namespace GUI {
|
|
|
|
class ProcessChooser final : public GUI::Dialog {
|
|
C_OBJECT(ProcessChooser);
|
|
|
|
public:
|
|
virtual ~ProcessChooser() override = default;
|
|
|
|
pid_t pid() const { return m_pid; }
|
|
|
|
private:
|
|
ProcessChooser(StringView window_title = "Process Chooser"sv, StringView button_label = "Select"sv, Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr);
|
|
|
|
void set_pid_from_index_and_close(ModelIndex const&);
|
|
|
|
pid_t m_pid { 0 };
|
|
|
|
DeprecatedString m_window_title;
|
|
DeprecatedString m_button_label;
|
|
RefPtr<Gfx::Bitmap> m_window_icon;
|
|
RefPtr<TableView> m_table_view;
|
|
RefPtr<RunningProcessesModel> m_process_model;
|
|
|
|
bool m_refresh_enabled { true };
|
|
unsigned m_refresh_interval { 1000 };
|
|
RefPtr<Core::Timer> m_refresh_timer;
|
|
};
|
|
|
|
}
|