Verified Commit f48cfbb2 authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak
Browse files

Merge branch 'librem5-3-24' into pureos/sloppy

parents 6fca0505 d748dfef
......@@ -32,6 +32,7 @@ Build-Depends: debhelper (>= 11.1.3),
libgrilo-0.3-dev (>= 0.3.0),
libgsound-dev,
libgtk-3-dev (>= 3.22.20),
libepoxy-dev,
libgtop2-dev,
libgudev-1.0-dev [linux-any],
libkrb5-dev,
......
......@@ -28,6 +28,7 @@ Build-Depends: debhelper (>= 11.1.3),
libgrilo-0.3-dev (>= 0.3.0),
libgsound-dev,
libgtk-3-dev (>= 3.22.20),
libepoxy-dev,
libgtop2-dev,
libgudev-1.0-dev [linux-any],
libkrb5-dev,
......
......@@ -349,3 +349,20 @@ cc_list_row_set_secondary_label (CcListRow *self,
gtk_label_set_label (self->secondary_label, label);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SECONDARY_LABEL]);
}
void
cc_list_row_set_secondary_markup (CcListRow *self,
const gchar *markup)
{
g_return_if_fail (CC_IS_LIST_ROW (self));
g_return_if_fail (!self->show_switch);
if (!markup)
markup = "";
if (g_str_equal (markup, gtk_label_get_label (self->secondary_label)))
return;
gtk_label_set_markup (self->secondary_label, markup);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SECONDARY_LABEL]);
}
......@@ -39,5 +39,7 @@ gboolean cc_list_row_get_active (CcListRow *self);
void cc_list_row_activate (CcListRow *self);
void cc_list_row_set_secondary_label (CcListRow *self,
const gchar *label);
void cc_list_row_set_secondary_markup (CcListRow *self,
const gchar *markup);
G_END_DECLS
......@@ -50,6 +50,7 @@
<property name="visible">1</property>
<property name="valign">center</property>
<property name="ellipsize">end</property>
<property name="selectable" bind-source="CcListRow" bind-property="activatable" bind-flags="sync-create|invert-boolean" />
<style>
<class name="dim-label"/>
</style>
......
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2019 Canonical Ltd.
*
* 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-os-release.h"
gchar *
cc_os_release_get_value (const gchar *key)
{
g_autoptr(GHashTable) values = NULL;
values = cc_os_release_get_values ();
if (values == NULL)
return NULL;
return g_strdup (g_hash_table_lookup (values, key));
}
GHashTable *
cc_os_release_get_values (void)
{
g_autoptr(GHashTable) values = NULL;
g_autofree gchar *buffer = NULL;
g_auto(GStrv) lines = NULL;
int i;
g_autoptr(GError) error = NULL;
values = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
if (!g_file_get_contents ("/etc/os-release", &buffer, NULL, &error))
{
if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
return NULL;
if (!g_file_get_contents ("/usr/lib/os-release", &buffer, NULL, NULL))
return NULL;
}
/* Default values in spec */
g_hash_table_insert (values, g_strdup ("NAME"), g_strdup ("Linux"));
g_hash_table_insert (values, g_strdup ("ID"), g_strdup ("Linux"));
g_hash_table_insert (values, g_strdup ("PRETTY_NAME"), g_strdup ("Linux"));
lines = g_strsplit (buffer, "\n", -1);
for (i = 0; lines[i] != NULL; i++)
{
gchar *line = lines[i];
g_auto(GStrv) tokens = NULL;
const gchar *key, *value;
g_autofree gchar *unquoted_value = NULL;
/* Skip comments */
if (g_str_has_prefix (line, "#"))
continue;
tokens = g_strsplit (line, "=", 2);
if (g_strv_length (tokens) < 2)
continue;
key = tokens[0];
value = tokens[1];
unquoted_value = g_shell_unquote (value, NULL);
if (unquoted_value != NULL)
value = unquoted_value;
g_hash_table_insert (values, g_strdup (key), g_strdup (value));
}
return g_steal_pointer (&values);
}
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2019 Canonical Ltd.
*
* 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 <glib.h>
G_BEGIN_DECLS
gchar *cc_os_release_get_value (const gchar *key);
GHashTable *cc_os_release_get_values (void);
G_END_DECLS
......@@ -43,6 +43,7 @@ libwidgets_dep = declare_dependency(
sources = common_sources + files(
'cc-common-language.c',
'cc-os-release.c',
'cc-language-chooser.c',
'cc-list-row.c',
'cc-util.c'
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
width="97.966095"
height="138.95122"
id="svg1903"
inkscape:version="0.48.1 r9760"
sodipodi:docname="GnomeLogoVerticalMedium.svg">
<metadata
id="metadata24">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="818"
inkscape:window-height="738"
id="namedview22"
showgrid="false"
inkscape:zoom="2.0645911"
inkscape:cx="6.1022513"
inkscape:cy="68.392751"
inkscape:window-x="460"
inkscape:window-y="26"
inkscape:window-maximized="0"
inkscape:current-layer="svg1903"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<defs
id="defs1905">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 244.11613 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="401.74014 : 244.11613 : 1"
inkscape:persp3d-origin="200.87007 : 162.74409 : 1"
id="perspective26" />
</defs>
<g
transform="matrix(0.30686102,0,0,0.30686102,-57.94673,-76.524295)"
id="layer1">
<g
transform="translate(925.8326,120.8762)"
id="g3963">
<g
transform="matrix(2.914897,0,0,2.914897,-717.5904,128.5015)"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="g3771">
<g
style="fill:#000000;fill-opacity:1"
id="g3773">
<path
d="M 86.068,0 C 61.466,0 56.851,35.041 70.691,35.041 84.529,35.041 110.671,0 86.068,0 z"
style="fill:#000000;fill-opacity:1"
id="path3775"
inkscape:connector-curvature="0" />
<path
d="M 45.217,30.699 C 52.586,31.149 60.671,2.577 46.821,4.374 32.976,6.171 37.845,30.249 45.217,30.699 z"
style="fill:#000000;fill-opacity:1"
id="path3777"
inkscape:connector-curvature="0" />
<path
d="M 11.445,48.453 C 16.686,46.146 12.12,23.581 3.208,29.735 -5.7,35.89 6.204,50.759 11.445,48.453 z"
style="fill:#000000;fill-opacity:1"
id="path3779"
inkscape:connector-curvature="0" />
<path
d="M 26.212,36.642 C 32.451,35.37 32.793,9.778 21.667,14.369 10.539,18.961 19.978,37.916 26.212,36.642 l 0,0 z"
style="fill:#000000;fill-opacity:1"
id="path3781"
inkscape:connector-curvature="0" />
<path
d="m 58.791,93.913 c 1.107,8.454 -6.202,12.629 -13.36,7.179 C 22.644,83.743 83.16,75.088 79.171,51.386 75.86,31.712 15.495,37.769 8.621,68.553 3.968,89.374 27.774,118.26 52.614,118.26 c 12.22,0 26.315,-11.034 28.952,-25.012 C 83.58,82.589 57.867,86.86 58.791,93.913 l 0,0 z"
style="fill:#000000;fill-opacity:1"
id="path3783"
inkscape:connector-curvature="0" />
</g>
</g>
<g
transform="matrix(1.098291,0,0,1.098291,41.06056,-50.07504)"
id="g3956">
<path
d="m -565.99523,509.46063 c -8.08731,0.21792 -14.47394,3.12448 -19.17071,8.69866 -4.86385,5.80101 -7.31024,13.81651 -7.31024,24.03862 0,10.19394 2.44651,18.18745 7.31024,23.98846 4.88761,5.801 11.59815,8.69866 20.15764,8.69866 8.5831,0 15.3105,-2.89766 20.17436,-8.69866 4.86373,-5.80101 7.29358,-13.79452 7.29353,-23.98846 -5e-5,-10.22211 -2.4298,-18.23761 -7.29353,-24.03862 -4.86386,-5.80075 -11.59131,-8.69866 -20.17436,-8.69866 -0.33434,0 -0.6582,-0.009 -0.98693,0 z m 0.60221,11.77669 c 0.12927,-0.003 0.25357,0 0.38472,0 4.21998,0 7.48996,1.8261 9.8028,5.48697 2.31266,3.66086 3.47944,8.82788 3.47949,15.47362 0,6.61757 -1.16692,11.74604 -3.47949,15.40691 -2.31274,3.66086 -5.58286,5.50352 -9.8028,5.50352 -4.19632,0 -7.43983,-1.84266 -9.75257,-5.50352 -2.31274,-3.66087 -3.47944,-8.78934 -3.47949,-15.40691 0,-6.64574 1.16684,-11.81276 3.47949,-15.47362 2.24035,-3.54647 5.35963,-5.37604 9.36785,-5.48697 z"
style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
id="path3787"
inkscape:connector-curvature="0" />
<path
d="m -657.35432,568.97161 c -7.12362,5.98235 -17.72219,5.91366 -22.13752,5.91366 -8.8932,0 -15.93855,-2.92879 -21.13613,-8.78612 -5.19765,-5.88525 -7.7964,-13.85456 -7.7964,-23.90791 0,-10.16578 2.64646,-18.16325 7.93945,-23.99241 5.293,-5.82892 12.54098,-8.74363 21.74413,-8.74363 3.55245,0 6.94991,0.39433 10.19254,1.18273 3.26638,0.78841 6.34203,1.95706 9.22697,3.50595 l -3.70487,10.9527 c -1.62185,-0.88773 -3.4788,-1.76286 -5.20022,-2.37807 -2.93262,-0.98557 -5.87712,-1.47823 -8.83351,-1.47823 -5.48379,0 -9.71581,1.81623 -12.69601,5.44892 -2.95649,3.60454 -4.4347,8.7718 -4.4347,15.50204 0,6.67415 1.4305,11.82733 4.29167,15.46003 2.86099,3.6327 7.16068,5.44892 12.19522,5.44892 5.11476,0 8.28269,-1.28922 9.97226,-2.64762 l 0,-10.91144 -11.08087,0 0,-10.89809 21.45799,0"
style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
id="path3789"
inkscape:connector-curvature="0" />
<path
d="m -528.50252,510.59568 17.5241,0 12.15952,39.37066 12.23105,-39.37066 14.81181,0 6.69132,63.06461 -13.01787,0 -4.0148,-39.4349 -12.30257,39.62391 -8.72628,0 -12.30263,-40.9623 -4.01479,40.77329 -13.05365,0 6.69132,-63.06461"
style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
id="path3793"
inkscape:connector-curvature="0" />
<path
d="m -455.68828,510.59568 37.15811,0 0,12.29183 -23.38928,0 0,13.08097 17.97969,0 0,10.95369 -17.97969,0 0,14.44629 24.17608,0 0,12.29183 -37.94491,0 0,-63.06461"
style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
id="path3795"
inkscape:connector-curvature="0" />
<path
d="m -647.94283,510.59568 8.6869,0 27.44915,37.90083 0,-37.90083 11.71533,0 0,63.06461 -8.6869,0 -27.4491,-37.90083 0,37.90083 -11.71538,0 0,-63.06461"
style="font-size:148.699646px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
id="path3791"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</svg>
This diff is collapsed.
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2017 Mohammed Sadiq <sadiq@sadiqpk.org>
*
* 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 <shell/cc-panel.h>
G_BEGIN_DECLS
#define CC_TYPE_INFO_OVERVIEW_PANEL (cc_info_overview_panel_get_type ())
G_DECLARE_FINAL_TYPE (CcInfoOverviewPanel, cc_info_overview_panel, CC, INFO_OVERVIEW_PANEL, CcPanel)
GtkWidget *cc_info_overview_panel_new (void);
G_END_DECLS
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<template class="CcInfoOverviewPanel" parent="CcPanel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="min-content-height">480</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="HdyColumn">
<property name="visible">True</property>
<property name="maximum_width">600</property>
<property name="linear_growth_width">400</property>
<property name="margin_top">32</property>
<property name="margin_bottom">32</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="spacing">30</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="resource">/org/gnome/control-center/info-overview/purism-logo.svg</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<object class="GtkListBox">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<signal name="row-activated" handler="cc_info_panel_row_activated_cb" swapped="yes"/>
<style>
<class name="frame" />
</style>
<!-- Device name -->
<child>
<object class="CcListRow" id="hostname_row">
<property name="visible">True</property>
<property name="title" translatable="yes">Device Name</property>
<property name="secondary-label" bind-source="hostname_entry" bind-property="text" bind-flags="sync-create" />
<property name="icon-name">go-next-symbolic</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBox" id="hardware_box">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<style>
<class name="frame" />
</style>
<!-- Memory -->
<child>
<object class="CcListRow" id="memory_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes">Memory</property>
</object>
</child>
<!-- Processor -->
<child>
<object class="CcListRow" id="processor_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes">Processor</property>
</object>
</child>
<!-- Graphics -->
<child>
<object class="CcListRow" id="graphics_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes">Graphics</property>
</object>
</child>
<!-- Disk Capacity -->
<child>
<object class="CcListRow" id="disk_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes">Disk Capacity</property>
<property name="secondary-label" translatable="yes">Calculating…</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBox" id="os_box">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<signal name="row-activated" handler="cc_info_panel_row_activated_cb" swapped="yes"/>
<style>
<class name="frame" />
</style>
<!-- OS Name -->
<child>
<object class="CcListRow" id="os_name_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes"
comments="translators: this field contains the distro name and version">OS Name</property>
</object>
</child>
<!-- OS Type -->
<child>
<object class="CcListRow" id="os_type_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes">OS Type</property>
</object>
</child>
<!-- GNOME Version -->
<child>
<object class="CcListRow" id="gnome_version_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes">GNOME Version</property>
<property name="secondary-label">3.0</property>
</object>
</child>
<!-- Windowing System -->
<child>
<object class="CcListRow" id="windowing_system_row">
<property name="visible">True</property>
<property name="activatable">False</property>
<property name="title" translatable="yes">Windowing System</property>
</object>
</child>
<!-- Virtualization -->
<child>
<object class="CcListRow" id="virtualization_row">
<property name="visible">False</property>
<property name="title" translatable="yes">Virtualization</property>
<property name="activatable">False</property>
</object>
</child>
<!-- Software Updates -->
<child>
<object class="CcListRow" id="software_updates_row">
<property name="visible">True</property>
<property name="title" translatable="yes">Software Updates</property>
<property name="icon-name">go-next-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="HdyDialog" id="hostname_editor">
<property name="visible">False</property>
<property name="modal">True</property>
<property name="use-header-bar">1</property>
<property name="default-height">24</property>
<property name="title" translatable="yes">Rename Device</property>
<signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
<child internal-child="vbox">
<object class="GtkBox">
<property name="border-width">0</property>
<property name="margin-top">18</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-bottom">18</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="margin-bottom">18</property>
<property name="wrap">True</property>
<property name="max-width-chars">35</property>
<property name="xalign">0.0</property>
<property name="label" translatable="yes">The device name is used to identify this device when it is viewed over the network, or when pairing Bluetooth devices.</property>
</object>
</child>
<child>
<object class="GtkEntry" id="device_name_entry">
<property name="visible">True</property>
</object>
</child>
</object>
</child>
<!-- Rename button -->
<child type="action">
<object class="GtkButton" id="rename_button">
<property name="visible">True</property>
<property name="can-default">True</property>
<property name="use-underline">True</property>
<property name="label" translatable="yes">_Rename</property>
</object>
</child>
<!-- Cancel button -->
<child type="action">
<object class="GtkButton" id="cancel_button">
<property name="visible">True</property>
<property name="use-underline">True</property>
<property name="label" translatable="yes">_Cancel</property>
</object>
</child>
<action-widgets>
<action-widget response="apply" default="true">rename_button</action-widget>
<action-widget response="cancel">cancel_button</action-widget>
</action-widgets>
</object>
<object class="CcHostnameEntry" id="hostname_entry">
<property name="visible">0</property>
</object>
</interface>