mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +00:00
Inspector: Exit if inspected process has not pledged accept
This commit is contained in:
parent
df2a4adcd2
commit
50092ea0ca
1 changed files with 16 additions and 0 deletions
|
@ -28,10 +28,12 @@
|
||||||
#include "RemoteObjectGraphModel.h"
|
#include "RemoteObjectGraphModel.h"
|
||||||
#include "RemoteObjectPropertyModel.h"
|
#include "RemoteObjectPropertyModel.h"
|
||||||
#include "RemoteProcess.h"
|
#include "RemoteProcess.h"
|
||||||
|
#include <LibCore/ProcessStatisticsReader.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/BoxLayout.h>
|
#include <LibGUI/BoxLayout.h>
|
||||||
#include <LibGUI/Menu.h>
|
#include <LibGUI/Menu.h>
|
||||||
#include <LibGUI/MenuBar.h>
|
#include <LibGUI/MenuBar.h>
|
||||||
|
#include <LibGUI/MessageBox.h>
|
||||||
#include <LibGUI/ModelEditingDelegate.h>
|
#include <LibGUI/ModelEditingDelegate.h>
|
||||||
#include <LibGUI/ProcessChooser.h>
|
#include <LibGUI/ProcessChooser.h>
|
||||||
#include <LibGUI/Splitter.h>
|
#include <LibGUI/Splitter.h>
|
||||||
|
@ -98,6 +100,20 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
auto window = GUI::Window::construct();
|
auto window = GUI::Window::construct();
|
||||||
|
|
||||||
|
auto all_processes = Core::ProcessStatisticsReader::get_all();
|
||||||
|
for (auto& it : all_processes.value()) {
|
||||||
|
if (it.value.pid != pid)
|
||||||
|
continue;
|
||||||
|
if (it.value.pledge.is_empty())
|
||||||
|
break;
|
||||||
|
if (!it.value.pledge.contains("accept")) {
|
||||||
|
GUI::MessageBox::show(window, String::formatted("{} ({}) has not pledged accept!", it.value.name, pid), "Error", GUI::MessageBox::Type::Error);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
window->set_title("Inspector");
|
window->set_title("Inspector");
|
||||||
window->resize(685, 500);
|
window->resize(685, 500);
|
||||||
window->set_icon(app_icon.bitmap_for_size(16));
|
window->set_icon(app_icon.bitmap_for_size(16));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue