diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-05-07 13:46:52 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-07 15:26:51 +0200 |
commit | 7b9cabb5a3371865324aacbf7648aa9cc4f655ce (patch) | |
tree | a4cb0ff8a8fc843c490572f396e624da475c59f6 /Userland | |
parent | 2d6091be10ba66a2939a1722d7b866442fc2bddc (diff) | |
download | serenity-7b9cabb5a3371865324aacbf7648aa9cc4f655ce.zip |
Profiler: Remove the old process selection widget
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/DevTools/Profiler/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/ProcessPickerWidget.cpp | 52 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/ProcessPickerWidget.h | 35 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/main.cpp | 3 |
4 files changed, 0 insertions, 91 deletions
diff --git a/Userland/DevTools/Profiler/CMakeLists.txt b/Userland/DevTools/Profiler/CMakeLists.txt index c5406b8480..7d60095c25 100644 --- a/Userland/DevTools/Profiler/CMakeLists.txt +++ b/Userland/DevTools/Profiler/CMakeLists.txt @@ -3,7 +3,6 @@ set(SOURCES main.cpp IndividualSampleModel.cpp Process.cpp - ProcessPickerWidget.cpp Profile.cpp ProfileModel.cpp SamplesModel.cpp diff --git a/Userland/DevTools/Profiler/ProcessPickerWidget.cpp b/Userland/DevTools/Profiler/ProcessPickerWidget.cpp deleted file mode 100644 index 2c34b149c8..0000000000 --- a/Userland/DevTools/Profiler/ProcessPickerWidget.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021, Gunnar Beutner <gunnar@beutner.name> - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include "ProcessPickerWidget.h" -#include "Profile.h" -#include <LibGUI/BoxLayout.h> -#include <LibGUI/ItemListModel.h> -#include <LibGUI/Label.h> - -namespace Profiler { - -ProcessPickerWidget::ProcessPickerWidget(Profile& profile) - : m_profile(profile) -{ - set_layout<GUI::HorizontalBoxLayout>(); - set_fixed_height(30); - - set_frame_shape(Gfx::FrameShape::NoFrame); - - auto& label = add<GUI::Label>("Process:"); - label.set_fixed_width(50); - label.set_text_alignment(Gfx::TextAlignment::CenterRight); - - m_process_combo = add<GUI::ComboBox>(); - m_process_combo->set_only_allow_values_from_model(true); - - m_processes.append("All processes"); - - for (auto& process : m_profile.processes()) - m_processes.append(String::formatted("{}: {}", process.pid, process.executable)); - - m_process_combo->set_model(*GUI::ItemListModel<String>::create(m_processes)); - m_process_combo->set_selected_index(0); - m_process_combo->on_change = [this](auto&, const GUI::ModelIndex& index) { - if (index.row() == 0) { - m_profile.clear_process_filter(); - } else { - auto& process = m_profile.processes()[index.row() - 1]; - auto end_valid = process.end_valid == 0 ? m_profile.last_timestamp() : process.end_valid; - m_profile.set_process_filter(process.pid, process.start_valid, end_valid); - } - }; -} - -ProcessPickerWidget::~ProcessPickerWidget() -{ -} - -} diff --git a/Userland/DevTools/Profiler/ProcessPickerWidget.h b/Userland/DevTools/Profiler/ProcessPickerWidget.h deleted file mode 100644 index b1c64a374f..0000000000 --- a/Userland/DevTools/Profiler/ProcessPickerWidget.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021, Gunnar Beutner <gunnar@beutner.name> - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#pragma once - -#include <LibGUI/ComboBox.h> -#include <LibGUI/Frame.h> - -namespace Profiler { - -class Profile; - -class ProcessPickerWidget final : public GUI::Frame { - C_OBJECT(ProcessPickerWidget) -public: - virtual ~ProcessPickerWidget() override; - - struct Process { - pid_t pid; - String name; - }; - -private: - explicit ProcessPickerWidget(Profile&); - - Profile& m_profile; - Vector<String> m_processes; - - RefPtr<GUI::ComboBox> m_process_combo; -}; - -} diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index a49640e1ab..e675158dd8 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -5,7 +5,6 @@ */ #include "IndividualSampleModel.h" -#include "ProcessPickerWidget.h" #include "Profile.h" #include "TimelineContainer.h" #include "TimelineHeader.h" @@ -112,8 +111,6 @@ int main(int argc, char** argv) [[maybe_unused]] auto& timeline_container = main_widget.add<TimelineContainer>(*timeline_header_container, *timeline_view); - main_widget.add<ProcessPickerWidget>(*profile); - auto& tab_widget = main_widget.add<GUI::TabWidget>(); auto& tree_tab = tab_widget.add_tab<GUI::Widget>("Call Tree"); |