Merge lp:~ilidrissi.amine/software-properties/updates-redesign into lp:software-properties

Proposed by Mohamed Amine Ilidrissi
Status: Merged
Merged at revision: 687
Proposed branch: lp:~ilidrissi.amine/software-properties/updates-redesign
Merge into: lp:software-properties
Diff against target: 771 lines (+303/-267)
5 files modified
data/designer/main.ui (+6/-6)
data/gtkbuilder/main.ui (+210/-183)
debian/changelog (+8/-0)
softwareproperties/SoftwareProperties.py (+9/-9)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+70/-69)
To merge this branch: bzr merge lp:~ilidrissi.amine/software-properties/updates-redesign
Reviewer Review Type Date Requested Status
Mohamed Amine Ilidrissi (community) Needs Resubmitting
Michael Vogt Pending
Review via email: mp+30889@code.launchpad.net

This proposal supersedes a proposal from 2010-07-02.

Description of the change

This branch revamps the 'Updates' tab to include some more options. Design was taken from https://wiki.ubuntu.com/SoftwareUpdates#settings

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

I had a couple of problems testing this. First, trying to merge, I got a repo versions error from bzr. Then I tried to apply the diff. data/glade/main.glade failed to patch because it was modified in revision 614 - after Mohamed branched it.

However, I was able to manually replace main.glade with the one from Mohamed's branch and test his changes. Everything appeared to be according to the referenced Wiki page. I haven't tested the functionality yet.

Can/Should this branch be modified to make the merge go more smoothly?

Revision history for this message
Mohamed Amine Ilidrissi (ilidrissi.amine) wrote :

I'll update this branch once I get some time (most likely when 11.04's cycle starts).

Revision history for this message
Mohamed Amine Ilidrissi (ilidrissi.amine) wrote :

Resubmitting this. I updated the branch to fix the conflicts.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/designer/main.ui'
2--- data/designer/main.ui 2010-09-06 16:27:00 +0000
3+++ data/designer/main.ui 2010-10-02 14:28:41 +0000
4@@ -23,7 +23,7 @@
5 <item row="0" column="0">
6 <widget class="QTabWidget" name="tabWidget">
7 <property name="currentIndex">
8- <number>0</number>
9+ <number>2</number>
10 </property>
11 <widget class="QWidget" name="tab">
12 <attribute name="title">
13@@ -345,11 +345,6 @@
14 <widget class="QComboBox" name="combobox_release_upgrades">
15 <item>
16 <property name="text">
17- <string>Never</string>
18- </property>
19- </item>
20- <item>
21- <property name="text">
22 <string>Normal Releases</string>
23 </property>
24 </item>
25@@ -358,6 +353,11 @@
26 <string>Long term support releases only</string>
27 </property>
28 </item>
29+ <item>
30+ <property name="text">
31+ <string>Never</string>
32+ </property>
33+ </item>
34 </widget>
35 </item>
36 </layout>
37
38=== modified file 'data/gtkbuilder/main.ui'
39--- data/gtkbuilder/main.ui 2010-09-13 07:42:46 +0000
40+++ data/gtkbuilder/main.ui 2010-10-02 14:28:41 +0000
41@@ -1,4 +1,4 @@
42-<?xml version="1.0"?>
43+<?xml version="1.0" encoding="UTF-8"?>
44 <interface>
45 <!-- interface-requires gtk+ 2.12 -->
46 <!-- interface-naming-policy toplevel-contextual -->
47@@ -9,19 +9,76 @@
48 </columns>
49 <data>
50 <row>
51+ <col id="0" translatable="yes">For any new version</col>
52+ </row>
53+ <row>
54+ <col id="0" translatable="yes">For long-term support versions</col>
55+ </row>
56+ <row>
57 <col id="0" translatable="yes">Never</col>
58 </row>
59- <row>
60- <col id="0" translatable="yes">Normal releases</col>
61- </row>
62- <row>
63- <col id="0" translatable="yes">Long term support releases only</col>
64- </row>
65 </data>
66 </object>
67 <object class="GtkTextBuffer" id="textbuffer1">
68 <property name="text">To install from a CD-ROM or DVD, insert the medium into the drive.</property>
69 </object>
70+ <object class="GtkListStore" id="model2">
71+ <columns>
72+ <!-- column-name gchararray -->
73+ <column type="gchararray"/>
74+ </columns>
75+ <data>
76+ <row>
77+ <col id="0" translatable="yes">Daily</col>
78+ </row>
79+ <row>
80+ <col id="0" translatable="yes">Every two days</col>
81+ </row>
82+ <row>
83+ <col id="0" translatable="yes">Weekly</col>
84+ </row>
85+ <row>
86+ <col id="0" translatable="yes">Every two weeks</col>
87+ </row>
88+ <row>
89+ <col id="0" translatable="yes">Never</col>
90+ </row>
91+ </data>
92+ </object>
93+ <object class="GtkListStore" id="model3">
94+ <columns>
95+ <!-- column-name gchararray1 -->
96+ <column type="gchararray"/>
97+ </columns>
98+ <data>
99+ <row>
100+ <col id="0" translatable="yes">Display immediately</col>
101+ </row>
102+ <row>
103+ <col id="0" translatable="yes">Download automatically</col>
104+ </row>
105+ <row>
106+ <col id="0" translatable="yes">Download and install automatically</col>
107+ </row>
108+ </data>
109+ </object>
110+ <object class="GtkListStore" id="model4">
111+ <columns>
112+ <!-- column-name gchararray1 -->
113+ <column type="gchararray"/>
114+ </columns>
115+ <data>
116+ <row>
117+ <col id="0" translatable="yes">Display immediately</col>
118+ </row>
119+ <row>
120+ <col id="0" translatable="yes">Display weekly</col>
121+ </row>
122+ <row>
123+ <col id="0" translatable="yes">Display every two weeks</col>
124+ </row>
125+ </data>
126+ </object>
127 <object class="GtkWindow" id="window_main">
128 <property name="border_width">6</property>
129 <property name="title" translatable="yes">Software Sources</property>
130@@ -405,6 +462,7 @@
131 <child type="label">
132 <object class="GtkLabel" id="label_updates">
133 <property name="visible">True</property>
134+ <property name="label" translatable="yes">Install updates from:</property>
135 <property name="use_markup">True</property>
136 </object>
137 </child>
138@@ -415,203 +473,172 @@
139 </packing>
140 </child>
141 <child>
142- <object class="GtkFrame" id="frame2">
143+ <object class="GtkAlignment" id="alignment2">
144 <property name="visible">True</property>
145- <property name="label_xalign">0</property>
146- <property name="shadow_type">none</property>
147+ <property name="top_padding">6</property>
148+ <property name="left_padding">12</property>
149 <child>
150- <object class="GtkAlignment" id="alignment2">
151- <property name="visible">True</property>
152- <property name="top_padding">6</property>
153- <property name="left_padding">12</property>
154- <child>
155- <object class="GtkVBox" id="vbox3">
156- <property name="visible">True</property>
157- <property name="spacing">6</property>
158- <child>
159- <object class="GtkHBox" id="hbox_check_for_updates">
160- <property name="visible">True</property>
161- <property name="spacing">6</property>
162- <child>
163- <object class="GtkCheckButton" id="checkbutton_auto_update">
164- <property name="label" translatable="yes">Chec_k for updates:</property>
165- <property name="visible">True</property>
166- <property name="can_focus">True</property>
167- <property name="receives_default">False</property>
168- <property name="use_underline">True</property>
169- <property name="draw_indicator">True</property>
170- </object>
171- <packing>
172- <property name="expand">False</property>
173- <property name="position">0</property>
174- </packing>
175- </child>
176- <child>
177- <placeholder/>
178- </child>
179- </object>
180- <packing>
181- <property name="expand">False</property>
182- <property name="fill">False</property>
183- <property name="position">0</property>
184- </packing>
185- </child>
186- <child>
187- <object class="GtkHBox" id="hbox7">
188- <property name="visible">True</property>
189- <child>
190- <object class="GtkLabel" id="label13">
191- <property name="visible">True</property>
192- <property name="label" translatable="yes"> </property>
193- </object>
194- <packing>
195- <property name="expand">False</property>
196- <property name="fill">False</property>
197- <property name="position">0</property>
198- </packing>
199- </child>
200- <child>
201- <object class="GtkVBox" id="vbox_auto_updates">
202- <property name="visible">True</property>
203- <property name="sensitive">False</property>
204- <property name="spacing">6</property>
205- <child>
206- <object class="GtkRadioButton" id="radiobutton_updates_inst_sec">
207- <property name="label" translatable="yes">Install _security updates without confirmation</property>
208- <property name="visible">True</property>
209- <property name="can_focus">True</property>
210- <property name="receives_default">False</property>
211- <property name="use_underline">True</property>
212- <property name="draw_indicator">True</property>
213- </object>
214- <packing>
215- <property name="expand">False</property>
216- <property name="fill">False</property>
217- <property name="position">0</property>
218- </packing>
219- </child>
220- <child>
221- <object class="GtkRadioButton" id="radiobutton_updates_download">
222- <property name="label" translatable="yes">_Download all updates in the background</property>
223- <property name="visible">True</property>
224- <property name="can_focus">True</property>
225- <property name="receives_default">False</property>
226- <property name="use_underline">True</property>
227- <property name="draw_indicator">True</property>
228- <property name="group">radiobutton_updates_inst_sec</property>
229- </object>
230- <packing>
231- <property name="expand">False</property>
232- <property name="fill">False</property>
233- <property name="position">1</property>
234- </packing>
235- </child>
236- <child>
237- <object class="GtkRadioButton" id="radiobutton_updates_notify">
238- <property name="label" translatable="yes">Only _notify about available updates</property>
239- <property name="visible">True</property>
240- <property name="can_focus">True</property>
241- <property name="receives_default">False</property>
242- <property name="use_underline">True</property>
243- <property name="draw_indicator">True</property>
244- <property name="group">radiobutton_updates_inst_sec</property>
245- </object>
246- <packing>
247- <property name="expand">False</property>
248- <property name="fill">False</property>
249- <property name="position">2</property>
250- </packing>
251- </child>
252- </object>
253- <packing>
254- <property name="position">1</property>
255- </packing>
256- </child>
257- </object>
258- <packing>
259- <property name="expand">False</property>
260- <property name="fill">False</property>
261- <property name="position">1</property>
262- </packing>
263- </child>
264- </object>
265- </child>
266- </object>
267- </child>
268- <child type="label">
269- <object class="GtkLabel" id="label4">
270- <property name="visible">True</property>
271- <property name="label" translatable="yes">&lt;b&gt;Automatic updates&lt;/b&gt;</property>
272- <property name="use_markup">True</property>
273+ <object class="GtkVBox" id="vbox6">
274+ <property name="visible">True</property>
275+ <property name="spacing">6</property>
276+ <child>
277+ <object class="GtkHBox" id="hbox_check_for_updates">
278+ <property name="visible">True</property>
279+ <property name="spacing">6</property>
280+ <child>
281+ <object class="GtkLabel" id="label3">
282+ <property name="visible">True</property>
283+ <property name="label" translatable="yes">Automatically check for updates:</property>
284+ </object>
285+ <packing>
286+ <property name="expand">False</property>
287+ <property name="fill">False</property>
288+ <property name="position">0</property>
289+ </packing>
290+ </child>
291+ <child>
292+ <object class="GtkComboBox" id="combobox_update_interval">
293+ <property name="visible">True</property>
294+ <property name="model">model2</property>
295+ <child>
296+ <object class="GtkCellRendererText" id="renderer_updateinterval"/>
297+ <attributes>
298+ <attribute name="text">0</attribute>
299+ </attributes>
300+ </child>
301+ </object>
302+ <packing>
303+ <property name="position">1</property>
304+ </packing>
305+ </child>
306+ </object>
307+ <packing>
308+ <property name="expand">False</property>
309+ <property name="fill">False</property>
310+ <property name="position">0</property>
311+ </packing>
312+ </child>
313+ <child>
314+ <object class="GtkHBox" id="hbox1">
315+ <property name="visible">True</property>
316+ <property name="spacing">6</property>
317+ <child>
318+ <object class="GtkLabel" id="label4">
319+ <property name="visible">True</property>
320+ <property name="label" translatable="yes">When there are security updates:</property>
321+ </object>
322+ <packing>
323+ <property name="expand">False</property>
324+ <property name="fill">False</property>
325+ <property name="position">0</property>
326+ </packing>
327+ </child>
328+ <child>
329+ <object class="GtkComboBox" id="combobox_security_updates">
330+ <property name="visible">True</property>
331+ <property name="model">model3</property>
332+ <child>
333+ <object class="GtkCellRendererText" id="renderer_securityupdates"/>
334+ <attributes>
335+ <attribute name="text">0</attribute>
336+ </attributes>
337+ </child>
338+ </object>
339+ <packing>
340+ <property name="position">1</property>
341+ </packing>
342+ </child>
343+ </object>
344+ <packing>
345+ <property name="expand">False</property>
346+ <property name="fill">False</property>
347+ <property name="position">1</property>
348+ </packing>
349+ </child>
350+ <child>
351+ <object class="GtkHBox" id="hbox2">
352+ <property name="visible">True</property>
353+ <property name="spacing">6</property>
354+ <child>
355+ <object class="GtkLabel" id="label5">
356+ <property name="visible">True</property>
357+ <property name="label" translatable="yes">When there are other updates:</property>
358+ </object>
359+ <packing>
360+ <property name="expand">False</property>
361+ <property name="fill">False</property>
362+ <property name="position">0</property>
363+ </packing>
364+ </child>
365+ <child>
366+ <object class="GtkComboBox" id="combobox_other_updates">
367+ <property name="visible">True</property>
368+ <property name="model">model4</property>
369+ <child>
370+ <object class="GtkCellRendererText" id="renderer_otherupdates"/>
371+ <attributes>
372+ <attribute name="text">0</attribute>
373+ </attributes>
374+ </child>
375+ </object>
376+ <packing>
377+ <property name="position">1</property>
378+ </packing>
379+ </child>
380+ </object>
381+ <packing>
382+ <property name="expand">False</property>
383+ <property name="fill">False</property>
384+ <property name="position">2</property>
385+ </packing>
386+ </child>
387 </object>
388 </child>
389 </object>
390 <packing>
391- <property name="expand">False</property>
392 <property name="position">1</property>
393 </packing>
394 </child>
395 <child>
396- <object class="GtkFrame" id="frame8">
397+ <object class="GtkAlignment" id="alignment15">
398 <property name="visible">True</property>
399- <property name="label_xalign">0</property>
400- <property name="shadow_type">none</property>
401+ <property name="left_padding">12</property>
402 <child>
403- <object class="GtkAlignment" id="alignment15">
404+ <object class="GtkHBox" id="hbox18">
405 <property name="visible">True</property>
406- <property name="left_padding">12</property>
407- <child>
408- <object class="GtkVBox" id="vbox24">
409- <property name="visible">True</property>
410+ <property name="spacing">6</property>
411+ <child>
412+ <object class="GtkLabel" id="label29">
413+ <property name="visible">True</property>
414+ <property name="label" translatable="yes">Notify me of a new Ubuntu version:</property>
415+ </object>
416+ <packing>
417+ <property name="expand">False</property>
418+ <property name="fill">False</property>
419+ <property name="position">0</property>
420+ </packing>
421+ </child>
422+ <child>
423+ <object class="GtkComboBox" id="combobox_release_upgrades">
424+ <property name="visible">True</property>
425+ <property name="model">model1</property>
426 <child>
427- <object class="GtkHBox" id="hbox18">
428- <property name="visible">True</property>
429- <property name="spacing">6</property>
430- <child>
431- <object class="GtkLabel" id="label29">
432- <property name="visible">True</property>
433- <property name="label" translatable="yes">Show new distribution releases: </property>
434- </object>
435- <packing>
436- <property name="expand">False</property>
437- <property name="fill">False</property>
438- <property name="position">0</property>
439- </packing>
440- </child>
441- <child>
442- <object class="GtkComboBox" id="combobox_release_upgrades">
443- <property name="visible">True</property>
444- <property name="model">model1</property>
445- <child>
446- <object class="GtkCellRendererText" id="renderer1"/>
447- <attributes>
448- <attribute name="text">0</attribute>
449- </attributes>
450- </child>
451- </object>
452- <packing>
453- <property name="position">1</property>
454- </packing>
455- </child>
456- </object>
457- <packing>
458- <property name="expand">False</property>
459- <property name="position">0</property>
460- </packing>
461+ <object class="GtkCellRendererText" id="renderer1"/>
462+ <attributes>
463+ <attribute name="text">0</attribute>
464+ </attributes>
465 </child>
466 </object>
467+ <packing>
468+ <property name="position">1</property>
469+ </packing>
470 </child>
471 </object>
472 </child>
473- <child type="label">
474- <object class="GtkLabel" id="label28">
475- <property name="visible">True</property>
476- <property name="label" translatable="yes">&lt;b&gt;Release upgrade&lt;/b&gt;</property>
477- <property name="use_markup">True</property>
478- </object>
479- </child>
480 </object>
481 <packing>
482+ <property name="expand">False</property>
483+ <property name="fill">False</property>
484 <property name="position">2</property>
485 </packing>
486 </child>
487
488=== modified file 'debian/changelog'
489--- debian/changelog 2010-09-20 13:02:52 +0000
490+++ debian/changelog 2010-10-02 14:28:41 +0000
491@@ -1,3 +1,11 @@
492+software-properties (0.77) UNRELEASED; urgency=low
493+
494+ * Redesigned the Updates tab according to
495+ https://wiki.ubuntu.com/SoftwareUpdateHandling#settings (LP:
496+ #351484, #357676, #253412)
497+
498+ -- Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com> Sat, 02 Oct 2010 14:13:00 +0000
499+
500 software-properties (0.76.7) maverick; urgency=low
501
502 [ Gabor Kelemen ]
503
504=== modified file 'softwareproperties/SoftwareProperties.py'
505--- softwareproperties/SoftwareProperties.py 2010-09-13 08:32:55 +0000
506+++ softwareproperties/SoftwareProperties.py 2010-10-02 14:28:41 +0000
507@@ -59,14 +59,14 @@
508 RELEASE_UPGRADES_CONF = "/etc/update-manager/release-upgrades"
509 #RELEASE_UPGRADES_CONF = "/tmp/release-upgrades"
510 (
511- RELEASE_UPGRADES_NEVER,
512 RELEASE_UPGRADES_NORMAL,
513- RELEASE_UPGRADES_LTS
514+ RELEASE_UPGRADES_LTS,
515+ RELEASE_UPGRADES_NEVER
516 ) = range(3)
517 release_upgrades_policy_map = {
518- RELEASE_UPGRADES_NEVER : 'never',
519 RELEASE_UPGRADES_NORMAL : 'normal',
520 RELEASE_UPGRADES_LTS : 'lts',
521+ RELEASE_UPGRADES_NEVER : 'never',
522 }
523
524 def __init__(self, datadir=None, options=None):
525@@ -178,9 +178,9 @@
526 def get_release_upgrades_policy(self):
527 """
528 return the release upgrade policy:
529- RELASE_UPGRADE_NEVER
530- RELASE_UPGRADE_NORMAL
531- RELASE_UPGRADE_LTS
532+ RELEASE_UPGRADES_NORMAL,
533+ RELEASE_UPGRADES_LTS,
534+ RELEASE_UPGRADES_NEVER
535 """
536 # default (if no option is set) is NORMAL
537 if not os.path.exists(self.RELEASE_UPGRADES_CONF):
538@@ -197,9 +197,9 @@
539 def set_release_upgrades_policy(self, i):
540 """
541 set the release upgrade policy:
542- RELASE_UPGRADE_NEVER
543- RELASE_UPGRADE_NORMAL
544- RELASE_UPGRADE_LTS
545+ RELEASE_UPGRADES_NORMAL,
546+ RELEASE_UPGRADES_LTS,
547+ RELEASE_UPGRADES_NEVER
548 """
549 # we are note using ConfigParser.write() as it removes comments
550 if not os.path.exists(self.RELEASE_UPGRADES_CONF):
551
552=== modified file 'softwareproperties/gtk/SoftwarePropertiesGtk.py'
553--- softwareproperties/gtk/SoftwarePropertiesGtk.py 2010-09-13 08:15:42 +0000
554+++ softwareproperties/gtk/SoftwarePropertiesGtk.py 2010-10-02 14:28:41 +0000
555@@ -32,6 +32,7 @@
556
557 import gtk
558 import gobject
559+import gconf
560
561 from SimpleGtkbuilderApp import SimpleGtkbuilderApp
562 from aptsources.sourceslist import SourceEntry
563@@ -111,6 +112,9 @@
564 if options and options.open_tab:
565 self.notebook_main.set_current_page(int(options.open_tab))
566
567+ self.client = gconf.client_get_default()
568+ self.initial_auto_launch = self.client.get_int("/apps/update-notifier/regular_auto_launch_interval") # For reverting
569+
570 # Show what we have early
571 self.window_main.show()
572
573@@ -167,8 +171,6 @@
574
575 def init_auto_update(self):
576 """ Set up the widgets that allow to configure the update automation """
577- self.combobox_update_interval = gtk.combo_box_new_text()
578- self.hbox_check_for_updates.pack_start(self.combobox_update_interval)
579 self.combobox_update_interval.show()
580
581 # this maps the key (combo-box-index) to the auto-update-interval value
582@@ -176,15 +178,10 @@
583 self.combobox_interval_mapping = { 0 : 1,
584 1 : 2,
585 2 : 7,
586- 3 : 14 }
587+ 3 : 14,
588+ 4 : 0 }
589 self.combobox_update_interval.set_active(0)
590
591- #update_days = apt_pkg.Config.FindI(softwareproperties.CONF_MAP["autoupdate"])
592- self.combobox_update_interval.append_text(_("Daily"))
593- self.combobox_update_interval.append_text(_("Every two days"))
594- self.combobox_update_interval.append_text(_("Weekly"))
595- self.combobox_update_interval.append_text(_("Every two weeks"))
596-
597 model_check_interval = gtk.ListStore(gobject.TYPE_STRING,
598 gobject.TYPE_INT)
599 update_days = self.get_update_interval()
600@@ -201,68 +198,53 @@
601 self.combobox_update_interval.set_active(key)
602 break
603
604- if update_days >= 1:
605- self.checkbutton_auto_update.set_active(True)
606- self.combobox_update_interval.set_sensitive(True)
607- self.vbox_auto_updates.set_sensitive(True)
608- else:
609- self.checkbutton_auto_update.set_active(False)
610- self.combobox_update_interval.set_sensitive(False)
611- self.vbox_auto_updates.set_sensitive(False)
612-
613- self.handlers.append(
614- (self.checkbutton_auto_update,
615- self.checkbutton_auto_update.connect("toggled",
616- self.on_auto_update_toggled)))
617 self.handlers.append(
618 (self.combobox_update_interval,
619 self.combobox_update_interval.connect("changed",
620 self.on_combobox_update_interval_changed)))
621- self.handlers.append(
622- (self.radiobutton_updates_download,
623- self.radiobutton_updates_download.connect("toggled",
624- self.set_update_automation_level,
625- softwareproperties.UPDATE_DOWNLOAD)))
626- self.handlers.append(
627- (self.radiobutton_updates_inst_sec,
628- self.radiobutton_updates_inst_sec.connect("toggled",
629- self.set_update_automation_level,
630- softwareproperties.UPDATE_INST_SEC)))
631- self.handlers.append(
632- (self.radiobutton_updates_notify,
633- self.radiobutton_updates_notify.connect("toggled",
634- self.set_update_automation_level,
635- softwareproperties.UPDATE_NOTIFY)))
636+
637+ self.handlers.append(
638+ (self.combobox_security_updates,
639+ self.combobox_security_updates.connect("changed",
640+ self.set_sec_update_automation_level)))
641+
642+ self.handlers.append(
643+ (self.combobox_security_updates,
644+ self.combobox_other_updates.connect("changed",
645+ self.set_other_update_automation_level)))
646
647+
648 def show_auto_update_level(self):
649 """Represent the level of update automation in the user interface"""
650- level = self.get_update_automation_level()
651- self.block_handlers()
652- if level == None:
653- self.radiobutton_updates_inst_sec.set_inconsistent(True)
654- self.radiobutton_updates_download.set_inconsistent(True)
655- self.radiobutton_updates_notify.set_inconsistent(True)
656+
657+ """ Security Updates """
658+ level_sec = self.get_update_automation_level()
659+ if level_sec == None:
660+ self.combobox_security_updates.set_sensitive(False)
661 else:
662- self.radiobutton_updates_inst_sec.set_inconsistent(False)
663- self.radiobutton_updates_download.set_inconsistent(False)
664- self.radiobutton_updates_notify.set_inconsistent(False)
665- if level == softwareproperties.UPDATE_MANUAL or \
666- level == softwareproperties.UPDATE_NOTIFY:
667- self.radiobutton_updates_notify.set_active(True)
668- elif level == softwareproperties.UPDATE_DOWNLOAD:
669- self.radiobutton_updates_download.set_active(True)
670- elif level == softwareproperties.UPDATE_INST_SEC:
671- self.radiobutton_updates_inst_sec.set_active(True)
672- # Unblock the toggle handlers
673- self.unblock_handlers()
674+ self.combobox_security_updates.set_sensitive(True)
675+
676+ if level_sec == softwareproperties.UPDATE_MANUAL or \
677+ level_sec == softwareproperties.UPDATE_NOTIFY:
678+ self.combobox_security_updates.set_active(0) # Display immediately
679+ elif level_sec == softwareproperties.UPDATE_DOWNLOAD:
680+ self.combobox_security_updates.set_active(1) # Download automatically
681+ elif level_sec == softwareproperties.UPDATE_INST_SEC:
682+ self.combobox_security_updates.set_active(2) # Download and install automatically
683+
684+ """ Other Updates """
685+ level_other = self.client.get_int("/apps/update-notifier/regular_auto_launch_interval")
686+ if level_other == 0:
687+ self.combobox_other_updates.set_active(0) # Display immediately
688+ elif level_other == 7:
689+ self.combobox_other_updates.set_active(1) # Display weekly
690+ elif level_other == 14:
691+ self.combobox_other_updates.set_active(2) # Display every two weeks
692
693 def init_distro(self):
694 """Setup the user interface elements to represent the distro"""
695
696 # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
697- self.label_updates.set_label("<b>%s</b>" % (_("%s updates") %\
698- self.distro.id))
699- # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
700 self.label_dist_name.set_label(_("%s Software") % self.distro.id)
701
702
703@@ -417,13 +399,31 @@
704 for source in self.sourceslist_visible:
705 self.print_source_entry(source)
706
707- def set_update_automation_level(self, widget, state):
708- '''Call the backend to set the update automation level to the given
709- value'''
710- if widget.get_active() == True:
711- self.vbox_auto_updates.foreach(lambda b: b.set_inconsistent(False))
712- SoftwareProperties.set_update_automation_level(self, state)
713- self.set_modified_config()
714+ def set_sec_update_automation_level(self, widget):
715+ """Call the backend to set the security update automation level to the given
716+ value"""
717+ index = widget.get_active()
718+ state = -1
719+ if index == 0: # Display immediately
720+ state = softwareproperties.UPDATE_NOTIFY
721+ elif index == 1: # Download automatically
722+ state = softwareproperties.UPDATE_DOWNLOAD
723+ elif index == 2: # Download and install automatically
724+ state = softwareproperties.UPDATE_INST_SEC
725+ SoftwareProperties.set_update_automation_level(self, state)
726+
727+ def set_other_update_automation_level(self, widget):
728+ """Set the other update automation level to the given value via gconf"""
729+ index = widget.get_active()
730+ days = 7
731+ if index == 0: # Display immediately
732+ days = 0
733+ elif index == 1: # Display weekly
734+ days = 7
735+ elif index == 2: # Display every two weeks
736+ days = 14
737+ self.client.set_int("/apps/update-notifier/regular_auto_launch_interval", days)
738+
739
740 def is_row_separator(self, model, iter, column=0):
741 ''' Check if a given row is a separator '''
742@@ -669,6 +669,7 @@
743 def on_button_revert_clicked(self, button):
744 """Restore the source list from the startup of the dialog"""
745 SoftwareProperties.revert(self)
746+ self.client.set_int("/apps/update-notifier/regular_auto_launch_interval", self.initial_auto_launch)
747 self.set_modified_sourceslist()
748 self.show_auto_update_level()
749 self.button_revert.set_sensitive(False)
750@@ -731,9 +732,9 @@
751 value = self.combobox_interval_mapping[i]
752 self.set_update_interval(value)
753
754- def on_auto_update_toggled(self, widget):
755- """Enable or disable automatic updates and modify the user interface
756- accordingly"""
757+ """def on_auto_update_toggled(self, widget):
758+ Enable or disable automatic updates and modify the user interface
759+ accordingly
760 if self.checkbutton_auto_update.get_active():
761 self.combobox_update_interval.set_sensitive(True)
762 self.vbox_auto_updates.set_sensitive(True)
763@@ -750,7 +751,7 @@
764 self.vbox_auto_updates.set_sensitive(False)
765 SoftwareProperties.set_update_automation_level(self, None)
766 value = 0
767- self.set_update_interval(str(value))
768+ self.set_update_interval(str(value))"""
769
770 def on_add_clicked(self, widget):
771 """Show a dialog that allows to enter the apt line of a to be used repo"""

Subscribers

People subscribed via source and target branches

to status/vote changes: