info-overview: Introduce CcSystemDetailsWindow

Introduce a new widget that will be used for displaying System Information in the about section
This commit is contained in:
Cyber Phantom 2023-03-25 18:38:30 +05:30 committed by Felipe Borges
parent f00643730e
commit 8049135849
6 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,51 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2023 Cyber Phantom <inam123451@gmail.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 2 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/>.
*
*/
#include "cc-system-details-window.h"
struct _CcSystemDetailsWindow
{
AdwWindow parent;
};
G_DEFINE_TYPE (CcSystemDetailsWindow, cc_system_details_window, ADW_TYPE_WINDOW)
static void
cc_system_details_window_class_init (CcSystemDetailsWindowClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/info-overview/cc-system-details-window.ui");
}
static void
cc_system_details_window_init (CcSystemDetailsWindow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
CcSystemDetailsWindow *
cc_system_details_window_new (void)
{
return g_object_new (CC_TYPE_SYSTEM_DETAILS_WINDOW,
NULL);
}

View file

@ -0,0 +1,31 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2023 Cyber Phantom <inam123451@gmail.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 2 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/>.
*
*/
#pragma once
#include <adwaita.h>
G_BEGIN_DECLS
#define CC_TYPE_SYSTEM_DETAILS_WINDOW (cc_system_details_window_get_type ())
G_DECLARE_FINAL_TYPE (CcSystemDetailsWindow, cc_system_details_window, CC, SYSTEM_DETAILS_WINDOW, AdwWindow)
CcSystemDetailsWindow *cc_system_details_window_new (void);
G_END_DECLS

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<interface>
<template class="CcSystemDetailsWindow" parent="AdwWindow">
<property name="title" translatable="yes">System Details</property>
<property name="modal">True</property>
<property name="hide-on-close">True</property>
<property name="destroy_with_parent">True</property>
<property name="default-width">640</property>
<property name="default-height">420</property>
<property name="content">
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<child type="start">
<object class="GtkButton">
<property name="label" translatable="yes">Copy</property>
</object>
</child>
</object>
</child>
<child>
</child>
</object>
</property>
</template>
</interface>

View file

@ -3,5 +3,6 @@
<gresource prefix="/org/gnome/control-center/info-overview">
<file preprocess="xml-stripblanks">cc-info-overview-panel.ui</file>
<file preprocess="xml-stripblanks">cc-info-entry.ui</file>
<file preprocess="xml-stripblanks">cc-system-details-window.ui</file>
</gresource>
</gresources>

View file

@ -17,6 +17,7 @@ cflags += [
sources = files(
'cc-info-overview-panel.c',
'cc-system-details-window.c',
'cc-info-entry.c',
'info-cleanup.c'
)

View file

@ -61,6 +61,8 @@ panels/firmware-security/cc-firmware-security-utils.c
panels/firmware-security/gnome-firmware-security-panel.desktop.in
panels/info-overview/cc-info-overview-panel.c
panels/info-overview/cc-info-overview-panel.ui
panels/info-overview/cc-system-details-window.c
panels/info-overview/cc-system-details-window.ui
panels/info-overview/gnome-info-overview-panel.desktop.in
panels/keyboard/00-multimedia.xml.in
panels/keyboard/01-input-sources.xml.in