lock: Port to GTK4

This one was even more trivial than the previous one!
This commit is contained in:
Georges Basile Stavracas Neto 2021-10-20 17:13:10 -03:00
parent 449c55be3a
commit b965f7cf50
4 changed files with 13 additions and 30 deletions

View file

@ -19,7 +19,6 @@
* Author: Matthias Clasen <mclasen@redhat.com>
*/
#include "list-box-helper.h"
#include "cc-lock-panel.h"
#include "cc-lock-resources.h"
#include "cc-util.h"
@ -284,10 +283,6 @@ cc_lock_panel_init (CcLockPanel *self)
gtk_widget_init_template (GTK_WIDGET (self));
gtk_list_box_set_header_func (self->lock_list_box,
cc_list_box_update_header_func,
NULL, NULL);
self->cancellable = g_cancellable_new ();
self->lock_settings = g_settings_new ("org.gnome.desktop.screensaver");

View file

@ -2,14 +2,11 @@
<!-- Generated with glade 3.18.1 -->
<interface>
<template class="CcLockPanel" parent="CcPanel">
<property name="visible">True</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">1</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="HdyClamp">
<property name="visible">True</property>
<object class="AdwClamp">
<property name="margin_top">32</property>
<property name="margin_bottom">32</property>
<property name="margin_start">12</property>
@ -17,12 +14,10 @@
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="hexpand">1</property>
<child>
<object class="GtkLabel" id="lock_description_label">
<property name="visible">1</property>
<property name="margin-bottom">12</property>
<property name="label" translatable="yes">Automatically locking the screen prevents others from accessing the computer while you're away.</property>
<property name="wrap">1</property>
@ -33,14 +28,15 @@
<child>
<object class="GtkListBox" id="lock_list_box">
<property name="visible">1</property>
<property name="can-focus">1</property>
<property name="selection-mode">none</property>
<style>
<class name="content" />
</style>
<!-- Blank Screen Delay row -->
<child>
<object class="HdyActionRow">
<property name="visible">true</property>
<object class="AdwActionRow">
<property name="title" translatable="yes">Blank Screen Delay</property>
<property name="subtitle" translatable="yes">Period of inactivity after which the screen will go blank.</property>
<property name="subtitle-lines">2</property>
@ -49,7 +45,6 @@
<property name="use-underline">true</property>
<child>
<object class="GtkComboBoxText" id="blank_screen_combo">
<property name="visible">1</property>
<property name="valign">center</property>
<property name="entry_text_column">0</property>
<property name="model">blank_screen_model</property>
@ -61,14 +56,12 @@
<!-- Automatic Screen Lock row -->
<child>
<object class="HdyActionRow">
<property name="visible">true</property>
<object class="AdwActionRow">
<property name="title" translatable="yes">Automatic Screen _Lock</property>
<property name="activatable-widget">automatic_screen_lock_switch</property>
<property name="use-underline">true</property>
<child>
<object class="GtkSwitch" id="automatic_screen_lock_switch">
<property name="visible">1</property>
<property name="halign">end</property>
<property name="valign">center</property>
</object>
@ -78,8 +71,7 @@
<!-- Automatic Screen Lock Delay row -->
<child>
<object class="HdyActionRow">
<property name="visible">true</property>
<object class="AdwActionRow">
<property name="title" translatable="yes">Automatic _Screen Lock Delay</property>
<property name="subtitle" translatable="yes">Period after the screen blanks when the screen is automatically locked.</property>
<property name="subtitle-lines">2</property>
@ -88,7 +80,6 @@
<property name="use-underline">true</property>
<child>
<object class="GtkComboBoxText" id="lock_after_combo">
<property name="visible">1</property>
<property name="valign">center</property>
<property name="entry_text_column">0</property>
<property name="model">lock_after_model</property>
@ -100,14 +91,12 @@
<!-- Show Notifications row -->
<child>
<object class="HdyActionRow">
<property name="visible">true</property>
<object class="AdwActionRow">
<property name="title" translatable="yes">Show _Notifications on Lock Screen</property>
<property name="activatable-widget">show_notifications_switch</property>
<property name="use-underline">true</property>
<child>
<object class="GtkSwitch" id="show_notifications_switch">
<property name="visible">1</property>
<property name="halign">end</property>
<property name="valign">center</property>
</object>
@ -117,7 +106,7 @@
<!-- USB protection row -->
<child>
<object class="HdyActionRow" id="usb_protection_row">
<object class="AdwActionRow" id="usb_protection_row">
<property name="visible">false</property>
<property name="title" translatable="yes">Forbid new _USB devices</property>
<property name="subtitle" translatable="yes">Prevent new USB devices from interacting with the system when the screen is locked.</property>
@ -126,7 +115,6 @@
<property name="use-underline">true</property>
<child>
<object class="GtkSwitch" id="usb_protection_switch">
<property name="visible">true</property>
<property name="halign">end</property>
<property name="valign">center</property>
</object>

View file

@ -12,7 +12,7 @@ panels = [
'info-overview',
# 'keyboard',
'location',
# 'lock',
'lock',
# 'microphone',
# 'mouse',
# 'multitasking',

View file

@ -72,7 +72,7 @@ extern GType cc_location_panel_get_type (void);
extern GType cc_camera_panel_get_type (void);
//extern GType cc_microphone_panel_get_type (void);
//extern GType cc_usage_panel_get_type (void);
//extern GType cc_lock_panel_get_type (void);
extern GType cc_lock_panel_get_type (void);
//extern GType cc_diagnostics_panel_get_type (void);
/* Static init functions */
@ -111,7 +111,7 @@ static CcPanelLoaderVtable default_panels[] =
PANEL_TYPE("info-overview", cc_info_overview_panel_get_type, NULL),
//PANEL_TYPE("keyboard", cc_keyboard_panel_get_type, NULL),
PANEL_TYPE("location", cc_location_panel_get_type, NULL),
//PANEL_TYPE("lock", cc_lock_panel_get_type, NULL),
PANEL_TYPE("lock", cc_lock_panel_get_type, NULL),
//PANEL_TYPE("microphone", cc_microphone_panel_get_type, NULL),
//PANEL_TYPE("mouse", cc_mouse_panel_get_type, NULL),
//PANEL_TYPE("multitasking", cc_multitasking_panel_get_type, NULL),