Skip to content

Commit 6311cda

Browse files
authored
Merge branch 'main' into release-1.4.0
2 parents 339c7af + 4aa7d14 commit 6311cda

10 files changed

Lines changed: 151 additions & 164 deletions

File tree

data/quick-settings.metainfo.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
</description>
4141
<issues>
4242
<issue url="https://github.com/elementary/quick-settings/issues/45">End Session Dialog should pull visual focus</issue>
43+
<issue url="https://github.com/elementary/quick-settings/issues/135">Ctrl+Alt+Del not available before opening Quick Settings for the first time</issue>
4344
</issues>
4445
</release>
4546

po/POTFILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ src/DBus/LockInterface.vala
55
src/DBus/SeatInterface.vala
66
src/DBus/SensorProxy.vala
77
src/DBus/SessionInterface.vala
8-
src/DBus/SystemInterface.vala
98
src/DBus/UserInterface.vala
109
src/Services/UserManager.vala
1110
src/Widgets/AvatarButton.vala

po/sl.po

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ msgstr ""
88
"Project-Id-Version: io.elementary.quick-settings\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2026-01-08 15:36+0000\n"
11-
"PO-Revision-Date: 2024-04-25 16:13+0000\n"
12-
"Last-Translator: anonymous <noreply@weblate.org>\n"
13-
"Language-Team: Slovenian <https://l10n.elementary.io/projects/wingpanel/"
11+
"PO-Revision-Date: 2026-01-19 15:55+0000\n"
12+
"Last-Translator: Jernej Virag <jernej@virag.si>\n"
13+
"Language-Team: Slovenian <https://l10n.elementaryos.org/projects/wingpanel/"
1414
"quick-settings/sl/>\n"
1515
"Language: sl\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
2020
"n%100==4 ? 2 : 3;\n"
21-
"X-Generator: Weblate 5.0.2\n"
21+
"X-Generator: Weblate 5.11.4\n"
2222

2323
#: src/PopoverWidget.vala:28
2424
msgid "Screen Reader"
@@ -30,33 +30,34 @@ msgstr "Zaslonska tipkovnica"
3030

3131
#: src/PopoverWidget.vala:160
3232
msgid "On Screen keyboard is unavailable in the Secure session"
33-
msgstr ""
33+
msgstr "Zaslonska tipkovnica ni na voljo v varni seji"
3434

3535
#: src/PopoverWidget.vala:161
3636
msgid "Log out and select “Classic session” to use the On Screen Keyboard."
3737
msgstr ""
38+
"Odjavite se in izberite \"Klasična seja\" za uporabo zaslonske tipkovnice."
3839

3940
#: src/PopoverWidget.vala:188
4041
msgid "Not logged in"
41-
msgstr ""
42+
msgstr "Brez prijave"
4243

4344
#: src/Services/UserManager.vala:135
4445
#, c-format
4546
msgid "Logged in as “%s”"
46-
msgstr ""
47+
msgstr "Prijavljen kot “%s”"
4748

4849
#: src/Services/UserManager.vala:158
4950
#, c-format
5051
msgid "%i other person logged in"
5152
msgid_plural "%i other people logged in"
52-
msgstr[0] ""
53-
msgstr[1] ""
54-
msgstr[2] ""
55-
msgstr[3] ""
53+
msgstr[0] "prijavljena %i druga oseba"
54+
msgstr[1] "prijavljeni %i drugi osebi"
55+
msgstr[2] "prijavljene %i druge osebe"
56+
msgstr[3] "prijavljenih %i drugih oseb"
5657

5758
#: src/Widgets/DarkModeToggle.vala:9
5859
msgid "Dark Mode"
59-
msgstr ""
60+
msgstr "Temni način"
6061

6162
#: src/Widgets/EndSessionDialog.vala:37
6263
msgid "Are you sure you want to Log Out?"
@@ -93,19 +94,19 @@ msgstr "Prekliči"
9394

9495
#: src/Widgets/EndSessionDialog.vala:87
9596
msgid "Install pending system updates"
96-
msgstr ""
97+
msgstr "Namesti čakajoče sistemske posodobitve"
9798

9899
#: src/Widgets/PreventSleepToggle.vala:12
99100
msgid "Prevent Sleep"
100-
msgstr ""
101+
msgstr "Prepreči spanje"
101102

102103
#: src/Widgets/RotationToggle.vala:9
103104
msgid "Rotation Lock"
104-
msgstr ""
105+
msgstr "Zaklep obračanja"
105106

106107
#: src/Widgets/SessionBox.vala:19
107108
msgid "System Settings…"
108-
msgstr ""
109+
msgstr "Sistemske nastavitve…"
109110

110111
#: src/Widgets/SessionBox.vala:24
111112
msgid "Suspend"
@@ -130,7 +131,7 @@ msgstr "Povečaj velikost besedila"
130131

131132
#: src/Widgets/UserList.vala:43
132133
msgid "User Accounts Settings…"
133-
msgstr ""
134+
msgstr "Nastavitve uporabniških računov…"
134135

135136
#: src/Widgets/UserRow.vala:82 src/Widgets/UserRow.vala:94
136137
#: src/Widgets/UserRow.vala:99
@@ -139,18 +140,16 @@ msgstr "Odjava…"
139140

140141
#: src/Widgets/UserRow.vala:136
141142
msgid "Logged in"
142-
msgstr ""
143+
msgstr "Prijavljen"
143144

144145
#: src/Widgets/UserRow.vala:138
145146
msgid "Logged out"
146-
msgstr ""
147+
msgstr "Odjavljen"
147148

148149
#: src/Widgets/UserRow.vala:148
149-
#, fuzzy
150-
#| msgid "Lock"
151150
msgid "Locked"
152-
msgstr "Zakleni"
151+
msgstr "Zaklenjen"
153152

154153
#: src/Widgets/UserRow.vala:151
155154
msgid "Guest"
156-
msgstr ""
155+
msgstr "Gost"

src/DBus/EndSessionDialogServer.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class QuickSettings.EndSessionDialogServer : Object {
3030
}
3131

3232
[DBus (visible = false)]
33-
public signal void show_dialog (uint type, uint32 triggering_event_timestamp);
33+
public signal void show_dialog (uint type);
3434

3535
public signal void confirmed_logout ();
3636
public signal void confirmed_reboot ();
@@ -47,6 +47,6 @@ public class QuickSettings.EndSessionDialogServer : Object {
4747
throw new DBusError.NOT_SUPPORTED ("Hibernate, suspend and hybrid sleep are not supported actions yet");
4848
}
4949

50-
show_dialog (type, timestamp);
50+
show_dialog (type);
5151
}
5252
}

src/DBus/Login1Manager.vala

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* SPDX-License-Identifier: GPL-3.0-or-later
3+
* SPDX-FileCopyrightText: 2024-2026 elementary, Inc. (https://elementary.io)
4+
*/
5+
6+
public class QuickSettings.Login1Manager : Object {
7+
public struct UserInfo {
8+
uint32 uid;
9+
string user_name;
10+
ObjectPath? user_object;
11+
}
12+
13+
[DBus (name = "org.freedesktop.login1.Manager")]
14+
public interface Login1ManagerInterface : Object {
15+
public abstract void suspend (bool interactive) throws GLib.Error;
16+
public abstract void reboot (bool interactive) throws GLib.Error;
17+
public abstract void power_off (bool interactive) throws GLib.Error;
18+
public abstract void reboot_with_flags (uint64 flags) throws GLib.Error;
19+
public abstract void power_off_with_flags (uint64 flags) throws GLib.Error;
20+
21+
public abstract UserInfo[] list_users () throws GLib.Error;
22+
public abstract string can_suspend () throws GLib.Error;
23+
}
24+
25+
public Login1ManagerInterface proxy { get; private set; }
26+
27+
private static GLib.Once<Login1Manager> instance;
28+
public static unowned Login1Manager get_default () {
29+
return instance.once (() => new Login1Manager ());
30+
}
31+
32+
private Login1Manager () {}
33+
34+
construct {
35+
try {
36+
proxy = Bus.get_proxy_sync<Login1ManagerInterface> (
37+
SYSTEM,
38+
"org.freedesktop.login1",
39+
"/org/freedesktop/login1"
40+
);
41+
} catch (Error e) {
42+
critical (e.message);
43+
}
44+
}
45+
}

src/DBus/SystemInterface.vala

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/Indicator.vala

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
public class QuickSettings.Indicator : Wingpanel.Indicator {
77
public Wingpanel.IndicatorManager.ServerType server_type { get; construct; }
88

9+
private EndSessionDialog? current_dialog;
910
private PopoverWidget? popover_widget;
1011

1112
public Indicator (Wingpanel.IndicatorManager.ServerType server_type) {
@@ -23,6 +24,55 @@ public class QuickSettings.Indicator : Wingpanel.Indicator {
2324
// Prevent a race that skips automatic resource loading
2425
// https://github.com/elementary/wingpanel-indicator-bluetooth/issues/203
2526
Gtk.IconTheme.get_default ().add_resource_path ("/org/elementary/wingpanel/icons");
27+
28+
EndSessionDialogServer.init ();
29+
EndSessionDialogServer.get_default ().show_dialog.connect (
30+
(type) => show_dialog ((EndSessionDialogType) type)
31+
);
32+
}
33+
34+
private void show_dialog (EndSessionDialogType type) {
35+
((Gtk.Popover?) popover_widget?.get_ancestor (typeof (Gtk.Popover)))?.popdown ();
36+
37+
if (current_dialog != null) {
38+
if (current_dialog.dialog_type != type) {
39+
current_dialog.destroy ();
40+
} else {
41+
return;
42+
}
43+
}
44+
45+
unowned var server = EndSessionDialogServer.get_default ();
46+
47+
current_dialog = new EndSessionDialog (type);
48+
current_dialog.destroy.connect (() => {
49+
server.closed ();
50+
current_dialog = null;
51+
});
52+
53+
current_dialog.cancelled.connect (() => server.canceled ());
54+
current_dialog.logout.connect (() => server.confirmed_logout ());
55+
current_dialog.shutdown.connect (() => {
56+
try {
57+
// See https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html for flags values
58+
// #define SD_LOGIND_ROOT_CHECK_INHIBITORS (UINT64_C(1) << 0) == 1
59+
Login1Manager.get_default ().proxy.power_off_with_flags (1);
60+
} catch (Error e) {
61+
warning ("Unable to shutdown: %s", e.message);
62+
}
63+
});
64+
65+
current_dialog.reboot.connect (() => {
66+
try {
67+
// See https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html for flags values
68+
// #define SD_LOGIND_KEXEC_REBOOT (UINT64_C(1) << 1) == 2
69+
Login1Manager.get_default ().proxy.reboot_with_flags (2);
70+
} catch (Error e) {
71+
warning ("Unable to reboot: %s", e.message);
72+
}
73+
});
74+
75+
current_dialog.present ();
2676
}
2777

2878
public override Gtk.Widget get_display_widget () {

src/Services/UserManager.vala

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,35 @@ public enum UserState {
2121
}
2222

2323
public class QuickSettings.UserManager : Object {
24-
private const string LOGIN_IFACE = "org.freedesktop.login1";
25-
private const string LOGIN_PATH = "/org/freedesktop/login1";
26-
27-
private static string active_user_real_name;
28-
private static SystemInterface? login_proxy;
29-
30-
private static async void init_login_proxy () {
31-
try {
32-
login_proxy = yield Bus.get_proxy (BusType.SYSTEM, LOGIN_IFACE, LOGIN_PATH, DBusProxyFlags.NONE);
33-
} catch (IOError e) {
34-
critical ("Failed to create login1 dbus proxy: %s", e.message);
35-
}
36-
}
24+
private static string? active_user_real_name;
3725

3826
public static async UserState get_user_state (uid_t uuid) {
39-
if (login_proxy == null) {
40-
yield init_login_proxy ();
41-
}
42-
4327
try {
44-
UserInfo[] users = login_proxy.list_users ();
28+
var users = Login1Manager.get_default ().proxy.list_users ();
4529
if (users == null) {
4630
return UserState.OFFLINE;
4731
}
4832

49-
foreach (UserInfo user in users) {
50-
if (((uid_t) user.uid) == uuid) {
51-
if (user.user_object == null) {
52-
return UserState.OFFLINE;
53-
}
54-
UserInterface? user_interface = yield Bus.get_proxy (BusType.SYSTEM, LOGIN_IFACE, user.user_object, DBusProxyFlags.NONE);
55-
if (user_interface == null) {
56-
return UserState.OFFLINE;
57-
}
58-
return UserState.to_enum (user_interface.state);
33+
foreach (var user in users) {
34+
if (((uid_t) user.uid) != uuid) {
35+
continue;
36+
}
37+
38+
if (user.user_object == null) {
39+
return UserState.OFFLINE;
40+
}
41+
42+
var user_interface = yield Bus.get_proxy<UserInterface> (
43+
SYSTEM,
44+
"org.freedesktop.login1",
45+
user.user_object
46+
);
47+
if (user_interface == null) {
48+
return UserState.OFFLINE;
5949
}
60-
}
6150

51+
return UserState.to_enum (user_interface.state);
52+
}
6253
} catch (GLib.Error e) {
6354
critical ("Failed to get user state: %s", e.message);
6455
}
@@ -67,13 +58,9 @@ public class QuickSettings.UserManager : Object {
6758
}
6859

6960
public static async UserState get_guest_state () {
70-
if (login_proxy == null) {
71-
return UserState.OFFLINE;
72-
}
73-
7461
try {
75-
UserInfo[] users = login_proxy.list_users ();
76-
foreach (UserInfo user in users) {
62+
var users = Login1Manager.get_default ().proxy.list_users ();
63+
foreach (var user in users) {
7764
var state = yield get_user_state (user.uid);
7865
if (user.user_name.has_prefix ("guest-")
7966
&& state == UserState.ACTIVE) {

0 commit comments

Comments
 (0)