Merge lp:~mterry/update-manager/update-at-start into lp:update-manager

Proposed by Michael Terry
Status: Merged
Approved by: Barry Warsaw
Approved revision: 2441
Merged at revision: 2504
Proposed branch: lp:~mterry/update-manager/update-at-start
Merge into: lp:update-manager
Diff against target: 896 lines (+148/-397)
8 files modified
UpdateManager/UnitySupport.py (+0/-9)
UpdateManager/UpdateManager.py (+22/-168)
UpdateManager/UpdateProgress.py (+84/-0)
UpdateManager/backend/InstallBackendAptdaemon.py (+11/-5)
data/com.ubuntu.update-manager.gschema.xml.in (+0/-5)
data/gtkbuilder/UpdateManager.ui (+14/-206)
data/update-manager.convert (+0/-1)
update-manager (+17/-3)
To merge this branch: bzr merge lp:~mterry/update-manager/update-at-start
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Michael Vogt Pending
Review via email: mp+108369@code.launchpad.net

Description of the change

Implements the 'update on start' aspect of the new spec.

This means that all ways to manually start an update are gone from the UI. We no longer warn about how long it's been since the last update, etc.

I've added a new class to handle the initial progress dialog. It just seemed cleaner to me to do it that way rather than introduce more possible states to the main dialog's class. Especially since so little of that class is relevant to the progress dialog.

The progress dialog doesn't look quite like it does in the spec yet. That will require changes to aptdaemon's progress dialog widget. But those can be done separately.

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

Note that I also filed https://code.launchpad.net/~mterry/update-notifier/use-no-update/+merge/108377 to have update-notifier pass --no-update when launching update-manager.

2439. By Michael Terry

merge from trunk

Revision history for this message
Barry Warsaw (barry) wrote :

When I run ./update-manager from your branch I get the following errors on the console:

% ./update-manager
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 354, in _full_callback
    raise AttributeError('Handler %s not found' % handler_name)
AttributeError: Handler on_button_reload_clicked not found
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 354, in _full_callback
    raise AttributeError('Handler %s not found' % handler_name)
AttributeError: Handler on_checkbutton_reminder_toggled not found

Probably some additional left over cruft that isn't removed in your branch?

Also, you mention a spec, but I'm not aware of it. Do you have a link?

Minor misspelling at the top of UpdateProgress.py

You might want to run pyflakes over UpdateProgress.py. Unused imports include Gtk, _, ngettext
Also, you can probably collapse the .Core.utils import onto one line
Spaces around the = sign when setting os.environ[]
4 space indents please! :)

Could you add some tests for the new functionality and files?

review: Needs Fixing
Revision history for this message
Michael Terry (mterry) wrote :

The spec is https://wiki.ubuntu.com/SoftwareUpdates

The AttributeError is likely because you need to point at the new glade files too (update-manager isn't smart enough to look in the local location). So either futz with XDG_DATA_DIRS or just do "sudo cp data/gtkbuilder/* /usr/share/update-manager/gtkbuilder/"

I'll update UpdateProgress.py and fix the nits. You're killing me with the 4-indents. Not that I care, but update-manager source is very inconsistent with 2 or 4, even inside a file, so I've tried to always stick with 2 in all my pending branches. :(

2440. By Michael Terry

review style nits and pyflakes fixes

Revision history for this message
Michael Terry (mterry) wrote :

OK, I've updated to fix nits. I'm not going to do the 4-indent change, because that would cause massive headache with all my chain of pending merges. I'd rather just do a big flag-day indent fixup branch at the end, which will fix existing inconsistencies too.

As for tests, I'd like to talk to mvo first about what his plans were for tests going forward. (tests right now are very hodge-pogde; some rely on internal test-only flags for detecting if a dialog was shown, some just use direct imports of modules and poke around, I don't think any use a UI-driving framework) It's fine if that's a blocker, but it's not something I can fix right this second.

Revision history for this message
Michael Vogt (mvo) wrote :

On Tue, Jun 19, 2012 at 09:56:18PM -0000, Michael Terry wrote:
> The spec is https://wiki.ubuntu.com/SoftwareUpdates
>
> The AttributeError is likely because you need to point at the new glade files too (update-manager isn't smart enough to look in the local location). So either futz with XDG_DATA_DIRS or just do "sudo cp data/gtkbuilder/* /usr/share/update-manager/gtkbuilder/"

Alternatively:
$ ./update-manager --data-dir ./data
should work too.

> I'll update UpdateProgress.py and fix the nits. You're killing me with the 4-indents. Not that I care, but update-manager source is very inconsistent with 2 or 4, even inside a file, so I've tried to always stick with 2 in all my pending branches. :(

Yeah, its a big pain, given the restructure that is going on, it
sounds like a good time to make it consistently 4 spaces, wdyt?

Cheers,
 Michael

Revision history for this message
Michael Vogt (mvo) wrote :

On Tue, Jun 19, 2012 at 10:07:18PM -0000, Michael Terry wrote:
> OK, I've updated to fix nits. I'm not going to do the 4-indent change, because that would cause massive headache with all my chain of pending merges. I'd rather just do a big flag-day indent fixup branch at the end, which will fix existing inconsistencies too.

That sounds like a reasonable approach.

> As for tests, I'd like to talk to mvo first about what his plans were for tests going forward. (tests right now are very hodge-pogde; some rely on internal test-only flags for detecting if a dialog was shown, some just use direct imports of modules and poke around, I don't think any use a UI-driving framework) It's fine if that's a blocker, but it's not something I can fix right this second.

Indeed, there is no UI-driving framework, my experience with all of
them wasn't that great, so its importing and poking around at the
modules/classes. I'm happy about u-m moving towards a UI-driving
framework, suggestions for a good one welcome.

Cheers,
 Michael

Revision history for this message
Michael Terry (mterry) wrote :

<mterry> mvo, darn, I was hoping you had been hiding some amazing UI driving framework that you had been too lazy to use. :-/
<mterry> mvo, the best I've used is ldtp, but it's very rickety
<mvo> mterry: yeah, excatly, I wasn't overly impressed with that one :/
<mterry> mvo, well, I'm happy to write various tests, but since doing so might involve various code changes (for instrumentation) and since code is moving around a lot in my branches, would you mind if I did a big test branch after all these intermediate branches land? (ala the indentation one)
<mvo> mterry: that is fine with me (for the given reasons)

So I'll start working on an indentation branch and a testing branch after my branches land on trunk. I believe that means there's no outstanding issue with this particular branch. Could I get a re-review?

Revision history for this message
Ken VanDine (ken-vandine) wrote :

I got a very minor merge conflict for UpdateManager/UpdateManager.py

<<<<<<< TREE
          if self._get_last_apt_get_update_text() is not None:
              text_label_main = self._get_last_apt_get_update_text()
              ago_minutes = self._get_last_apt_get_update_minutes()
              if ago_minutes is not None and ago_minutes > self.NO_UPDATE_WARNING_DAYS*24*60:
                  text_header = _("Software updates may be available for your computer.")
          # add timer to ensure we update the information when the
          # last package count update was performed
          GObject.timeout_add_seconds(10, self.update_last_updated_text, None)
=======
>>>>>>> MERGE-SOURCE

I manually fixed the merge and tested. After applying updates I noticed the "Details of updates" expander doesn't get hidden. Perhaps that is expected at this point and fixed in another branch.

Still reviewing... more to come later.

Revision history for this message
Barry Warsaw (barry) wrote :

On Jun 22, 2012, at 06:36 PM, Ken VanDine wrote:

>I got a very minor merge conflict for UpdateManager/UpdateManager.py
>
><<<<<<< TREE
> if self._get_last_apt_get_update_text() is not None:
> text_label_main = self._get_last_apt_get_update_text()
> ago_minutes = self._get_last_apt_get_update_minutes()
> if ago_minutes is not None and ago_minutes > self.NO_UPDATE_WARNING_DAYS*24*60:
> text_header = _("Software updates may be available for your computer.")
> # add timer to ensure we update the information when the
> # last package count update was performed
> GObject.timeout_add_seconds(10, self.update_last_updated_text, None)
>=======
>>>>>>>> MERGE-SOURCE

I get the same conflict against trunk. I suppose that chunk of code is
supposed to be removed?

Revision history for this message
Barry Warsaw (barry) wrote :

On Jun 19, 2012, at 10:07 PM, Michael Terry wrote:

>OK, I've updated to fix nits. I'm not going to do the 4-indent change,
>because that would cause massive headache with all my chain of pending
>merges. I'd rather just do a big flag-day indent fixup branch at the end,
>which will fix existing inconsistencies too.

I think it's fine to defer the reindentation, and I agree the code base is
fairly inconsistent about indentation right now. It would be nice at some
point to do a thorough PEP-8-ification of the code.

>As for tests, I'd like to talk to mvo first about what his plans were for
>tests going forward. (tests right now are very hodge-pogde; some rely on
>internal test-only flags for detecting if a dialog was shown, some just use
>direct imports of modules and poke around, I don't think any use a UI-driving
>framework) It's fine if that's a blocker, but it's not something I can fix
>right this second.

I guess not. This is another thing I'd really like to do at some point,
i.e. refactor the code to be more testable and have better coverage.

Right now your branch is conflicting with trunk. Can you resolve that and
push an update?

Revision history for this message
Ken VanDine (ken-vandine) wrote :

On Fri, 2012-06-22 at 18:22 -0400, Barry Warsaw wrote:
> On Jun 22, 2012, at 06:36 PM, Ken VanDine wrote:
>
> >I got a very minor merge conflict for UpdateManager/UpdateManager.py
> >
> ><<<<<<< TREE
> > if self._get_last_apt_get_update_text() is not None:
> > text_label_main = self._get_last_apt_get_update_text()
> > ago_minutes = self._get_last_apt_get_update_minutes()
> > if ago_minutes is not None and ago_minutes > self.NO_UPDATE_WARNING_DAYS*24*60:
> > text_header = _("Software updates may be available for your computer.")
> > # add timer to ensure we update the information when the
> > # last package count update was performed
> > GObject.timeout_add_seconds(10, self.update_last_updated_text, None)
> >=======
> >>>>>>>> MERGE-SOURCE
>
> I get the same conflict against trunk. I suppose that chunk of code is
> supposed to be removed?
>

Looks like it to me.

--
Ken VanDine
Ubuntu Desktop Integration Engineer
Canonical, Ltd.

2441. By Michael Terry

merge from trunk

Revision history for this message
Michael Terry (mterry) wrote :

Yup, the conflicting code just needed to be removed. How about now?

Revision history for this message
Barry Warsaw (barry) wrote :

Looks good now, thanks.

review: Approve
Revision history for this message
Barry Warsaw (barry) wrote :

On Jun 25, 2012, at 03:06 PM, Michael Terry wrote:

>Yup, the conflicting code just needed to be removed. How about now?

Looks good, thanks. I've merged this into trunk, but didn't upload it, in
case there are other upcoming changes for u-m. Happy to upload it if you
prefer though.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UpdateManager/UnitySupport.py'
--- UpdateManager/UnitySupport.py 2011-08-11 11:47:34 +0000
+++ UpdateManager/UnitySupport.py 2012-06-25 15:02:27 +0000
@@ -51,15 +51,6 @@
5151
52 def _add_quicklist(self, parent):52 def _add_quicklist(self, parent):
53 quicklist = Dbusmenu.Menuitem.new()53 quicklist = Dbusmenu.Menuitem.new()
54 # update
55 update_dbusmenuitem = Dbusmenu.Menuitem.new()
56 update_dbusmenuitem.property_set(
57 Dbusmenu.MENUITEM_PROP_LABEL, _("Check for Updates"))
58 update_dbusmenuitem.property_set_bool(
59 Dbusmenu.MENUITEM_PROP_VISIBLE, True)
60 update_dbusmenuitem.connect (
61 "item-activated", parent.on_button_reload_clicked, None)
62 quicklist.child_append(update_dbusmenuitem)
63 # install 54 # install
64 self.install_dbusmenuitem = Dbusmenu.Menuitem.new()55 self.install_dbusmenuitem = Dbusmenu.Menuitem.new()
65 self.install_dbusmenuitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL,56 self.install_dbusmenuitem.property_set (Dbusmenu.MENUITEM_PROP_LABEL,
6657
=== modified file 'UpdateManager/UpdateManager.py'
--- UpdateManager/UpdateManager.py 2012-06-14 21:14:13 +0000
+++ UpdateManager/UpdateManager.py 2012-06-25 15:02:27 +0000
@@ -1,6 +1,6 @@
1# UpdateManager.py1# UpdateManager.py
2# 2#
3# Copyright (c) 2004-2010 Canonical3# Copyright (c) 2004-2012 Canonical
4# 2004 Michiel Sikkes4# 2004 Michiel Sikkes
5# 2005 Martin Willemoes Hansen5# 2005 Martin Willemoes Hansen
6# 2010 Mohamed Amine IL Idrissi6# 2010 Mohamed Amine IL Idrissi
@@ -10,6 +10,7 @@
10# Martin Willemoes Hansen <mwh@sysrq.dk>10# Martin Willemoes Hansen <mwh@sysrq.dk>
11# Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com>11# Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com>
12# Alex Launi <alex.launi@canonical.com>12# Alex Launi <alex.launi@canonical.com>
13# Michael Terry <michael.terry@canonical.com>
13# 14#
14# This program is free software; you can redistribute it and/or 15# This program is free software; you can redistribute it and/or
15# modify it under the terms of the GNU General Public License as 16# modify it under the terms of the GNU General Public License as
@@ -40,12 +41,10 @@
4041
41import apt_pkg42import apt_pkg
4243
43import gettext
44import sys44import sys
45import os45import os
46import stat46import stat
47import re47import re
48import locale
49import logging48import logging
50import operator49import operator
51import subprocess50import subprocess
@@ -66,7 +65,6 @@
6665
6766
68from .Core.utils import (humanize_size,67from .Core.utils import (humanize_size,
69 init_proxy,
70 on_battery,68 on_battery,
71 inhibit_sleep,69 inhibit_sleep,
72 allow_sleep)70 allow_sleep)
@@ -91,9 +89,6 @@
91# list constants89# list constants
92(LIST_CONTENTS, LIST_NAME, LIST_PKG, LIST_ORIGIN, LIST_TOGGLE_CHECKED) = range(5)90(LIST_CONTENTS, LIST_NAME, LIST_PKG, LIST_ORIGIN, LIST_TOGGLE_CHECKED) = range(5)
9391
94# actions for "invoke_manager"
95(INSTALL, UPDATE) = range(2)
96
97# file that signals if we need to reboot92# file that signals if we need to reboot
98REBOOT_REQUIRED_FILE = "/var/run/reboot-required"93REBOOT_REQUIRED_FILE = "/var/run/reboot-required"
9994
@@ -140,27 +135,14 @@
140 return True135 return True
141136
142 @dbus.service.method('org.freedesktop.UpdateManagerIFace')137 @dbus.service.method('org.freedesktop.UpdateManagerIFace')
143 def update(self):
144 try:
145 self.alert_watcher.check_alert_state ()
146 self.parent.invoke_manager(UPDATE)
147 return self.connected
148 except:
149 return False
150
151 @dbus.service.method('org.freedesktop.UpdateManagerIFace')
152 def upgrade(self):138 def upgrade(self):
153 try:139 try:
154 self.parent.cache.checkFreeSpace()140 self.parent.cache.checkFreeSpace()
155 self.parent.invoke_manager(INSTALL)141 self.parent.invoke_manager()
156 return True142 return True
157 except:143 except:
158 return False144 return False
159145
160 @dbus.service.signal('org.freedesktop.UpdateManagerIFace', 'b')
161 def updated(self, success):
162 pass
163
164 def _on_network_alert(self, watcher, state):146 def _on_network_alert(self, watcher, state):
165 if state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST:147 if state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST:
166 self.connected = True148 self.connected = True
@@ -169,21 +151,12 @@
169151
170class UpdateManager(SimpleGtkbuilderApp):152class UpdateManager(SimpleGtkbuilderApp):
171153
172 # how many days until u-m warns about manual pressing "check"
173 NO_UPDATE_WARNING_DAYS = 7
174
175 def __init__(self, datadir, options):154 def __init__(self, datadir, options):
176 self.setupDbus()155 self.setupDbus()
177 Gtk.Window.set_default_icon_name("system-software-update")
178 self.datadir = datadir156 self.datadir = datadir
157 self.options = options
179 SimpleGtkbuilderApp.__init__(self, datadir+"gtkbuilder/UpdateManager.ui",158 SimpleGtkbuilderApp.__init__(self, datadir+"gtkbuilder/UpdateManager.ui",
180 "update-manager")159 "update-manager")
181 gettext.bindtextdomain("update-manager", "/usr/share/locale")
182 gettext.textdomain("update-manager")
183 try:
184 locale.setlocale(locale.LC_ALL, "")
185 except:
186 logging.exception("setlocale failed")
187160
188 # Used for inhibiting power management161 # Used for inhibiting power management
189 self.sleep_cookie = None162 self.sleep_cookie = None
@@ -192,7 +165,6 @@
192 # workaround for LP: #945536165 # workaround for LP: #945536
193 self.clearing_store = False166 self.clearing_store = False
194167
195 self.image_logo.set_from_icon_name("system-software-update", Gtk.IconSize.DIALOG)
196 self.window_main.set_sensitive(False)168 self.window_main.set_sensitive(False)
197 self.window_main.grab_focus()169 self.window_main.grab_focus()
198 self.button_close.grab_focus()170 self.button_close.grab_focus()
@@ -257,13 +229,10 @@
257 self.button_settings.set_sensitive(False)229 self.button_settings.set_sensitive(False)
258230
259 self.settings = Gio.Settings("com.ubuntu.update-manager")231 self.settings = Gio.Settings("com.ubuntu.update-manager")
260 init_proxy(self.settings)
261 # init show version232 # init show version
262 self.show_versions = self.settings.get_boolean("show-versions")233 self.show_versions = self.settings.get_boolean("show-versions")
263 # init summary_before_name234 # init summary_before_name
264 self.summary_before_name = self.settings.get_boolean("summary-before-name")235 self.summary_before_name = self.settings.get_boolean("summary-before-name")
265 # keep track when we run (for update-notifier)
266 self.settings.set_int("launch-time", int(time.time()))
267236
268 # get progress object237 # get progress object
269 self.progress = GtkOpProgressInline(238 self.progress = GtkOpProgressInline(
@@ -366,10 +335,6 @@
366 self.dbusController = UpdateManagerDbusController(self, bus_name)335 self.dbusController = UpdateManagerDbusController(self, bus_name)
367336
368337
369 def on_checkbutton_reminder_toggled(self, checkbutton):
370 self.settings.set_boolean("remind-reload",
371 not checkbutton.get_active())
372
373 def close(self, widget, data=None):338 def close(self, widget, data=None):
374 if self.window_main.get_property("sensitive") is False:339 if self.window_main.get_property("sensitive") is False:
375 return True340 return True
@@ -600,74 +565,11 @@
600 self.hbox_downsize.show()565 self.hbox_downsize.show()
601 self.vbox_alerts.show()566 self.vbox_alerts.show()
602567
603 def _get_last_apt_get_update_minutes(self):
604 """
605 Return the number of minutes since the last successful apt-get update
606
607 If the date is unknown, return "None"
608 """
609 if not os.path.exists("/var/lib/apt/periodic/update-success-stamp"):
610 return None
611 # calculate when the last apt-get update (or similar operation)
612 # was performed
613 mtime = os.stat("/var/lib/apt/periodic/update-success-stamp")[stat.ST_MTIME]
614 ago_minutes = int((time.time() - mtime) / 60 )
615 return ago_minutes
616
617 def _get_last_apt_get_update_text(self):
618 """
619 return a human readable string with the information when
620 the last apt-get update was run
621 """
622 ago_minutes = self._get_last_apt_get_update_minutes()
623 if ago_minutes is None:
624 return _("It is unknown when the package information was "
625 "updated last. Please click the 'Check' "
626 "button to update the information.")
627 ago_hours = int( ago_minutes / 60 )
628 ago_days = int( ago_hours / 24 )
629 if ago_days > self.NO_UPDATE_WARNING_DAYS:
630 return _("The package information was last updated %(days_ago)s "
631 "days ago.\n"
632 "Press the 'Check' button below to check for new software "
633 "updates.") % { "days_ago" : ago_days, }
634 elif ago_days > 0:
635 return ngettext("The package information was last updated %(days_ago)s day ago.",
636 "The package information was last updated %(days_ago)s days ago.",
637 ago_days) % { "days_ago" : ago_days, }
638 elif ago_hours > 0:
639 return ngettext("The package information was last updated %(hours_ago)s hour ago.",
640 "The package information was last updated %(hours_ago)s hours ago.",
641 ago_hours) % { "hours_ago" : ago_hours, }
642 elif ago_minutes >= 45:
643 # TRANSLATORS: only in plural form, as %s minutes ago is one of 15, 30, 45 minutes ago
644 return _("The package information was last updated about %s minutes ago.")%45
645 elif ago_minutes >= 30:
646 return _("The package information was last updated about %s minutes ago.")%30
647 elif ago_minutes >= 15:
648 return _("The package information was last updated about %s minutes ago.")%15
649 else:
650 return _("The package information was just updated.")
651 return None
652
653 def update_last_updated_text(self, user_data):
654 """timer that updates the last updated text """
655 #print("update_last_updated_text")
656 num_updates = self.cache.install_count
657 if num_updates == 0:
658 if self._get_last_apt_get_update_text() is not None:
659 text_label_main = self._get_last_apt_get_update_text()
660 self.label_main_details.set_text(text_label_main)
661 return True
662 # stop the timer if there are upgrades now
663 return False
664
665 def update_count(self):568 def update_count(self):
666 """activate or disable widgets and show dialog texts correspoding to569 """activate or disable widgets and show dialog texts correspoding to
667 the number of available updates"""570 the number of available updates"""
668 self.refresh_updates_count()571 self.refresh_updates_count()
669 num_updates = self.cache.install_count572 num_updates = self.cache.install_count
670 text_label_main = ""
671573
672 # setup unity stuff574 # setup unity stuff
673 self.unity.set_updates_count(num_updates)575 self.unity.set_updates_count(num_updates)
@@ -683,14 +585,6 @@
683 self.button_close.grab_default()585 self.button_close.grab_default()
684 self.textview_changes.get_buffer().set_text("")586 self.textview_changes.get_buffer().set_text("")
685 self.textview_descr.get_buffer().set_text("")587 self.textview_descr.get_buffer().set_text("")
686 if self._get_last_apt_get_update_text() is not None:
687 text_label_main = self._get_last_apt_get_update_text()
688 ago_minutes = self._get_last_apt_get_update_minutes()
689 if ago_minutes is not None and ago_minutes > self.NO_UPDATE_WARNING_DAYS*24*60:
690 text_header = _("Software updates may be available for your computer.")
691 # add timer to ensure we update the information when the
692 # last package count update was performed
693 GObject.timeout_add_seconds(10, self.update_last_updated_text, None)
694 else:588 else:
695 # show different text on first run (UX team suggestion)589 # show different text on first run (UX team suggestion)
696 firstrun = self.settings.get_boolean("first-run")590 firstrun = self.settings.get_boolean("first-run")
@@ -704,7 +598,6 @@
704 self.button_install.grab_default()598 self.button_install.grab_default()
705 self.treeview_update.set_cursor(Gtk.TreePath.new_from_string("1"), None, False)599 self.treeview_update.set_cursor(Gtk.TreePath.new_from_string("1"), None, False)
706 self.label_header.set_markup(text_header)600 self.label_header.set_markup(text_header)
707 self.label_main_details.set_text(text_label_main)
708 return True601 return True
709602
710 # Before we shrink the window, capture the size603 # Before we shrink the window, capture the size
@@ -725,11 +618,6 @@
725 expanded = self.expander_desc.get_expanded()618 expanded = self.expander_desc.get_expanded()
726 self.expander_desc.set_vexpand(expanded)619 self.expander_desc.set_vexpand(expanded)
727620
728 def on_button_reload_clicked(self, widget, menuitem = None, data = None):
729 #print("on_button_reload_clicked")
730 self.check_metarelease()
731 self.invoke_manager(UPDATE)
732
733 #def on_button_help_clicked(self, widget):621 #def on_button_help_clicked(self, widget):
734 # self.help_viewer.run()622 # self.help_viewer.run()
735623
@@ -774,7 +662,7 @@
774 return662 return
775 except SystemError as e:663 except SystemError as e:
776 logging.exception("free space check failed")664 logging.exception("free space check failed")
777 self.invoke_manager(INSTALL)665 self.invoke_manager()
778 666
779 def on_button_restart_required_clicked(self, button=None):667 def on_button_restart_required_clicked(self, button=None):
780 self._request_reboot_via_session_manager()668 self._request_reboot_via_session_manager()
@@ -807,7 +695,7 @@
807 except dbus.DBusException:695 except dbus.DBusException:
808 pass696 pass
809697
810 def invoke_manager(self, action):698 def invoke_manager(self):
811 # check first if no other package manager is runing699 # check first if no other package manager is runing
812700
813 # don't display apt-listchanges, we already showed the changelog701 # don't display apt-listchanges, we already showed the changelog
@@ -819,30 +707,23 @@
819 # set window to insensitive707 # set window to insensitive
820 self.window_main.set_sensitive(False)708 self.window_main.set_sensitive(False)
821 self.window_main.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))709 self.window_main.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))
822#710
823 # do it711 # If the progress dialog should be closed automatically afterwards
824 if action == UPDATE:712 settings = Gio.Settings("com.ubuntu.update-manager")
825 self.install_backend.update()713 close_on_done = settings.get_boolean("autoclose-install-window")
826 elif action == INSTALL:714 # Get the packages which should be installed and update
827 # If the progress dialog should be closed automatically afterwards715 pkgs_install = []
828 settings = Gio.Settings("com.ubuntu.update-manager")716 pkgs_upgrade = []
829 close_on_done = settings.get_boolean("autoclose-install-window")717 for pkg in self.cache:
830 # Get the packages which should be installed and update718 if pkg.marked_install:
831 pkgs_install = []719 pkgs_install.append(pkg.name)
832 pkgs_upgrade = []720 elif pkg.marked_upgrade:
833 for pkg in self.cache:721 pkgs_upgrade.append(pkg.name)
834 if pkg.marked_install:722 self.install_backend.commit(pkgs_install, pkgs_upgrade, close_on_done)
835 pkgs_install.append(pkg.name)
836 elif pkg.marked_upgrade:
837 pkgs_upgrade.append(pkg.name)
838 self.install_backend.commit(pkgs_install, pkgs_upgrade, close_on_done)
839723
840 def _on_backend_done(self, backend, action, authorized, success):724 def _on_backend_done(self, backend, action, authorized, success):
841 if (action == UPDATE):
842 self.dbusController.updated(success)
843 # check if there is a new reboot required notification725 # check if there is a new reboot required notification
844 if (action == INSTALL and726 if os.path.exists(REBOOT_REQUIRED_FILE):
845 os.path.exists(REBOOT_REQUIRED_FILE)):
846 self.show_reboot_required_info()727 self.show_reboot_required_info()
847 if authorized:728 if authorized:
848 msg = _("Reading package information")729 msg = _("Reading package information")
@@ -861,7 +742,6 @@
861 # can deal with dialup connections properly742 # can deal with dialup connections properly
862 if state in NetworkManagerHelper.NM_STATE_CONNECTING_LIST:743 if state in NetworkManagerHelper.NM_STATE_CONNECTING_LIST:
863 self.label_offline.set_text(_("Connecting..."))744 self.label_offline.set_text(_("Connecting..."))
864 #self.button_reload.set_sensitive(False)
865 self.refresh_updates_count()745 self.refresh_updates_count()
866 self.hbox_offline.show()746 self.hbox_offline.show()
867 self.vbox_alerts.show()747 self.vbox_alerts.show()
@@ -869,7 +749,6 @@
869 # in doubt (STATE_UNKNOWN), assume connected749 # in doubt (STATE_UNKNOWN), assume connected
870 elif (state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST or 750 elif (state in NetworkManagerHelper.NM_STATE_CONNECTED_LIST or
871 state == NetworkManagerHelper.NM_STATE_UNKNOWN):751 state == NetworkManagerHelper.NM_STATE_UNKNOWN):
872 #self.button_reload.set_sensitive(True)
873 self.refresh_updates_count()752 self.refresh_updates_count()
874 self.hbox_offline.hide()753 self.hbox_offline.hide()
875 self.connected = True754 self.connected = True
@@ -878,7 +757,6 @@
878 else:757 else:
879 self.connected = False758 self.connected = False
880 self.label_offline.set_text(_("You may not be able to check for updates or download new updates."))759 self.label_offline.set_text(_("You may not be able to check for updates or download new updates."))
881 #self.button_reload.set_sensitive(False)
882 self.refresh_updates_count()760 self.refresh_updates_count()
883 self.hbox_offline.show()761 self.hbox_offline.show()
884 self.vbox_alerts.show()762 self.vbox_alerts.show()
@@ -1022,11 +900,7 @@
1022900
1023 # fill them again901 # fill them again
1024 try:902 try:
1025 # This is a quite nasty hack to stop the initial update 903 self.list.update(self.cache)
1026 if not self.options.no_update:
1027 self.list.update(self.cache)
1028 else:
1029 self.options.no_update = False
1030 except SystemError as e:904 except SystemError as e:
1031 msg = ("<big><b>%s</b></big>\n\n%s\n'%s'" %905 msg = ("<big><b>%s</b></big>\n\n%s\n'%s'" %
1032 (_("Could not calculate the upgrade"),906 (_("Could not calculate the upgrade"),
@@ -1167,22 +1041,6 @@
1167 else:1041 else:
1168 self.progress.all_done()1042 self.progress.all_done()
11691043
1170 def check_auto_update(self):
1171 # Check if automatic update is enabled. If not show a dialog to inform
1172 # the user about the need of manual "reloads"
1173 remind = self.settings.get_boolean("remind-reload")
1174 if remind == False:
1175 return
1176
1177 update_days = apt_pkg.config.find_i("APT::Periodic::Update-Package-Lists")
1178 if update_days < 1:
1179 self.dialog_manual_update.set_transient_for(self.window_main)
1180 self.dialog_manual_update.set_title("")
1181 res = self.dialog_manual_update.run()
1182 self.dialog_manual_update.hide()
1183 if res == Gtk.ResponseType.YES:
1184 self.on_button_reload_clicked(None)
1185
1186 def check_all_updates_installable(self):1044 def check_all_updates_installable(self):
1187 """ Check if all available updates can be installed and suggest1045 """ Check if all available updates can be installed and suggest
1188 to run a distribution upgrade if not """1046 to run a distribution upgrade if not """
@@ -1214,9 +1072,7 @@
1214 self.meta.connect("new_dist_available",self.new_dist_available)1072 self.meta.connect("new_dist_available",self.new_dist_available)
1215 1073
12161074
1217 def main(self, options):1075 def main(self):
1218 self.options = options
1219
1220 # check for new distributin information1076 # check for new distributin information
1221 self.check_metarelease()1077 self.check_metarelease()
12221078
@@ -1224,6 +1080,4 @@
1224 Gtk.main_iteration()1080 Gtk.main_iteration()
12251081
1226 self.fillstore()1082 self.fillstore()
1227 self.check_auto_update()
1228 self.alert_watcher.check_alert_state()1083 self.alert_watcher.check_alert_state()
1229 Gtk.main()
12301084
=== added file 'UpdateManager/UpdateProgress.py'
--- UpdateManager/UpdateProgress.py 1970-01-01 00:00:00 +0000
+++ UpdateManager/UpdateProgress.py 2012-06-25 15:02:27 +0000
@@ -0,0 +1,84 @@
1# UpdateProgress.py
2#
3# Copyright (c) 2004-2012 Canonical
4# 2004 Michiel Sikkes
5# 2005 Martin Willemoes Hansen
6# 2010 Mohamed Amine IL Idrissi
7#
8# Author: Michiel Sikkes <michiel@eyesopened.nl>
9# Michael Vogt <mvo@debian.org>
10# Martin Willemoes Hansen <mwh@sysrq.dk>
11# Mohamed Amine IL Idrissi <ilidrissiamine@gmail.com>
12# Alex Launi <alex.launi@canonical.com>
13# Michael Terry <michael.terry@canonical.com>
14#
15# This program is free software; you can redistribute it and/or
16# modify it under the terms of the GNU General Public License as
17# published by the Free Software Foundation; either version 2 of the
18# License, or (at your option) any later version.
19#
20# This program is distributed in the hope that it will be useful,
21# but WITHOUT ANY WARRANTY; without even the implied warranty of
22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23# GNU General Public License for more details.
24#
25# You should have received a copy of the GNU General Public License
26# along with this program; if not, write to the Free Software
27# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28# USA
29
30from __future__ import absolute_import, print_function
31
32from gi.repository import GLib
33
34import warnings
35warnings.filterwarnings("ignore", "Accessed deprecated property", DeprecationWarning)
36
37import os
38import sys
39
40from .backend import get_backend
41
42from UpdateManager.UpdateManager import UpdateManager
43from .Core.utils import inhibit_sleep, allow_sleep
44
45class UpdateProgress(object):
46
47 def __init__(self, datadir, options):
48 self.datadir = datadir
49 self.options = options
50
51 # Used for inhibiting power management
52 self.sleep_cookie = None
53 self.sleep_dev = None
54
55 # get the install backend
56 self.install_backend = get_backend(None)
57 self.install_backend.connect("action-done", self._on_backend_done)
58
59 def invoke_manager(self):
60 # don't display apt-listchanges
61 os.environ["APT_LISTCHANGES_FRONTEND"] = "none"
62
63 # Do not suspend during the update process
64 (self.sleep_dev, self.sleep_cookie) = inhibit_sleep()
65
66 self.install_backend.update()
67
68 def _on_backend_done(self, backend, action, authorized, success):
69 # Allow suspend after synaptic is finished
70 if self.sleep_cookie:
71 allow_sleep(self.sleep_dev, self.sleep_cookie)
72 self.sleep_cookie = self.sleep_dev = None
73
74 # Either launch main dialog and continue or quit altogether
75 if success:
76 app = UpdateManager(self.datadir, self.options)
77 # Run app.main at idle time so the progress dialog can close before we
78 # do lengthy recalculation in app.main
79 GLib.idle_add(app.main)
80 else:
81 sys.exit(0)
82
83 def main(self):
84 self.invoke_manager()
085
=== modified file 'UpdateManager/backend/InstallBackendAptdaemon.py'
--- UpdateManager/backend/InstallBackendAptdaemon.py 2012-05-01 00:29:04 +0000
+++ UpdateManager/backend/InstallBackendAptdaemon.py 2012-06-25 15:02:27 +0000
@@ -12,6 +12,8 @@
12from UpdateManager.backend import InstallBackend12from UpdateManager.backend import InstallBackend
13from UpdateManager.UnitySupport import UnitySupport13from UpdateManager.UnitySupport import UnitySupport
1414
15from gettext import gettext as _
16
15import apt17import apt
16import dbus18import dbus
1719
@@ -33,7 +35,7 @@
33 pass35 pass
34 try:36 try:
35 trans = yield self.client.update_cache(defer=True)37 trans = yield self.client.update_cache(defer=True)
36 yield self._run_in_dialog(trans, self.UPDATE)38 yield self._run_in_dialog(trans, self.UPDATE, False)
37 except errors.NotAuthorizedError:39 except errors.NotAuthorizedError:
38 self.emit("action-done", self.UPDATE, False, False)40 self.emit("action-done", self.UPDATE, False, False)
39 except:41 except:
@@ -53,7 +55,7 @@
53 pkgs_install, reinstall, remove, purge, pkgs_upgrade, 55 pkgs_install, reinstall, remove, purge, pkgs_upgrade,
54 downgrade, defer=True)56 downgrade, defer=True)
55 trans.connect("progress-changed", self._on_progress_changed)57 trans.connect("progress-changed", self._on_progress_changed)
56 yield self._run_in_dialog(trans, self.INSTALL)58 yield self._run_in_dialog(trans, self.INSTALL, True)
57 except errors.NotAuthorizedError as e:59 except errors.NotAuthorizedError as e:
58 self.emit("action-done", self.INSTALL, False, False)60 self.emit("action-done", self.INSTALL, False, False)
59 except dbus.DBusException as e:61 except dbus.DBusException as e:
@@ -70,18 +72,22 @@
70 self.unity.set_progress(progress)72 self.unity.set_progress(progress)
7173
72 @inline_callbacks74 @inline_callbacks
73 def _run_in_dialog(self, trans, action):75 def _run_in_dialog(self, trans, action, show_details):
74 dia = AptProgressDialog(trans, parent=self.window_main)76 dia = AptProgressDialog(trans, parent=self.window_main)
75 dia.set_icon_name("system-software-update")77 dia.set_icon_name("system-software-update")
78 dia.set_title(_("Software Updater"))
79 if not show_details:
80 dia.expander.set_no_show_all(True)
81 dia.expander.hide()
76 dia.connect("finished", self._on_finished, action)82 dia.connect("finished", self._on_finished, action)
77 yield dia.run()83 yield dia.run(close_on_finished=False)
7884
79 def _on_finished(self, dialog, action):85 def _on_finished(self, dialog, action):
80 dialog.hide()
81 # tell unity to hide the progress again86 # tell unity to hide the progress again
82 self.unity.set_progress(-1)87 self.unity.set_progress(-1)
83 self.emit("action-done", action, 88 self.emit("action-done", action,
84 True, dialog._transaction.exit == EXIT_SUCCESS)89 True, dialog._transaction.exit == EXIT_SUCCESS)
90 dialog.hide()
8591
86if __name__ == "__main__":92if __name__ == "__main__":
87 b = InstallBackendAptdaemon(None)93 b = InstallBackendAptdaemon(None)
8894
=== modified file 'data/com.ubuntu.update-manager.gschema.xml.in'
--- data/com.ubuntu.update-manager.gschema.xml.in 2012-05-31 22:18:33 +0000
+++ data/com.ubuntu.update-manager.gschema.xml.in 2012-06-25 15:02:27 +0000
@@ -1,10 +1,5 @@
1<schemalist>1<schemalist>
2 <schema id="com.ubuntu.update-manager" path="/apps/update-manager/">2 <schema id="com.ubuntu.update-manager" path="/apps/update-manager/">
3 <key name="remind-reload" type="b">
4 <default>true</default>
5 <summary>Remind to reload the channel list</summary>
6 <description>If automatic checking for updates is disabled, you have to reload the channel list manually. This option allows to hide the reminder shown in this case.</description>
7 </key>
8 <key name="show-details" type="b">3 <key name="show-details" type="b">
9 <default>false</default>4 <default>false</default>
10 <summary>Show details of an update</summary>5 <summary>Show details of an update</summary>
116
=== modified file 'data/gtkbuilder/UpdateManager.ui'
--- data/gtkbuilder/UpdateManager.ui 2012-05-31 22:18:33 +0000
+++ data/gtkbuilder/UpdateManager.ui 2012-06-25 15:02:27 +0000
@@ -230,153 +230,6 @@
230 <action-widget response="-7">okbutton3</action-widget>230 <action-widget response="-7">okbutton3</action-widget>
231 </action-widgets>231 </action-widgets>
232 </object>232 </object>
233 <object class="GtkDialog" id="dialog_manual_update">
234 <property name="can_focus">False</property>
235 <property name="border_width">6</property>
236 <property name="resizable">False</property>
237 <property name="modal">True</property>
238 <property name="window_position">center-on-parent</property>
239 <property name="type_hint">dialog</property>
240 <property name="skip_taskbar_hint">True</property>
241 <property name="skip_pager_hint">True</property>
242 <child internal-child="vbox">
243 <object class="GtkBox" id="dialog-vbox4">
244 <property name="visible">True</property>
245 <property name="can_focus">False</property>
246 <property name="spacing">12</property>
247 <child internal-child="action_area">
248 <object class="GtkButtonBox" id="dialog-action_area4">
249 <property name="visible">True</property>
250 <property name="can_focus">False</property>
251 <property name="layout_style">end</property>
252 <child>
253 <object class="GtkButton" id="cancelbutton1">
254 <property name="label" translatable="yes">Chec_k</property>
255 <property name="use_action_appearance">False</property>
256 <property name="visible">True</property>
257 <property name="can_focus">True</property>
258 <property name="can_default">True</property>
259 <property name="receives_default">False</property>
260 <property name="use_action_appearance">False</property>
261 <property name="image">image-refresh</property>
262 <property name="use_underline">True</property>
263 </object>
264 <packing>
265 <property name="expand">False</property>
266 <property name="fill">False</property>
267 <property name="position">0</property>
268 </packing>
269 </child>
270 <child>
271 <object class="GtkButton" id="okbutton2">
272 <property name="label">gtk-close</property>
273 <property name="use_action_appearance">False</property>
274 <property name="visible">True</property>
275 <property name="can_focus">True</property>
276 <property name="can_default">True</property>
277 <property name="receives_default">False</property>
278 <property name="use_action_appearance">False</property>
279 <property name="use_stock">True</property>
280 </object>
281 <packing>
282 <property name="expand">False</property>
283 <property name="fill">False</property>
284 <property name="position">1</property>
285 </packing>
286 </child>
287 </object>
288 <packing>
289 <property name="expand">False</property>
290 <property name="fill">True</property>
291 <property name="pack_type">end</property>
292 <property name="position">0</property>
293 </packing>
294 </child>
295 <child>
296 <object class="GtkHBox" id="hbox16">
297 <property name="visible">True</property>
298 <property name="can_focus">False</property>
299 <property name="border_width">6</property>
300 <property name="spacing">11</property>
301 <child>
302 <object class="GtkImage" id="image12">
303 <property name="visible">True</property>
304 <property name="can_focus">False</property>
305 <property name="xalign">0</property>
306 <property name="yalign">0</property>
307 <property name="stock">gtk-dialog-info</property>
308 <property name="icon-size">6</property>
309 </object>
310 <packing>
311 <property name="expand">False</property>
312 <property name="fill">True</property>
313 <property name="position">0</property>
314 </packing>
315 </child>
316 <child>
317 <object class="GtkVBox" id="vbox17">
318 <property name="visible">True</property>
319 <property name="can_focus">False</property>
320 <property name="spacing">12</property>
321 <child>
322 <object class="GtkLabel" id="label27">
323 <property name="visible">True</property>
324 <property name="can_focus">True</property>
325 <property name="xalign">0</property>
326 <property name="yalign">0</property>
327 <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;You must check for updates manually&lt;/big&gt;&lt;/b&gt;
328
329Your system does not check for updates automatically. You can configure this behavior in &lt;i&gt;Software Sources&lt;/i&gt; on the &lt;i&gt;Updates&lt;/i&gt; tab.</property>
330 <property name="use_markup">True</property>
331 <property name="wrap">True</property>
332 <property name="selectable">True</property>
333 </object>
334 <packing>
335 <property name="expand">False</property>
336 <property name="fill">False</property>
337 <property name="position">0</property>
338 </packing>
339 </child>
340 <child>
341 <object class="GtkCheckButton" id="checkbutton_reminder">
342 <property name="label" translatable="yes">_Hide this information in the future</property>
343 <property name="use_action_appearance">False</property>
344 <property name="visible">True</property>
345 <property name="can_focus">True</property>
346 <property name="receives_default">False</property>
347 <property name="use_action_appearance">False</property>
348 <property name="use_underline">True</property>
349 <property name="xalign">0.5</property>
350 <property name="draw_indicator">True</property>
351 <signal name="toggled" handler="on_checkbutton_reminder_toggled" swapped="no"/>
352 </object>
353 <packing>
354 <property name="expand">False</property>
355 <property name="fill">False</property>
356 <property name="position">1</property>
357 </packing>
358 </child>
359 </object>
360 <packing>
361 <property name="expand">False</property>
362 <property name="fill">False</property>
363 <property name="position">1</property>
364 </packing>
365 </child>
366 </object>
367 <packing>
368 <property name="expand">True</property>
369 <property name="fill">True</property>
370 <property name="position">1</property>
371 </packing>
372 </child>
373 </object>
374 </child>
375 <action-widgets>
376 <action-widget response="-8">cancelbutton1</action-widget>
377 <action-widget response="-7">okbutton2</action-widget>
378 </action-widgets>
379 </object>
380 <object class="GtkDialog" id="dialog_on_battery">233 <object class="GtkDialog" id="dialog_on_battery">
381 <property name="can_focus">False</property>234 <property name="can_focus">False</property>
382 <property name="border_width">6</property>235 <property name="border_width">6</property>
@@ -607,11 +460,6 @@
607 <property name="can_focus">False</property>460 <property name="can_focus">False</property>
608 <property name="stock">gtk-apply</property>461 <property name="stock">gtk-apply</property>
609 </object>462 </object>
610 <object class="GtkImage" id="image-refresh">
611 <property name="visible">True</property>
612 <property name="can_focus">False</property>
613 <property name="stock">gtk-refresh</property>
614 </object>
615 <object class="GtkWindow" id="window_fetch">463 <object class="GtkWindow" id="window_fetch">
616 <property name="can_focus">False</property>464 <property name="can_focus">False</property>
617 <property name="border_width">6</property>465 <property name="border_width">6</property>
@@ -796,6 +644,8 @@
796 <property name="visible">True</property>644 <property name="visible">True</property>
797 <property name="can_focus">False</property>645 <property name="can_focus">False</property>
798 <property name="yalign">0</property>646 <property name="yalign">0</property>
647 <property name="pixel_size">48</property>
648 <property name="icon_name">system-software-update</property>
799 </object>649 </object>
800 <packing>650 <packing>
801 <property name="expand">False</property>651 <property name="expand">False</property>
@@ -804,46 +654,19 @@
804 </packing>654 </packing>
805 </child>655 </child>
806 <child>656 <child>
807 <object class="GtkVBox" id="vbox_label_main">657 <object class="GtkLabel" id="label_header">
808 <property name="visible">True</property>658 <property name="visible">True</property>
809 <property name="can_focus">False</property>659 <property name="can_focus">False</property>
810 <property name="spacing">6</property>660 <property name="xalign">0</property>
811 <child>661 <property name="use_underline">True</property>
812 <object class="GtkLabel" id="label_header">662 <property name="wrap">True</property>
813 <property name="visible">True</property>663 <attributes>
814 <property name="can_focus">False</property>664 <attribute name="weight" value="bold"/>
815 <property name="xalign">0</property>665 <attribute name="scale" value="1.25"/>
816 <property name="yalign">0</property>666 </attributes>
817 <property name="label" translatable="yes">Starting Software Updater</property>
818 <property name="use_underline">True</property>
819 <property name="wrap">True</property>
820 <attributes>
821 <attribute name="weight" value="bold"/>
822 <attribute name="scale" value="1.25"/>
823 </attributes>
824 </object>
825 <packing>
826 <property name="expand">False</property>
827 <property name="fill">False</property>
828 <property name="position">0</property>
829 </packing>
830 </child>
831 <child>
832 <object class="GtkLabel" id="label_main_details">
833 <property name="visible">True</property>
834 <property name="can_focus">False</property>
835 <property name="xalign">0</property>
836 <property name="wrap">True</property>
837 </object>
838 <packing>
839 <property name="expand">False</property>
840 <property name="fill">False</property>
841 <property name="position">1</property>
842 </packing>
843 </child>
844 </object>667 </object>
845 <packing>668 <packing>
846 <property name="expand">True</property>669 <property name="expand">False</property>
847 <property name="fill">True</property>670 <property name="fill">True</property>
848 <property name="position">1</property>671 <property name="position">1</property>
849 </packing>672 </packing>
@@ -998,6 +821,9 @@
998 </child>821 </child>
999 <signal name="cursor-changed" handler="on_treeview_update_cursor_changed" swapped="no"/>822 <signal name="cursor-changed" handler="on_treeview_update_cursor_changed" swapped="no"/>
1000 <signal name="row-activated" handler="on_treeview_update_row_activated" swapped="no"/>823 <signal name="row-activated" handler="on_treeview_update_row_activated" swapped="no"/>
824 <child internal-child="selection">
825 <object class="GtkTreeSelection" id="treeview-selection2"/>
826 </child>
1001 </object>827 </object>
1002 </child>828 </child>
1003 </object>829 </object>
@@ -1365,24 +1191,6 @@
1365 </packing>1191 </packing>
1366 </child>1192 </child>
1367 <child>1193 <child>
1368 <object class="GtkButton" id="button_reload">
1369 <property name="label" translatable="yes">Chec_k</property>
1370 <property name="use_action_appearance">False</property>
1371 <property name="visible">True</property>
1372 <property name="can_focus">True</property>
1373 <property name="receives_default">True</property>
1374 <property name="use_action_appearance">False</property>
1375 <property name="image">image-refresh</property>
1376 <property name="use_underline">True</property>
1377 <signal name="clicked" handler="on_button_reload_clicked" swapped="no"/>
1378 </object>
1379 <packing>
1380 <property name="expand">False</property>
1381 <property name="fill">True</property>
1382 <property name="position">1</property>
1383 </packing>
1384 </child>
1385 <child>
1386 <object class="GtkButton" id="button_close">1194 <object class="GtkButton" id="button_close">
1387 <property name="label">gtk-close</property>1195 <property name="label">gtk-close</property>
1388 <property name="use_action_appearance">False</property>1196 <property name="use_action_appearance">False</property>
13891197
=== modified file 'data/update-manager.convert'
--- data/update-manager.convert 2012-05-31 22:18:33 +0000
+++ data/update-manager.convert 2012-06-25 15:02:27 +0000
@@ -1,5 +1,4 @@
1[com.ubuntu.update-manager]1[com.ubuntu.update-manager]
2remind-reload = /apps/update-manager/remind_reload
3show-details = /apps/update-manager/show_details2show-details = /apps/update-manager/show_details
4check-dist-upgrades = /apps/update-manager/check_dist_upgrades3check-dist-upgrades = /apps/update-manager/check_dist_upgrades
5autoclose-install-window = /apps/update-manager/autoclose_install_window4autoclose-install-window = /apps/update-manager/autoclose_install_window
65
=== modified file 'update-manager'
--- update-manager 2012-06-13 22:45:57 +0000
+++ update-manager 2012-06-25 15:02:27 +0000
@@ -26,13 +26,17 @@
26from __future__ import print_function26from __future__ import print_function
2727
28from gi.repository import Gtk28from gi.repository import Gtk
29from gi.repository import Gio
29import gi30import gi
30gi.require_version("Gtk", "3.0")31gi.require_version("Gtk", "3.0")
3132
32import os33import os
33import sys34import sys
35import time
3436
35from UpdateManager.UpdateManager import UpdateManager37from UpdateManager.UpdateManager import UpdateManager
38from UpdateManager.UpdateProgress import UpdateProgress
39from UpdateManager.Core.utils import init_proxy
36from DistUpgrade.DistUpgradeVersion import VERSION40from DistUpgrade.DistUpgradeVersion import VERSION
37import locale41import locale
38import gettext42import gettext
@@ -42,7 +46,8 @@
42if __name__ == "__main__":46if __name__ == "__main__":
4347
44 Gtk.init_check(sys.argv)48 Gtk.init_check(sys.argv)
45 49 Gtk.Window.set_default_icon_name("system-software-update")
50
46 #FIXME: Workaround a bug in optparser which doesn't handle unicode/str51 #FIXME: Workaround a bug in optparser which doesn't handle unicode/str
47 # correctly, see http://bugs.python.org/issue439152 # correctly, see http://bugs.python.org/issue4391
48 # Should be resolved by Python353 # Should be resolved by Python3
@@ -117,5 +122,14 @@
117 controller = DistUpgradeController(view, datadir=data_dir)122 controller = DistUpgradeController(view, datadir=data_dir)
118 controller.doPartialUpgrade()123 controller.doPartialUpgrade()
119 else:124 else:
120 app = UpdateManager(data_dir, options)125 # keep track when we run (for update-notifier)
121 app.main(options)126 settings = Gio.Settings("com.ubuntu.update-manager")
127 settings.set_int("launch-time", int(time.time()))
128 init_proxy(settings)
129
130 if options.no_update:
131 app = UpdateManager(data_dir, options)
132 else:
133 app = UpdateProgress(data_dir, options)
134 app.main()
135 Gtk.main()

Subscribers

People subscribed via source and target branches

to status/vote changes: