Merge lp:~seb128/software-properties/dialog-enable-proposed into lp:software-properties

Proposed by Sebastien Bacher
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~seb128/software-properties/dialog-enable-proposed
Merge into: lp:software-properties
Diff against target: 43 lines (+24/-1)
1 file modified
softwareproperties/gtk/SoftwarePropertiesGtk.py (+24/-1)
To merge this branch: bzr merge lp:~seb128/software-properties/dialog-enable-proposed
Reviewer Review Type Date Requested Status
Iain Lane Pending
Ubuntu Core Development Team Pending
Review via email: mp+286213@code.launchpad.net

Commit message

Display a warning dialog and request a confirmation when
enabling a proposed repository. Since those updates can create issues
they shouldn't be too easy to enable without knowing what you are doing.

Description of the change

Display a warning dialog and request a confirmation when
enabling a proposed repository. Since those updates can create issues
they shouldn't be too easy to enable without knowing what you are doing.

To post a comment you must log in.
Revision history for this message
Will Cooke (willcooke) wrote :

Please hold, pending input from Design on the copy.

Revision history for this message
Brian Murray (brian-murray) wrote :

I didn't look too closely to see if this is possible, but I wonder if the confirmation dialog should be different if the release is still in development. Ideally, enabling -proposed wouldn't be an option for the development release in the GUI so maybe this is moot.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> I didn't look too closely to see if this is possible, but I wonder if the confirmation dialog
> should be different if the release is still in development.

Yeah, we might not display that control in that case

> Ideally, enabling -proposed wouldn't be an option for the development release in the GUI so maybe
> this is moot.

The warning is intended for stable series as far as I understand it, proposed SRUs are less likely to be an issue than devel-proposed but still cause confusion and problems for users, so I think the change is still relevant

Revision history for this message
Will Cooke (willcooke) wrote :

From Design on the text:

<title> Warning: Enabling updates from proposed can be dangerous </title>

<body> This repository is only for testing updates and providing development feedback. Enabling may introduce instability. </body>

953. By Sebastien Bacher

Display a warning dialog and request a confirmation when
enabling a proposed repository. Since those updates can create issues
they shouldn't be too easy to enable without knowing what you are doing.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Unmerged revisions

953. By Sebastien Bacher

Display a warning dialog and request a confirmation when
enabling a proposed repository. Since those updates can create issues
they shouldn't be too easy to enable without knowing what you are doing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwareproperties/gtk/SoftwarePropertiesGtk.py'
2--- softwareproperties/gtk/SoftwarePropertiesGtk.py 2015-11-01 12:39:02 +0000
3+++ softwareproperties/gtk/SoftwarePropertiesGtk.py 2016-02-17 10:48:44 +0000
4@@ -338,8 +338,9 @@
5 checkbox = Gtk.CheckButton(label="%s (%s)" % (template.description,
6 template.name))
7 checkbox.template = template
8+ handler = self.on_proposed_toggled if ("proposed" in template.name) else self.on_checkbutton_child_toggled
9 self.handlers[checkbox] = checkbox.connect("toggled",
10- self.on_checkbutton_child_toggled,
11+ handler,
12 template)
13 self.vbox_updates.add(checkbox)
14 checkbox.show()
15@@ -570,6 +571,28 @@
16 if e._dbus_error_name == 'com.ubuntu.SoftwareProperties.PermissionDeniedByPolicy':
17 logging.error("Authentication canceled, changes have not been saved")
18
19+ def on_proposed_toggled(self, checkbutton, template):
20+ """
21+ Enabling a proposed source requires confirmation
22+ """
23+ # don't require confirmation to disable
24+ if checkbutton.get_active() == False:
25+ self.on_checkbutton_child_toggled(checkbutton, template)
26+ return
27+
28+ dialog = Gtk.MessageDialog(self.window_main, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.NONE, _("Enabling updates from proposed can be dangerous"))
29+ dialog.format_secondary_text(_("This repository is only for testing updates and providing development feedback. Enabling may introduce instability.") )
30+ dialog.add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.NO,
31+ _("Enable"), Gtk.ResponseType.YES)
32+ res = dialog.run()
33+ if res == Gtk.ResponseType.YES:
34+ self.on_checkbutton_child_toggled(checkbutton, template)
35+ else:
36+ self.block_handlers()
37+ checkbutton.set_active(not checkbutton.get_active())
38+ self.unblock_handlers()
39+ dialog.destroy ()
40+
41 def on_checkbutton_source_code_toggled(self, checkbutton):
42 """ Disable or enable the source code for all sources """
43 try:

Subscribers

People subscribed via source and target branches

to status/vote changes: