Merge lp:~djaler1/switchboard-plug-power/fix-bug-1598368 into lp:~elementary-apps/switchboard-plug-power/trunk

Proposed by Kirill Romanov
Status: Merged
Approved by: kay van der Zander
Approved revision: 332
Merged at revision: 332
Proposed branch: lp:~djaler1/switchboard-plug-power/fix-bug-1598368
Merge into: lp:~elementary-apps/switchboard-plug-power/trunk
Diff against target: 78 lines (+9/-21)
2 files modified
src/ActionComboBox.vala (+3/-5)
src/Plug.vala (+6/-16)
To merge this branch: bzr merge lp:~djaler1/switchboard-plug-power/fix-bug-1598368
Reviewer Review Type Date Requested Status
kay van der Zander (community) code Approve
Review via email: mp+300261@code.launchpad.net

Commit message

Remove deprecated keys: button-power, button-sleep, critical-battery-action. Add new key - power-button-action.

Description of the change

Fix bug#1598368

To post a comment you must log in.
Revision history for this message
kay van der Zander (kay20) wrote :

looks good thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ActionComboBox.vala'
2--- src/ActionComboBox.vala 2016-07-04 02:25:39 +0000
3+++ src/ActionComboBox.vala 2016-07-16 21:00:29 +0000
4@@ -24,9 +24,9 @@
5 private string key;
6
7 // this maps combobox indices to gsettings enums
8- private int[] map_to_sett = {1, 2, 3, 4, 5};
9+ private int[] map_to_sett = {0, 1, 2};
10 // and vice-versa
11- private int[] map_to_list = {4, 0, 1, 2, 3, 4};
12+ private int[] map_to_list = {0, 1, 2};
13
14 public ActionComboBox (string label_name, string key_value) {
15 key = key_value;
16@@ -34,11 +34,9 @@
17 label.halign = Gtk.Align.END;
18 ((Gtk.Misc) label).xalign = 1.0f;
19
20+ append_text (_("Do nothing"));
21 append_text (_("Suspend"));
22- append_text (_("Shutdown"));
23 append_text (_("Hibernate"));
24- append_text (_("Ask me"));
25- append_text (_("Do nothing"));
26
27 hexpand = true;
28
29
30=== modified file 'src/Plug.vala'
31--- src/Plug.vala 2016-07-07 04:27:29 +0000
32+++ src/Plug.vala 2016-07-16 21:00:29 +0000
33@@ -242,18 +242,13 @@
34 var screen_timeout = new TimeoutComboBox (pantheon_dpms_settings, "standby-time");
35 screen_timeout.changed.connect (run_dpms_helper);
36
37- var sleep_combobox = new ActionComboBox (_("Sleep button:"), "button-sleep");
38- label_size.add_widget (sleep_combobox.label);
39-
40- var power_combobox = new ActionComboBox (_("Power button:"), "button-power");
41+ var power_combobox = new ActionComboBox (_("Power button:"), "power-button-action");
42 label_size.add_widget (power_combobox.label);
43
44 main_grid.attach (screen_timeout_label, 0, 3, 1, 1);
45 main_grid.attach (screen_timeout, 1, 3, 1, 1);
46- main_grid.attach (sleep_combobox.label, 0, 4, 1, 1);
47- main_grid.attach (sleep_combobox, 1, 4, 1, 1);
48- main_grid.attach (power_combobox.label, 0, 5, 1, 1);
49- main_grid.attach (power_combobox, 1, 5, 1, 1);
50+ main_grid.attach (power_combobox.label, 0, 4, 1, 1);
51+ main_grid.attach (power_combobox, 1, 4, 1, 1);
52
53 return main_grid;
54 }
55@@ -307,20 +302,15 @@
56
57 settings.bind ("idle-dim", dim_switch, "active", SettingsBindFlags.DEFAULT);
58
59- var critical_box = new ActionComboBox (_("When power is critically low:"), "critical-battery-action");
60- label_size.add_widget (critical_box.label);
61-
62 lid_closed_box.sensitive = false;
63 lid_closed_box.label.sensitive = false;
64 label_size.add_widget (lid_closed_box.label);
65
66 grid.attach (dim_label, 0, 0, 1, 1);
67 grid.attach (dim_switch, 1, 0, 1, 1);
68- grid.attach (critical_box.label, 0, 2, 1, 1);
69- grid.attach (critical_box, 1, 2, 1, 1);
70- grid.attach (lid_closed_box.label, 0, 3, 1, 1);
71- grid.attach (lid_closed_box, 1, 3, 1, 1);
72- grid.attach (lock_image2, 2, 3, 1, 1);
73+ grid.attach (lid_closed_box.label, 0, 2, 1, 1);
74+ grid.attach (lid_closed_box, 1, 2, 1, 1);
75+ grid.attach (lock_image2, 2, 2, 1, 1);
76
77 } else if (battery.laptop) {
78 lid_dock_box.sensitive = false;

Subscribers

People subscribed via source and target branches

to all changes: