Merge lp:~brian-murray/software-properties/more-restart into lp:software-properties

Proposed by Brian Murray
Status: Merged
Merged at revision: 1009
Proposed branch: lp:~brian-murray/software-properties/more-restart
Merge into: lp:software-properties
Diff against target: 59 lines (+27/-2)
3 files modified
debian/changelog (+8/-0)
debian/control (+1/-1)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+18/-1)
To merge this branch: bzr merge lp:~brian-murray/software-properties/more-restart
Reviewer Review Type Date Requested Status
Simon Quigley Needs Fixing
Sean Davis (community) xubuntu Approve
Mathieu Trudel-Lapierre Pending
Ubuntu Core Development Team Pending
Review via email: mp+340543@code.launchpad.net

Description of the change

It's testable via 'sudo touch /var/run/reboot-required' and '/usr/share/ubuntu-drivers-common/fake-devices-wrapper software-properties-gtk --open-tab 4'. With the changes installed you should see the "Restart" button and clicking it should raise a dialog about restarting.

To post a comment you must log in.
Revision history for this message
Sean Davis (bluesabre) wrote :

This should resolve the issue for Xubuntu.

review: Approve (xubuntu)
Revision history for this message
Simon Quigley (tsimonq2) wrote :

I disagree with the changes being made here because one or more of these packages could be installed at the same time; each desktop environment should use the reboot tool that corresponds to the one they're currently on ($XDG_CURRENT_DESKTOP).

While you're at it, if you're adding support for Lubuntu, please add support for LXQt too, which can be called via `lxqt-leave --reboot`.

Thanks!

Revision history for this message
Simon Quigley (tsimonq2) wrote :

Er, let me mark the status too... ;)

review: Needs Fixing
1010. By Brian Murray

Use XDG_CURRENT_DESKTOP environment variable to determine which command to call.

1011. By Brian Murray

Add in support for LXQt desktop

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2018-03-02 02:35:22 +0000
3+++ debian/changelog 2018-03-06 15:47:45 +0000
4@@ -1,3 +1,11 @@
5+software-properties (0.96.24.23) bionic; urgency=medium
6+
7+ * SoftwarePropertiesGtk.py: After installing proprietary drivers provide the
8+ capability to restart on Lubuntu and Xubuntu. Add recommends on the
9+ packages which provide the restart tools. (LP: #1693038)
10+
11+ -- Brian Murray <brian@ubuntu.com> Fri, 02 Mar 2018 10:43:18 -0800
12+
13 software-properties (0.96.24.22) bionic; urgency=medium
14
15 * software-properties-gtk: Depend on libgtk3-perl for debconf's GNOME
16
17=== modified file 'debian/control'
18--- debian/control 2018-03-02 02:34:49 +0000
19+++ debian/control 2018-03-06 15:47:45 +0000
20@@ -63,8 +63,8 @@
21 software-properties-common,
22 ubuntu-drivers-common (>= 1:0.2.75),
23 python3-gi,
24- gnome-session-bin,
25 libgtk3-perl
26+Recommends: gnome-session-bin | xfce4-session | lubuntu-default-settings | lxqt-session
27 Description: manage the repositories that you install software from (gtk)
28 This software provides an abstraction of the used apt repositories.
29 It allows you to easily manage your distribution and independent software
30
31=== modified file 'softwareproperties/gtk/SoftwarePropertiesGtk.py'
32--- softwareproperties/gtk/SoftwarePropertiesGtk.py 2017-04-10 21:33:20 +0000
33+++ softwareproperties/gtk/SoftwarePropertiesGtk.py 2018-03-06 15:47:45 +0000
34@@ -1113,7 +1113,24 @@
35 self.clear_changes()
36
37 def on_driver_restart_clicked(self, button_restart):
38- subprocess.call(['gnome-session-quit', '--reboot'])
39+ if 'XDG_CURRENT_DESKTOP' in os.environ:
40+ desktop = os.environ['XDG_CURRENT_DESKTOP']
41+ else:
42+ desktop = 'Unknown'
43+
44+ if (desktop == 'ubuntu:GNOME' and
45+ os.path.exists('/usr/bin/gnome-session-quit')):
46+ # argument presents a dialog to cancel reboot
47+ subprocess.call(['gnome-session-quit', '--reboot'])
48+ elif (desktop == 'XFCE' and
49+ os.path.exists('/usr/bin/xfce4-session-logout')):
50+ subprocess.call(['xfce4-session-logout'])
51+ elif (desktop == 'LXDE' and
52+ os.path.exists('/usr/bin/lubuntu-logout')):
53+ subprocess.call(['lubuntu-logout'])
54+ elif (desktop == 'LXQt' and
55+ os.path.exists('/usr/bin/lxqt-leave')):
56+ subprocess.call(['lxqt-leave'])
57
58 def clear_changes(self):
59 self.orig_selection = {}

Subscribers

People subscribed via source and target branches

to status/vote changes: