mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: remove cpu info dialog
We can do this with a section instead.
This commit is contained in:
@ -8,7 +8,6 @@ sysprof_sources = [
|
||||
'sysprof-color-iter.c',
|
||||
'sysprof-column-layer.c',
|
||||
'sysprof-counters-section.c',
|
||||
'sysprof-cpu-info-dialog.c',
|
||||
'sysprof-cpu-section.c',
|
||||
'sysprof-css.c',
|
||||
'sysprof-duplex-layer.c',
|
||||
|
||||
@ -1,135 +0,0 @@
|
||||
/* sysprof-cpu-info-dialog.c
|
||||
*
|
||||
* Copyright 2023 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "sysprof-cpu-info-dialog.h"
|
||||
|
||||
struct _SysprofCpuInfoDialog
|
||||
{
|
||||
AdwWindow parent_instance;
|
||||
SysprofDocument *document;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_DOCUMENT,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (SysprofCpuInfoDialog, sysprof_cpu_info_dialog, ADW_TYPE_WINDOW)
|
||||
|
||||
static GParamSpec *properties [N_PROPS];
|
||||
|
||||
static void
|
||||
sysprof_cpu_info_dialog_dispose (GObject *object)
|
||||
{
|
||||
SysprofCpuInfoDialog *self = (SysprofCpuInfoDialog *)object;
|
||||
|
||||
gtk_widget_dispose_template (GTK_WIDGET (self), SYSPROF_TYPE_CPU_INFO_DIALOG);
|
||||
|
||||
g_clear_object (&self->document);
|
||||
|
||||
G_OBJECT_CLASS (sysprof_cpu_info_dialog_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_cpu_info_dialog_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofCpuInfoDialog *self = SYSPROF_CPU_INFO_DIALOG (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DOCUMENT:
|
||||
g_value_set_object (value, sysprof_cpu_info_dialog_get_document (self));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_cpu_info_dialog_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofCpuInfoDialog *self = SYSPROF_CPU_INFO_DIALOG (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DOCUMENT:
|
||||
sysprof_cpu_info_dialog_set_document (self, g_value_get_object (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_cpu_info_dialog_class_init (SysprofCpuInfoDialogClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->dispose = sysprof_cpu_info_dialog_dispose;
|
||||
object_class->get_property = sysprof_cpu_info_dialog_get_property;
|
||||
object_class->set_property = sysprof_cpu_info_dialog_set_property;
|
||||
|
||||
properties [PROP_DOCUMENT] =
|
||||
g_param_spec_object ("document", NULL, NULL,
|
||||
SYSPROF_TYPE_DOCUMENT,
|
||||
(G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-cpu-info-dialog.ui");
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_cpu_info_dialog_init (SysprofCpuInfoDialog *self)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
SysprofDocument *
|
||||
sysprof_cpu_info_dialog_get_document (SysprofCpuInfoDialog *self)
|
||||
{
|
||||
g_return_val_if_fail (SYSPROF_IS_CPU_INFO_DIALOG (self), NULL);
|
||||
|
||||
return self->document;
|
||||
}
|
||||
|
||||
void
|
||||
sysprof_cpu_info_dialog_set_document (SysprofCpuInfoDialog *self,
|
||||
SysprofDocument *document)
|
||||
{
|
||||
g_return_if_fail (SYSPROF_IS_CPU_INFO_DIALOG (self));
|
||||
g_return_if_fail (!document || SYSPROF_IS_DOCUMENT (document));
|
||||
|
||||
if (g_set_object (&self->document, document))
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_DOCUMENT]);
|
||||
}
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
/* sysprof-cpu-info-dialog.h
|
||||
*
|
||||
* Copyright 2023 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <adwaita.h>
|
||||
|
||||
#include <sysprof-analyze.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define SYSPROF_TYPE_CPU_INFO_DIALOG (sysprof_cpu_info_dialog_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (SysprofCpuInfoDialog, sysprof_cpu_info_dialog, SYSPROF, CPU_INFO_DIALOG, AdwWindow)
|
||||
|
||||
SysprofDocument *sysprof_cpu_info_dialog_get_document (SysprofCpuInfoDialog *self);
|
||||
void sysprof_cpu_info_dialog_set_document (SysprofCpuInfoDialog *self,
|
||||
SysprofDocument *document);
|
||||
|
||||
G_END_DECLS
|
||||
@ -1,156 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="SysprofCpuInfoDialog" parent="AdwWindow">
|
||||
<property name="default-width">800</property>
|
||||
<property name="default-height">600</property>
|
||||
<property name="content">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="title-widget">
|
||||
<object class="AdwWindowTitle">
|
||||
<property name="title" translatable="yes">CPU Information</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="content">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">true</property>
|
||||
<child>
|
||||
<object class="GtkColumnView" id="column_view">
|
||||
<property name="show-column-separators">true</property>
|
||||
<property name="show-row-separators">true</property>
|
||||
<style>
|
||||
<class name="data-table"/>
|
||||
</style>
|
||||
<property name="model">
|
||||
<object class="GtkMultiSelection">
|
||||
<property name="model">
|
||||
<object class="GtkSortListModel">
|
||||
<binding name="sorter">
|
||||
<lookup name="sorter">column_view</lookup>
|
||||
</binding>
|
||||
<binding name="model">
|
||||
<lookup name="cpu-info" type="SysprofDocument">
|
||||
<lookup name="document">SysprofCpuInfoDialog</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="id_column">
|
||||
<property name="title" translatable="yes">ID</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="id" type="SysprofCpuInfo"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkInscription">
|
||||
<property name="min-chars">2</property>
|
||||
<property name="xalign">1</property>
|
||||
<binding name="text">
|
||||
<lookup name="id" type="SysprofCpuInfo">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="core_id_column">
|
||||
<property name="title" translatable="yes">Core</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="core-id" type="SysprofCpuInfo"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkInscription">
|
||||
<property name="min-chars">2</property>
|
||||
<property name="xalign">1</property>
|
||||
<binding name="text">
|
||||
<lookup name="core-id" type="SysprofCpuInfo">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="model_name_column">
|
||||
<property name="title" translatable="yes">Model Name</property>
|
||||
<property name="expand">true</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkStringSorter">
|
||||
<property name="expression">
|
||||
<lookup name="model-name" type="SysprofCpuInfo"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="model-name" type="SysprofCpuInfo">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include "sysprof-counters-section.h"
|
||||
#include "sysprof-cpu-info-dialog.h"
|
||||
#include "sysprof-cpu-section.h"
|
||||
#include "sysprof-files-section.h"
|
||||
#include "sysprof-greeter.h"
|
||||
@ -116,24 +115,6 @@ sysprof_window_record_capture_action (GtkWidget *widget,
|
||||
show_greeter (SYSPROF_WINDOW (widget), SYSPROF_GREETER_PAGE_RECORD);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_window_show_cpu_info_action (GtkWidget *widget,
|
||||
const char *action_name,
|
||||
GVariant *param)
|
||||
{
|
||||
SysprofWindow *self = (SysprofWindow *)widget;
|
||||
GtkWindow *window;
|
||||
|
||||
g_assert (SYSPROF_IS_WINDOW (self));
|
||||
|
||||
window = g_object_new (SYSPROF_TYPE_CPU_INFO_DIALOG,
|
||||
"document", self->document,
|
||||
"transient-for", self,
|
||||
NULL);
|
||||
|
||||
gtk_window_present (window);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_window_set_document (SysprofWindow *self,
|
||||
SysprofDocument *document)
|
||||
@ -397,7 +378,6 @@ sysprof_window_class_init (SysprofWindowClass *klass)
|
||||
|
||||
gtk_widget_class_install_action (widget_class, "win.open-capture", NULL, sysprof_window_open_capture_action);
|
||||
gtk_widget_class_install_action (widget_class, "win.record-capture", NULL, sysprof_window_record_capture_action);
|
||||
gtk_widget_class_install_action (widget_class, "win.show-cpu-info", NULL, sysprof_window_show_cpu_info_action);
|
||||
gtk_widget_class_install_action (widget_class, "session.zoom-one", NULL, sysprof_window_session_zoom_one);
|
||||
gtk_widget_class_install_action (widget_class, "session.zoom-out", NULL, sysprof_window_session_zoom_out);
|
||||
gtk_widget_class_install_action (widget_class, "session.zoom-in", NULL, sysprof_window_session_zoom_in);
|
||||
|
||||
@ -221,12 +221,6 @@
|
||||
<attribute name="label" translatable="yes">Save As…</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Show CPU Information…</attribute>
|
||||
<attribute name="action">win.show-cpu-info</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Preferences</attribute>
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/system-log-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-callgraph-view.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-counters-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-cpu-info-dialog.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-cpu-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-files-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-frame-utility.ui</file>
|
||||
|
||||
Reference in New Issue
Block a user