[gnome-control-center/gbsneto/gtk4: 39/53] thunderbolt: Port to GTK4
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/gtk4: 39/53] thunderbolt: Port to GTK4
- Date: Wed, 15 Dec 2021 01:34:34 +0000 (UTC)
commit b81a180c4fbe80b86728c1f608f790f9ad3ebb82
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Oct 21 21:08:31 2021 -0300
thunderbolt: Port to GTK4
The C code of this panel is just so. damn. good. Porting it was
a breeze.
panels/meson.build | 2 +-
panels/thunderbolt/cc-bolt-device-dialog.c | 35 +-
panels/thunderbolt/cc-bolt-device-dialog.ui | 275 ++++------
panels/thunderbolt/cc-bolt-device-entry.ui | 44 +-
panels/thunderbolt/cc-bolt-panel.c | 62 +--
panels/thunderbolt/cc-bolt-panel.ui | 770 +++++++++++++---------------
panels/thunderbolt/meson.build | 1 -
shell/cc-panel-loader.c | 4 +-
8 files changed, 488 insertions(+), 705 deletions(-)
---
diff --git a/panels/meson.build b/panels/meson.build
index 57342333d..087810b9b 100644
--- a/panels/meson.build
+++ b/panels/meson.build
@@ -38,7 +38,7 @@ endif
if host_is_linux_not_s390
panels += [
# 'bluetooth',
-# 'thunderbolt',
+ 'thunderbolt',
# 'wacom'
]
endif
diff --git a/panels/thunderbolt/cc-bolt-device-dialog.c b/panels/thunderbolt/cc-bolt-device-dialog.c
index a1683c414..bfe52b779 100644
--- a/panels/thunderbolt/cc-bolt-device-dialog.c
+++ b/panels/thunderbolt/cc-bolt-device-dialog.c
@@ -19,8 +19,6 @@
#include <config.h>
-#include <list-box-helper.h>
-
#include <glib/gi18n.h>
#include "bolt-device.h"
@@ -155,7 +153,7 @@ dialog_update_from_device (CcBoltDeviceDialog *dialog)
}
gtk_label_set_label (dialog->name_label, label);
- gtk_header_bar_set_title (dialog->header_bar, label);
+ gtk_window_set_title (GTK_WINDOW (dialog), label);
status_brief = status_to_string_for_ui (dev);
gtk_label_set_label (dialog->status_label, status_brief);
@@ -270,27 +268,25 @@ static void
on_connect_button_clicked_cb (CcBoltDeviceDialog *dialog)
{
g_autoptr(GPtrArray) devices = NULL;
- g_autoptr(GList) entries = NULL;
BoltDevice *device = dialog->device;
- GList *iter;
+ GtkWidget *child;
g_return_if_fail (device != NULL);
dialog_operation_start (dialog);
- entries = gtk_container_get_children (GTK_CONTAINER (dialog->parents_devices));
devices = g_ptr_array_new ();
- /* reverse the order, so to start with the devices closest to the host */
- entries = g_list_reverse (entries);
-
- for (iter = entries; iter; iter = iter->next)
+ /* Iter from the last child to the first one */
+ for (child = gtk_widget_get_last_child (GTK_WIDGET (dialog->parents_devices));
+ child;
+ child = gtk_widget_get_prev_sibling (child))
{
CcBoltDeviceEntry *entry;
BoltDevice *dev;
BoltStatus status;
- entry = (CcBoltDeviceEntry *) iter->data;
+ entry = CC_BOLT_DEVICE_ENTRY (child);
dev = cc_bolt_device_entry_get_device (entry);
status = bolt_device_get_status (dev);
@@ -300,7 +296,7 @@ on_connect_button_clicked_cb (CcBoltDeviceDialog *dialog)
* all following device (down the chain, towards the target) will
* also be not authorized. */
if (!bolt_status_is_pending (status))
- continue;
+ continue;
/* device is now either !stored || pending */
g_ptr_array_add (devices, dev);
@@ -413,11 +409,6 @@ cc_bolt_device_dialog_init (CcBoltDeviceDialog *dialog)
{
g_resources_register (cc_thunderbolt_get_resource ());
gtk_widget_init_template (GTK_WIDGET (dialog));
-
- gtk_list_box_set_header_func (dialog->parents_devices,
- cc_list_box_update_header_func,
- NULL,
- NULL);
}
/* public functions */
@@ -453,6 +444,8 @@ cc_bolt_device_dialog_set_device (CcBoltDeviceDialog *dialog,
if (dialog->device)
{
+ GtkWidget *child;
+
g_cancellable_cancel (dialog->cancel);
g_clear_object (&dialog->cancel);
dialog->cancel = g_cancellable_new ();
@@ -462,8 +455,9 @@ cc_bolt_device_dialog_set_device (CcBoltDeviceDialog *dialog,
dialog);
g_clear_object (&dialog->device);
- gtk_container_foreach (GTK_CONTAINER (dialog->parents_devices),
- (GtkCallback) gtk_widget_destroy, NULL);
+ while ((child = gtk_widget_get_first_child (GTK_WIDGET (dialog->parents_devices))) != NULL)
+ gtk_list_box_remove (dialog->parents_devices, child);
+
gtk_widget_hide (GTK_WIDGET (dialog->parents_expander));
}
@@ -503,8 +497,7 @@ cc_bolt_device_dialog_set_device (CcBoltDeviceDialog *dialog,
parent = g_ptr_array_index (parents, i);
entry = cc_bolt_device_entry_new (parent, TRUE);
- gtk_widget_show (GTK_WIDGET (entry));
- gtk_container_add (GTK_CONTAINER (dialog->parents_devices), GTK_WIDGET (entry));
+ gtk_list_box_append (dialog->parents_devices, GTK_WIDGET (entry));
}
}
diff --git a/panels/thunderbolt/cc-bolt-device-dialog.ui b/panels/thunderbolt/cc-bolt-device-dialog.ui
index 4229a1dd0..7d164dcdc 100644
--- a/panels/thunderbolt/cc-bolt-device-dialog.ui
+++ b/panels/thunderbolt/cc-bolt-device-dialog.ui
@@ -3,71 +3,51 @@
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="CcBoltDeviceDialog" parent="GtkDialog">
- <property name="can_focus">False</property>
- <property name="type_hint">dialog</property>
+ <property name="title">Device Identifier</property>
<property name="use_header_bar">1</property>
<property name="resizable">False</property>
<property name="modal">True</property>
+ <property name="hide-on-close">True</property>
<child internal-child="headerbar">
<object class="GtkHeaderBar" id="header_bar">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="show_close_button">True</property>
- <property name="title">Device Identifier</property>
- <property name="subtitle"></property>
- <property name="has-subtitle">False</property>
+ <property name="show_title_buttons">True</property>
</object>
</child>
- <child internal-child="vbox">
+ <child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="margin-bottom">24</property>
- <property name="border-width">0</property>
<child>
<object class="GtkOverlay">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child type="overlay">
<object class="GtkRevealer" id="notify_revealer">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="transition_type">slide-down</property>
<child>
<object class="GtkFrame">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="notify_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
</child>
<child>
<object class="GtkButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="relief">none</property>
+ <style>
+ <class name="flat" />
+ </style>
<signal name="clicked"
handler="on_notify_button_clicked_cb"
object="CcBoltDeviceDialog"
swapped="no" />
<child>
<object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="icon-name">window-close-symbolic</property>
</object>
</child>
@@ -84,25 +64,20 @@
</child>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="expand">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin-left">72</property>
- <property name="margin-right">72</property>
+ <property name="margin-start">72</property>
+ <property name="margin-end">72</property>
<property name="margin-top">24</property>
<property name="margin-bottom">0</property>
<property name="row_spacing">12</property>
<property name="column_spacing">24</property>
<child>
<object class="GtkLabel" id="name_title_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">end</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
@@ -110,31 +85,27 @@
<property name="justify">right</property>
<property name="xalign">1</property>
<property name="mnemonic_widget">name_label</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="name_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label">Device identifier</property>
<property name="use_markup">True</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="status_title_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">end</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
@@ -142,32 +113,28 @@
<property name="justify">right</property>
<property name="xalign">1</property>
<property name="mnemonic_widget">status_label</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="status_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="label">Status</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="uuid_title_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">end</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
@@ -175,32 +142,28 @@
<property name="justify">right</property>
<property name="xalign">1</property>
<property name="mnemonic_widget">uuid_label</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">2</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="uuid_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="label">Status</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">2</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="time_title">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">end</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
@@ -208,122 +171,80 @@
<property name="justify">right</property>
<property name="xalign">1</property>
<property name="mnemonic_widget">time_label</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">3</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="time_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="label">Status</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">3</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="padding">1</property>
- <property name="position">1</property>
- </packing>
- <object class="GtkSizeGroup" id="device_titles_sizegroup">
- <widgets>
- <widget name="name_title_label"/>
- <widget name="status_title_label"/>
- <widget name="uuid_title_label"/>
- <widget name="time_title"/>
- </widgets>
- </object>
- <object class="GtkSizeGroup" id="device_labels_sizegroup">
- <widgets>
- <widget name="name_label"/>
- <widget name="status_label"/>
- <widget name="uuid_label"/>
- <widget name="time_label"/>
- </widgets>
- </object>
</child>
<!-- end of grid -->
- <child>
- <object class="GtkExpander" id="parents_expander">
- <property name="visible">False</property>
- <property name="halign">fill</property>
- <property name="margin-left">72</property>
- <property name="margin-right">72</property>
+ <child>
+ <object class="GtkExpander" id="parents_expander">
+ <property name="visible">False</property>
+ <property name="halign">fill</property>
+ <property name="margin-start">72</property>
+ <property name="margin-end">72</property>
<property name="margin-top">12</property>
<property name="margin-bottom">0</property>
- <property name="spacing">12</property>
- <child type="label">
- <object class="GtkLabel" id="parents_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">end</property>
+ <child type="label">
+ <object class="GtkLabel" id="parents_label">
+ <property name="halign">end</property>
<property name="hexpand">False</property>
<property name="vexpand">False</property>
<property name="label">Depends on other devices:</property>
<property name="justify">center</property>
<property name="xalign">1</property>
- </object>
- </child>
- <child>
- <object class="GtkFrame">
- <property name="margin-top">12</property>
- <property name="visible">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkListBox" id="parents_devices">
<property name="valign">start</property>
<property name="vexpand">False</property>
+ <property name="selection-mode">none</property>
<style>
- <class name="view" />
+ <class name="content" />
</style>
- <child>
- <object class="GtkListBox" id="parents_devices">
- <property name="valign">start</property>
- <property name="vexpand">False</property>
- <property name="visible">True</property>
- <property name="selection-mode">none</property>
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <!-- end of -->
+ </object>
+ </child>
+ </object>
+ </child>
+ <!-- end of -->
<child>
<object class="GtkBox" id="button_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<property name="spacing">12</property>
- <property name="margin-left">72</property>
- <property name="margin-right">72</property>
+ <property name="margin-start">72</property>
+ <property name="margin-end">72</property>
<property name="margin-top">36</property>
<property name="margin-bottom">0</property>
<property name="halign">fill</property>
<child>
<object class="GtkSpinner" id="spinner">
- <property name="visible">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
- <property name="active">False</property>
+ <property name="spinning">False</property>
</object>
</child>
<child>
<object class="GtkButton" id="connect_button">
<property name="label" translatable="yes">Authorize and Connect</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">fill</property>
@@ -335,17 +256,11 @@
<class name="suggested-action"/>
</style>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
</child>
<child>
<object class="GtkButton" id="forget_button">
<property name="label" translatable="yes">Forget Device</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">fill</property>
<signal name="clicked"
@@ -356,39 +271,13 @@
<class name="destructive-action"/>
</style>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
</child>
<child>
<object class="GtkBox" id="spinner_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
-
- <object class="GtkSizeGroup" id="actions_sizegroup">
- <widgets>
- <widget name="forget_button"/>
- <widget name="connect_button"/>
- </widgets>
- </object>
-
- <object class="GtkSizeGroup" id="spinner_sizegroup">
- <widgets>
- <widget name="spinner"/>
- <widget name="spinner_box"/>
- </widgets>
- </object>
-
</child>
</object>
</child>
@@ -398,4 +287,36 @@
</object>
</child>
</template>
+
+ <object class="GtkSizeGroup" id="device_titles_sizegroup">
+ <widgets>
+ <widget name="name_title_label"/>
+ <widget name="status_title_label"/>
+ <widget name="uuid_title_label"/>
+ <widget name="time_title"/>
+ </widgets>
+ </object>
+ <object class="GtkSizeGroup" id="device_labels_sizegroup">
+ <widgets>
+ <widget name="name_label"/>
+ <widget name="status_label"/>
+ <widget name="uuid_label"/>
+ <widget name="time_label"/>
+ </widgets>
+ </object>
+
+ <object class="GtkSizeGroup" id="actions_sizegroup">
+ <widgets>
+ <widget name="forget_button"/>
+ <widget name="connect_button"/>
+ </widgets>
+ </object>
+
+ <object class="GtkSizeGroup" id="spinner_sizegroup">
+ <widgets>
+ <widget name="spinner"/>
+ <widget name="spinner_box"/>
+ </widgets>
+ </object>
+
</interface>
diff --git a/panels/thunderbolt/cc-bolt-device-entry.ui b/panels/thunderbolt/cc-bolt-device-entry.ui
index 7668f6a10..0b10a7009 100644
--- a/panels/thunderbolt/cc-bolt-device-entry.ui
+++ b/panels/thunderbolt/cc-bolt-device-entry.ui
@@ -3,63 +3,49 @@
<requires lib="gtk+" version="3.20"/>
<template class="CcBoltDeviceEntry" parent="GtkListBoxRow">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
<property name="activatable">True</property>
<child>
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="border-width">12</property>
- <property name="margin_left">6</property>
- <property name="margin_right">6</property>
+ <object class="GtkBox">
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
<property name="column-spacing">12</property>
<property name="row-spacing">2</property>
<child>
<object class="GtkLabel" id="name_label">
<property name="ellipsize">end</property>
<property name="use-markup">True</property>
- <property name="visible">True</property>
<property name="hexpand">True</property>
<property name="label">Device Name</property>
<property name="xalign">0.0</property>
<property name="valign">center</property>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- </packing>
</child>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
<property name="hexpand">False</property>
<property name="halign">end</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage" id="status_warning">
<property name="visible">False</property>
- <property name="can_focus">False</property>
<property name="icon_name">dialog-warning-symbolic</property>
<property name="icon_size">1</property>
<property name="margin_left">0</property>
<property name="xalign">0.0</property>
</object>
</child>
- <child>
- <object class="GtkLabel" id="status_label">
- <property name="visible">True</property>
- <property name="hexpand">False</property>
- <property name="label">Status</property>
- <property name="halign">end</property>
- <property name="valign">center</property>
- <property name="xalign">1.0</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- </packing>
+ <child>
+ <object class="GtkLabel" id="status_label">
+ <property name="hexpand">False</property>
+ <property name="label">Status</property>
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ <property name="xalign">1.0</property>
+ </object>
+ </child>
+ </object>
</child>
</object>
</child>
diff --git a/panels/thunderbolt/cc-bolt-panel.c b/panels/thunderbolt/cc-bolt-panel.c
index 9004c3c9b..6585a933e 100644
--- a/panels/thunderbolt/cc-bolt-panel.c
+++ b/panels/thunderbolt/cc-bolt-panel.c
@@ -20,7 +20,6 @@
#include <config.h>
#include <shell/cc-panel.h>
-#include <list-box-helper.h>
#include <glib/gi18n.h>
#include <polkit/polkit.h>
@@ -127,10 +126,6 @@ static gboolean on_authmode_state_set_cb (CcBoltPanel *panel,
static void on_device_entry_row_activated_cb (CcBoltPanel *panel,
GtkListBoxRow *row);
-static gboolean on_device_dialog_delete_event_cb (GtkWidget *widget,
- GdkEvent *event,
- CcBoltPanel *panel);
-
static void on_device_entry_status_changed_cb (CcBoltDeviceEntry *entry,
BoltStatus new_status,
CcBoltPanel *panel);
@@ -310,15 +305,15 @@ devices_table_synchronize (CcBoltPanel *panel)
}
static gboolean
-list_box_sync_visible (GtkListBox *lstbox)
+list_box_sync_visible (GtkListBox *listbox)
{
- g_autoptr(GList) children = NULL;
+ GtkWidget *child;
gboolean show;
- children = gtk_container_get_children (GTK_CONTAINER (lstbox));
- show = g_list_length (children) > 0;
+ child = gtk_widget_get_first_child (GTK_WIDGET (listbox));
+ show = child != NULL;
- gtk_widget_set_visible (GTK_WIDGET (lstbox), show);
+ gtk_widget_set_visible (GTK_WIDGET (listbox), show);
return show;
}
@@ -353,19 +348,17 @@ cc_bolt_panel_add_device (CcBoltPanel *panel,
path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (dev));
/* add to the list box */
- gtk_widget_show (GTK_WIDGET (entry));
-
status = bolt_device_get_status (dev);
if (bolt_status_is_pending (status))
{
- gtk_container_add (GTK_CONTAINER (panel->pending_list), GTK_WIDGET (entry));
+ gtk_list_box_append (panel->pending_list, GTK_WIDGET (entry));
gtk_widget_show (GTK_WIDGET (panel->pending_list));
gtk_widget_show (GTK_WIDGET (panel->pending_box));
}
else
{
- gtk_container_add (GTK_CONTAINER (panel->devices_list), GTK_WIDGET (entry));
+ gtk_list_box_append (panel->devices_list, GTK_WIDGET (entry));
gtk_widget_show (GTK_WIDGET (panel->devices_list));
gtk_widget_show (GTK_WIDGET (panel->devices_box));
}
@@ -399,7 +392,7 @@ cc_bolt_panel_del_device_entry (CcBoltPanel *panel,
}
p = gtk_widget_get_parent (GTK_WIDGET (entry));
- gtk_widget_destroy (GTK_WIDGET (entry));
+ gtk_list_box_remove (GTK_LIST_BOX (p), GTK_WIDGET (entry));
box = cc_bolt_panel_box_for_listbox (panel, GTK_LIST_BOX (p));
show = list_box_sync_visible (GTK_LIST_BOX (p));
@@ -446,8 +439,8 @@ cc_panel_list_box_migrate (CcBoltPanel *panel,
target = GTK_WIDGET (entry);
- gtk_container_remove (GTK_CONTAINER (from), target);
- gtk_container_add (GTK_CONTAINER (to), target);
+ gtk_list_box_remove (from, target);
+ gtk_list_box_append (to, target);
gtk_widget_show (GTK_WIDGET (to));
from_box = cc_bolt_panel_box_for_listbox (panel, from);
@@ -698,25 +691,10 @@ on_device_entry_row_activated_cb (CcBoltPanel *panel,
cc_bolt_device_dialog_set_device (panel->device_dialog, device, parents);
- gtk_window_resize (GTK_WINDOW (panel->device_dialog), 1, 1);
+ gtk_window_set_default_size (GTK_WINDOW (panel->device_dialog), 1, 1);
gtk_widget_show (GTK_WIDGET (panel->device_dialog));
}
-static gboolean
-on_device_dialog_delete_event_cb (GtkWidget *widget,
- GdkEvent *event,
- CcBoltPanel *panel)
-{
- CcBoltDeviceDialog *dialog;
-
- dialog = CC_BOLT_DEVICE_DIALOG (widget);
-
- cc_bolt_device_dialog_set_device (dialog, NULL, NULL);
- gtk_widget_hide (widget);
-
- return TRUE;
-}
-
static void
on_device_entry_status_changed_cb (CcBoltDeviceEntry *entry,
BoltStatus new_status,
@@ -898,7 +876,8 @@ cc_bolt_panel_dispose (GObject *object)
CcBoltPanel *panel = CC_BOLT_PANEL (object);
/* Must be destroyed in dispose, not finalize. */
- g_clear_pointer ((GtkWidget **) &panel->device_dialog, gtk_widget_destroy);
+ cc_bolt_device_dialog_set_device (panel->device_dialog, NULL, NULL);
+ g_clear_pointer ((GtkWindow **) &panel->device_dialog, gtk_window_destroy);
G_OBJECT_CLASS (cc_bolt_panel_parent_class)->dispose (object);
}
@@ -961,16 +940,6 @@ cc_bolt_panel_init (CcBoltPanel *panel)
gtk_stack_set_visible_child_name (panel->container, "loading");
- gtk_list_box_set_header_func (panel->devices_list,
- cc_list_box_update_header_func,
- NULL,
- NULL);
-
- gtk_list_box_set_header_func (panel->pending_list,
- cc_list_box_update_header_func,
- NULL,
- NULL);
-
gtk_list_box_set_sort_func (panel->devices_list,
device_entries_sort_by_recency_cb,
panel,
@@ -984,11 +953,6 @@ cc_bolt_panel_init (CcBoltPanel *panel)
panel->devices = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
panel->device_dialog = cc_bolt_device_dialog_new ();
- g_signal_connect_object (panel->device_dialog,
- "delete-event",
- G_CALLBACK (on_device_dialog_delete_event_cb),
- panel, 0);
bolt_client_new_async (cc_panel_get_cancellable (CC_PANEL (panel)), bolt_client_ready, g_object_ref
(panel));
-
}
diff --git a/panels/thunderbolt/cc-bolt-panel.ui b/panels/thunderbolt/cc-bolt-panel.ui
index 226353c64..5379fca77 100644
--- a/panels/thunderbolt/cc-bolt-panel.ui
+++ b/panels/thunderbolt/cc-bolt-panel.ui
@@ -3,50 +3,37 @@
<requires lib="gtk+" version="3.20"/>
<template class="CcBoltPanel" parent="CcPanel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
<child>
<object class="GtkOverlay">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child type="overlay">
<object class="GtkRevealer" id="notification_revealer">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="transition_type">slide-down</property>
<child>
<object class="GtkFrame">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="notification_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
</child>
<child>
<object class="GtkButton">
- <property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="relief">none</property>
+ <style>
+ <class name="flat" />
+ </style>
<signal name="clicked"
handler="on_notification_button_clicked_cb"
object="CcBoltPanel"
swapped="no" />
<child>
<object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="icon-name">window-close-symbolic</property>
</object>
</child>
@@ -64,405 +51,403 @@
<child>
<object class="GtkStack" id="container">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="homogeneous">False</property>
+ <property name="hhomogeneous">False</property>
+ <property name="vhomogeneous">False</property>
<property name="transition_type">crossfade</property>
<!-- Spinner for when we are creating -->
<child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="expand">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="orientation">vertical</property>
- <property name="spacing">10</property>
- <property name="margin">18</property>
- <child type="center">
- <object class="GtkSpinner" id="loading-spinner">
- <property name="visible">True</property>
- <property name="active">True</property>
- <property name="expand">True</property>
+ <object class="GtkStackPage">
+ <property name="name">loading</property>
+ <property name="child">
+ <object class="GtkCenterBox">
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-top">18</property>
+ <property name="margin-bottom">18</property>
+ <property name="margin-start">18</property>
+ <property name="margin-end">18</property>
+ <child type="center">
+ <object class="GtkSpinner" id="loading-spinner">
+ <property name="spinning">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
</object>
- </child>
+ </property>
</object>
- <packing>
- <property name="name">loading</property>
- </packing>
</child>
<!-- No tunderbolt -->
<child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="expand">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="orientation">vertical</property>
- <property name="spacing">10</property>
- <property name="margin">18</property>
- <child type="center" >
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_start">12</property>
- <property name="margin_end">6</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">24</property>
+ <object class="GtkStackPage">
+ <property name="name">no-thunderbolt</property>
+ <property name="child">
+ <object class="GtkCenterBox">
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-top">18</property>
+ <property name="margin-bottom">18</property>
+ <property name="margin-start">18</property>
+ <property name="margin-end">18</property>
+ <child type="center" >
+ <object class="GtkGrid">
+ <property name="margin_start">12</property>
+ <property name="margin_end">6</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">24</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">thunderbolt-symbolic</property>
- <property name="pixel_size">96</property>
- <property name="yalign">0</property>
- <style>
- <class name="dim-label" />
- </style>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="height">2</property>
- </packing>
- </child>
+ <child>
+ <object class="GtkImage">
+ <property name="icon_name">thunderbolt-symbolic</property>
+ <property name="pixel_size">96</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="row-span">2</property>
+ </layout>
+ <style>
+ <class name="dim-label" />
+ </style>
+ </object>
+ </child>
- <child>
- <object class="GtkLabel" id="notb_caption">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="wrap">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">No Thunderbolt support</property>
- <attributes>
- <attribute name="scale" value="1.2" />
- </attributes>
- <style>
- <class name="dim-label" />
- </style>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
+ <child>
+ <object class="GtkLabel" id="notb_caption">
+ <property name="wrap">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">No Thunderbolt support</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
+ <attributes>
+ <attribute name="scale" value="1.2" />
+ </attributes>
+ <style>
+ <class name="dim-label" />
+ </style>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkLabel" id="notb_details">
+ <property name="hexpand">True</property>
+ <property name="max-width-chars">40</property>
+ <property name="use_markup">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="wrap">True</property>
+ <property name="label" translatable="no">Could not connect to the thunderbolt
subsystem.</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
- <child>
- <object class="GtkLabel" id="notb_details">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="max-width-chars">40</property>
- <property name="use_markup">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="wrap">True</property>
- <property name="label" translatable="no">Could not connect to the thunderbolt
subsystem.</property>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
</child>
</object>
- </child>
-
+ </property>
</object>
- <packing>
- <property name="name">no-thunderbolt</property>
- </packing>
</child>
<!-- Normal operation mode (show list of devices) -->
- <child>
- <object class="GtkScrolledWindow">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar-policy">never</property>
- <child>
- <object class="GtkViewport">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">devices-listing</property>
+ <property name="child">
+ <object class="GtkScrolledWindow">
+ <property name="hscrollbar-policy">never</property>
<child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">horizontal</property>
- <property name="valign">start</property>
+ <object class="GtkViewport">
- <!-- Stub box -->
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- </object>
- </child>
+ <property name="orientation">horizontal</property>
+ <property name="valign">start</property>
- <!-- center/content box -->
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="spacing">32</property>
- <property name="margin_top">32</property>
- <property name="margin_bottom">32</property>
- <property name="margin_left">18</property>
- <property name="margin_right">18</property>
- <property name="orientation">vertical</property>
-
- <!-- Auth Mode -->
+ <!-- Stub box -->
<child>
- <object class="GtkBox" id="authmode_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">horizontal</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">False</property>
- <property name="halign">start</property>
- <property name="xalign">0.0</property>
- <property name="label" translatable="yes">Direct Access</property>
- <property name="mnemonic_widget">authmode_switch</property>
- <attributes>
- <attribute name="weight" value="bold" />
- </attributes>
- </object>
- </child>
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ </object>
+ </child>
+ <!-- center/content box -->
+ <child>
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ <property name="spacing">32</property>
+ <property name="margin_top">32</property>
+ <property name="margin_bottom">32</property>
+ <property name="margin-start">18</property>
+ <property name="margin-end">18</property>
+ <property name="orientation">vertical</property>
+
+ <!-- Auth Mode -->
+ <child>
+ <object class="GtkBox" id="authmode_box">
+ <property name="orientation">horizontal</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkStack" id="authmode_mode">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="transition-type">crossfade</property>
- <property name="homogeneous">True</property>
-
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
<object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="margin_left">0</property>
<property name="hexpand">False</property>
- <property name="vexpand">False</property>
- <property name="label" translatable="yes" >Allow direct access
to devices such as docks and external GPUs.</property>
- <property name="use_markup">True</property>
- <property name="wrap">True</property>
+ <property name="halign">start</property>
<property name="xalign">0.0</property>
- <property name="yalign">0.0</property>
- <property name="max-width-chars">45</property>
+ <property name="label" translatable="yes">Direct
Access</property>
+ <property name="mnemonic_widget">authmode_switch</property>
+ <attributes>
+ <attribute name="weight" value="bold" />
+ </attributes>
</object>
- <packing>
- <property name="name">enabled</property>
- </packing>
</child>
<child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="margin_left">0</property>
- <property name="hexpand">False</property>
- <property name="vexpand">False</property>
- <property name="label" translatable="yes" >Only USB and Display
Port devices can attach.</property>
- <property name="use_markup">True</property>
- <property name="wrap">True</property>
- <property name="xalign">0.0</property>
- <property name="yalign">0.0</property>
- <property name="max-width-chars">45</property>
- </object>
- <packing>
- <property name="name">disabled</property>
- </packing>
- </child>
+ <object class="GtkStack" id="authmode_mode">
+ <property name="transition-type">crossfade</property>
+ <property name="hhomogeneous">False</property>
+ <property name="vhomogeneous">False</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">horizontal</property>
- <property name="spacing">6</property>
- <property name="halign">center</property>
- <property name="valign">start</property>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">enabled</property>
+ <property name="child">
+ <object class="GtkLabel">
+ <property name="halign">start</property>
+ <property name="margin-start">0</property>
+ <property name="hexpand">False</property>
+ <property name="vexpand">False</property>
+ <property name="label" translatable="yes" >Allow direct
access to devices such as docks and external GPUs.</property>
+ <property name="use_markup">True</property>
+ <property name="wrap">True</property>
+ <property name="xalign">0.0</property>
+ <property name="yalign">0.0</property>
+ <property name="max-width-chars">45</property>
+ </object>
+ </property>
+ </object>
+ </child>
- <child>
- <object class="GtkSpinner" id="authmode_spinner">
- <property name="visible">True</property>
- <property name="active">False</property>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">disabled</property>
+ <property name="child">
+ <object class="GtkLabel">
+ <property name="halign">start</property>
+ <property name="margin-start">0</property>
+ <property name="hexpand">False</property>
+ <property name="vexpand">False</property>
+ <property name="label" translatable="yes" >Only USB and
Display Port devices can attach.</property>
+ <property name="use_markup">True</property>
+ <property name="wrap">True</property>
+ <property name="xalign">0.0</property>
+ <property name="yalign">0.0</property>
+ <property name="max-width-chars">45</property>
+ </object>
+ </property>
+ </object>
+ </child>
+
+ </object>
+ </child>
</object>
</child>
-
<child>
- <object class="GtkSwitch" id="authmode_switch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">end</property>
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="spacing">6</property>
+ <property name="halign">center</property>
<property name="valign">start</property>
- <property name="active">True</property>
- <signal name="state-set"
- handler="on_authmode_state_set_cb"
- object="CcBoltPanel"
- swapped="yes" />
+
+ <child>
+ <object class="GtkSpinner" id="authmode_spinner">
+ <property name="spinning">False</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkSwitch" id="authmode_switch">
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="active">True</property>
+ <signal name="state-set"
+ handler="on_authmode_state_set_cb"
+ object="CcBoltPanel"
+ swapped="yes" />
+ </object>
+ </child>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- <property name="pack-type">end</property>
- </packing>
</child>
- </object>
- </child>
-
- <!-- Stack: devices/no-devices -->
- <child>
- <object class="GtkStack" id="devices_stack">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="transition-type">crossfade</property>
+ <!-- Stack: devices/no-devices -->
<child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">32</property>
+ <object class="GtkStack" id="devices_stack">
+ <property name="transition-type">crossfade</property>
- <!-- Pending Device List -->
<child>
- <object class="GtkBox" id="pending_box">
- <property name="visible">False</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
-
- <!-- Pending Device List: Header -->
- <child>
- <object class="GtkBox" id="pending_header">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="halign">start</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">dialog-warning-symbolic</property>
- <property name="icon_size">1</property>
- <property name="margin_left">0</property>
- <property name="xalign">0.0</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Pending
Devices</property>
- <property name="xalign">0.0</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <object class="GtkStackPage">
+ <property name="name">have-devices</property>
+ <property name="child">
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">32</property>
+
+ <!-- Pending Device List -->
<child>
- <object class="GtkSpinner" id="pending_spinner">
- <property name="hexpand">True</property>
- <property name="visible">True</property>
+ <object class="GtkBox" id="pending_box">
+ <property name="visible">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+
+ <!-- Pending Device List: Header -->
+ <child>
+ <object class="GtkBox" id="pending_header">
+ <property name="hexpand">True</property>
+ <property name="halign">start</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkImage">
+ <property
name="icon_name">dialog-warning-symbolic</property>
+ <property name="icon_size">1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">Pending
Devices</property>
+ <property name="xalign">0.0</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSpinner" id="pending_spinner">
+ <property name="hexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+
+ <!-- Pending List: Devices -->
+ <child>
+ <object class="GtkFrame">
+ <property name="valign">start</property>
+ <property name="vexpand">False</property>
+ <style>
+ <class name="view" />
+ </style>
+ <child>
+ <object class="GtkListBox" id="pending_list">
+ <property name="selection-mode">none</property>
+ <property name="can_focus">True</property>
+ <signal name="row-activated"
+ handler="on_device_entry_row_activated_cb"
+ object="CcBoltPanel"
+ swapped="yes" />
+ </object>
+ </child>
+ </object>
+ </child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
</child>
- </object>
- </child>
- <!-- Pending List: Devices -->
- <child>
- <object class="GtkFrame">
- <property name="visible">True</property>
- <property name="valign">start</property>
- <property name="vexpand">False</property>
- <style>
- <class name="view" />
- </style>
+ <!-- Device List -->
<child>
- <object class="GtkListBox" id="pending_list">
- <property name="visible">True</property>
- <property name="selection-mode">none</property>
- <property name="can_focus">True</property>
- <signal name="row-activated"
- handler="on_device_entry_row_activated_cb"
- object="CcBoltPanel"
- swapped="yes" />
+ <object class="GtkBox" id="devices_box">
+ <property name="visible">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+
+ <!-- Device List: Header -->
+ <child>
+ <object class="GtkBox" id="devices_header">
+ <property name="hexpand">True</property>
+ <property name="halign">start</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label"
translatable="yes">Devices</property>
+ <property name="xalign">0.0</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSpinner" id="probing_spinner">
+ <property name="hexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+
+ <!-- Device List: Devices -->
+ <child>
+ <object class="GtkFrame">
+ <property name="valign">start</property>
+ <property name="vexpand">False</property>
+ <style>
+ <class name="view" />
+ </style>
+ <child>
+ <object class="GtkListBox" id="devices_list">
+ <property name="selection-mode">none</property>
+ <property name="can_focus">True</property>
+ <signal name="row-activated"
+ handler="on_device_entry_row_activated_cb"
+ object="CcBoltPanel"
+ swapped="yes" />
+ </object>
+ </child>
+ </object>
+ </child>
+
</object>
</child>
+
</object>
- </child>
+ </property>
</object>
</child>
- <!-- Device List -->
+ <!-- No Devices -->
<child>
- <object class="GtkBox" id="devices_box">
- <property name="visible">False</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
-
- <!-- Device List: Header -->
- <child>
- <object class="GtkBox" id="devices_header">
- <property name="visible">True</property>
+ <object class="GtkStackPage">
+ <property name="name">no-devices</property>
+ <property name="child">
+ <object class="GtkBox">
<property name="hexpand">True</property>
<property name="halign">start</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel">
- <property name="visible">True</property>
<property name="label" translatable="yes">Devices</property>
<property name="xalign">0.0</property>
<attributes>
@@ -471,102 +456,39 @@
</object>
</child>
<child>
- <object class="GtkSpinner" id="probing_spinner">
- <property name="hexpand">True</property>
- <property name="visible">True</property>
- </object>
- </child>
- </object>
- </child>
-
- <!-- Device List: Devices -->
- <child>
- <object class="GtkFrame">
- <property name="visible">True</property>
- <property name="valign">start</property>
- <property name="vexpand">False</property>
- <style>
- <class name="view" />
- </style>
- <child>
- <object class="GtkListBox" id="devices_list">
- <property name="visible">True</property>
- <property name="selection-mode">none</property>
- <property name="can_focus">True</property>
- <signal name="row-activated"
- handler="on_device_entry_row_activated_cb"
- object="CcBoltPanel"
- swapped="yes" />
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">No devices
attached</property>
+ <property name="xalign">0.0</property>
</object>
</child>
</object>
- </child>
-
+ </property>
</object>
- </child>
-
- </object>
- <packing>
- <property name="name">have-devices</property>
- </packing>
- </child>
+ </child> <!-- End of: No Devices -->
- <!-- No Devices -->
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="halign">start</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Devices</property>
- <property name="xalign">0.0</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">No devices
attached</property>
- <property name="xalign">0.0</property>
- </object>
- </child>
</object>
- <packing>
- <property name="name">no-devices</property>
- </packing>
- </child> <!-- End of: No Devices -->
+ </child> <!-- End of Stack: devices/no-devices -->
</object>
- </child> <!-- End of Stack: devices/no-devices -->
+ </child> <!-- End of enter/content box -->
- </object>
- </child> <!-- End of enter/content box -->
+ <!-- Stub box -->
+ <child>
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ </object>
+ </child>
- <!-- Stub box -->
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
+ <!-- End of content -->
</object>
</child>
-
- <!-- End of content -->
</object>
</child>
</object>
- </child>
+
+ </property>
</object>
- <packing>
- <property name="name">devices-listing</property>
- </packing>
</child>
<!-- End of 'container' -->
@@ -581,12 +503,10 @@
<!-- Headerbar entries -->
<object class="GtkBox" id="headerbar_box">
<property name="visible">False</property>
- <property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="halign">end</property>
<child>
<object class="GtkLockButton" id="lock_button">
- <property name="visible">True</property>
</object>
</child>
</object>
diff --git a/panels/thunderbolt/meson.build b/panels/thunderbolt/meson.build
index 53aa9b466..796524a1f 100644
--- a/panels/thunderbolt/meson.build
+++ b/panels/thunderbolt/meson.build
@@ -56,7 +56,6 @@ sources += gnome.compile_resources(
)
deps = common_deps + [
- gnome_desktop_dep,
polkit_gobject_dep,
m_dep,
]
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index a512d96cd..eb4ccd415 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -58,7 +58,7 @@ extern GType cc_search_panel_get_type (void);
extern GType cc_sharing_panel_get_type (void);
extern GType cc_sound_panel_get_type (void);
#ifdef BUILD_THUNDERBOLT
-//extern GType cc_bolt_panel_get_type (void);
+extern GType cc_bolt_panel_get_type (void);
#endif /* BUILD_THUNDERBOLT */
extern GType cc_ua_panel_get_type (void);
//extern GType cc_user_panel_get_type (void);
@@ -129,7 +129,7 @@ static CcPanelLoaderVtable default_panels[] =
PANEL_TYPE("sharing", cc_sharing_panel_get_type, NULL),
PANEL_TYPE("sound", cc_sound_panel_get_type, NULL),
#ifdef BUILD_THUNDERBOLT
- //PANEL_TYPE("thunderbolt", cc_bolt_panel_get_type, NULL),
+ PANEL_TYPE("thunderbolt", cc_bolt_panel_get_type, NULL),
#endif
PANEL_TYPE("universal-access", cc_ua_panel_get_type, NULL),
PANEL_TYPE("usage", cc_usage_panel_get_type, NULL),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]