mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:42:43 +00:00 
			
		
		
		
	SystemMonitor: Only show the most important process stats by default
You can still enable additional columns via the context menu, and this gives us a much more focused default interface.
This commit is contained in:
		
							parent
							
								
									52de9b1753
								
							
						
					
					
						commit
						6902adbb84
					
				
					 3 changed files with 21 additions and 11 deletions
				
			
		|  | @ -99,7 +99,7 @@ String ProcessModel::column_name(int column) const | |||
|     case Column::Physical: | ||||
|         return "Physical"; | ||||
|     case Column::DirtyPrivate: | ||||
|         return "DirtyP"; | ||||
|         return "Private"; | ||||
|     case Column::CleanInode: | ||||
|         return "CleanI"; | ||||
|     case Column::PurgeableVolatile: | ||||
|  |  | |||
|  | @ -39,25 +39,25 @@ class ProcessModel final : public GUI::Model { | |||
| public: | ||||
|     enum Column { | ||||
|         Icon = 0, | ||||
|         PID, | ||||
|         Name, | ||||
|         CPU, | ||||
|         Processor, | ||||
|         State, | ||||
|         Priority, | ||||
|         User, | ||||
|         PID, | ||||
|         TID, | ||||
|         PPID, | ||||
|         PGID, | ||||
|         SID, | ||||
|         Virtual, | ||||
|         Physical, | ||||
|         DirtyPrivate, | ||||
|         Pledge, | ||||
|         Physical, | ||||
|         CleanInode, | ||||
|         PurgeableVolatile, | ||||
|         PurgeableNonvolatile, | ||||
|         Veil, | ||||
|         Pledge, | ||||
|         Processor, | ||||
|         Priority, | ||||
|         TID, | ||||
|         PPID, | ||||
|         PGID, | ||||
|         SID, | ||||
|         Syscalls, | ||||
|         InodeFaults, | ||||
|         ZeroFaults, | ||||
|  |  | |||
|  | @ -174,7 +174,7 @@ int main(int argc, char** argv) | |||
| 
 | ||||
|     auto window = GUI::Window::construct(); | ||||
|     window->set_title("System Monitor"); | ||||
|     window->resize(680, 430); | ||||
|     window->resize(560, 430); | ||||
| 
 | ||||
|     auto& main_widget = window->set_main_widget<GUI::Widget>(); | ||||
|     main_widget.set_layout<GUI::VerticalBoxLayout>(); | ||||
|  | @ -227,6 +227,16 @@ int main(int argc, char** argv) | |||
|     auto& process_table_view = process_table_container.add<GUI::TableView>(); | ||||
|     process_table_view.set_column_headers_visible(true); | ||||
|     process_table_view.set_model(GUI::SortingProxyModel::create(process_model)); | ||||
|     for (auto column = 0; column < ProcessModel::Column::__Count; ++column) | ||||
|         process_table_view.set_column_visible(column, false); | ||||
|     process_table_view.set_column_visible(ProcessModel::Column::Icon, true); | ||||
|     process_table_view.set_column_visible(ProcessModel::Column::PID, true); | ||||
|     process_table_view.set_column_visible(ProcessModel::Column::Name, true); | ||||
|     process_table_view.set_column_visible(ProcessModel::Column::CPU, true); | ||||
|     process_table_view.set_column_visible(ProcessModel::Column::User, true); | ||||
|     process_table_view.set_column_visible(ProcessModel::Column::Virtual, true); | ||||
|     process_table_view.set_column_visible(ProcessModel::Column::DirtyPrivate, true); | ||||
| 
 | ||||
|     process_table_view.set_key_column_and_sort_order(ProcessModel::Column::CPU, GUI::SortOrder::Descending); | ||||
|     process_table_view.model()->update(); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling