mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:02:43 +00:00 
			
		
		
		
	 5e1499d104
			
		
	
	
		5e1499d104
		
	
	
	
	
		
			
			This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).
This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
		
	
			
		
			
				
	
	
		
			43 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			43 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 <AK/String.h>
 | |
| #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, String button_label = "Select"_string, 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 };
 | |
| 
 | |
|     ByteString m_window_title;
 | |
|     String m_button_label;
 | |
|     RefPtr<Gfx::Bitmap const> 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;
 | |
| };
 | |
| 
 | |
| }
 |