From beedb31a3fd606e360eaf5dcce0b4cbe2a3b6bab Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Tue, 2 Jul 2019 20:03:26 -0700 Subject: Use DetailView for SHELL_VIEW_NORMAL and the more info display This change has been made mostly because we need more control in how things are displayed, and fighting GTK+ so that this is possible isn't going to cut it. For instance, it is now possible to display links -- albeit only external links at the moment, but internal links will be possible, allowing for instance for one to click in a kernel module dependency to know more about that particular module. Links will also be useful to go to the vendor website, and maybe other things (like web search for Vendor + Product ID) and whatnot. Eventually this will replace the summary view altogether. That code has a lot of drawbacks, including not being able to have its contents copied to the clipboard, appear in reports, or have auto-updating fields. It stays for now, but it will be gone before 0.6 is released. I had forgotten how messy this code is. One of the reasons I lost the interest in this project... I want to hack on a nicer code base but I also lack the strong motivation to write the shell from the scratch. --- modules/computer.c | 13 +++++++++++-- modules/devices.c | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/computer.c b/modules/computer.c index 80d8ba2b..f8adfc38 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -328,7 +328,7 @@ gchar *callback_dev(void) { return g_strdup_printf( "[$ShellParam$]\n" - "ViewType=0\n" + "ViewType=5\n" "ColumnTitle$TextValue=%s\n" /* Program */ "ColumnTitle$Value=%s\n" /* Version */ "ShowColumnHeaders=true\n" @@ -512,8 +512,10 @@ gchar *callback_summary(void) { struct Info *info = info_new(); + info_set_view_type(info, SHELL_VIEW_DETAIL); + info_add_group(info, _("Computer"), - info_field_printf(_("Processor"), "%s", + info_field(_("Processor"), module_call_method("devices::getProcessorName")), info_field_update(_("Memory"), 1000), info_field_printf(_("Machine Type"), "%s", @@ -547,6 +549,8 @@ gchar *callback_os(void) struct Info *info = info_new(); struct InfoField distro = info_field(_("Distribution"), computer->os->distro); + info_set_view_type(info, SHELL_VIEW_DETAIL); + if (computer->os->distrocode) { distro = info_field_with_icon(distro, idle_free(g_strdup_printf("distros/%s.png", @@ -581,6 +585,8 @@ gchar *callback_security(void) { struct Info *info = info_new(); + info_set_view_type(info, SHELL_VIEW_DETAIL); + info_add_group(info, _("HardInfo"), info_field(_("HardInfo running as"), (getuid() == 0) ? _("Superuser") : _("User")), info_field_last()); @@ -692,6 +698,9 @@ gchar *callback_display(void) wl_info *wl = computer->display->wl; struct Info *info = info_new(); + + info_set_view_type(info, SHELL_VIEW_DETAIL); + info_add_group(info, _("Session"), info_field(_("Type"), THISORUNK(computer->display->session_type)), info_field_last()); diff --git a/modules/devices.c b/modules/devices.c index ca31f803..f4a716a1 100644 --- a/modules/devices.c +++ b/modules/devices.c @@ -627,7 +627,10 @@ gchar *callback_processors() gchar *callback_dmi() { - return g_strdup(dmi_info); + return g_strdup_printf("%s" + "[$ShellParam$]\n" + "ViewType=5\n", + dmi_info); } gchar *callback_dmi_mem() @@ -646,6 +649,7 @@ gchar *callback_battery() { return g_strdup_printf("%s\n" "[$ShellParam$]\n" + "ViewType=5\n" "ReloadInterval=4000\n", battery_list); } -- cgit v1.2.3