lock: Port to GTK4
This one was even more trivial than the previous one!
This commit is contained in:
parent
449c55be3a
commit
b965f7cf50
4 changed files with 13 additions and 30 deletions
|
@ -19,7 +19,6 @@
|
||||||
* Author: Matthias Clasen <mclasen@redhat.com>
|
* Author: Matthias Clasen <mclasen@redhat.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "list-box-helper.h"
|
|
||||||
#include "cc-lock-panel.h"
|
#include "cc-lock-panel.h"
|
||||||
#include "cc-lock-resources.h"
|
#include "cc-lock-resources.h"
|
||||||
#include "cc-util.h"
|
#include "cc-util.h"
|
||||||
|
@ -284,10 +283,6 @@ cc_lock_panel_init (CcLockPanel *self)
|
||||||
|
|
||||||
gtk_widget_init_template (GTK_WIDGET (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->cancellable = g_cancellable_new ();
|
||||||
|
|
||||||
self->lock_settings = g_settings_new ("org.gnome.desktop.screensaver");
|
self->lock_settings = g_settings_new ("org.gnome.desktop.screensaver");
|
||||||
|
|
|
@ -2,14 +2,11 @@
|
||||||
<!-- Generated with glade 3.18.1 -->
|
<!-- Generated with glade 3.18.1 -->
|
||||||
<interface>
|
<interface>
|
||||||
<template class="CcLockPanel" parent="CcPanel">
|
<template class="CcLockPanel" parent="CcPanel">
|
||||||
<property name="visible">True</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkScrolledWindow">
|
<object class="GtkScrolledWindow">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="hscrollbar-policy">never</property>
|
<property name="hscrollbar-policy">never</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyClamp">
|
<object class="AdwClamp">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="margin_top">32</property>
|
<property name="margin_top">32</property>
|
||||||
<property name="margin_bottom">32</property>
|
<property name="margin_bottom">32</property>
|
||||||
<property name="margin_start">12</property>
|
<property name="margin_start">12</property>
|
||||||
|
@ -17,12 +14,10 @@
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="hexpand">1</property>
|
<property name="hexpand">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="lock_description_label">
|
<object class="GtkLabel" id="lock_description_label">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="margin-bottom">12</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="label" translatable="yes">Automatically locking the screen prevents others from accessing the computer while you're away.</property>
|
||||||
<property name="wrap">1</property>
|
<property name="wrap">1</property>
|
||||||
|
@ -33,14 +28,15 @@
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBox" id="lock_list_box">
|
<object class="GtkListBox" id="lock_list_box">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="can-focus">1</property>
|
|
||||||
<property name="selection-mode">none</property>
|
<property name="selection-mode">none</property>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
<class name="content" />
|
||||||
|
</style>
|
||||||
|
|
||||||
<!-- Blank Screen Delay row -->
|
<!-- Blank Screen Delay row -->
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="visible">true</property>
|
|
||||||
<property name="title" translatable="yes">Blank Screen Delay</property>
|
<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" translatable="yes">Period of inactivity after which the screen will go blank.</property>
|
||||||
<property name="subtitle-lines">2</property>
|
<property name="subtitle-lines">2</property>
|
||||||
|
@ -49,7 +45,6 @@
|
||||||
<property name="use-underline">true</property>
|
<property name="use-underline">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkComboBoxText" id="blank_screen_combo">
|
<object class="GtkComboBoxText" id="blank_screen_combo">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="entry_text_column">0</property>
|
<property name="entry_text_column">0</property>
|
||||||
<property name="model">blank_screen_model</property>
|
<property name="model">blank_screen_model</property>
|
||||||
|
@ -61,14 +56,12 @@
|
||||||
|
|
||||||
<!-- Automatic Screen Lock row -->
|
<!-- Automatic Screen Lock row -->
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="visible">true</property>
|
|
||||||
<property name="title" translatable="yes">Automatic Screen _Lock</property>
|
<property name="title" translatable="yes">Automatic Screen _Lock</property>
|
||||||
<property name="activatable-widget">automatic_screen_lock_switch</property>
|
<property name="activatable-widget">automatic_screen_lock_switch</property>
|
||||||
<property name="use-underline">true</property>
|
<property name="use-underline">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="automatic_screen_lock_switch">
|
<object class="GtkSwitch" id="automatic_screen_lock_switch">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
</object>
|
</object>
|
||||||
|
@ -78,8 +71,7 @@
|
||||||
|
|
||||||
<!-- Automatic Screen Lock Delay row -->
|
<!-- Automatic Screen Lock Delay row -->
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="visible">true</property>
|
|
||||||
<property name="title" translatable="yes">Automatic _Screen Lock Delay</property>
|
<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" translatable="yes">Period after the screen blanks when the screen is automatically locked.</property>
|
||||||
<property name="subtitle-lines">2</property>
|
<property name="subtitle-lines">2</property>
|
||||||
|
@ -88,7 +80,6 @@
|
||||||
<property name="use-underline">true</property>
|
<property name="use-underline">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkComboBoxText" id="lock_after_combo">
|
<object class="GtkComboBoxText" id="lock_after_combo">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="entry_text_column">0</property>
|
<property name="entry_text_column">0</property>
|
||||||
<property name="model">lock_after_model</property>
|
<property name="model">lock_after_model</property>
|
||||||
|
@ -100,14 +91,12 @@
|
||||||
|
|
||||||
<!-- Show Notifications row -->
|
<!-- Show Notifications row -->
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="visible">true</property>
|
|
||||||
<property name="title" translatable="yes">Show _Notifications on Lock Screen</property>
|
<property name="title" translatable="yes">Show _Notifications on Lock Screen</property>
|
||||||
<property name="activatable-widget">show_notifications_switch</property>
|
<property name="activatable-widget">show_notifications_switch</property>
|
||||||
<property name="use-underline">true</property>
|
<property name="use-underline">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="show_notifications_switch">
|
<object class="GtkSwitch" id="show_notifications_switch">
|
||||||
<property name="visible">1</property>
|
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
</object>
|
</object>
|
||||||
|
@ -117,7 +106,7 @@
|
||||||
|
|
||||||
<!-- USB protection row -->
|
<!-- USB protection row -->
|
||||||
<child>
|
<child>
|
||||||
<object class="HdyActionRow" id="usb_protection_row">
|
<object class="AdwActionRow" id="usb_protection_row">
|
||||||
<property name="visible">false</property>
|
<property name="visible">false</property>
|
||||||
<property name="title" translatable="yes">Forbid new _USB devices</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>
|
<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>
|
<property name="use-underline">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="usb_protection_switch">
|
<object class="GtkSwitch" id="usb_protection_switch">
|
||||||
<property name="visible">true</property>
|
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -12,7 +12,7 @@ panels = [
|
||||||
'info-overview',
|
'info-overview',
|
||||||
# 'keyboard',
|
# 'keyboard',
|
||||||
'location',
|
'location',
|
||||||
# 'lock',
|
'lock',
|
||||||
# 'microphone',
|
# 'microphone',
|
||||||
# 'mouse',
|
# 'mouse',
|
||||||
# 'multitasking',
|
# 'multitasking',
|
||||||
|
|
|
@ -72,7 +72,7 @@ extern GType cc_location_panel_get_type (void);
|
||||||
extern GType cc_camera_panel_get_type (void);
|
extern GType cc_camera_panel_get_type (void);
|
||||||
//extern GType cc_microphone_panel_get_type (void);
|
//extern GType cc_microphone_panel_get_type (void);
|
||||||
//extern GType cc_usage_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);
|
//extern GType cc_diagnostics_panel_get_type (void);
|
||||||
|
|
||||||
/* Static init functions */
|
/* Static init functions */
|
||||||
|
@ -111,7 +111,7 @@ static CcPanelLoaderVtable default_panels[] =
|
||||||
PANEL_TYPE("info-overview", cc_info_overview_panel_get_type, NULL),
|
PANEL_TYPE("info-overview", cc_info_overview_panel_get_type, NULL),
|
||||||
//PANEL_TYPE("keyboard", cc_keyboard_panel_get_type, NULL),
|
//PANEL_TYPE("keyboard", cc_keyboard_panel_get_type, NULL),
|
||||||
PANEL_TYPE("location", cc_location_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("microphone", cc_microphone_panel_get_type, NULL),
|
||||||
//PANEL_TYPE("mouse", cc_mouse_panel_get_type, NULL),
|
//PANEL_TYPE("mouse", cc_mouse_panel_get_type, NULL),
|
||||||
//PANEL_TYPE("multitasking", cc_multitasking_panel_get_type, NULL),
|
//PANEL_TYPE("multitasking", cc_multitasking_panel_get_type, NULL),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue